Search in sources :

Example 1 with JBSplitter

use of com.intellij.ui.JBSplitter in project intellij-community by JetBrains.

the class CodeFragmentInputComponent method addComponent.

@Override
public void addComponent(JPanel contentPanel, JPanel resultPanel) {
    final JBSplitter splitter = new JBSplitter(true, 0.3f, 0.2f, 0.7f);
    splitter.setSplitterProportionKey(mySplitterProportionKey);
    contentPanel.add(splitter, BorderLayout.CENTER);
    splitter.setFirstComponent(myMainPanel);
    splitter.setSecondComponent(resultPanel);
}
Also used : JBSplitter(com.intellij.ui.JBSplitter)

Example 2 with JBSplitter

use of com.intellij.ui.JBSplitter in project intellij-community by JetBrains.

the class VcsSelectionHistoryDialog method createBottomPanel.

private JComponent createBottomPanel(final JComponent addComp) {
    JBSplitter splitter = new JBSplitter(true, COMMENTS_SPLITTER_PROPORTION_KEY, COMMENTS_SPLITTER_PROPORTION);
    splitter.setDividerWidth(4);
    JPanel tablePanel = new JPanel(new BorderLayout());
    tablePanel.add(ScrollPaneFactory.createScrollPane(myList), BorderLayout.CENTER);
    JPanel statusPanel = new JPanel(new FlowLayout());
    statusPanel.add(myStatusSpinner);
    statusPanel.add(myStatusLabel);
    JPanel separatorPanel = new JPanel(new BorderLayout());
    separatorPanel.add(myChangesOnlyCheckBox, BorderLayout.WEST);
    separatorPanel.add(statusPanel, BorderLayout.EAST);
    tablePanel.add(separatorPanel, BorderLayout.NORTH);
    splitter.setFirstComponent(tablePanel);
    splitter.setSecondComponent(createComments(addComp));
    return splitter;
}
Also used : JBSplitter(com.intellij.ui.JBSplitter)

Example 3 with JBSplitter

use of com.intellij.ui.JBSplitter in project intellij-community by JetBrains.

the class FocusTracesDialog method createCenterPanel.

@Override
protected JComponent createCenterPanel() {
    JPanel panel = new JPanel(new BorderLayout());
    JBSplitter splitter = new JBSplitter(true, .5F, .2F, .8F);
    splitter.setFirstComponent(new JBScrollPane(myRequestsTable, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER));
    JComponent consoleComponent = new JPanel(new BorderLayout());
    consoleComponent.add(consoleView.getComponent(), BorderLayout.CENTER);
    int row = myRequestsTable.getSelectedRow();
    if (row >= 0) {
        consoleView.print(ExceptionUtil.getThrowableText(myRequests.get(row).trace), ConsoleViewContentType.NORMAL_OUTPUT);
    }
    splitter.setSecondComponent(new JBScrollPane(consoleComponent, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER));
    panel.add(splitter, BorderLayout.CENTER);
    return panel;
}
Also used : JBSplitter(com.intellij.ui.JBSplitter) JBScrollPane(com.intellij.ui.components.JBScrollPane)

Example 4 with JBSplitter

use of com.intellij.ui.JBSplitter in project android by JetBrains.

the class TraceViewPanel method createUIComponents.

private void createUIComponents() {
    MouseAdapter l = new MouseAdapter() {

        @Override
        public void mousePressed(MouseEvent e) {
            if (e.getSource() == myCloseLabel) {
                closeSearchComponent();
            } else if (e.getSource() == mySearchLabel) {
                showSearchComponent();
            } else if (e.getSource() == myZoomFitLabel) {
                myTraceViewCanvas.zoomFit();
            }
        }
    };
    myDefaultHeaderPanel = new EditorHeaderComponent();
    mySearchLabel = new JLabel(AllIcons.Actions.Search);
    mySearchLabel.addMouseListener(l);
    mySearchLabel.setToolTipText("Find (Ctrl + F)");
    myZoomFitLabel = new JLabel(AndroidIcons.ZoomFit);
    myZoomFitLabel.setToolTipText("Zoom Fit");
    myZoomFitLabel.addMouseListener(l);
    myFindPanel = new EditorHeaderComponent();
    myFindFieldWrapper = new NonOpaquePanel(new BorderLayout());
    mySearchField = createSearchField();
    myFindFieldWrapper.add(mySearchField);
    myCloseLabel = new JLabel(AllIcons.Actions.Cross);
    myCloseLabel.addMouseListener(l);
    myVmStatsTreeTableModel = new VmStatsTreeTableModel();
    myTreeTable = new TreeTable(myVmStatsTreeTableModel);
    myTraceViewCanvas = new TraceViewCanvasWrapper();
    JBScrollPane scrollPane = new JBScrollPane(myTreeTable);
    mySplitter = new JBSplitter(true, 0.75f);
    mySplitter.setShowDividerControls(true);
    mySplitter.setShowDividerIcon(true);
    mySplitter.setFirstComponent(myTraceViewCanvas);
    mySplitter.setSecondComponent(scrollPane);
}
Also used : NonOpaquePanel(com.intellij.ui.components.panels.NonOpaquePanel) TreeTable(com.intellij.ui.treeStructure.treetable.TreeTable) EditorHeaderComponent(com.intellij.openapi.editor.impl.EditorHeaderComponent) JBSplitter(com.intellij.ui.JBSplitter) JBScrollPane(com.intellij.ui.components.JBScrollPane) VmStatsTreeTableModel(com.android.tools.idea.editors.vmtrace.treemodel.VmStatsTreeTableModel)

Example 5 with JBSplitter

use of com.intellij.ui.JBSplitter in project intellij-community by JetBrains.

the class CommonContentEntriesEditor method createComponentImpl.

@Override
public JPanel createComponentImpl() {
    final Module module = getModule();
    final Project project = module.getProject();
    myContentEntryEditorListener = new MyContentEntryEditorListener();
    final JPanel mainPanel = new JPanel(new BorderLayout());
    addAdditionalSettingsToPanel(mainPanel);
    final DefaultActionGroup group = new DefaultActionGroup();
    final AddContentEntryAction action = new AddContentEntryAction();
    action.registerCustomShortcutSet(KeyEvent.VK_C, InputEvent.ALT_DOWN_MASK, mainPanel);
    group.add(action);
    myEditorsPanel = new ScrollablePanel(new VerticalStackLayout());
    myEditorsPanel.setBackground(BACKGROUND_COLOR);
    JScrollPane myScrollPane = ScrollPaneFactory.createScrollPane(myEditorsPanel, true);
    final ToolbarPanel toolbarPanel = new ToolbarPanel(myScrollPane, group);
    int border = myWithBorders ? 1 : 0;
    toolbarPanel.setBorder(new CustomLineBorder(1, 0, border, border));
    final JBSplitter splitter = new OnePixelSplitter(false);
    splitter.setProportion(0.6f);
    splitter.setHonorComponentsMinimumSize(true);
    myRootTreeEditor = createContentEntryTreeEditor(project);
    final JComponent component = myRootTreeEditor.createComponent();
    component.setBorder(new CustomLineBorder(1, border, border, 0));
    splitter.setFirstComponent(component);
    splitter.setSecondComponent(toolbarPanel);
    JPanel contentPanel = new JPanel(new GridBagLayout());
    final ActionToolbar actionToolbar = ActionManager.getInstance().createActionToolbar(ActionPlaces.UNKNOWN, myRootTreeEditor.getEditingActionsGroup(), true);
    contentPanel.add(new JLabel("Mark as:"), new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.WEST, 0, JBUI.insets(0, 10), 0, 0));
    contentPanel.add(actionToolbar.getComponent(), new GridBagConstraints(1, 0, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, JBUI.emptyInsets(), 0, 0));
    contentPanel.add(splitter, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 2, 1, 1.0, 1.0, GridBagConstraints.WEST, GridBagConstraints.BOTH, JBUI.emptyInsets(), 0, 0));
    mainPanel.add(contentPanel, BorderLayout.CENTER);
    final JPanel innerPanel = createBottomControl(module);
    if (innerPanel != null) {
        mainPanel.add(innerPanel, BorderLayout.SOUTH);
    }
    final ModifiableRootModel model = getModel();
    if (model != null) {
        final ContentEntry[] contentEntries = model.getContentEntries();
        if (contentEntries.length > 0) {
            for (final ContentEntry contentEntry : contentEntries) {
                addContentEntryPanel(contentEntry.getUrl());
            }
            selectContentEntry(contentEntries[0].getUrl());
        }
    }
    return mainPanel;
}
Also used : OnePixelSplitter(com.intellij.ui.OnePixelSplitter) ModifiableRootModel(com.intellij.openapi.roots.ModifiableRootModel) Project(com.intellij.openapi.project.Project) VerticalStackLayout(com.intellij.openapi.roots.ui.componentsList.layout.VerticalStackLayout) ScrollablePanel(com.intellij.openapi.roots.ui.componentsList.components.ScrollablePanel) CustomLineBorder(com.intellij.ui.border.CustomLineBorder) ContentEntry(com.intellij.openapi.roots.ContentEntry) JBSplitter(com.intellij.ui.JBSplitter) Module(com.intellij.openapi.module.Module) ToolbarPanel(com.intellij.ui.roots.ToolbarPanel)

Aggregations

JBSplitter (com.intellij.ui.JBSplitter)11 JBScrollPane (com.intellij.ui.components.JBScrollPane)2 NotNull (org.jetbrains.annotations.NotNull)2 VmStatsTreeTableModel (com.android.tools.idea.editors.vmtrace.treemodel.VmStatsTreeTableModel)1 EditorGutterComponentEx (com.intellij.openapi.editor.ex.EditorGutterComponentEx)1 EditorHeaderComponent (com.intellij.openapi.editor.impl.EditorHeaderComponent)1 Module (com.intellij.openapi.module.Module)1 Project (com.intellij.openapi.project.Project)1 JavaSdk (com.intellij.openapi.projectRoots.JavaSdk)1 Sdk (com.intellij.openapi.projectRoots.Sdk)1 ContentEntry (com.intellij.openapi.roots.ContentEntry)1 ModifiableRootModel (com.intellij.openapi.roots.ModifiableRootModel)1 ScrollablePanel (com.intellij.openapi.roots.ui.componentsList.components.ScrollablePanel)1 VerticalStackLayout (com.intellij.openapi.roots.ui.componentsList.layout.VerticalStackLayout)1 JdkConfigurable (com.intellij.openapi.roots.ui.configuration.projectRoot.JdkConfigurable)1 OnePixelSplitter (com.intellij.ui.OnePixelSplitter)1 CustomLineBorder (com.intellij.ui.border.CustomLineBorder)1 JBPanel (com.intellij.ui.components.JBPanel)1 NonOpaquePanel (com.intellij.ui.components.panels.NonOpaquePanel)1 ToolbarPanel (com.intellij.ui.roots.ToolbarPanel)1