當前位置: 首頁>>代碼示例>>Java>>正文


Java ActionManager.createActionToolbar方法代碼示例

本文整理匯總了Java中com.intellij.openapi.actionSystem.ActionManager.createActionToolbar方法的典型用法代碼示例。如果您正苦於以下問題:Java ActionManager.createActionToolbar方法的具體用法?Java ActionManager.createActionToolbar怎麽用?Java ActionManager.createActionToolbar使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.intellij.openapi.actionSystem.ActionManager的用法示例。


在下文中一共展示了ActionManager.createActionToolbar方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: SeedStackNavigatorPanel

import com.intellij.openapi.actionSystem.ActionManager; //導入方法依賴的package包/類
SeedStackNavigatorPanel(Project project, SimpleTree tree) {
    super(true, true);
    this.project = project;
    this.tree = tree;

    final ActionManager actionManager = ActionManager.getInstance();
    ActionToolbar actionToolbar = actionManager.createActionToolbar(
            "SeedStack Navigator Toolbar",
            (DefaultActionGroup) actionManager.getAction("SeedStack.NavigatorActionsToolbar"),
            true
    );
    actionToolbar.setTargetComponent(tree);
    setToolbar(actionToolbar.getComponent());
    setContent(ScrollPaneFactory.createScrollPane(tree));
}
 
開發者ID:seedstack,項目名稱:intellij-plugin,代碼行數:16,代碼來源:SeedStackNavigatorPanel.java

示例2: createToolbarFromGroupId

import com.intellij.openapi.actionSystem.ActionManager; //導入方法依賴的package包/類
private static ActionToolbar createToolbarFromGroupId(final String groupId) {
    final ActionManager actionManager = ActionManager.getInstance();

    if (!actionManager.isGroup(groupId)) {
        throw new IllegalStateException(groupId + " should have been a group");
    }
    final ActionGroup group = ((ActionGroup)actionManager.getAction(groupId));
    final ActionToolbarImpl editorToolbar =
            ((ActionToolbarImpl)actionManager.createActionToolbar(ActionPlaces.EDITOR_TOOLBAR, group, true));
    editorToolbar.setOpaque(false);
    editorToolbar.setBorder(new JBEmptyBorder(0, 2, 0, 2));

    return editorToolbar;
}
 
開發者ID:zalando,項目名稱:intellij-swagger,代碼行數:15,代碼來源:SwaggerUIToolbar.java

示例3: TitleWithToolbar

import com.intellij.openapi.actionSystem.ActionManager; //導入方法依賴的package包/類
public TitleWithToolbar(@NotNull String title,
                        @NotNull String actionGroupId,
                        @NotNull String place,
                        @NotNull JComponent targetComponent)
{
  super(new GridBagLayout());
  ActionManager actionManager = ActionManager.getInstance();
  ActionGroup group = (ActionGroup)actionManager.getAction(actionGroupId);
  ActionToolbar actionToolbar = actionManager.createActionToolbar(place, group, true);
  actionToolbar.setTargetComponent(targetComponent);
  actionToolbar.setLayoutPolicy(ActionToolbar.NOWRAP_LAYOUT_POLICY);

  add(new MyTitleComponent(title), new GridBag().weightx(1).anchor(GridBagConstraints.WEST).fillCellHorizontally());
  add(actionToolbar.getComponent(), new GridBag().anchor(GridBagConstraints.CENTER));
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:16,代碼來源:TitleWithToolbar.java

示例4: createToolBar

import com.intellij.openapi.actionSystem.ActionManager; //導入方法依賴的package包/類
private static ActionToolbar createToolBar(ActionGroup group) {
  ActionManager actionManager = ActionManager.getInstance();
  ActionToolbar toolbar = actionManager.createActionToolbar("LayoutConfiguration", group, true);
  toolbar.setLayoutPolicy(ActionToolbar.AUTO_LAYOUT_POLICY);

  // The default toolbar layout adds too much spacing between the buttons. Switch to mini mode,
  // but also set a minimum size which will add *some* padding for our 16x16 icons.
  // Disabled because mini mode does not seem to change the visual appearance anymore, and
  // more importantly, it introduces some subtle layout bugs (additional insets when the
  // toolbar does not fully fit etc)
  //toolbar.setMiniMode(true);

  toolbar.setMinimumButtonSize(new Dimension(22, 24));
  return toolbar;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:16,代碼來源:ConfigurationToolBar.java

示例5: initContent

import com.intellij.openapi.actionSystem.ActionManager; //導入方法依賴的package包/類
public void initContent() {
  final ActionManager actionManager = ActionManager.getInstance();
  final ActionGroup actionGroup = (ActionGroup)actionManager.getAction(TOOL_WINDOW_TOOLBAR_ID);
  ActionToolbar actionToolbar = actionManager.createActionToolbar(myPlace, actionGroup, true);
  JPanel toolbarControl = new JPanel(new GridBagLayout());
  GridBagConstraints constraints = new GridBagConstraints();
  constraints.gridwidth = GridBagConstraints.REMAINDER;
  constraints.weightx = 1;
  constraints.fill = GridBagConstraints.HORIZONTAL;
  constraints.anchor = GridBagConstraints.WEST;
  toolbarControl.add(actionToolbar.getComponent(), constraints);
  for (JComponent component : getToolbarControls()) {
    component.setBorder(IdeBorderFactory.createBorder(SideBorder.TOP));
    toolbarControl.add(component, constraints);
  }
  setToolbar(toolbarControl);
  
  final JComponent payloadControl = buildContent();
  JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(payloadControl);
  JScrollBar scrollBar = scrollPane.getVerticalScrollBar();
  scrollBar.setUnitIncrement(scrollBar.getUnitIncrement() * 7);
  myContent.add(scrollPane, CONTENT_CARD_NAME);
  RichTextControlBuilder builder = new RichTextControlBuilder();
  builder.setBackgroundColor(payloadControl.getBackground());
  builder.setForegroundColor(UIUtil.getInactiveTextColor());
  builder.setFont(payloadControl.getFont());
  builder.setText(GradleBundle.message("gradle.toolwindow.text.no.linked.project"));
  final JComponent noLinkedProjectControl = builder.build();
  myContent.add(noLinkedProjectControl, NON_LINKED_CARD_NAME);
  update();
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:32,代碼來源:GradleToolWindowPanel.java


注:本文中的com.intellij.openapi.actionSystem.ActionManager.createActionToolbar方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。