当前位置: 首页>>代码示例>>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;未经允许,请勿转载。