本文整理汇总了Java中com.intellij.openapi.actionSystem.ex.ComboBoxAction类的典型用法代码示例。如果您正苦于以下问题:Java ComboBoxAction类的具体用法?Java ComboBoxAction怎么用?Java ComboBoxAction使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ComboBoxAction类属于com.intellij.openapi.actionSystem.ex包,在下文中一共展示了ComboBoxAction类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: click
import com.intellij.openapi.actionSystem.ex.ComboBoxAction; //导入依赖的package包/类
private void click() throws ClassNotFoundException {
final Class<?> comboBoxButtonClass = getClass().getClassLoader().loadClass(ComboBoxAction.class.getCanonicalName() + "$ComboBoxButton");
final ActionButtonFixture runButton = projectFrame.findRunApplicationButton();
Container actionToolbarContainer = execute(new GuiQuery<Container>() {
@Override
protected Container executeInEDT() throws Throwable {
return runButton.target().getParent();
}
});
assertNotNull(actionToolbarContainer);
JButton comboBoxButton = robot.finder().find(actionToolbarContainer, new GenericTypeMatcher<JButton>(JButton.class) {
@Override
protected boolean isMatching(@NotNull JButton component) {
return comboBoxButtonClass.isInstance(component);
}
});
final JButtonFixture comboBoxButtonFixture = new JButtonFixture(robot, comboBoxButton);
pause(new Condition("Wait until comboBoxButton is enabled") {
@Override
public boolean test() {
//noinspection ConstantConditions
return execute(new GuiQuery<Boolean>() {
@Override
protected Boolean executeInEDT() throws Throwable {
return comboBoxButtonFixture.target().isEnabled();
}
});
}
}, SHORT_TIMEOUT);
comboBoxButtonFixture.click();
}
示例2: getPreferredSize
import com.intellij.openapi.actionSystem.ex.ComboBoxAction; //导入依赖的package包/类
@Override
public Dimension getPreferredSize(JComponent c) {
ComboBoxButton comboBoxButton = (ComboBoxButton)c;
ComboBoxAction comboBoxAction = comboBoxButton.getComboBoxAction();
final boolean isEmpty = comboBoxButton.getIcon() == null && StringUtil.isEmpty(comboBoxButton.getText());
int width = isEmpty ? JBUI.scale(10) + getArrowIcon().getIconWidth() : super.getPreferredSize(c).width;
if (comboBoxAction.isSmallVariant()) width += JBUI.scale(4);
return new Dimension(width, comboBoxAction.isSmallVariant() ? JBUI.scale(19) : super.getPreferredSize(c).height);
}
示例3: getPreferredSize
import com.intellij.openapi.actionSystem.ex.ComboBoxAction; //导入依赖的package包/类
@Override
public Dimension getPreferredSize(JComponent c) {
ComboBoxButton comboBoxButton = (ComboBoxButton)c;
ComboBoxAction comboBoxAction = comboBoxButton.getComboBoxAction();
final boolean isEmpty = comboBoxButton.getIcon() == null && StringUtil.isEmpty(comboBoxButton.getText());
int width = isEmpty ? JBUI.scale(18) : super.getPreferredSize(c).width;
if (comboBoxAction.isSmallVariant()) width += JBUI.scale(4);
return new Dimension(width, comboBoxAction.isSmallVariant() ? JBUI.scale(21) : super.getPreferredSize(c).height);
}
示例4: isNeedGap
import com.intellij.openapi.actionSystem.ex.ComboBoxAction; //导入依赖的package包/类
private static boolean isNeedGap(final AnAction group) {
final AnAction firstAction = getFirstAction(group);
return firstAction instanceof ComboBoxAction;
}