本文整理汇总了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));
}
示例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;
}
示例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));
}
示例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;
}
示例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();
}