Example usage for com.intellij.openapi.actionSystem Constraints LAST

List of usage examples for com.intellij.openapi.actionSystem Constraints LAST

Introduction

In this page you can find the example usage for com.intellij.openapi.actionSystem Constraints LAST.

Prototype

Constraints LAST

To view the source code for com.intellij.openapi.actionSystem Constraints LAST.

Click Source Link

Usage

From source file:com.anecdote.ideaplugins.commitlog.CommitLogProjectComponent.java

License:Apache License

public void initComponent() {
    _vcsManager = ProjectLevelVcsManager.getInstance(_project);
    _vcsManager.registerCheckinHandlerFactory(this);
    if (_generateCommentAction == null) {
        _generateCommentAction = new GenerateCommentAction();
        ActionManager.getInstance().registerAction("CommitLogPlugin.GenerateComment", _generateCommentAction);
        DefaultActionGroup actionGroup = (DefaultActionGroup) ActionManager.getInstance()
                .getAction("Vcs.MessageActionGroup");
        actionGroup.add(_generateCommentAction, Constraints.LAST);
        actionGroup = (DefaultActionGroup) ActionManager.getInstance()
                .getAction("CHANGES_BAR_COMMIT_COMMENT_ACTIONS");
        if (actionGroup != null) {
            actionGroup.add(_generateCommentAction, Constraints.FIRST);
        }/*from   www  . ja  v a  2 s  .c o m*/
    }
}

From source file:com.atlassian.clover.idea.CloverPlugin.java

/**
 * @see ApplicationComponent#initComponent()
 *///from  w  ww.j ava2s  .c  o m
@Override
public void initComponent() {
    // run through initialisation sequence...
    CloverStartup.logVersionInfo(LOG);
    LOG.info("Plugin Version " + PluginVersionInfo.RELEASE_NUMBER + "[" + PluginVersionInfo.BUILD_NUMBER + "]");

    loadLicense();

    // TODO As we dropped IDEA 10.x we could add the <add-to-group group-id="CompilerErrorViewPopupMenu" anchor="last"/>
    // TODO for <action id="CloverPlugin.JumpToActualSource" ...> and remove the following lines.
    // TODO However, the LightIdeaTestCase does not register the CompilerErrorViewPopupMenu group which causes
    // TODO errors in our tests if we remove these lines and use the add-to-group.
    final ActionManager actionManager = ActionManager.getInstance();
    DefaultActionGroup compilerPopupMenu = (DefaultActionGroup) actionManager
            .getAction(IdeActions.GROUP_COMPILER_ERROR_VIEW_POPUP);
    if (compilerPopupMenu == null) {
        compilerPopupMenu = new DefaultActionGroup();
        actionManager.registerAction(IdeActions.GROUP_COMPILER_ERROR_VIEW_POPUP, compilerPopupMenu);
    }

    // Note: CloverPlugin.JumpToActualSource is defined in plugin.xml
    final AnAction action = actionManager.getAction("CloverPlugin.JumpToActualSource");
    compilerPopupMenu.add(action, Constraints.LAST);
}

From source file:com.google.cloud.tools.intellij.CloudToolsPluginInitializationComponent.java

License:Apache License

private void initAppEngineSupport(CloudToolsPluginConfigurationService pluginConfigurationService) {
    AppEngineCloudType appEngineCloudType = new AppEngineCloudType();
    pluginConfigurationService.registerExtension(ServerType.EP_NAME, appEngineCloudType);
    pluginConfigurationService.registerExtension(ConfigurationType.CONFIGURATION_TYPE_EP,
            new DeployToServerConfigurationType(appEngineCloudType));
    pluginConfigurationService.registerExtension(DeploymentSourceType.EP_NAME,
            new UserSpecifiedPathDeploymentSourceType());
    pluginConfigurationService.registerExtension(DeploymentSourceType.EP_NAME,
            new MavenBuildDeploymentSourceType());
    pluginConfigurationService.registerExtension(DeploymentSourceType.EP_NAME,
            new AppEngineArtifactDeploymentSourceType());

    ActionManager actionManager = ActionManager.getInstance();
    AnAction toolsMenuAction = new AppEngineToolsMenuAction();
    actionManager.registerAction(AppEngineToolsMenuAction.ID, toolsMenuAction);
    DefaultActionGroup toolsMenu = (DefaultActionGroup) actionManager
            .getAction(AppEngineToolsMenuAction.GROUP_ID);
    toolsMenu.add(toolsMenuAction, Constraints.LAST);
}

From source file:com.microsoft.alm.plugin.idea.common.ui.controls.WorkItemQueryDropDown.java

License:Open Source License

public WorkItemQueryDropDown(final Project project, final RepositoryContext repositoryContext) {
    super();//from   w w  w. java  2  s  .c  o  m
    this.project = project;
    this.repositoryContext = repositoryContext;
    this.defaultQuery = new QueryAction(TfPluginBundle.message(TfPluginBundle.KEY_VCS_WIT_QUERY_DEFAULT_QUERY),
            WorkItemHelper.getAssignedToMeQuery());
    this.loadingAction = new LoadingAction();
    this.queryOperationInput = new WorkItemQueriesLookupOperation.QueryInputs(
            WorkItemQueriesLookupOperation.QueryRootDirectories.MY_QUERIES);

    // set defaults for dropdown entries
    this.group.add(defaultQuery, Constraints.FIRST);
    this.group.addSeparator(TfPluginBundle.message(TfPluginBundle.KEY_VCS_WIT_QUERY_SEPARATOR_MY_QUERIES));
    this.group.add(loadingAction, Constraints.LAST);
    this.selectedQuery = defaultQuery;

    initializeUI();
}

From source file:com.microsoft.alm.plugin.idea.common.ui.controls.WorkItemQueryDropDown.java

License:Open Source License

protected ActionGroup populateDropDownMenu() {
    if (!isInitialized) {
        // add initial items to menu
        group.add(defaultQuery, Constraints.FIRST);
        group.addSeparator(TfPluginBundle.message(TfPluginBundle.KEY_VCS_WIT_QUERY_SEPARATOR_MY_QUERIES));
        group.add(loadingAction, Constraints.LAST);

        // persist an existing selected query if there is one
        selectedQuery = selectedQuery == null ? defaultQuery : selectedQuery;

        // add menu items from server
        addQueriesFromServer(group);/*from  w  w  w .  ja va 2s .  c  o m*/

        isInitialized = true;
    }
    return group;
}

From source file:org.metaborg.intellij.idea.actions.ActionUtils.java

License:Apache License

/**
 * Gets an object that specifies where the action is positioned.
 *
 * @param relativeToActionId The action ID relative to which to position the action;
 *                           or <code>null</code> to position the action at the start or end.
 * @param anchor The anchor indicating where to position the action;
 *               or <code>null</code> to position the action after or at the end.
 * @return The {@link Constraints}.//w  ww.j a va  2 s . co  m
 */
private Constraints getActionConstraints(@Nullable final String relativeToActionId,
        @Nullable final Anchor anchor) {
    if (relativeToActionId != null && anchor != null) {
        return new Constraints(anchor, relativeToActionId);
    } else if (relativeToActionId != null) {
        return new Constraints(Anchor.AFTER, relativeToActionId);
    } else if (anchor == Anchor.BEFORE || anchor == Anchor.FIRST) {
        return Constraints.FIRST;
    } else {
        return Constraints.LAST;
    }
}