本文整理匯總了Java中com.intellij.openapi.actionSystem.DefaultActionGroup.add方法的典型用法代碼示例。如果您正苦於以下問題:Java DefaultActionGroup.add方法的具體用法?Java DefaultActionGroup.add怎麽用?Java DefaultActionGroup.add使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.intellij.openapi.actionSystem.DefaultActionGroup
的用法示例。
在下文中一共展示了DefaultActionGroup.add方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: initBPMNModelMenu
import com.intellij.openapi.actionSystem.DefaultActionGroup; //導入方法依賴的package包/類
public void initBPMNModelMenu() {
DefaultActionGroup modelMenu = (DefaultActionGroup) ActionManager.getInstance().getAction("yaoqiang.actions.BPMNModelMenu");
AppMenu model = new ModelMenu();
for (int i = 0; i < model.getItemCount(); i++) {
JMenuItem item = model.getItem(i);
if (item == null) {
modelMenu.addSeparator();
} else {
AnAction action = new AnAction(item.getText()) {
@Override
public void actionPerformed(AnActionEvent e) {
item.getAction().actionPerformed(new ActionEvent(e, 0, ""));
}
};
modelMenu.add(action);
}
}
}
示例2: createList
import com.intellij.openapi.actionSystem.DefaultActionGroup; //導入方法依賴的package包/類
/**
* create ListPop
*
* @param title
* @param data
* @param listener
*/
public void createList(String title, String[] data, OnItemClickListener listener) {
DefaultActionGroup group = new DefaultActionGroup();
if (data != null && data.length > 0) {
for (int i = 0; i < data.length; i++) {
if (!Utils.isEmpty(data[i])) {
if (data[i].contains("-")) {
group.add(new ListItemAction(i, data[i], listener));
} else {
group.addSeparator(data[i]);
}
}
}
}
listPopup = JBPopupFactory.getInstance().createActionGroupPopup(title, group,
anActionEvent.getDataContext(), aid, true, null, -1, null, "unknown");
show();
}
示例3: getTaskDescriptionActionGroup
import com.intellij.openapi.actionSystem.DefaultActionGroup; //導入方法依賴的package包/類
@NotNull
default DefaultActionGroup getTaskDescriptionActionGroup() {
final DefaultActionGroup group = new DefaultActionGroup();
String[] ids = new String[]{
StudyCheckAction.ACTION_ID,
StudyPreviousTaskAction.ACTION_ID,
StudyNextTaskAction.ACTION_ID,
StudyRefreshTaskFileAction.ACTION_ID,
StudyShowHintAction.ACTION_ID
};
ActionManager actionManager = ActionManager.getInstance();
Arrays.stream(ids)
.map(actionManager::getAction)
.filter(Objects::nonNull)
.forEach(group::add);
group.add(new StudyEditInputAction());
return group;
}
示例4: initComponent
import com.intellij.openapi.actionSystem.DefaultActionGroup; //導入方法依賴的package包/類
@Override
public void initComponent() {
PluginSettings settings = PluginSettings.getInstance();
ActionManager am = ActionManager.getInstance();
// Gets an instance of the WindowMenu action group.
DefaultActionGroup menuManager = (DefaultActionGroup) am.getAction(COMPONENT_GROUP); //(IdeActions.GROUP_EDITOR_POPUP); //"EditorPopupMenu");
//menuManager.addSeparator();
for (PluginSettings.SearchEngine engine : settings.searchEngines) {
LaunchSearchAction action = new LaunchSearchAction(engine);
// Passes an instance of your custom TextBoxes class to the registerAction method of the ActionManager class.
am.registerAction(getActionId(action), action);
// Adds a separator and a new menu command to the WindowMenu group on the main menu.
menuManager.add(action); //, Constraints.LAST);
}
menuManager.addSeparator();
}
示例5: createToolWindowContent
import com.intellij.openapi.actionSystem.DefaultActionGroup; //導入方法依賴的package包/類
public void createToolWindowContent(@NotNull ToolWindow toolWindow) {
//Create runner UI layout
RunnerLayoutUi.Factory factory = RunnerLayoutUi.Factory.getInstance(myProject);
RunnerLayoutUi layoutUi = factory.create("", "", "session", myProject);
// Adding actions
DefaultActionGroup group = new DefaultActionGroup();
layoutUi.getOptions().setLeftToolbar(group, ActionPlaces.UNKNOWN);
Content console = layoutUi.createContent(GradleConsoleToolWindowFactory.ID, myConsoleView.getComponent(), "", null, null);
AnAction[] consoleActions = myConsoleView.createConsoleActions();
for (AnAction action : consoleActions) {
if (!shouldIgnoreAction(action)) {
group.add(action);
}
}
layoutUi.addContent(console, 0, PlaceInGrid.right, false);
JComponent layoutComponent = layoutUi.getComponent();
myConsolePanel.add(layoutComponent, BorderLayout.CENTER);
//noinspection ConstantConditions
Content content = ContentFactory.SERVICE.getInstance().createContent(layoutComponent, null, true);
toolWindow.getContentManager().addContent(content);
}
示例6: createActionGroupPopup
import com.intellij.openapi.actionSystem.DefaultActionGroup; //導入方法依賴的package包/類
@Nullable
protected JBPopup createActionGroupPopup(PsiFile file, Project project, Editor editor) {
final DefaultActionGroup group = new DefaultActionGroup();
for (final IntentionAction action : IntentionManager.getInstance().getAvailableIntentionActions()) {
if (shouldShowInGutterPopup(action) && action.isAvailable(project, editor, file)) {
group.add(new ApplyIntentionAction(action, action.getText(), editor, file));
}
}
if (group.getChildrenCount() > 0) {
final DataContext context = SimpleDataContext.getProjectContext(null);
return JBPopupFactory.getInstance()
.createActionGroupPopup(null, group, context, JBPopupFactory.ActionSelectionAid.SPEEDSEARCH, true);
}
return null;
}
示例7: getToolbarActions
import com.intellij.openapi.actionSystem.DefaultActionGroup; //導入方法依賴的package包/類
@NotNull
public ActionGroup getToolbarActions() {
DefaultActionGroup group = new DefaultActionGroup();
if (Boolean.getBoolean(ENABLE_EXPERIMENTAL_ACTIONS)) {
group.add(new RecordingAction(myMemorySampler));
}
group.add(new GcAction(myDeviceContext));
group.add(new DumpHprofAction(myProject, myDeviceContext, myEvents));
group.add(new ToggleAllocationTrackingAction(myDeviceContext, myEvents));
if (Boolean.getBoolean("studio.profiling.debug")) {
group.addSeparator();
group.add(new ToggleDebugRender(myTimelineComponent));
}
return group;
}
示例8: createLanguagePopup
import com.intellij.openapi.actionSystem.DefaultActionGroup; //導入方法依賴的package包/類
private ListPopup createLanguagePopup() {
DefaultActionGroup actions = new DefaultActionGroup();
for (final Language language : getEditorsProvider().getSupportedLanguages(myProject, mySourcePosition)) {
//noinspection ConstantConditions
actions.add(new AnAction(language.getDisplayName(), null, language.getAssociatedFileType().getIcon()) {
@Override
public void actionPerformed(@NotNull AnActionEvent e) {
XExpression currentExpression = getExpression();
setExpression(new XExpressionImpl(currentExpression.getExpression(), language, currentExpression.getCustomInfo()));
requestFocusInEditor();
}
});
}
DataContext dataContext = DataManager.getInstance().getDataContext(getComponent());
return JBPopupFactory.getInstance().createActionGroupPopup("Choose language", actions, dataContext,
JBPopupFactory.ActionSelectionAid.SPEEDSEARCH,
false);
}
示例9: createToolbarWithActions
import com.intellij.openapi.actionSystem.DefaultActionGroup; //導入方法依賴的package包/類
/**
* Create some actions
*
* @param horizontal is horizontal displayed
* @return
*/
public static ActionToolbar createToolbarWithActions(boolean horizontal,
AnAction... actions) {
DefaultActionGroup group = new DefaultActionGroup();
if (actions != null) {
for (AnAction anAction : actions) {
group.add(anAction);
}
}
//group.addSeparator();
return ActionManager.getInstance().createActionToolbar("unknown", group, horizontal);// horizontal
}
示例10: createActionToolbar
import com.intellij.openapi.actionSystem.DefaultActionGroup; //導入方法依賴的package包/類
@NotNull
private ActionGroup createActionToolbar(JComponent consolePanel, ConsoleView consoleView, @NotNull final RunnerLayoutUi myUi, RunContentDescriptor contentDescriptor, Executor runExecutorInstance) {
final DefaultActionGroup actionGroup = new DefaultActionGroup();
actionGroup.add(new FilterAction());
actionGroup.add(new RerunAction(consolePanel, consoleView));
actionGroup.add(new StopAction());
actionGroup.add(new FormatAction());
actionGroup.add(new MyCloseAction(runExecutorInstance, contentDescriptor, myProject));
return actionGroup;
}
示例11: createToolbar
import com.intellij.openapi.actionSystem.DefaultActionGroup; //導入方法依賴的package包/類
public ActionToolbar createToolbar() {
DefaultActionGroup group = new DefaultActionGroup();
group.add(new ScrollToTheEndToolbarAction(this.getEditor()));
group.add(new ClearLogAction(this));
group.add(new StartAction(this, getProject()));
ActionToolbar toolbar = ActionManager.getInstance().createActionToolbar("left", group, false);
toolbar.setTargetComponent(this.getComponent());
return toolbar;
}
示例12: getTaskDescriptionActionGroup
import com.intellij.openapi.actionSystem.DefaultActionGroup; //導入方法依賴的package包/類
@NotNull
@Override
public DefaultActionGroup getTaskDescriptionActionGroup() {
DefaultActionGroup taskDescriptionActionGroup = super.getTaskDescriptionActionGroup();
taskDescriptionActionGroup.remove(ActionManager.getInstance().getAction(StudyShowHintAction.ACTION_ID));
StudyFillPlaceholdersAction fillPlaceholdersAction = new StudyFillPlaceholdersAction();
fillPlaceholdersAction.getTemplatePresentation().setIcon(EduKotlinIcons.FILL_PLACEHOLDERS_ICON);
fillPlaceholdersAction.getTemplatePresentation().setText("Fill Answer Placeholders");
taskDescriptionActionGroup.add(fillPlaceholdersAction);
return taskDescriptionActionGroup;
}
示例13: createUI
import com.intellij.openapi.actionSystem.DefaultActionGroup; //導入方法依賴的package包/類
private void createUI() {
myMainPanel = new JPanel(new BorderLayout());
myBrowser = new RepositoryBrowserComponent(SvnVcs.getInstance(myProject));
final DefaultActionGroup group = new DefaultActionGroup();
group.add(new RepositoryBrowserDialog.MkDirAction(myBrowser) {
@Override
public void update(AnActionEvent e) {
super.update(e);
e.getPresentation().setText("New Remote Folder...");
}
});
group.add(new RepositoryBrowserDialog.DeleteAction(myBrowser));
group.add(new RepositoryBrowserDialog.RefreshAction(myBrowser));
final ActionPopupMenu popupMenu = ActionManager.getInstance().createActionPopupMenu("", group);
final JPopupMenu component = popupMenu.getComponent();
myBrowser.getRepositoryTree().addMouseListener(new PopupHandler() {
@Override
public void invokePopup(Component comp, int x, int y) {
component.show(comp, x, y);
}
});
final Splitter splitter = new Splitter(true);
splitter.setProportion(0.7f);
final JPanel wrapper = createBrowserPartWrapper();
splitter.setFirstComponent(wrapper);
final JPanel commitMessageWrapper = createCommitMessageWrapper();
splitter.setSecondComponent(commitMessageWrapper);
myMainPanel.add(splitter, BorderLayout.CENTER);
final JPanel recentMessagesWrapper = new JPanel(new BorderLayout());
recentMessagesWrapper.add(new JLabel("Recent Messages:"), BorderLayout.NORTH);
myMessagesBox = new JComboBox();
recentMessagesWrapper.add(myMessagesBox, BorderLayout.SOUTH);
recentMessagesWrapper.setBorder(BorderFactory.createEmptyBorder(4,0,0,0));
myMainPanel.add(recentMessagesWrapper, BorderLayout.SOUTH);
}
示例14: addFillActions
import com.intellij.openapi.actionSystem.DefaultActionGroup; //導入方法依賴的package包/類
static void addFillActions(DesignerEditorPanel designer,
DefaultActionGroup actionGroup,
List<? extends RadViewComponent> selection) {
actionGroup.add(new ToggleSizeAction(designer, selection, "Toggle Width", ATTR_LAYOUT_WIDTH, AndroidDesignerIcons.FillWidth,
AndroidDesignerIcons.WrapWidth));
actionGroup.add(new ToggleSizeAction(designer, selection, "Toggle Height", ATTR_LAYOUT_HEIGHT, AndroidDesignerIcons.FillHeight,
AndroidDesignerIcons.WrapHeight));
}
示例15: createActions
import com.intellij.openapi.actionSystem.DefaultActionGroup; //導入方法依賴的package包/類
/**
* Create a list of idea actions that the user can choose, to change their pairs.
*
* @param pairController Pair logic controller for list of members.
* @return list of actions.
*/
private static ActionGroup createActions(@NotNull PairController pairController, @NotNull TeamMemberAction.TeamMemberActionPerformer teamMemberActionPerformer) {
DefaultActionGroup defaultActionGroup = new DefaultActionGroup(null, false);
PairConfig pairConfig = pairController.getPairConfig();
for (TeamMember teamMember : pairConfig.getTeamMembers()) {
defaultActionGroup.add(new TeamMemberAction(teamMember, teamMemberActionPerformer));
}
return defaultActionGroup;
}