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

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

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

Utilities.getKitClass介绍

[英]Helper method to obtain editor kit class from existing JTextComponent. This method is useful for example when dealing with Settings. The method doesn't require any document locking.
[中]从现有JTextComponent获取编辑器工具包类的助手方法。例如,在处理设置时,此方法非常有用。该方法不需要任何文档锁定。

代码示例

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

private int getPackageImportSetting(){
  Class kitClass = Utilities.getKitClass(target);
  if (kitClass != null) {
    return SettingsUtil.getInteger(kitClass,
      ExtSettingsNames.FAST_IMPORT_SELECTION,
      ExtSettingsDefaults.defaultFastImportSelection);
  }
  return ExtSettingsDefaults.defaultFastImportSelection.intValue();
}

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

private Class getKitClass() {
  return (component != null) ? Utilities.getKitClass(component)
      : ((printDoc != null) ? printDoc.getKitClass() : null);
}

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

private Class getKitClass() {
  return (component != null) ? Utilities.getKitClass(component) : ((printDoc != null) ? printDoc.getKitClass() : null);
}

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

/** Retrieve a javadoc popup delay from options */
private int getJavaDocDelay(){
  Class kitClass = Utilities.getKitClass(extEditorUI.getComponent());
  if (kitClass != null) {
    return ((Integer)SettingsUtil.getValue(kitClass,
         ExtSettingsNames.JAVADOC_AUTO_POPUP_DELAY,
         ExtSettingsDefaults.defaultJavaDocAutoPopupDelay)).intValue();
  }
  return ExtSettingsDefaults.defaultJavaDocAutoPopupDelay.intValue();
}

代码示例来源:origin: org.netbeans.api/org-netbeans-modules-editor-deprecated-pre61completion

/** Retrieve a javadoc popup delay from options */
private int getJavaDocDelay(){
  Class kitClass = Utilities.getKitClass(extEditorUI.getComponent());
  if (kitClass != null) {
    return ((Integer)SettingsUtil.getValue(kitClass,
         ExtSettingsNames.JAVADOC_AUTO_POPUP_DELAY,
         ExtSettingsDefaults.defaultJavaDocAutoPopupDelay)).intValue();
  }
  return ExtSettingsDefaults.defaultJavaDocAutoPopupDelay.intValue();
}

代码示例来源:origin: org.netbeans.api/org-netbeans-modules-editor-deprecated-pre61completion

/** Retrieve a auto popup of javadoc property from options */    
private boolean  getJavaDocAutoPopup(){
  Class kitClass = Utilities.getKitClass(extEditorUI.getComponent());
  if (kitClass != null) {
    return ((Boolean)SettingsUtil.getValue(kitClass,
         ExtSettingsNames.JAVADOC_AUTO_POPUP,
         ExtSettingsDefaults.defaultJavaDocAutoPopup)).booleanValue();
  }
  return ExtSettingsDefaults.defaultJavaDocAutoPopup.booleanValue();
}

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

/** Retrieve a auto popup of javadoc property from options */    
private boolean  getJavaDocAutoPopup(){
  Class kitClass = Utilities.getKitClass(extEditorUI.getComponent());
  if (kitClass != null) {
    return ((Boolean)SettingsUtil.getValue(kitClass,
         ExtSettingsNames.JAVADOC_AUTO_POPUP,
         ExtSettingsDefaults.defaultJavaDocAutoPopup)).booleanValue();
  }
  return ExtSettingsDefaults.defaultJavaDocAutoPopup.booleanValue();
}

代码示例来源:origin: org.netbeans.api/org-netbeans-modules-editor-deprecated-pre61completion

/** Retrieve a background color of javadoc from options */
private Color getJavaDocBGColor(){
  Class kitClass = Utilities.getKitClass(extEditorUI.getComponent());
  if (kitClass != null) {
    return (Color)SettingsUtil.getValue(kitClass,
         ExtSettingsNames.JAVADOC_BG_COLOR,
         ExtSettingsDefaults.defaultJavaDocBGColor);
  }
  return ExtSettingsDefaults.defaultJavaDocBGColor;
}

代码示例来源:origin: org.netbeans.api/org-netbeans-modules-editor-deprecated-pre61completion

private Dimension getMaxPopupSize(){
  Class kitClass = Utilities.getKitClass(extEditorUI.getComponent());
  if (kitClass != null) {
    return (Dimension)SettingsUtil.getValue(kitClass,
         ExtSettingsNames.JAVADOC_PREFERRED_SIZE,
         ExtSettingsDefaults.defaultJavaDocAutoPopupDelay);
    
  }
  return ExtSettingsDefaults.defaultJavaDocPreferredSize;
}

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

private void updateRenderingHints(){
  JTextComponent comp = editorUI.getComponent();
  if (comp == null) return;
  Object value = Settings.getValue(Utilities.getKitClass(comp), SettingsNames.RENDERING_HINTS);
  renderingHints = (value instanceof Map) ? (java.util.Map)value : null;
}

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

private Dimension getMaxPopupSize(){
  Class kitClass = Utilities.getKitClass(extEditorUI.getComponent());
  if (kitClass != null) {
    return (Dimension)SettingsUtil.getValue(kitClass,
         ExtSettingsNames.JAVADOC_PREFERRED_SIZE,
         ExtSettingsDefaults.defaultJavaDocAutoPopupDelay);
    
  }
  return ExtSettingsDefaults.defaultJavaDocPreferredSize;
}

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

/** Retrieve a background color of javadoc from options */
private Color getJavaDocBGColor(){
  Class kitClass = Utilities.getKitClass(extEditorUI.getComponent());
  if (kitClass != null) {
    return (Color)SettingsUtil.getValue(kitClass,
         ExtSettingsNames.JAVADOC_BG_COLOR,
         ExtSettingsDefaults.defaultJavaDocBGColor);
  }
  return ExtSettingsDefaults.defaultJavaDocBGColor;
}

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

protected JPopupMenu buildPopupMenu(JTextComponent target) {
  JPopupMenu pm = new JPopupMenu();
  EditorUI ui = Utilities.getEditorUI(target);
  List l = (List) Settings.getValue(Utilities.getKitClass(target),
      (ui == null || ui.hasExtComponent()) ? ExtSettingsNames.POPUP_MENU_ACTION_NAME_LIST : ExtSettingsNames.DIALOG_POPUP_MENU_ACTION_NAME_LIST);
  if (l != null) {
    Iterator i = l.iterator();
    while (i.hasNext()) {
      String an = (String) i.next();
      addAction(target, pm, an);
    }
  }
  return pm;
}

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

private void updateRenderingHints(Graphics g){
  JTextComponent comp = editorUI.getComponent();
  if (comp == null) return;
  Object value = Settings.getValue(Utilities.getKitClass(comp), SettingsNames.RENDERING_HINTS);
  Map renderingHints = (value instanceof Map) ? (java.util.Map)value : null;
  // Possibly apply the rendering hints
  if (renderingHints != null) {
    ((java.awt.Graphics2D)g).setRenderingHints(renderingHints);
  }
}

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

public void settingsChange(SettingsChangeEvent evt) {
  Class kitClass = Utilities.getKitClass(extEditorUI.getComponent());
  if (kitClass != null) {
    minSize = (Dimension) SettingsUtil.getValue(kitClass, ExtSettingsNames.COMPLETION_PANE_MIN_SIZE, ExtSettingsDefaults.defaultCompletionPaneMinSize);
    maxSize = (Dimension) SettingsUtil.getValue(kitClass, ExtSettingsNames.COMPLETION_PANE_MAX_SIZE, ExtSettingsDefaults.defaultCompletionPaneMaxSize);
  }
}

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

/** Called when settings were changed. The method is called
* also in constructor, so the code must count with the evt being null.
*/
public void settingsChange(SettingsChangeEvent evt) {
  if( evt != null && SettingsNames.CARET_BLINK_RATE.equals( evt.getSettingName() ) ) {
    
    JTextComponent c = component;
    if (c == null) return;
    if (evt.getKitClass() != Utilities.getKitClass(c)) return;
    
    Object value = evt.getNewValue();
    if( value instanceof Integer ) {
      setBlinkRate( ((Integer)value).intValue() );
    }
  }
  updateType();
}

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

public void settingsChange(SettingsChangeEvent evt) {
  JTextComponent component = getComponent();
  if (component == null) return;
  
  if (evt == null || Utilities.getKitClass(component) != evt.getKitClass()) return;
  
  if (SettingsNames.CODE_FOLDING_ENABLE.equals(evt.getSettingName())){
    Boolean foldingEnabledBoolean =(Boolean)Settings.getValue(evt.getKitClass(), SettingsNames.CODE_FOLDING_ENABLE);
    foldingEnabled = foldingEnabledBoolean.booleanValue();
    component.putClientProperty(SettingsNames.CODE_FOLDING_ENABLE, foldingEnabledBoolean);
    needsRefresh = true;
    refresh();
  }
}

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

public void settingsChange(SettingsChangeEvent evt) {
  Class kitClass = Utilities.getKitClass(extEditorUI.getComponent());
  if (kitClass != null) {
    autoPopup = SettingsUtil.getBoolean(kitClass, ExtSettingsNames.COMPLETION_AUTO_POPUP, ExtSettingsDefaults.defaultCompletionAutoPopup);
    autoPopupDelay = SettingsUtil.getInteger(kitClass, ExtSettingsNames.COMPLETION_AUTO_POPUP_DELAY,
        ExtSettingsDefaults.defaultCompletionAutoPopupDelay);
    refreshDelay = SettingsUtil.getInteger(kitClass, ExtSettingsNames.COMPLETION_REFRESH_DELAY, ExtSettingsDefaults.defaultCompletionRefreshDelay);
  }
}

代码示例来源:origin: org.netbeans.api/org-netbeans-modules-editor-deprecated-pre61completion

public void settingsChange(SettingsChangeEvent evt) {
  Class kitClass = Utilities.getKitClass(extEditorUI.getComponent());
  if (kitClass != null) {
    minSize = (Dimension)SettingsUtil.getValue(kitClass,
         ExtSettingsNames.COMPLETION_PANE_MIN_SIZE,
         ExtSettingsDefaults.defaultCompletionPaneMinSize);
    minSizeDefault = new Dimension(minSize);
    setMinimumSize(minSize);
    
    maxSize = (Dimension)SettingsUtil.getValue(kitClass,
         ExtSettingsNames.COMPLETION_PANE_MAX_SIZE,
         ExtSettingsDefaults.defaultCompletionPaneMaxSize);
    setMaximumSize(maxSize);
    
  }
}

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

public void settingsChange(SettingsChangeEvent evt) {
  Class kitClass = Utilities.getKitClass(extEditorUI.getComponent());
  if (kitClass != null) {
    minSize = (Dimension)SettingsUtil.getValue(kitClass,
         ExtSettingsNames.COMPLETION_PANE_MIN_SIZE,
         ExtSettingsDefaults.defaultCompletionPaneMinSize);
    minSizeDefault = new Dimension(minSize);
    setMinimumSize(minSize);
    
    maxSize = (Dimension)SettingsUtil.getValue(kitClass,
         ExtSettingsNames.COMPLETION_PANE_MAX_SIZE,
         ExtSettingsDefaults.defaultCompletionPaneMaxSize);
    setMaximumSize(maxSize);
    
  }
}

相关文章