• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java AnActionButton类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.intellij.ui.AnActionButton的典型用法代码示例。如果您正苦于以下问题:Java AnActionButton类的具体用法?Java AnActionButton怎么用?Java AnActionButton使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



AnActionButton类属于com.intellij.ui包,在下文中一共展示了AnActionButton类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: run

import com.intellij.ui.AnActionButton; //导入依赖的package包/类
@Override
public void run(AnActionButton button) {
    // 获取选中节点
    final DefaultMutableTreeNode selectedNode = getSelectedNode();
    if (selectedNode == null) {
        return;
    }
    List<AnAction> actions = getMultipleActions(selectedNode);
    if (actions == null || actions.isEmpty()) {
        return;
    }
    // 显示新增按钮
    final DefaultActionGroup group = new DefaultActionGroup(actions);
    JBPopupFactory.getInstance()
            .createActionGroupPopup(null, group, DataManager.getInstance().getDataContext(button.getContextComponent()),
                    JBPopupFactory.ActionSelectionAid.SPEEDSEARCH, true).show(button.getPreferredPopupPoint());
}
 
开发者ID:hykes,项目名称:CodeGen,代码行数:18,代码来源:TemplateAddAction.java


示例2: editAction

import com.intellij.ui.AnActionButton; //导入依赖的package包/类
@NotNull
public CheckBoxListModelEditor<T> editAction(final @NotNull Function<T, T> consumer) {
  final Runnable action = new Runnable() {
    @Override
    public void run() {
      T item = getSelectedItem();
      if (item != null) {
        T newItem = consumer.fun(item);
        if (newItem != null) {
          list.updateItem(item, newItem, StringUtil.notNullize(toNameConverter.fun(newItem)));
        }
        list.requestFocus();
      }
    }
  };
  toolbarDecorator.setEditAction(new AnActionButtonRunnable() {
    @Override
    public void run(AnActionButton button) {
      action.run();
    }
  });
  EditSourceOnDoubleClickHandler.install(list, action);
  return this;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:CheckBoxListModelEditor.java


示例3: getEditActionButtonRunnable

import com.intellij.ui.AnActionButton; //导入依赖的package包/类
private AnActionButtonRunnable getEditActionButtonRunnable(Set<String> patterns) {
    return new AnActionButtonRunnable() {
        @Override
        public void run(AnActionButton anActionButton) {
            String oldValue = (String) patternList.getSelectedValue();
            String pattern = Messages.showInputDialog(
                    textEditMessage, textEditTitle, null, oldValue, getRegexInputValidator());
            if (pattern != null && !pattern.equals(oldValue)) {
                patterns.remove(oldValue);
                patternModels.removeElement(oldValue);
                if (patterns.add(pattern)) {
                    patternModels.addElementSorted(pattern);
                }
            }
        }
    };
}
 
开发者ID:dubreuia,项目名称:intellij-plugin-save-actions,代码行数:18,代码来源:FileMaskPanel.java


示例4: getRemoveAction

import com.intellij.ui.AnActionButton; //导入依赖的package包/类
private AnActionButtonRunnable getRemoveAction(final TableView<XQueryRunVariable> variablesTable) {
    return new AnActionButtonRunnable() {
        @Override
        public void run(AnActionButton button) {
            TableUtil.stopEditing(variablesTable);
            final int[] selected = variablesTable.getSelectedRows();
            if (selected == null || selected.length == 0) return;
            for (int i = selected.length - 1; i >= 0; i--) {
                variablesModel.removeRow(selected[i]);
            }
            for (int i = selected.length - 1; i >= 0; i--) {
                int idx = selected[i];
                variablesModel.fireTableRowsDeleted(idx, idx);
            }
            int selection = selected[0];
            if (selection >= variablesModel.getRowCount()) {
                selection = variablesModel.getRowCount() - 1;
            }
            if (selection >= 0) {
                variablesTable.setRowSelectionInterval(selection, selection);
            }
            variablesTable.requestFocus();
        }
    };
}
 
开发者ID:ligasgr,项目名称:intellij-xquery,代码行数:26,代码来源:VariablesPanel.java


示例5: getAddAction

import com.intellij.ui.AnActionButton; //导入依赖的package包/类
private AnActionButtonRunnable getAddAction(final TableView<XQueryRunVariable> variablesTable) {
    return new AnActionButtonRunnable() {
        @Override
        public void run(AnActionButton button) {
            XQueryRunVariable newVariable = new XQueryRunVariable();
            if (showEditorDialog(newVariable)) {
                ArrayList<XQueryRunVariable> newList = new ArrayList<XQueryRunVariable>(variablesModel
                        .getItems());
                newList.add(newVariable);
                variablesModel.setItems(newList);
                int index = variablesModel.getRowCount() - 1;
                variablesModel.fireTableRowsInserted(index, index);
                variablesTable.setRowSelectionInterval(index, index);
            }
        }
    };
}
 
开发者ID:ligasgr,项目名称:intellij-xquery,代码行数:18,代码来源:VariablesPanel.java


示例6: shouldRemoveEntryAfterRemoveButtonClicked

import com.intellij.ui.AnActionButton; //导入依赖的package包/类
@Test
public void shouldRemoveEntryAfterRemoveButtonClicked() {
    panel.populateWithConfigurations(asList(defaultDataSource));
    final AnActionButton action = getAnActionButton(REMOVE);
    final AnActionEvent event = new TestActionEvent(action);

    execute(new GuiTask() {
        @Override
        protected void executeInEDT() throws Throwable {
            action.actionPerformed(event);
        }
    });

    window.list().requireNoSelection();
    assertThat(window.list().contents().length, is(0));
}
 
开发者ID:ligasgr,项目名称:intellij-xquery,代码行数:17,代码来源:DataSourceListPanelGuiTest.java


示例7: addWebDeploymentButton

import com.intellij.ui.AnActionButton; //导入依赖的package包/类
private void addWebDeploymentButton(ToolbarDecorator tablePanel) {
    tablePanel.addExtraAction(new AnActionButton("Remote", WebDeploymentIcons.Download) {
        @Override
        public void actionPerformed(AnActionEvent anActionEvent) {
            UiSettingsUtil.openFileDialogForDefaultWebServerConnection(project, new WebServerFileDialogExtensionCallback("xml") {
                @Override
                public void success(@NotNull WebServerConfig server, @NotNull WebServerConfig.RemotePath remotePath) {
                    ContainerSettingsForm.this.tableView.getListTableModel().addRow(
                        new ContainerFile("remote://" + org.apache.commons.lang.StringUtils.stripStart(remotePath.path, "/"))
                    );

                    ContainerSettingsForm.this.changed = true;
                }
            });
        }
    });
}
 
开发者ID:Haehnchen,项目名称:idea-php-symfony2-plugin,代码行数:18,代码来源:ContainerSettingsForm.java


示例8: addWebDeploymentButton

import com.intellij.ui.AnActionButton; //导入依赖的package包/类
private void addWebDeploymentButton(ToolbarDecorator tablePanel) {
    tablePanel.addExtraAction(new AnActionButton("Remote", WebDeploymentIcons.Download) {
        @Override
        public void actionPerformed(AnActionEvent anActionEvent) {
            UiSettingsUtil.openFileDialogForDefaultWebServerConnection(project, new WebServerFileDialogExtensionCallback("php") {
                @Override
                public void success(@NotNull WebServerConfig server, @NotNull WebServerConfig.RemotePath remotePath) {
                    RoutingSettingsForm.this.tableView.getListTableModel().addRow(
                        new RoutingFile("remote://" + org.apache.commons.lang.StringUtils.stripStart(remotePath.path, "/"))
                    );

                    RoutingSettingsForm.this.changed = true;
                }
            });
        }
    });
}
 
开发者ID:Haehnchen,项目名称:idea-php-symfony2-plugin,代码行数:18,代码来源:RoutingSettingsForm.java


示例9: createAddRemovePanel

import com.intellij.ui.AnActionButton; //导入依赖的package包/类
public static JPanel createAddRemovePanel(final ListTable table) {
  return ToolbarDecorator.createDecorator(table)
    .setAddAction(new AnActionButtonRunnable() {
      @Override
      public void run(AnActionButton button) {
        final ListWrappingTableModel tableModel = table.getModel();
        tableModel.addRow();
        EventQueue.invokeLater(new Runnable() {
          @Override
          public void run() {
            final int lastRowIndex = tableModel.getRowCount() - 1;
            final Rectangle rectangle = table.getCellRect(lastRowIndex, 0, true);
            table.scrollRectToVisible(rectangle);
            table.editCellAt(lastRowIndex, 0);
            final ListSelectionModel selectionModel = table.getSelectionModel();
            selectionModel.setSelectionInterval(lastRowIndex, lastRowIndex);
            final TableCellEditor editor = table.getCellEditor();
            final Component component = editor.getTableCellEditorComponent(table, null, true, lastRowIndex, 0);
            component.requestFocus();
          }
        });
      }
    }).setRemoveAction(new RemoveAction(table))
    .disableUpDownActions().createPanel();
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:26,代码来源:UiUtils.java


示例10: run

import com.intellij.ui.AnActionButton; //导入依赖的package包/类
@Override
public void run(AnActionButton button)
{
	final int selectedRow = myRendererChooser.getSelectedElementRow();
	if(selectedRow < 0)
	{
		return;
	}
	int newRow = selectedRow + (myMoveUp ? -1 : 1);
	if(newRow < 0)
	{
		newRow = myRendererChooser.getElementCount() - 1;
	}
	else if(newRow >= myRendererChooser.getElementCount())
	{
		newRow = 0;
	}
	myRendererChooser.moveElement(myRendererChooser.getElementAt(selectedRow), newRow);
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:20,代码来源:UserRenderersConfigurable.java


示例11: run

import com.intellij.ui.AnActionButton; //导入依赖的package包/类
@Override
public void run(AnActionButton button) {
    DefaultMutableTreeNode selectedNode = getSelectedNode();
    if (selectedNode != null && selectedNode.getParent() != null) {
        // 删除指定节点
        DefaultTreeModel model = (DefaultTreeModel) this.templateTree.getModel();
        model.removeNodeFromParent(selectedNode);
    }
}
 
开发者ID:hykes,项目名称:CodeGen,代码行数:10,代码来源:TemplateRemoveAction.java


示例12: run

import com.intellij.ui.AnActionButton; //导入依赖的package包/类
@Override
public void run(AnActionButton button) {
  final NodeRenderer renderer = (NodeRenderer)NodeRendererSettings.getInstance().createRenderer(CompoundNodeRenderer.UNIQUE_ID);
  renderer.setEnabled(true);
  addRenderer(renderer);
  SwingUtilities.invokeLater(new Runnable() {
    @Override
    public void run() {
      myNameField.requestFocus();
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:UserRenderersConfigurable.java


示例13: addToolbarButtons

import com.intellij.ui.AnActionButton; //导入依赖的package包/类
@Override
protected void addToolbarButtons(ToolbarDecorator toolbarDecorator) {
  AnActionButton reloadButton = new AnActionButton(PyBundle.message("sdk.paths.dialog.reload.paths"), AllIcons.Actions.Refresh) {
    @Override
    public void actionPerformed(AnActionEvent e) {
      onReloadButtonClicked();
    }
  };
  toolbarDecorator.addExtraAction(reloadButton);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:PythonPathEditor.java


示例14: showPopupActions

import com.intellij.ui.AnActionButton; //导入依赖的package包/类
/**
 * Shows the popup-menu.
 *
 * @param button The button that was pressed.
 */
private void showPopupActions(final AnActionButton button) {
    @Nullable final ActionGroup group = this.addActionPopupGroup;
    if (group == null)
        return;

    JBPopupFactory.getInstance().createActionGroupPopup(null, group,
         DataManager.getInstance().getDataContext(button.getContextComponent()),
         JBPopupFactory.ActionSelectionAid.SPEEDSEARCH, true
    ).show(button.getPreferredPopupPoint());
}
 
开发者ID:metaborg,项目名称:spoofax-intellij,代码行数:16,代码来源:LanguagesPanel.java


示例15: getRemoveActionButtonRunnable

import com.intellij.ui.AnActionButton; //导入依赖的package包/类
@NotNull
private AnActionButtonRunnable getRemoveActionButtonRunnable(Set<String> patterns) {
    return new AnActionButtonRunnable() {
        @Override
        public void run(AnActionButton anActionButton) {
            for (Object object : patternList.getSelectedValues()) {
                String selectedValue = (String) object;
                patterns.remove(selectedValue);
                patternModels.removeElement(selectedValue);
            }
        }
    };
}
 
开发者ID:dubreuia,项目名称:intellij-plugin-save-actions,代码行数:14,代码来源:FileMaskPanel.java


示例16: getAddActionButtonRunnable

import com.intellij.ui.AnActionButton; //导入依赖的package包/类
@NotNull
private AnActionButtonRunnable getAddActionButtonRunnable(Set<String> patterns) {
    return new AnActionButtonRunnable() {
        @Override
        public void run(AnActionButton anActionButton) {
            String pattern = Messages.showInputDialog(
                    textAddMessage, textAddTitle, null, null, getRegexInputValidator());
            if (pattern != null) {
                if (patterns.add(pattern)) {
                    patternModels.addElementSorted(pattern);
                }
            }
        }
    };
}
 
开发者ID:dubreuia,项目名称:intellij-plugin-save-actions,代码行数:16,代码来源:FileMaskPanel.java


示例17: getUpdateAction

import com.intellij.ui.AnActionButton; //导入依赖的package包/类
private AnActionButtonRunnable getUpdateAction(final TableView<XQueryRunVariable> variablesTable) {
    return new AnActionButtonRunnable() {
        @Override
        public void run(AnActionButton button) {
            final int selectedRow = variablesTable.getSelectedRow();
            final XQueryRunVariable selectedVariable = variablesTable.getSelectedObject();
            showEditorDialog(selectedVariable);
            variablesModel.fireTableDataChanged();
            variablesTable.setRowSelectionInterval(selectedRow, selectedRow);
        }
    };
}
 
开发者ID:ligasgr,项目名称:intellij-xquery,代码行数:13,代码来源:VariablesPanel.java


示例18: clickAdd

import com.intellij.ui.AnActionButton; //导入依赖的package包/类
private void clickAdd() {
    final AnActionButton action = getAnActionButton(ADD);
    final AnActionEvent event = new TestActionEvent(action);

    execute(new GuiTask() {
        @Override
        protected void executeInEDT() throws Throwable {
            action.actionPerformed(event);
        }
    });
}
 
开发者ID:ligasgr,项目名称:intellij-xquery,代码行数:12,代码来源:DataSourceListPanelGuiTest.java


示例19: shouldShowAddPathDialogAfterActioningAddButton

import com.intellij.ui.AnActionButton; //导入依赖的package包/类
@Test
public void shouldShowAddPathDialogAfterActioningAddButton() {
    setUpPanelWithUserLibrary(ENABLED);
    final AnActionButton action = getAnActionButton(ADD);
    final AnActionEvent event = new TestActionEvent(action);

    simulateAction(action, event);

    assertThat(fileChooserUsedToChooseFiles, is(true));
}
 
开发者ID:ligasgr,项目名称:intellij-xquery,代码行数:11,代码来源:UserDefinedLibraryPanelGuiTest.java


示例20: shouldRemoveSelectedPositionAfterActioningRemoveButton

import com.intellij.ui.AnActionButton; //导入依赖的package包/类
@Test
public void shouldRemoveSelectedPositionAfterActioningRemoveButton() {
    cfg.USER_DEFINED_LIBRARY_PATHS = asList(PATH_JAR);
    setUpPanelWithUserLibrary(ENABLED);
    final AnActionButton action = getAnActionButton(REMOVE);
    final AnActionEvent event = new TestActionEvent(action);
    panel.getPathList().setSelectedIndex(0);

    simulateAction(action, event);

    assertThat(window.list(PATH_LIST_NAME).contents().length, is(0));
}
 
开发者ID:ligasgr,项目名称:intellij-xquery,代码行数:13,代码来源:UserDefinedLibraryPanelGuiTest.java



注:本文中的com.intellij.ui.AnActionButton类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Transport类代码示例发布时间:2022-05-21
下一篇:
Java ILogger类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap