本文整理汇总了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);
}
}
};
}
示例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);
}
示例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;
}