Exemplo n.º 1
0
  public void SwitchOutputCommand() {
    clearSelection();
    isOutput = !isOutput;
    if (isOutput) {
      removeCommand(output);
      output = new Command("Code", Command.ITEM, 5);
      addCommand(output);

      currentX = getCursorX();
      currentY = getCursorY();
      setCursorPosition(0, 0);
      updateCaretPosition();

      currentCode = getText();
      setText(midlet.getOutput());

      setAndViewStatus("Output");
    } else {
      removeCommand(output);
      output = new Command("Output", Command.ITEM, 5);
      addCommand(output);

      setText(currentCode);
      setCursorPosition(currentX, currentY);
      updateCaretPosition();

      if (currentDirName != null && currentFileName != null) {
        setAndViewStatus(currentDirName + currentFileName);
      }
    }
  }