javax.swing.text.JTextComponent.addHierarchyListener()方法的使用及代码示例

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

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

JTextComponent.addHierarchyListener介绍

暂无

代码示例

代码示例来源:origin: com.fifesoft/autocomplete

void addTo(JTextComponent tc) {
  tc.addFocusListener(this);
  tc.addHierarchyListener(this);
}

代码示例来源:origin: protegeproject/protege

public OWLAutoCompleter(OWLEditorKit owlEditorKit, JTextComponent tc,
                  OWLExpressionChecker checker) {
  this.owlEditorKit = owlEditorKit;
  this.checker = checker;
  this.textComponent = tc;
  wordDelimeters = new HashSet<>();
  wordDelimeters.add(" ");
  wordDelimeters.add("\n");
  wordDelimeters.add("[");
  wordDelimeters.add("]");
  wordDelimeters.add("{");
  wordDelimeters.add("}");
  wordDelimeters.add("(");
  wordDelimeters.add(")");
  wordDelimeters.add(",");
  wordDelimeters.add("^");
  matcher = new AutoCompleterMatcherImpl(owlEditorKit.getModelManager());
  popupList = new JList();
  popupList.setAutoscrolls(true);
  popupList.setCellRenderer(owlEditorKit.getWorkspace().createOWLCellRenderer());
  popupList.addMouseListener(mouseListener);
  popupList.setRequestFocusEnabled(false);
  textComponent.addKeyListener(keyListener);
  textComponent.addHierarchyListener(hierarchyListener);
  // moving or resizing the text component or dialog closes the popup
  textComponent.addComponentListener(componentListener);
  // switching focus to another component closes the popup
  textComponent.addFocusListener(focusListener);
  createPopupWindow();
}

代码示例来源:origin: edu.stanford.protege/protege-editor-owl

public OWLAutoCompleter(OWLEditorKit owlEditorKit, JTextComponent tc,
                  OWLExpressionChecker checker) {
  this.owlEditorKit = owlEditorKit;
  this.checker = checker;
  this.textComponent = tc;
  wordDelimeters = new HashSet<>();
  wordDelimeters.add(" ");
  wordDelimeters.add("\n");
  wordDelimeters.add("[");
  wordDelimeters.add("]");
  wordDelimeters.add("{");
  wordDelimeters.add("}");
  wordDelimeters.add("(");
  wordDelimeters.add(")");
  wordDelimeters.add(",");
  wordDelimeters.add("^");
  matcher = new AutoCompleterMatcherImpl(owlEditorKit.getModelManager());
  popupList = new JList();
  popupList.setAutoscrolls(true);
  popupList.setCellRenderer(owlEditorKit.getWorkspace().createOWLCellRenderer());
  popupList.addMouseListener(mouseListener);
  popupList.setRequestFocusEnabled(false);
  textComponent.addKeyListener(keyListener);
  textComponent.addHierarchyListener(hierarchyListener);
  // moving or resizing the text component or dialog closes the popup
  textComponent.addComponentListener(componentListener);
  // switching focus to another component closes the popup
  textComponent.addFocusListener(focusListener);
  createPopupWindow();
}

代码示例来源:origin: edu.stanford.protege/org.protege.editor.owl

public OWLAutoCompleter(OWLEditorKit owlEditorKit, JTextComponent tc,
                  OWLExpressionChecker checker) {
  this.owlEditorKit = owlEditorKit;
  this.checker = checker;
  this.textComponent = tc;
  wordDelimeters = new HashSet<String>();
  wordDelimeters.add(" ");
  wordDelimeters.add("\n");
  wordDelimeters.add("[");
  wordDelimeters.add("]");
  wordDelimeters.add("{");
  wordDelimeters.add("}");
  wordDelimeters.add("(");
  wordDelimeters.add(")");
  wordDelimeters.add(",");
  wordDelimeters.add("^");
  matcher = new AutoCompleterMatcherImpl(owlEditorKit.getModelManager());
  popupList = new JList();
  popupList.setAutoscrolls(true);
  popupList.setCellRenderer(owlEditorKit.getWorkspace().createOWLCellRenderer());
  popupList.addMouseListener(mouseListener);
  popupList.setRequestFocusEnabled(false);
  textComponent.addKeyListener(keyListener);
  textComponent.addHierarchyListener(hierarchyListener);
  // moving or resizing the text component or dialog closes the popup
  textComponent.addComponentListener(componentListener);
  // switching focus to another component closes the popup
  textComponent.addFocusListener(focusListener);
  createPopupWindow();
}

代码示例来源:origin: org.protege/protege-editor-owl

public OWLAutoCompleter(OWLEditorKit owlEditorKit, JTextComponent tc,
                  OWLExpressionChecker checker) {
  this.owlEditorKit = owlEditorKit;
  this.checker = checker;
  this.textComponent = tc;
  wordDelimeters = new HashSet<String>();
  wordDelimeters.add(" ");
  wordDelimeters.add("\n");
  wordDelimeters.add("[");
  wordDelimeters.add("]");
  wordDelimeters.add("{");
  wordDelimeters.add("}");
  wordDelimeters.add("(");
  wordDelimeters.add(")");
  wordDelimeters.add(",");
  wordDelimeters.add("^");
  matcher = new AutoCompleterMatcherImpl(owlEditorKit.getModelManager());
  popupList = new JList();
  popupList.setAutoscrolls(true);
  popupList.setCellRenderer(owlEditorKit.getWorkspace().createOWLCellRenderer());
  popupList.addMouseListener(mouseListener);
  popupList.setRequestFocusEnabled(false);
  textComponent.addKeyListener(keyListener);
  textComponent.addHierarchyListener(hierarchyListener);
  // moving or resizing the text component or dialog closes the popup
  textComponent.addComponentListener(componentListener);
  // switching focus to another component closes the popup
  textComponent.addFocusListener(focusListener);
  createPopupWindow();
}

相关文章

JTextComponent类方法