当前位置: 首页>>代码示例>>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;未经允许,请勿转载。