use of com.intellij.openapi.ui.SimpleToolWindowPanel in project freeline by alibaba.
the class FreelineTerminal method createTerminalInContentPanel.
/**
* 创建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;
}
use of com.intellij.openapi.ui.SimpleToolWindowPanel in project intellij-community by JetBrains.
the class ChangesViewManager method createChangeViewComponent.
private JComponent createChangeViewComponent() {
SimpleToolWindowPanel panel = new SimpleToolWindowPanel(false, true);
EmptyAction.registerWithShortcutSet("ChangesView.Refresh", CommonShortcuts.getRerun(), panel);
EmptyAction.registerWithShortcutSet("ChangesView.NewChangeList", CommonShortcuts.getNew(), panel);
EmptyAction.registerWithShortcutSet("ChangesView.RemoveChangeList", CommonShortcuts.getDelete(), panel);
EmptyAction.registerWithShortcutSet(IdeActions.MOVE_TO_ANOTHER_CHANGE_LIST, CommonShortcuts.getMove(), panel);
EmptyAction.registerWithShortcutSet("ChangesView.Rename", CommonShortcuts.getRename(), panel);
EmptyAction.registerWithShortcutSet("ChangesView.SetDefault", new CustomShortcutSet(KeyStroke.getKeyStroke(KeyEvent.VK_U, InputEvent.ALT_DOWN_MASK | ctrlMask())), panel);
EmptyAction.registerWithShortcutSet("ChangesView.Diff", CommonShortcuts.getDiff(), panel);
DefaultActionGroup group = (DefaultActionGroup) ActionManager.getInstance().getAction("ChangesViewToolbar");
ActionToolbar toolbar = ActionManager.getInstance().createActionToolbar(ActionPlaces.CHANGES_VIEW_TOOLBAR, group, false);
toolbar.setTargetComponent(myView);
JComponent toolbarComponent = toolbar.getComponent();
JPanel toolbarPanel = new JPanel(new BorderLayout());
toolbarPanel.add(toolbarComponent, BorderLayout.WEST);
DefaultActionGroup visualActionsGroup = new DefaultActionGroup();
final Expander expander = new Expander();
visualActionsGroup.add(CommonActionsManager.getInstance().createExpandAllAction(expander, panel));
visualActionsGroup.add(CommonActionsManager.getInstance().createCollapseAllAction(expander, panel));
ToggleShowFlattenAction showFlattenAction = new ToggleShowFlattenAction();
showFlattenAction.registerCustomShortcutSet(new CustomShortcutSet(KeyStroke.getKeyStroke(KeyEvent.VK_P, ctrlMask())), panel);
visualActionsGroup.add(showFlattenAction);
visualActionsGroup.add(ActionManager.getInstance().getAction(IdeActions.ACTION_COPY));
visualActionsGroup.add(new ToggleShowIgnoredAction());
visualActionsGroup.add(new IgnoredSettingsAction());
visualActionsGroup.add(new ToggleDetailsAction());
visualActionsGroup.add(new ContextHelpAction(ChangesListView.HELP_ID));
toolbarPanel.add(ActionManager.getInstance().createActionToolbar(ActionPlaces.CHANGES_VIEW_TOOLBAR, visualActionsGroup, false).getComponent(), BorderLayout.CENTER);
myView.setMenuActions((DefaultActionGroup) ActionManager.getInstance().getAction("ChangesViewPopupMenu"));
myView.setShowFlatten(myState.myShowFlatten);
myProgressLabel = new JPanel(new BorderLayout());
panel.setToolbar(toolbarPanel);
final JPanel content = new JPanel(new BorderLayout());
mySplitter = new JBSplitter(false, "ChangesViewManager.DETAILS_SPLITTER_PROPORTION", 0.5f);
mySplitter.setHonorComponentsMinimumSize(false);
final JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(myView);
final JPanel wrapper = new JPanel(new BorderLayout());
wrapper.add(scrollPane, BorderLayout.CENTER);
mySplitter.setFirstComponent(wrapper);
content.add(mySplitter, BorderLayout.CENTER);
content.add(myProgressLabel, BorderLayout.SOUTH);
panel.setContent(content);
ChangesDnDSupport.install(myProject, myView);
myView.addTreeSelectionListener(myTsl);
return panel;
}
use of com.intellij.openapi.ui.SimpleToolWindowPanel in project intellij-community by JetBrains.
the class DynamicToolWindowWrapper method buildBigPanel.
private JPanel buildBigPanel() {
myBigPanel = new SimpleToolWindowPanel(true);
myBigPanel.setBackground(UIUtil.getFieldForegroundColor());
final JPanel panel = new JPanel(new BorderLayout());
myBigPanel.add(panel, BorderLayout.CENTER);
myTreeTablePanel = new JPanel(new BorderLayout());
rebuildTreePanel();
panel.add(myTreeTablePanel);
myBigPanel.setPreferredSize(new Dimension(200, myBigPanel.getHeight()));
final ActionManager actionManager = ActionManager.getInstance();
final ActionGroup actionGroup = (ActionGroup) actionManager.getAction("Groovy.Dynamic.Toolbar");
ActionToolbar actionToolbar = actionManager.createActionToolbar("Groovy.Dynamic.Toolbar", actionGroup, true);
myBigPanel.setToolbar(actionToolbar.getComponent());
myBigPanel.revalidate();
return myBigPanel;
}
use of com.intellij.openapi.ui.SimpleToolWindowPanel in project intellij-community by JetBrains.
the class ConsoleManager method createConsole.
private void createConsole(@NotNull final NetService netService) {
TextConsoleBuilder consoleBuilder = TextConsoleBuilderFactory.getInstance().createBuilder(netService.getProject());
netService.configureConsole(consoleBuilder);
console = consoleBuilder.getConsole();
ApplicationManager.getApplication().invokeLater(() -> {
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());
}
use of com.intellij.openapi.ui.SimpleToolWindowPanel in project intellij-community by JetBrains.
the class PythonConsoleToolWindow method createContent.
private static Content createContent(@NotNull final RunContentDescriptor contentDescriptor) {
SimpleToolWindowPanel panel = new SimpleToolWindowPanel(false, true);
Content content = ContentFactory.SERVICE.getInstance().createContent(panel, contentDescriptor.getDisplayName(), false);
content.setCloseable(true);
resetContent(contentDescriptor, panel, content);
return content;
}
Aggregations