Exemple #1
0
    public void bracketSelected(
        org.gjt.sp.jedit.textarea.TextArea textArea, int line, String text) {
      StatusBar status = view.getStatus();
      if (status == null) return;

      status.setMessageAndClear(
          jEdit.getProperty("view.status.bracket", new Object[] {line, text}));
    }
Exemple #2
0
    public void statusChanged(
        org.gjt.sp.jedit.textarea.TextArea textArea, int flag, boolean value) {
      StatusBar status = view.getStatus();
      if (status == null) return;

      switch (flag) {
        case OVERWRITE_CHANGED:
          status.setMessageAndClear(
              jEdit.getProperty("view.status.overwrite-changed", new Integer[] {value ? 1 : 0}));
          break;
        case MULTI_SELECT_CHANGED:
          status.setMessageAndClear(
              jEdit.getProperty("view.status.multi-changed", new Integer[] {value ? 1 : 0}));
          break;
        case RECT_SELECT_CHANGED:
          status.setMessageAndClear(
              jEdit.getProperty("view.status.rect-select-changed", new Integer[] {value ? 1 : 0}));
          break;
      }

      status.updateMiscStatus();
    }
Exemple #3
0
    public void narrowActive(org.gjt.sp.jedit.textarea.TextArea textArea) {
      StatusBar status = view.getStatus();
      if (status == null) return;

      status.setMessageAndClear(jEdit.getProperty("view.status.narrow"));
    }
Exemple #4
0
  @EBHandler
  public void handleBufferUpdate(BufferUpdate msg) {
    Buffer _buffer = msg.getBuffer();
    if (msg.getWhat() == BufferUpdate.CREATED) {
      if (bufferSwitcher != null) bufferSwitcher.updateBufferList();

      if (buffer.isClosed()) {

        recentBuffer = null;
      }
    } else if (msg.getWhat() == BufferUpdate.CLOSED) {
      if (bufferSwitcher != null) bufferSwitcher.updateBufferList();

      if (_buffer == buffer) {

        Buffer newBuffer = recentBuffer != null ? recentBuffer : _buffer.getPrev();

        if (newBuffer != null && !newBuffer.isClosed()) {
          setBuffer(newBuffer);
          recentBuffer = newBuffer.getPrev();
        }
      } else if (_buffer == recentBuffer) recentBuffer = null;

      Buffer closedBuffer = msg.getBuffer();
      if (closedBuffer.isUntitled()) {

        caretsForPath.remove(closedBuffer.getPath());
      }
    } else if (msg.getWhat() == BufferUpdate.LOAD_STARTED) {
      if (_buffer == buffer) {
        textArea.setCaretPosition(0);
        textArea.getPainter().repaint();
      }
    } else if (msg.getWhat() == BufferUpdate.LOADED) {
      if (_buffer == buffer) {
        textArea.repaint();
        if (bufferSwitcher != null) bufferSwitcher.updateBufferList();

        if (view.getEditPane() == this) {
          StatusBar status = view.getStatus();
          status.updateCaretStatus();
          status.updateBufferStatus();
          status.updateMiscStatus();
        }

        loadCaretInfo();
      }

    } else if (msg.getWhat() == BufferUpdate.DIRTY_CHANGED) {
      if (_buffer == buffer && bufferSwitcher != null) {
        if (buffer.isDirty()) bufferSwitcher.repaint();
        else bufferSwitcher.updateBufferList();
      }
    } else if (msg.getWhat() == BufferUpdate.MARKERS_CHANGED) {
      if (_buffer == buffer) textArea.getGutter().repaint();
    } else if (msg.getWhat() == BufferUpdate.PROPERTIES_CHANGED) {
      if (_buffer == buffer && buffer.isLoaded()) {
        textArea.propertiesChanged();
        if (view.getEditPane() == this) view.getStatus().updateBufferStatus();
      }
    } else if (msg.getWhat() == BufferUpdate.SAVED && _buffer == buffer) {
      textArea.propertiesChanged();
    }
  }