com.intellij.openapi.actionSystem.Constraints Java Examples

The following examples show how to use com.intellij.openapi.actionSystem.Constraints. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: WorkItemQueryDropDown.java    From azure-devops-intellij with MIT License 6 votes vote down vote up
public WorkItemQueryDropDown(final Project project) {
    super();
    this.project = project;
    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();
    // default to false
    enableDropDown(false);
}
 
Example #2
Source File: WorkItemQueryDropDown.java    From azure-devops-intellij with MIT License 5 votes vote down vote up
protected void populateDropDownMenu() {
    isLoading = true;
    group.removeAll();

    // 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);
}
 
Example #3
Source File: MainWindow.java    From KodeBeagle with Apache License 2.0 5 votes vote down vote up
@NotNull
@Override
protected final DefaultActionGroup getActionGroup() {
    RefreshAction refreshAction = new RefreshAction();
    DefaultActionGroup actionGroup = getBasicActionGroup();
    actionGroup.add(refreshAction, Constraints.FIRST);
    actionGroup.addSeparator();
    return actionGroup;
}
 
Example #4
Source File: ShortcutStartupActivity.java    From StringManipulation with Apache License 2.0 5 votes vote down vote up
protected static void registerAction(ActionManager actionManager, DefaultActionGroup group, CustomActionModel customActionModel) {
		if (StringUtils.isNotBlank(customActionModel.getId()) && StringUtils.isNotBlank(customActionModel.getName())) {
			CustomAction action = new CustomAction(customActionModel);
			LOG.info("Registering " + action + " id:" + customActionModel.getId());
			actionManager.registerAction(customActionModel.getId(), action, PluginId.getId("String Manipulation"));
			group.add(action, Constraints.FIRST);


			CustomActionModel reverse = customActionModel.reverse();
			CustomAction reverseAction = new CustomAction(reverse);
			LOG.info("Registering " + reverseAction + " id:" + reverse.getId());
			actionManager.registerAction(reverse.getId(), reverseAction, PluginId.getId("String Manipulation"));
//			group.add(reverseAction, Constraints.FIRST);
		}
	}