javax.swing.JEditorPane.addCaretListener()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(5.9k)|赞(0)|评价(0)|浏览(178)

本文整理了Java中javax.swing.JEditorPane.addCaretListener()方法的一些代码示例,展示了JEditorPane.addCaretListener()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JEditorPane.addCaretListener()方法的具体详情如下:
包路径:javax.swing.JEditorPane
类名称:JEditorPane
方法名:addCaretListener

JEditorPane.addCaretListener介绍

暂无

代码示例

代码示例来源:origin: io.ultreia.java4all.jaxx/jaxx-widgets-extra

@Override
public void addCaretListener(CaretListener listener) {
  editor.addCaretListener(listener);
}

代码示例来源:origin: org.nuiton/nuiton-widgets

@Override
public void addCaretListener(CaretListener listener) {
  editor.addCaretListener(listener);
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-web-core

@Override
protected void componentActivated () {
  pane.addCaretListener(caretListener);
  super.componentActivated (); 
}

代码示例来源:origin: freeplane/freeplane

public void propertyChange(PropertyChangeEvent evt) {
  if (evt.getPropertyName().equals("document")) {
    pane.removeCaretListener(this);
    if (status.equals(Status.INSTALLING)) {
      pane.addCaretListener(this);
      deHighlight();
    }
  }
}

代码示例来源:origin: de.sciss/jsyntaxpane

@Override
public void install(JEditorPane editor) {
  this.pane = editor;
  pane.addCaretListener(this);
  markTokenAt(editor.getCaretPosition());
  status = Status.INSTALLING;
}

代码示例来源:origin: org.netbeans.api/org-netbeans-modules-languages

private void setCurrentEditor (JEditorPane editor) {
  if (caretListener == null)
    caretListener = new MyCaretListener ();
  if (lastEditor != null)
    lastEditor.removeCaretListener (caretListener);
  lastEditor = editor;
  if (lastEditor != null)
    lastEditor.addCaretListener (caretListener);
}

代码示例来源:origin: de.sciss/syntaxpane

@Override
public void install(JEditorPane editor) {
  this.pane = editor;
  pane.addCaretListener(this);
  markTokenAt(editor.getCaretPosition());
  status = Status.INSTALLING;
}

代码示例来源:origin: de.sciss/syntaxpane

@Override
  public void propertyChange(PropertyChangeEvent evt) {
    if (evt.getPropertyName().equals("document")) {
        pane.removeCaretListener(this);
      if (status.equals(Status.INSTALLING)) {
        pane.addCaretListener(this);
        removeMarkers();
      }
    }
  }
}

代码示例来源:origin: de.sciss/jsyntaxpane

@Override
  public void propertyChange(PropertyChangeEvent evt) {
    if (evt.getPropertyName().equals("document")) {
        pane.removeCaretListener(this);
      if (status.equals(Status.INSTALLING)) {
        pane.addCaretListener(this);
        removeMarkers();
      }
    }
  }
}

代码示例来源:origin: freeplane/freeplane

@Override
  public void install(JEditorPane editor) {
    this.pane = editor;
    pane.addCaretListener(this);
    handle(editor.getCaretPosition());
    status = Status.INSTALLING;
    addWindowListener();
//        addFocusListener();
  }
  private void addWindowListener() {

代码示例来源:origin: de.sciss/jsyntaxpane

jEdtTest.setFont(new java.awt.Font("Monospaced", 0, 13));
jEdtTest.setCaretColor(new java.awt.Color(153, 204, 255));
jEdtTest.addCaretListener(new javax.swing.event.CaretListener() {
  public void caretUpdate(javax.swing.event.CaretEvent evt) {
    jEdtTestCaretUpdate(evt);

代码示例来源:origin: org.sonarsource.sslr/sslr-toolkit

sourceCodeEditorPane.addCaretListener(new CaretListener() {
 @Override
 public void caretUpdate(CaretEvent e) {

代码示例来源:origin: org.codehaus.sonar.sslr/sslr-devkit

codeEditor.addCaretListener(new CaretListener() {
 public void caretUpdate(CaretEvent event) {
  selectPath();

代码示例来源:origin: org.codehaus.sonar.sslr/sslr-toolkit

sourceCodeEditorPane.addCaretListener(new CaretListener() {
 @Override
 public void caretUpdate(CaretEvent e) {

代码示例来源:origin: omegat-org/omegat

panel.editorPane.addCaretListener(new CaretListener() {
  @Override
  public void caretUpdate(CaretEvent e) {

代码示例来源:origin: org.netbeans.api/org-netbeans-modules-languages

public @Override void install (JEditorPane c) {
  super.install (c);
  HyperlinkListener hl = new HyperlinkListener ();
  c.addMouseMotionListener (hl);
  c.addMouseListener (hl);
  c.addKeyListener(hl);
  c.addCaretListener (new MarkOccurrencesSupport (c));
}

代码示例来源:origin: de.sciss/jsyntaxpane

@Override
public void install(final JEditorPane editor) {
  this.editor = editor;
  setFont(editor.getFont());
  // setMinimumDisplayDigits(3);
  editor.getDocument().addDocumentListener(this);
  editor.addCaretListener(this);
  editor.addPropertyChangeListener(this);
  JScrollPane sp = getScrollPane(editor);
  sp.setRowHeaderView(this);
  mouseListener = new MouseAdapter() {
    @Override
    public void mouseClicked(MouseEvent e) {
      GotoLineDialog.showForEditor(editor);
    }
  };
  addMouseListener(mouseListener);
  status = Status.INSTALLING;
}

代码示例来源:origin: de.sciss/syntaxpane

@Override
public void install(final JEditorPane editor) {
  this.editor = editor;
  setFont(editor.getFont());
  // setMinimumDisplayDigits(3);
  Insets ein = editor.getInsets();
  if (ein.top != 0 || ein.bottom != 0) {
    Insets curr = getInsets();
    setBorder(BorderFactory.createEmptyBorder(ein.top, curr.left, ein.bottom, curr.right));
  }
  editor.getDocument().addDocumentListener(this);
  editor.addCaretListener(this);
  editor.addPropertyChangeListener(this);
  JScrollPane sp = getScrollPane(editor);
  if (sp != null) sp.setRowHeaderView(this);
  mouseListener = new MouseAdapter() {
    @Override
    public void mouseClicked(MouseEvent e) {
      GotoLineDialog.showForEditor(editor);
    }
  };
  addMouseListener(mouseListener);
  setPreferredWidth(false);    // required for toggle-lines to correctly repaint
  status = Status.INSTALLING;
}

代码示例来源:origin: org.netbeans.api/org-netbeans-modules-languages

private ASTNode getCurrentRootNode () {
  Node[] ns = TopComponent.getRegistry ().getActivatedNodes ();
  if (ns.length != 1) return null;
  EditorCookie editorCookie = ns [0].getLookup ().
    lookup (EditorCookie.class);
  if (editorCookie == null) return null;
  if (editorCookie.getOpenedPanes () == null) return null;
  if (editorCookie.getOpenedPanes ().length < 1) return null;
  JEditorPane pane = editorCookie.getOpenedPanes () [0];
  if (caretListener == null)
    caretListener = new CListener ();
  if (lastPane != null && lastPane != pane) {
    lastPane.removeCaretListener (caretListener);
    lastPane = null;
  }
  if (lastPane == null) {
    pane.addCaretListener (caretListener);
    lastPane = pane;
  }
  Document document = editorCookie.getDocument ();
  if (document == null || !(document instanceof NbEditorDocument)) return null;
  return ParserManagerImpl.getImpl (document).getAST ();
}

代码示例来源:origin: org.netbeans.api/org-netbeans-modules-languages

pane.addCaretListener (caretListener);
lastPane = pane;

相关文章

JEditorPane类方法