當前位置: 首頁>>代碼示例>>Java>>正文


Java GlassPanel類代碼示例

本文整理匯總了Java中com.intellij.openapi.options.ex.GlassPanel的典型用法代碼示例。如果您正苦於以下問題:Java GlassPanel類的具體用法?Java GlassPanel怎麽用?Java GlassPanel使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


GlassPanel類屬於com.intellij.openapi.options.ex包,在下文中一共展示了GlassPanel類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: lightOptions

import com.intellij.openapi.options.ex.GlassPanel; //導入依賴的package包/類
public static Runnable lightOptions(final SearchableConfigurable configurable,
                                    final JComponent component,
                                    final String option,
                                    final GlassPanel glassPanel) {
  return new Runnable() {
    public void run() {
      if (!traverseComponentsTree(configurable, glassPanel, component, option, true)) {
        traverseComponentsTree(configurable, glassPanel, component, option, false);
      }
    }
  };
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:13,代碼來源:SearchUtil.java

示例2: SpotlightPainter

import com.intellij.openapi.options.ex.GlassPanel; //導入依賴的package包/類
SpotlightPainter(JComponent target, Disposable parent) {
  myQueue = new MergingUpdateQueue("SettingsSpotlight", 200, false, target, parent, target);
  myGlassPanel = new GlassPanel(target);
  myTarget = target;
  IdeGlassPaneUtil.installPainter(target, this, parent);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:7,代碼來源:SpotlightPainter.java

示例3: traverseComponentsTree

import com.intellij.openapi.options.ex.GlassPanel; //導入依賴的package包/類
private static boolean traverseComponentsTree(final SearchableConfigurable configurable,
                                              GlassPanel glassPanel,
                                              JComponent rootComponent,
                                              String option,
                                              boolean force) {

  rootComponent.putClientProperty(HIGHLIGHT_WITH_BORDER, null);

  if (option == null || option.trim().length() == 0) return false;
  boolean highlight = false;
  if (rootComponent instanceof JCheckBox) {
    final JCheckBox checkBox = ((JCheckBox)rootComponent);
    if (isComponentHighlighted(checkBox.getText(), option, force, configurable)) {
      highlight = true;
      glassPanel.addSpotlight(checkBox);
    }
  }
  else if (rootComponent instanceof JRadioButton) {
    final JRadioButton radioButton = ((JRadioButton)rootComponent);
    if (isComponentHighlighted(radioButton.getText(), option, force, configurable)) {
      highlight = true;
      glassPanel.addSpotlight(radioButton);
    }
  }
  else if (rootComponent instanceof JLabel) {
    final JLabel label = ((JLabel)rootComponent);
    if (isComponentHighlighted(label.getText(), option, force, configurable)) {
      highlight = true;
      glassPanel.addSpotlight(label);
    }
  }
  else if (rootComponent instanceof JButton) {
    final JButton button = ((JButton)rootComponent);
    if (isComponentHighlighted(button.getText(), option, force, configurable)) {
      highlight = true;
      glassPanel.addSpotlight(button);
    }
  }
  else if (rootComponent instanceof JTabbedPane) {
    final JTabbedPane tabbedPane = (JTabbedPane)rootComponent;
    final String path = SearchableOptionsRegistrar.getInstance().getInnerPath(configurable, option);
    if (path != null) {
      final int index = getSelection(path, tabbedPane);
      if (index > -1 && index < tabbedPane.getTabCount()) {
        if (tabbedPane.getTabComponentAt(index) instanceof JComponent) {
          glassPanel.addSpotlight((JComponent)tabbedPane.getTabComponentAt(index));
        }
      }
    }
  }


  final Component[] components = rootComponent.getComponents();
  for (Component component : components) {
    if (component instanceof JComponent) {
      final boolean innerHighlight = traverseComponentsTree(configurable, glassPanel, (JComponent)component, option, force);

      if (!highlight && !innerHighlight) {
        final Border border = rootComponent.getBorder();
        if (border instanceof TitledBorder) {
          final String title = ((TitledBorder)border).getTitle();
          if (isComponentHighlighted(title, option, force, configurable)) {
            highlight = true;
            glassPanel.addSpotlight(rootComponent);
            rootComponent.putClientProperty(HIGHLIGHT_WITH_BORDER, Boolean.TRUE);
          }
        }
      }


      if (innerHighlight) {
        highlight = true;
      }
    }
  }
  return highlight;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:78,代碼來源:SearchUtil.java


注:本文中的com.intellij.openapi.options.ex.GlassPanel類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。