本文整理汇总了Java中com.intellij.util.ui.AwtVisitor类的典型用法代码示例。如果您正苦于以下问题:Java AwtVisitor类的具体用法?Java AwtVisitor怎么用?Java AwtVisitor使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AwtVisitor类属于com.intellij.util.ui包,在下文中一共展示了AwtVisitor类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getActions
import com.intellij.util.ui.AwtVisitor; //导入依赖的package包/类
public List<AnAction> getActions(boolean originalProvider) {
final Ref<ActionToolbar> toolbar = new Ref<ActionToolbar>();
if (myToolbar != null) {
new AwtVisitor(myToolbar) {
@Override
public boolean visit(Component component) {
if (component instanceof ActionToolbar) {
toolbar.set((ActionToolbar)component);
return true;
}
return false;
}
};
}
if (toolbar.get() != null) {
return toolbar.get().getActions(originalProvider);
}
return null;
}
示例2: getTargets
import com.intellij.util.ui.AwtVisitor; //导入依赖的package包/类
@Override
public List<SwitchTarget> getTargets(final boolean onlyVisible, boolean originalProvider) {
final ArrayList<SwitchTarget> result = new ArrayList<SwitchTarget>();
TabInfo selected = myTabs.getSelectedInfo();
new AwtVisitor(selected.getComponent()) {
@Override
public boolean visit(Component component) {
if (component instanceof JBTabs) {
JBTabs tabs = (JBTabs)component;
if (tabs != myTabs) {
result.addAll(tabs.getTargets(onlyVisible, false));
return true;
}
}
return false;
}
};
return result;
}
示例3: getCurrentTarget
import com.intellij.util.ui.AwtVisitor; //导入依赖的package包/类
@Override
public SwitchTarget getCurrentTarget() {
TabInfo selected = myTabs.getSelectedInfo();
final Ref<SwitchTarget> targetRef = new Ref<SwitchTarget>();
new AwtVisitor(selected.getComponent()) {
@Override
public boolean visit(Component component) {
if (component instanceof JBTabs) {
JBTabs tabs = (JBTabs)component;
if (tabs != myTabs) {
targetRef.set(tabs.getCurrentTarget());
return true;
}
}
return false;
}
};
return targetRef.get();
}
示例4: resetProgressBars
import com.intellij.util.ui.AwtVisitor; //导入依赖的package包/类
private void resetProgressBars(final boolean enabled, @Nullable final Boolean completed) {
new AwtVisitor(myPassStatuses) {
@Override
public boolean visit(Component component) {
if (component instanceof JProgressBar) {
JProgressBar progress = (JProgressBar)component;
progress.setEnabled(enabled);
if (completed != null) {
if (completed) {
progress.setValue(TrafficLightRenderer.MAX);
myProgressToText.get(progress).setText(MAX_TEXT);
}
else {
progress.setValue(0);
myProgressToText.get(progress).setText(MIN_TEXT);
}
}
}
return false;
}
};
}
示例5: getTargets
import com.intellij.util.ui.AwtVisitor; //导入依赖的package包/类
public List<SwitchTarget> getTargets(final boolean onlyVisible, boolean originalProvider) {
final ArrayList<SwitchTarget> result = new ArrayList<SwitchTarget>();
TabInfo selected = myTabs.getSelectedInfo();
new AwtVisitor(selected.getComponent()) {
@Override
public boolean visit(Component component) {
if (component instanceof JBTabs) {
JBTabs tabs = (JBTabs)component;
if (tabs != myTabs) {
result.addAll(tabs.getTargets(onlyVisible, false));
return true;
}
}
return false;
}
};
return result;
}
示例6: getCurrentTarget
import com.intellij.util.ui.AwtVisitor; //导入依赖的package包/类
public SwitchTarget getCurrentTarget() {
TabInfo selected = myTabs.getSelectedInfo();
final Ref<SwitchTarget> targetRef = new Ref<SwitchTarget>();
new AwtVisitor(selected.getComponent()) {
@Override
public boolean visit(Component component) {
if (component instanceof JBTabs) {
JBTabs tabs = (JBTabs)component;
if (tabs != myTabs) {
targetRef.set(tabs.getCurrentTarget());
return true;
}
}
return false;
}
};
return targetRef.get();
}
示例7: setPassesEnabled
import com.intellij.util.ui.AwtVisitor; //导入依赖的package包/类
private void setPassesEnabled(final boolean enabled, @Nullable final Boolean completed) {
new AwtVisitor(myPassStatuses) {
@Override
public boolean visit(Component component) {
if (component instanceof JProgressBar) {
JProgressBar progress = (JProgressBar)component;
progress.setEnabled(enabled);
if (completed != null) {
if (completed) {
progress.setValue(MAX);
myProgressToText.get(progress).setText(MAX_TEXT);
}
else {
progress.setValue(0);
myProgressToText.get(progress).setText(MIN_TEXT);
}
}
}
return false;
}
};
}
示例8: unregisterKeyboardActions
import com.intellij.util.ui.AwtVisitor; //导入依赖的package包/类
public static void unregisterKeyboardActions(final JRootPane rootPane) {
new AwtVisitor(rootPane) {
@Override
public boolean visit(final Component component) {
if (component instanceof JComponent) {
final JComponent eachComp = (JComponent)component;
final ActionMap actionMap = eachComp.getActionMap();
final KeyStroke[] strokes = eachComp.getRegisteredKeyStrokes();
for (KeyStroke eachStroke : strokes) {
boolean remove = true;
if (actionMap != null) {
for (int i : new int[]{JComponent.WHEN_FOCUSED, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, JComponent.WHEN_IN_FOCUSED_WINDOW}) {
final InputMap inputMap = eachComp.getInputMap(i);
final Object key = inputMap.get(eachStroke);
if (key != null) {
final Action action = actionMap.get(key);
if (action instanceof UIResource) remove = false;
}
}
}
if (remove) eachComp.unregisterKeyboardAction(eachStroke);
}
}
return false;
}
};
}
示例9: initStyle
import com.intellij.util.ui.AwtVisitor; //导入依赖的package包/类
public void initStyle(Component c, boolean includeChildren) {
if (includeChildren) {
new AwtVisitor(c) {
@Override
public boolean visit(Component component) {
doInit(component);
return false;
}
};
} else {
doInit(c);
}
}
示例10: processEnabled
import com.intellij.util.ui.AwtVisitor; //导入依赖的package包/类
private void processEnabled() {
new AwtVisitor(this) {
@Override
public boolean visit(Component component) {
if (component != myEnabled) {
component.setEnabled(myQaEnabled);
}
return false;
}
};
}
示例11: unregisterKeyboardActions
import com.intellij.util.ui.AwtVisitor; //导入依赖的package包/类
public static void unregisterKeyboardActions(final JRootPane rootPane) {
new AwtVisitor(rootPane) {
@Override
public boolean visit(final Component component) {
if (component instanceof JComponent) {
final JComponent eachComp = (JComponent)component;
final ActionMap actionMap = eachComp.getActionMap();
final KeyStroke[] strokes = eachComp.getRegisteredKeyStrokes();
for (KeyStroke eachStroke : strokes) {
boolean remove = true;
if (actionMap != null) {
for (int i = 0; i < 3; i++) {
final InputMap inputMap = eachComp.getInputMap(i);
final Object key = inputMap.get(eachStroke);
if (key != null) {
final Action action = actionMap.get(key);
if (action instanceof UIResource) remove = false;
}
}
}
if (remove) eachComp.unregisterKeyboardAction(eachStroke);
}
}
return false;
}
};
}