Examples of CaretListener


Examples of com.intellij.openapi.editor.event.CaretListener

    final Editor grammarEditor = livePreviewLanguage == null ? null : getGrammarEditor(psiFile.getProject(), livePreviewLanguage);

    if (editor == null || grammarEditor == null) return;

    final Project project = psiFile.getProject();
    CaretListener caretListener = editor.getUserData(GRAMMAR_UPDATE_RUNNING);
    if (caretListener != null) {
      editor.putUserData(GRAMMAR_UPDATE_RUNNING, null);
      editor.getCaretModel().removeCaretListener(caretListener);
      HighlightManagerImpl highlightManager = (HighlightManagerImpl)HighlightManager.getInstance(project);
      highlightManager.hideHighlights(grammarEditor, HighlightManager.HIDE_BY_ESCAPE | HighlightManager.HIDE_BY_ANY_KEY);
    }
    else {
      updateGrammarHighlighters(project, editor, livePreviewLanguage, grammarEditor);

      caretListener = new CaretAdapter() {
        @Override
        public void caretPositionChanged(final CaretEvent e) {
          final CaretListener caretListener = this;
          LivePreviewHelper.getUpdateQueue(project).queue(new Update(e.getEditor()) {
            @Override
            public void run() {
              if (grammarEditor.isDisposed()) {
                e.getEditor().getCaretModel().removeCaretListener(caretListener);
View Full Code Here

Examples of com.intellij.openapi.editor.event.CaretListener

   *
   * @param editor the editor for which the structure view model is requested.
   */
  protected TextEditorBasedStructureViewModel(final Editor editor) {
    myEditor = editor;
    myCaretListener = new CaretListener() {
      public void caretPositionChanged(CaretEvent e) {
        if (Comparing.equal(e.getEditor(), myEditor)) {
          fireCaretPositionChanged();
        }
      }
View Full Code Here

Examples of javax.swing.event.CaretListener

                                }
                                dispose();
                        }
                });

                CaretListener caretListener = new CaretListener() {
                        public void caretUpdate(CaretEvent e) {
                                updateComponents();
                        }
                };
View Full Code Here

Examples of javax.swing.event.CaretListener

    btnOK = new JButton(UILabelResourceManager.getInstance().getString(TEXT_BUTTON_LOGIN));
    btnOK.setIcon(IconHelper.getLoginIcon());
    btnClose = new JButton(UILabelResourceManager.getInstance().getString(TEXT_BUTTON_CLOSE));
    btnClose.setIcon(IconHelper.getCloseIcon());
   
    txtUserName.addCaretListener(new CaretListener() {
      public void caretUpdate(CaretEvent event) {
        btnOK.setEnabled(txtUserName.getText().trim().length() > 0);
      }
    });
    txtUserName.addActionListener(this);
View Full Code Here

Examples of javax.swing.event.CaretListener

    private JTextArea jTextArea = null;

    public XJTextArea() {
        jTextArea = new JTextArea();
        jTextArea.addCaretListener(new CaretListener() {
            public void caretUpdate(CaretEvent e) {
                keyValueChanged(KV_TEXT_STRING, jTextArea.getText());
            }
        });
    }
View Full Code Here

Examples of javax.swing.event.CaretListener

    this.setSize(d);
   
    this.setToolTipText(text);
   
    this.addCaretListener(
        new CaretListener(){

          @Override
          public void caretUpdate(CaretEvent e) {
            setToolTipText(getText());
          }
View Full Code Here

Examples of javax.swing.event.CaretListener

    JPanel panel = new JPanel(new BorderLayout(12, 12));
    JLabel label = new JLabel("Please specify the location and name of the file to export to.");
    panel.add(label, BorderLayout.NORTH);
    JPanel entryPanel = new JPanel(new BorderLayout(12, 12));
    pathNameField = new JTextField();
    pathNameField.addCaretListener(new CaretListener() {
      /**
       * Called when the caret position is updated.
       *
       * @param e the caret event
       */
 
View Full Code Here

Examples of javax.swing.event.CaretListener

        setLineWrap(true);
        this.printStream = new JTextComponentPrintStream(this, true);
        this.completionHandler = new DefaultCompletionHandler();
        this.inputStream = new JTextComponentInputStream2(this);

        addCaretListener(new CaretListener() {
            public void caretUpdate(CaretEvent e) {
                if (! duringMousePressed) {
                    lastDot = e.getDot();
                }
            }
View Full Code Here

Examples of javax.swing.event.CaretListener

          updatePreview();
        }
      });

    patternEditor.addCaretListener(
      new CaretListener() {
        public void caretUpdate(CaretEvent e) {
          updateTextActions(e.getMark() != e.getDot());
        }
      });
  }
View Full Code Here

Examples of javax.swing.event.CaretListener

    new CaretPositionCorrector(field, jumpCharacters, '\0', startPosition);
  }
 
  /** Create caret listener for making sure of editing the right value.*/
  private void createCaretListener(final JFormattedTextField field) {
    mCaretListener = new CaretListener() {
      public void caretUpdate(final CaretEvent e) {
        if(mCaretPosition != -1 && field.getSelectedText() == null) {
          mCaretPosition = field.getCaretPosition();
        }
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.