org.netbeans.editor.Utilities.getEditorUI()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(6.1k)|赞(0)|评价(0)|浏览(127)

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

Utilities.getEditorUI介绍

[英]Helper method to obtain instance of EditorUI (extended UI) from the existing JTextComponent. It doesn't require any document locking.
[中]方法从现有的JTextComponent获取EditorUI(扩展UI)实例。它不需要任何文档锁定。

代码示例

代码示例来源:origin: net.java.abeille/abeille

public void actionPerformed(ActionEvent evt, JTextComponent target) {
    if (target != null) {
      Utilities.getEditorUI(target).adjustCaret(percentFromWindowTop);
    }
  }
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/org-netbeans-modules-editor-lib

public void actionPerformed(ActionEvent evt, JTextComponent target) {
    if (target != null) {
      Utilities.getEditorUI(target).adjustCaret(percentFromWindowTop);
    }
  }
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/org-netbeans-modules-editor-lib

public void actionPerformed(ActionEvent evt, JTextComponent target) {
    if (target != null) {
      Utilities.getEditorUI(target).adjustWindow(percentFromWindowTop);
    }
  }
}

代码示例来源:origin: net.java.abeille/abeille

public void actionPerformed(ActionEvent evt, JTextComponent target) {
    if (target != null) {
      Utilities.getEditorUI(target).adjustWindow(percentFromWindowTop);
    }
  }
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/org-netbeans-modules-editor-lib

public void actionPerformed(ActionEvent evt, JTextComponent target) {
    if (target != null) {
      EditorUI editorUI = Utilities.getEditorUI(target);
      Boolean overwriteMode = (Boolean)editorUI.getProperty(EditorUI.OVERWRITE_MODE_PROPERTY);
      // Now toggle
      overwriteMode = (overwriteMode == null || !overwriteMode.booleanValue())
              ? Boolean.TRUE : Boolean.FALSE;
      editorUI.putProperty(EditorUI.OVERWRITE_MODE_PROPERTY, overwriteMode);
    }
  }
}

代码示例来源:origin: net.java.abeille/abeille

public static void setStatusText(JTextComponent c, String text) {
  StatusBar sb = getEditorUI(c).getStatusBar();
  if (sb != null) {
    sb.setText(StatusBar.CELL_MAIN, text);
  }
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/org-netbeans-modules-editor-lib

public static void setStatusText(JTextComponent c, String text) {
  StatusBar sb = getEditorUI(c).getStatusBar();
  if (sb != null) {
    sb.setText(StatusBar.CELL_MAIN, text);
  }
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/org-netbeans-modules-editor-lib

public JComponent createSideBar(JTextComponent target) {
  EditorUI eui = Utilities.getEditorUI(target);
  GlyphGutter glyph = new GlyphGutter(eui);
  eui.setGlyphGutter(glyph);
  return glyph;
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/org-netbeans-modules-editor-lib

public static void setStatusBoldText(JTextComponent c, String text) {
  StatusBar sb = getEditorUI(c).getStatusBar();
  if (sb != null) {
    sb.setBoldText(StatusBar.CELL_MAIN, text);
  }
}

代码示例来源:origin: net.java.abeille/abeille

public static void setStatusBoldText(JTextComponent c, String text) {
  StatusBar sb = getEditorUI(c).getStatusBar();
  if (sb != null) {
    sb.setBoldText(StatusBar.CELL_MAIN, text);
  }
}

代码示例来源:origin: net.java.abeille/abeille

public static void setStatusText(JTextComponent c, String text, Coloring extraColoring) {
  StatusBar sb = getEditorUI(c).getStatusBar();
  if (sb != null) {
    sb.setText(StatusBar.CELL_MAIN, text, extraColoring);
  }
}

代码示例来源:origin: net.java.abeille/abeille

public void actionPerformed(ActionEvent evt, JTextComponent target) {
  if (target != null) {
    EditorUI editorUI = Utilities.getEditorUI(target);
    Rectangle bounds = editorUI.getExtentBounds();
    bounds.y -= editorUI.getLineHeight();
    editorUI.scrollRectToVisible(bounds, EditorUI.SCROLL_SMALLEST);
  }
}

代码示例来源:origin: net.java.abeille/abeille

public void deinstall(JTextComponent c) {
  EditorUI editorUI = Utilities.getEditorUI(c);
  editorUI.removeLayer(HIGHLIGHT_ROW_LAYER_NAME);
  editorUI.removeLayer(HIGHLIGHT_BRACE_LAYER_NAME);
  super.deinstall(c);
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/org-netbeans-modules-editor-lib

public void deinstall(JTextComponent c) {
  EditorUI editorUI = Utilities.getEditorUI(c);
  editorUI.removeLayer(HIGHLIGHT_ROW_LAYER_NAME);
  editorUI.removeLayer(HIGHLIGHT_BRACE_LAYER_NAME);
  super.deinstall(c);
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/org-netbeans-modules-editor-lib

public void actionPerformed(ActionEvent evt, JTextComponent target) {
  if (target != null) {
    EditorUI editorUI = Utilities.getEditorUI(target);
    Rectangle bounds = editorUI.getExtentBounds();
    bounds.y -= editorUI.getLineHeight();
    bounds.x += editorUI.getTextMargin().left;
    editorUI.scrollRectToVisible(bounds, EditorUI.SCROLL_SMALLEST);
  }
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-cnd-debugger-common2

public void showTooltip() {
  final JEditorPane ep = EditorContextDispatcher.getDefault().getMostRecentEditor();
  final EditorUI eui = org.netbeans.editor.Utilities.getEditorUI(ep);
  final ToolTipSupport toolTipSupport = eui.getToolTipSupport();
  toolTipSupport.setToolTip(this, PopupManager.ViewPortBounds, PopupManager.AbovePreferred, 0, 0, ToolTipSupport.FLAGS_HEAVYWEIGHT_TOOLTIP);
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/org-netbeans-modules-editor-lib

public void actionPerformed(ActionEvent evt, JTextComponent target) {
  if (target != null) {
    EditorUI editorUI = Utilities.getEditorUI(target);
    Rectangle bounds = editorUI.getExtentBounds();
    bounds.y += editorUI.getLineHeight();
    bounds.x += editorUI.getTextMargin().left;
    editorUI.scrollRectToVisible(bounds, EditorUI.SCROLL_SMALLEST);
  }
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-cnd-debugger-common2

public void showTooltip() {
  final JEditorPane ep = EditorContextDispatcher.getDefault().getMostRecentEditor();
  final EditorUI eui = org.netbeans.editor.Utilities.getEditorUI(ep);
  final ToolTipSupport toolTipSupport = eui.getToolTipSupport();
  toolTipSupport.setToolTip(this);
}

代码示例来源:origin: net.java.abeille/abeille

public void install(JTextComponent c) {
  EditorUI editorUI = Utilities.getEditorUI(c);
  editorUI.addLayer(new HighlightRowLayer(), HIGHLIGHT_ROW_LAYER_VISIBILITY);
  editorUI.addLayer(new HighlightBraceLayer(), HIGHLIGHT_BRACE_LAYER_VISIBILITY);
  super.install(c);
}

代码示例来源:origin: net.java.abeille/abeille

public JMenuItem getPopupMenuItem(JTextComponent target) {
  EditorUI ui = Utilities.getEditorUI(target);
  try {
    return ui.getDocument().getAnnotations().createMenu(Utilities.getKit(target),
        Utilities.getLineOffset(ui.getDocument(), target.getCaret().getDot()));
  } catch (BadLocationException ex) {
    return null;
  }
}

相关文章