@Override public void createToolWindowContent(@NotNull final Project project, @NotNull ToolWindow toolWindow) { SimpleToolWindowPanel panel = new SimpleToolWindowPanel(false, true); BsConsole console = new BsConsole(project); panel.setContent(console.getComponent()); ActionToolbar toolbar = console.createToolbar(); panel.setToolbar(toolbar.getComponent()); Content content = ContentFactory.SERVICE.getInstance().createContent(panel, "", true); toolWindow.getContentManager().addContent(content); // Start compiler BsCompiler bsc = BucklescriptProjectComponent.getInstance(project).getCompiler(); if (bsc != null) { bsc.addListener(new BsOutputListener(project)); ProcessHandler handler = bsc.getHandler(); if (handler == null) { console.print("Bsb not found, check the event logs.", ERROR_OUTPUT); } else { console.attachToProcess(handler); } bsc.startNotify(); } }
private JPanel createIssuesViewTab(boolean supported) { ActionToolbar toolbar = ComponentUtils.createActionToolbar(issuesComponentsTree); IssueFilterMenu issueFilterMenu = new IssueFilterMenu(project); JPanel filterButton = new FilterButton(issueFilterMenu, "Severity", "Select severities to show"); SimpleToolWindowPanel filterPanel = new SimpleToolWindowPanel(false); filterPanel.setToolbar(toolbar.getComponent()); filterPanel.setContent(filterButton); issuesPanel = createComponentsIssueDetailView(); issuesRightHorizontalSplit = new OnePixelSplitter(true, 0.55f); issuesRightHorizontalSplit.setFirstComponent(createComponentsDetailsView(supported)); issuesRightHorizontalSplit.setSecondComponent(issuesPanel); OnePixelSplitter centralVerticalSplit = new OnePixelSplitter(false, 0.33f); centralVerticalSplit.setFirstComponent(createIssuesComponentsTreeView()); centralVerticalSplit.setSecondComponent(issuesRightHorizontalSplit); OnePixelSplitter issuesViewTab = new OnePixelSplitter(true, 0f); issuesViewTab.setResizeEnabled(false); issuesViewTab.setFirstComponent(filterPanel); issuesViewTab.setSecondComponent(centralVerticalSplit); return issuesViewTab; }
private JPanel createLicenseInfoTab(boolean supported) { ActionToolbar toolbar = ComponentUtils.createActionToolbar(licensesComponentsTree); licenseFilterMenu = new LicenseFilterMenu(project); FilterButton licensesFilterButton = new FilterButton(licenseFilterMenu, "License", "Select licenses to show"); licensesFilterButton.setAlignmentX(Component.LEFT_ALIGNMENT); SimpleToolWindowPanel filterPanel = new SimpleToolWindowPanel(false); filterPanel.setToolbar(toolbar.getComponent()); filterPanel.setContent(licensesFilterButton); JPanel licenseTab = new JBPanel(new BorderLayout()); licensesCentralVerticalSplit = new OnePixelSplitter(false, 0.3f); licensesCentralVerticalSplit.setFirstComponent(createLicensesComponentsTreeView()); licensesCentralVerticalSplit.setSecondComponent(createLicenseDetailsView(supported)); licenseTab.add(filterPanel, BorderLayout.NORTH); licenseTab.add(licensesCentralVerticalSplit, BorderLayout.CENTER); return licenseTab; }
public List<AnAction> getActions(boolean originalProvider) { final Ref<ActionToolbar> toolbar = new Ref<ActionToolbar>(); if (myToolbar != null) { new AwtVisitor(myToolbar) { @Override public boolean visit(Component component) { if (component instanceof ActionToolbar) { toolbar.set((ActionToolbar)component); return true; } return false; } }; } if (toolbar.get() != null) { return toolbar.get().getActions(originalProvider); } return null; }
private void createConsole(@NotNull final NetService netService) { TextConsoleBuilder consoleBuilder = TextConsoleBuilderFactory.getInstance().createBuilder(netService.getProject()); netService.configureConsole(consoleBuilder); console = consoleBuilder.getConsole(); ApplicationManager.getApplication().invokeLater(new Runnable() { @Override public void run() { ActionGroup actionGroup = netService.getConsoleToolWindowActions(); ActionToolbar toolbar = ActionManager.getInstance().createActionToolbar(ActionPlaces.UNKNOWN, actionGroup, false); SimpleToolWindowPanel toolWindowPanel = new SimpleToolWindowPanel(false, true); toolWindowPanel.setContent(console.getComponent()); toolWindowPanel.setToolbar(toolbar.getComponent()); ToolWindow toolWindow = ToolWindowManager.getInstance(netService.getProject()) .registerToolWindow(netService.getConsoleToolWindowId(), false, ToolWindowAnchor.BOTTOM, netService.getProject(), true); toolWindow.setIcon(netService.getConsoleToolWindowIcon()); Content content = ContentFactory.SERVICE.getInstance().createContent(toolWindowPanel, "", false); Disposer.register(content, console); toolWindow.getContentManager().addContent(content); } }, netService.getProject().getDisposed()); }
@NotNull static JPanel createTreePanel(@NotNull CheckboxTreeView tree) { JPanel treePanel = new JPanel(new BorderLayout()); DefaultActionGroup group = new DefaultActionGroup(); CommonActionsManager actions = CommonActionsManager.getInstance(); group.addAll(actions.createExpandAllAction(tree, treePanel), actions.createCollapseAllAction(tree, treePanel)); ActionToolbar actionToolBar = ActionManager.getInstance().createActionToolbar("", group, true); JPanel buttonsPanel = new JPanel(new BorderLayout()); buttonsPanel.add(actionToolBar.getComponent(), BorderLayout.CENTER); buttonsPanel.setBorder(new SideBorder(JBColor.border(), SideBorder.TOP | SideBorder.LEFT | SideBorder.RIGHT, 1)); treePanel.add(buttonsPanel, BorderLayout.NORTH); treePanel.add(ScrollPaneFactory.createScrollPane(tree), BorderLayout.CENTER); return treePanel; }
GroovyDocGenerationPanel() { myInputDir.addBrowseFolderListener(GroovyDocBundle.message("groovydoc.generate.directory.browse"), null, null, FileChooserDescriptorFactory.createSingleFolderDescriptor()); myOutputDir.addBrowseFolderListener(GroovyDocBundle.message("groovydoc.generate.directory.browse"), null, null, FileChooserDescriptorFactory.createSingleFolderDescriptor()); myDataModel = new DefaultListModel(); myPackagesList = new JBList(myDataModel); myPackagesList.setMinimumSize(JBUI.size(100, 150)); JScrollPane packagesScrollPane = ScrollPaneFactory.createScrollPane(myPackagesList); myPackagesPanel.setLayout(new BorderLayout()); myPackagesPanel.setBorder(IdeBorderFactory.createTitledBorder("Source packages", false)); ActionToolbar actionToolbar = ActionManager.getInstance().createActionToolbar("GroovyDoc", getActionGroup(), true); myPackagesPanel.add(actionToolbar.getComponent(), BorderLayout.NORTH); myPackagesPanel.add(packagesScrollPane, BorderLayout.SOUTH); actionToolbar.updateActionsImmediately(); myPanel.setMinimumSize(JBUI.size(275, 350)); }
@Before public void setUp() { MockApplication application = new MyMockApplicationEx(parent); ActionManagerEx manager = Mockito.mock(ActionManagerEx.class); ActionToolbar actionToolbar = Mockito.mock(ActionToolbar.class); Mockito.when(actionToolbar.getComponent()).thenReturn(new JComponent() {}); Mockito.when( manager.createActionToolbar( Mockito.anyString(), Mockito.any(ActionGroup.class), Mockito.anyBoolean())) .thenReturn(actionToolbar); Mockito.when( manager.createActionToolbar( Mockito.anyString(), Mockito.any(ActionGroup.class), Mockito.anyBoolean(), Mockito.anyBoolean())) .thenReturn(actionToolbar); application.addComponent(ActionManager.class, manager); application.registerService(UISettings.class); ApplicationManager.setApplication(application, parent); XDebugSession session = Mockito.mock(XDebugSession.class); Mockito.when(handler.getProcess()).thenReturn(mockProcess); Mockito.when(mockProcess.getXDebugSession()).thenReturn(session); }
@Override public void createToolWindowContent(Project project, ToolWindow toolWindow) { toolWindow.setToHideOnEmptyContent(true); ToolWindowPane panel = new ToolWindowPane(true, true); final Content content = ContentFactory.SERVICE.getInstance().createContent(panel, "", false); content.setCloseable(true); ActionToolbar actionToolbar = createToolbar(); panel.setToolbar(actionToolbar.getComponent()); ColorTextPane textArea = new ColorTextPane(); panel.setOutputTextArea(textArea); toolWindow.getContentManager().addContent(content); toolWindow.activate(null); }
@Override public void createToolWindowContent(Project project, ToolWindow toolWindow) { final Document document = new PlainDocument(); final NetConsoleClient netConsole = new NetConsoleClient(document); final JXTextArea textArea = new JXTextArea(); textArea.setDocument(document); textArea.setEditable(false); final DefaultActionGroup actionGroup = new DefaultActionGroup(); actionGroup.addAction(new AutoScrollAction(netConsole, textArea)); actionGroup.addAction(new ClearAction(netConsole)); actionGroup.addAction(new DisableAction(netConsole, textArea)); final SimpleToolWindowPanel netConsolePanel = new SimpleToolWindowPanel(false, false); final ActionToolbar toolbar = ActionManager.getInstance().createActionToolbar(ActionPlaces.UNKNOWN, actionGroup, false); netConsolePanel.setToolbar(toolbar.getComponent()); netConsolePanel.setContent(new JBScrollPane(textArea)); final ContentFactory contentFactory = ContentFactory.SERVICE.getInstance(); final Content content = contentFactory.createContent(netConsolePanel, "", true); toolWindow.getContentManager().addContent(content); }
public TelemetryToolWindow(InspectionGadgetsTelemetry telemetry) { final TelemetryDisplay telemetryDisplay = new TelemetryDisplay(telemetry); final DefaultActionGroup toolbarGroup = new DefaultActionGroup(); toolbarGroup.add( new UpdateTelemetryViewAction(telemetry, telemetryDisplay)); toolbarGroup.add(new ResetTelemetryAction(telemetry, telemetryDisplay)); final ActionManager actionManager = ActionManager.getInstance(); final ActionToolbar toolbar = actionManager.createActionToolbar(TOOL_WINDOW_ID, toolbarGroup, true); contentPanel = new JPanel(new BorderLayout()); contentPanel.setBackground(JBColor.GRAY); final JComponent toolbarComponent = toolbar.getComponent(); contentPanel.add(toolbarComponent, BorderLayout.NORTH); final JComponent displayContentPane = telemetryDisplay.getContentPane(); contentPanel.add(displayContentPane, BorderLayout.CENTER); }
private void setupMetadataPanel(Project project, SimpleToolWindowPanel metadataPanel) { RestClientService restClientService = ServiceManager.getService(project, RestClientService.class); SimpleNode metadataRootNode = new MetadataExplorerRootNode(project, restClientService, "Metadata"); SimpleTree metadataTree = new SimpleTree(); SimpleTreeBuilder metadataTreeBuilder = new SimpleTreeBuilder(metadataTree, (DefaultTreeModel)metadataTree.getModel(), new ExplorerTreeStructure(metadataRootNode), null); Disposer.register(project, metadataTreeBuilder); metadataTree.addTreeExpansionListener(new ExplorerTreeExpansionListener(metadataTreeBuilder)); metadataTree.setCellRenderer(new ExplorerCellRenderer()); ActionToolbar toolbar = createToolbar(metadataRootNode, metadataTreeBuilder); toolbar.setTargetComponent(metadataPanel); metadataPanel.setToolbar(toolbar.getComponent()); metadataPanel.setContent(ScrollPaneFactory.createScrollPane(metadataTree)); metadataTree.setShowsRootHandles(true); }
private void setupToolingMetadataPanel(Project project, SimpleToolWindowPanel toolingMetadataPanel) { ToolingRestClientService toolingRestClientService = ServiceManager.getService(project, ToolingRestClientService.class); SimpleNode toolingMetadataRootNode = new MetadataExplorerRootNode(project, toolingRestClientService, " Tooling Metadata"); SimpleTree toolingMetadataTree = new SimpleTree(); SimpleTreeBuilder toolingMetadataTreeBuilder = new SimpleTreeBuilder(toolingMetadataTree, (DefaultTreeModel)toolingMetadataTree.getModel(), new ExplorerTreeStructure(toolingMetadataRootNode), null); Disposer.register(project, toolingMetadataTreeBuilder); toolingMetadataTree.addTreeExpansionListener(new ExplorerTreeExpansionListener(toolingMetadataTreeBuilder)); toolingMetadataTree.setCellRenderer(new ExplorerCellRenderer()); ActionToolbar toolbar = createToolbar(toolingMetadataRootNode, toolingMetadataTreeBuilder); toolbar.setTargetComponent(toolingMetadataPanel); toolingMetadataPanel.setToolbar(toolbar.getComponent()); toolingMetadataPanel.setContent(ScrollPaneFactory.createScrollPane(toolingMetadataTree)); toolingMetadataTree.setShowsRootHandles(true); }
public TableContent(Project project, Entity entity, String label, Icon icon, ActionToolbar toolbar, EntityTableLoader loader) { super(new BorderLayout()); this.entity = entity; this.label = label; this.icon = icon; this.loader = loader; this.listeners = new LinkedList<ChangeListener>(); this.querySharingManager = project.getComponent(QuerySharingManager.class); toolbars = new JPanel(new FlowLayout(FlowLayout.LEFT, 2, 0)); if(toolbar != null) { toolbar.setTargetComponent(this); toolbars.add(toolbar.getComponent()); } add(toolbars, BorderLayout.NORTH); entityToolbar = ActionUtil.createActionToolbar("hpali.entity", "detail-table", true); }
private Content getOrCreateConsoleContent(final ContentManager contentManager) { final String displayName = VcsBundle.message("vcs.console.toolwindow.display.name"); Content content = contentManager.findContent(displayName); if (content == null) { releaseConsole(); myConsole = TextConsoleBuilderFactory.getInstance().createBuilder(myProject).getConsole(); JPanel panel = new JPanel(new BorderLayout()); panel.add(myConsole.getComponent(), BorderLayout.CENTER); ActionToolbar toolbar = ActionManager.getInstance() .createActionToolbar("VcsManager", new DefaultActionGroup(myConsole.createConsoleActions()), false); panel.add(toolbar.getComponent(), BorderLayout.WEST); content = ContentFactory.getInstance().createContent(panel, displayName, true); content.setDisposer(myConsoleDisposer); contentManager.addContent(content); for (Pair<String, ConsoleViewContentType> pair : myPendingOutput) { printToConsole(pair.first, pair.second); } myPendingOutput.clear(); } return content; }
public final void setToolbarActions(final AnAction... actions) { final DefaultActionGroup actionGroup = new DefaultActionGroup(); for (final AnAction action : actions) { actionGroup.add(action); } if (getHelpId() != null) { actionGroup.add(AnSeparator.getInstance()); actionGroup.add(new ContextHelpAction(getHelpId())); } final ActionManager actionManager = ActionManager.getInstance(); final ToolbarPosition position = getToolbarPosition(); final ActionToolbar myActionToolbar = actionManager.createActionToolbar(ActionPlaces.PROJECT_VIEW_TOOLBAR, actionGroup, position == ToolbarPosition.TOP || position == ToolbarPosition.BOTTOM); myActionToolbar.setTargetComponent(myInnerPanel); final JComponent toolbarComponent = myActionToolbar.getComponent(); final MatteBorder matteBorder = BorderFactory.createMatteBorder(0, 0, position == ToolbarPosition.TOP ? 1 : 0, 0, JBColor.DARK_GRAY); toolbarComponent.setBorder(BorderFactory.createCompoundBorder(matteBorder, toolbarComponent.getBorder())); getTable().getSelectionModel().addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { myActionToolbar.updateActionsImmediately(); } }); add(toolbarComponent, position.getPosition()); }
/** * 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 }
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; }
public static ActionToolbar createActionToolbar(Tree componentsTree) { DefaultActionGroup defaultActionGroup = new DefaultActionGroup(); defaultActionGroup.addAction(ActionManager.getInstance().getAction("Xray.Refresh")); defaultActionGroup.addAction(new CollapseAllAction(componentsTree)); defaultActionGroup.addAction(new ExpandAllAction(componentsTree)); return ActionManager.getInstance().createActionToolbar(ActionPlaces.CHANGES_VIEW_TOOLBAR, defaultActionGroup, true); }
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)); }
SwaggerUIToolbar(final JComponent targetComponentForActions) { super(new GridBagLayout()); final ActionToolbar toolbar = createToolbarFromGroupId(SWAGGER_TOOLBAR_GROUP_ID); toolbar.setTargetComponent(targetComponentForActions); add(toolbar.getComponent()); setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIUtil.CONTRAST_BORDER_COLOR)); }
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; }
/** * 创建Terminal panel * * @param terminalRunner * @param toolWindow * @return */ private Content createTerminalInContentPanel(@NotNull AbstractTerminalRunner terminalRunner, @NotNull final ToolWindow toolWindow) { SimpleToolWindowPanel panel = new SimpleToolWindowPanel(false, true); Content content = ContentFactory.SERVICE.getInstance().createContent(panel, "", false); content.setCloseable(true); myTerminalWidget = terminalRunner.createTerminalWidget(content); panel.setContent(myTerminalWidget.getComponent()); panel.addFocusListener(this); ActionToolbar toolbar = createToolbar(terminalRunner, myTerminalWidget, toolWindow); toolbar.setTargetComponent(panel); panel.setToolbar(toolbar.getComponent()); content.setPreferredFocusableComponent(myTerminalWidget.getComponent()); return content; }
/** * 创建左侧工具栏 * * @param terminalRunner * @param terminal * @param toolWindow * @return */ private ActionToolbar createToolbar(@Nullable AbstractTerminalRunner terminalRunner, @NotNull JBTabbedTerminalWidget terminal, @NotNull ToolWindow toolWindow) { DefaultActionGroup group = new DefaultActionGroup(); if (terminalRunner != null) { group.add(new RunAction(this)); group.add(new StopAction(this)); group.addSeparator(); group.add(new ClearAction(this)); } return ActionManager.getInstance().createActionToolbar("unknown", group, false); }
public ToolbarPanel(JComponent contentComponent, ActionGroup actions, final String toolbarPlace) { super(new GridBagLayout()); setBorder(BorderFactory.createEtchedBorder()); if (contentComponent.getBorder() != null) { contentComponent.setBorder(BorderFactory.createEmptyBorder()); } final ActionToolbar actionToolbar = ActionManager.getInstance().createActionToolbar(toolbarPlace, actions, true); add(actionToolbar.getComponent(), new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); add(contentComponent, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1.0, 1.0, GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); }
private void initToolbar(Project project) { DefaultActionGroup group = new DefaultActionGroup(); group.add(new RefreshRemoteFileAction(myVirtualFile)); for (RemoteFileEditorActionProvider actionProvider : RemoteFileEditorActionProvider.EP_NAME.getExtensions()) { group.addAll(actionProvider.createToolbarActions(project, myVirtualFile)); } final ActionToolbar actionToolbar = ActionManager.getInstance().createActionToolbar(ActionPlaces.UNKNOWN, group, true); myToolbarPanel.add(actionToolbar.getComponent(), BorderLayout.CENTER); }
@NotNull private JPanel createReloadButtonPanel() { ReloadAction reloadAction = new ReloadAction(); ActionButton reloadButton = new ActionButton( reloadAction, reloadAction.getTemplatePresentation().clone(), CONTROL_PLACE, ActionToolbar.DEFAULT_MINIMUM_BUTTON_SIZE ); JPanel panel = new JPanel(new BorderLayout(0, 0)); panel.add(reloadButton, BorderLayout.WEST); return panel; }
@Override public Insets getBorderInsets(Component c) { if (c.getParent() instanceof ActionToolbar) { return JBUI.insets(4, 16, 4, 16); } if (DarculaButtonUI.isSquare(c)) { return JBUI.insets(2, 0, 2, 0).asUIResource(); } return JBUI.insets(8, 16, 8, 14).asUIResource(); }
public JComponent initContent() { myBrowser = new CommittedChangesTreeBrowser(myProject, Collections.<CommittedChangeList>emptyList()); myBrowser.getEmptyText().setText(VcsBundle.message("incoming.changes.not.loaded.message")); ActionGroup group = (ActionGroup) ActionManager.getInstance().getAction("IncomingChangesToolbar"); final ActionToolbar toolbar = myBrowser.createGroupFilterToolbar(myProject, group, null, Collections.<AnAction>emptyList()); myBrowser.setToolBar(toolbar.getComponent()); myBrowser.setTableContextMenu(group, Collections.<AnAction>emptyList()); myConnection = myBus.connect(); myConnection.subscribe(CommittedChangesCache.COMMITTED_TOPIC, new MyCommittedChangesListener()); loadChangesToBrowser(false, true); JPanel contentPane = new JPanel(new BorderLayout()); contentPane.add(myBrowser, BorderLayout.CENTER); return contentPane; }
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)); }
private static JPanel createToolbarPanel() { final DefaultActionGroup group = new DefaultActionGroup(); group.add(new StudyCheckAction()); group.add(new StudyPreviousStudyTaskAction()); group.add(new StudyNextStudyTaskAction()); group.add(new StudyRefreshTaskFileAction()); group.add(new StudyShowHintAction()); group.add(new StudyRunAction()); group.add(new StudyEditInputAction()); final ActionToolbar actionToolBar = ActionManager.getInstance().createActionToolbar("Study", group, true); return JBUI.Panels.simplePanel(actionToolBar.getComponent()); }
public ConfigurationToolBar(AndroidLayoutPreviewToolWindowForm previewWindow) { myPreviewWindow = previewWindow; DefaultActionGroup group = createActions(myPreviewWindow); ActionToolbar toolbar = createToolBar(group); setLayout(new BorderLayout()); add(toolbar.getComponent(), BorderLayout.CENTER); }
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; }
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(); }
public Form() { myList.setModel(new DefaultListModel()); if (ApplicationManager.getApplication() == null) { myListController = new ReorderableListToolbar<T>(myList); return; // Preview mode } DefaultActionGroup actionGroup = new DefaultActionGroup(); ActionToolbar toolbar = ActionManager.getInstance().createActionToolbar(ActionPlaces.UNKNOWN, actionGroup, true); myListController = new ReorderableListToolbar<T>(myList); }
public GitSimplePathsBrowser(@NotNull Project project, @NotNull Collection<String> absolutePaths) { super(new BorderLayout()); FilePathChangesTreeList browser = createBrowser(project, absolutePaths); ActionToolbar toolbar = createToolbar(browser); add(toolbar.getComponent(), BorderLayout.NORTH); add(browser); }
/** A custom toolbar panel, without most of the irrelevant built-in items. */ private JComponent createToolbarPanel() { DefaultActionGroup group = new DefaultActionGroup(); group.add(new PreviousOccurenceToolbarAction(this)); // NOTYPO group.add(new NextOccurenceToolbarAction(this)); // NOTYPO fillRightToolbarGroup(group); ActionToolbar toolbar = ActionManager.getInstance() .createActionToolbar(ActionPlaces.COMPILER_MESSAGES_TOOLBAR, group, false); return toolbar.getComponent(); }
private JPanel createToolbarPanel(SlingServerTreeManager treeManager) { ActionManager actionManager = ActionManager.getInstance(); DefaultActionGroup group = new DefaultActionGroup(); group.add(actionManager.getAction("AEM.Toolbar")); treeManager.adjustToolbar(group); final ActionToolbar actionToolbar = ActionManager.getInstance().createActionToolbar(ActionPlaces.TOOLBAR, group, true); final JPanel buttonsPanel = new JPanel(new BorderLayout()); buttonsPanel.add(actionToolbar.getComponent(), BorderLayout.CENTER); return buttonsPanel; }