Search in sources :

Example 1 with ActionButton

use of com.intellij.openapi.actionSystem.impl.ActionButton in project intellij-community by JetBrains.

the class ReloadablePanel method createReloadButtonPanel.

@NotNull
private JPanel createReloadButtonPanel() {
    ReloadAction reloadAction = new ReloadAction();
    ActionButton reloadButton = new ActionButton(reloadAction, reloadAction.getTemplatePresentation().clone(), CONTROL_PLACE, ActionToolbar.DEFAULT_MINIMUM_BUTTON_SIZE);
    JPanel panel = new JPanel(new BorderLayout(0, 0));
    panel.add(reloadButton, BorderLayout.WEST);
    return panel;
}
Also used : ActionButton(com.intellij.openapi.actionSystem.impl.ActionButton) NotNull(org.jetbrains.annotations.NotNull)

Example 2 with ActionButton

use of com.intellij.openapi.actionSystem.impl.ActionButton in project intellij-community by JetBrains.

the class JBMovePanel method setEnabled.

// Commented to preserve green code policy until this method is not used. Uncomment when necessary.
//public void setRightInsertionStrategy(@NotNull InsertPositionStrategy rightInsertionStrategy) {
//  myRightInsertionStrategy = rightInsertionStrategy;
//}
@Override
public void setEnabled(boolean enabled) {
    super.setEnabled(enabled);
    myLeftList.setEnabled(enabled);
    myRightList.setEnabled(enabled);
    for (ActionButton button : myButtons.values()) {
        button.setEnabled(enabled);
    }
}
Also used : ActionButton(com.intellij.openapi.actionSystem.impl.ActionButton)

Example 3 with ActionButton

use of com.intellij.openapi.actionSystem.impl.ActionButton in project intellij-community by JetBrains.

the class JBMovePanel method createButton.

@NotNull
private ActionButton createButton(@NotNull final ButtonType type) {
    final AnAction action;
    switch(type) {
        case LEFT:
            action = new LeftAction();
            break;
        case RIGHT:
            action = new RightAction();
            break;
        case ALL_LEFT:
            action = new AllLeftAction();
            break;
        case ALL_RIGHT:
            action = new AllRightAction();
            break;
        default:
            throw new IllegalArgumentException("Unsupported button type: " + type);
    }
    ActionButton button = createButton(action);
    myButtons.put(type, button);
    return button;
}
Also used : ActionButton(com.intellij.openapi.actionSystem.impl.ActionButton) AnAction(com.intellij.openapi.actionSystem.AnAction) NotNull(org.jetbrains.annotations.NotNull)

Example 4 with ActionButton

use of com.intellij.openapi.actionSystem.impl.ActionButton in project android by JetBrains.

the class ProjectStructureDialogFixture method clickAddButtonImpl.

protected void clickAddButtonImpl() {
    ActionButton addButton = robot().finder().find(target(), new GenericTypeMatcher<ActionButton>(ActionButton.class) {

        @Override
        protected boolean isMatching(@NotNull ActionButton button) {
            String toolTipText = button.getToolTipText();
            return button.isShowing() && toolTipText != null && toolTipText.startsWith("Add");
        }
    });
    robot().click(addButton);
}
Also used : ActionButton(com.intellij.openapi.actionSystem.impl.ActionButton)

Example 5 with ActionButton

use of com.intellij.openapi.actionSystem.impl.ActionButton in project android by JetBrains.

the class NlConfigurationToolbarFixture method showDesign.

/**
   * Click on the "Show Design" button
   */
public NlConfigurationToolbarFixture showDesign() {
    ActionButton button = waitUntilShowing(myRobot, myToolBar.getComponent(), new GenericTypeMatcher<ActionButton>(ActionButton.class) {

        @Override
        protected boolean isMatching(@NotNull ActionButton component) {
            return "Show Design".equals(component.getAction().getTemplatePresentation().getDescription());
        }
    });
    new ActionButtonFixture(myRobot, button).click();
    return this;
}
Also used : ActionButton(com.intellij.openapi.actionSystem.impl.ActionButton) ActionButtonFixture(com.android.tools.idea.tests.gui.framework.fixture.ActionButtonFixture)

Aggregations

ActionButton (com.intellij.openapi.actionSystem.impl.ActionButton)25 NotNull (org.jetbrains.annotations.NotNull)6 AnAction (com.intellij.openapi.actionSystem.AnAction)3 Test (org.junit.Test)3 ActionButtonFixture (com.android.tools.idea.tests.gui.framework.fixture.ActionButtonFixture)2 PresentationFactory (com.intellij.openapi.actionSystem.impl.PresentationFactory)2 Ref (com.intellij.openapi.util.Ref)2 VirtualFile (com.intellij.openapi.vfs.VirtualFile)2 ComponentLookupException (org.fest.swing.exception.ComponentLookupException)2 PropertiesComponent (com.intellij.ide.util.PropertiesComponent)1 GotoFileCellRenderer (com.intellij.ide.util.gotoByName.GotoFileCellRenderer)1 ActionButtonLook (com.intellij.openapi.actionSystem.ex.ActionButtonLook)1 InplaceActionButtonLook (com.intellij.openapi.actionSystem.impl.InplaceActionButtonLook)1 Project (com.intellij.openapi.project.Project)1 ExistingLibraryEditor (com.intellij.openapi.roots.ui.configuration.libraryEditor.ExistingLibraryEditor)1 LibraryEditor (com.intellij.openapi.roots.ui.configuration.libraryEditor.LibraryEditor)1 LibraryRootsComponent (com.intellij.openapi.roots.ui.configuration.libraryEditor.LibraryRootsComponent)1 ValidationInfo (com.intellij.openapi.ui.ValidationInfo)1 MultiLineLabel (com.intellij.openapi.ui.ex.MultiLineLabel)1 JBPopup (com.intellij.openapi.ui.popup.JBPopup)1