本文整理匯總了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;
}