Search in sources :

Example 46 with Splitter

use of com.intellij.openapi.ui.Splitter in project android by JetBrains.

the class AndroidProjectStructureConfigurable method createComponent.

@Override
@Nullable
public JComponent createComponent() {
    JComponent component = new MainPanel();
    mySplitter = new Splitter(false, .15f);
    mySplitter.setHonorComponentsMinimumSize(true);
    initSidePanel();
    mySplitter.setFirstComponent(mySidePanel);
    mySplitter.setSecondComponent(myDetails);
    component.add(mySplitter, BorderLayout.CENTER);
    myNotificationPanel = new JPanel();
    Color background = EditorColorsManager.getInstance().getGlobalScheme().getColor(EditorColors.GUTTER_BACKGROUND);
    if (background == null) {
        background = JBColor.GRAY;
    }
    myNotificationPanel.setBackground(background);
    myNotificationPanel.setLayout(new BoxLayout(myNotificationPanel, BoxLayout.Y_AXIS));
    component.add(myNotificationPanel, BorderLayout.NORTH);
    myErrorsPanel = new ConfigurationErrorsPanel();
    component.add(myErrorsPanel, BorderLayout.SOUTH);
    myUiInitialized = true;
    GradleSyncState.subscribe(myProject, this);
    return component;
}
Also used : Splitter(com.intellij.openapi.ui.Splitter) JBColor(com.intellij.ui.JBColor) Nullable(org.jetbrains.annotations.Nullable)

Example 47 with Splitter

use of com.intellij.openapi.ui.Splitter in project android by JetBrains.

the class BasePerspectiveConfigurable method reInitWholePanelIfNeeded.

@Override
protected void reInitWholePanelIfNeeded() {
    if (!myToReInitWholePanel) {
        return;
    }
    if (myTreeMinimized) {
        Splitter splitter = getSplitter();
        myCenterComponent = splitter.getSecondComponent();
        if (myCenterComponent == null) {
            super.reInitWholePanelIfNeeded();
            splitter = getSplitter();
            myCenterComponent = splitter.getSecondComponent();
        }
        myToReInitWholePanel = false;
        splitter.setSecondComponent(null);
        myWholePanel.remove(splitter);
        myWholePanel.add(myCenterComponent, BorderLayout.CENTER);
        revalidateAndRepaint(myWholePanel);
    } else {
        if (myWholePanel == null) {
            super.reInitWholePanelIfNeeded();
        }
        myToReInitWholePanel = false;
        Splitter splitter = getSplitter();
        if (myCenterComponent != null && myCenterComponent != splitter) {
            myWholePanel.remove(myCenterComponent);
            splitter.setSecondComponent(myCenterComponent);
            myWholePanel.add(splitter);
            revalidateAndRepaint(myWholePanel);
        }
        myCenterComponent = splitter;
        JComponent first = splitter.getFirstComponent();
        if (first instanceof JPanel && myHeader == null) {
            JPanel panel = (JPanel) first;
            myHeader = ToolWindowHeader.createAndAdd("Modules", AllIcons.Nodes.Module, panel, ToolWindowAnchor.LEFT);
            myHeader.setPreferredFocusedComponent(myTree);
            myHeader.addMinimizeListener(() -> {
                modulesTreeMinimized();
                reInitWholePanelIfNeeded();
            });
        }
    }
}
Also used : Splitter(com.intellij.openapi.ui.Splitter)

Aggregations

Splitter (com.intellij.openapi.ui.Splitter)47 OnePixelSplitter (com.intellij.ui.OnePixelSplitter)7 NotNull (org.jetbrains.annotations.NotNull)7 ThreeComponentsSplitter (com.intellij.openapi.ui.ThreeComponentsSplitter)6 ListSelectionEvent (javax.swing.event.ListSelectionEvent)6 ListSelectionListener (javax.swing.event.ListSelectionListener)6 Nullable (org.jetbrains.annotations.Nullable)6 AllIcons (com.intellij.icons.AllIcons)4 Disposable (com.intellij.openapi.Disposable)4 Project (com.intellij.openapi.project.Project)4 com.intellij.openapi.actionSystem (com.intellij.openapi.actionSystem)3 ApplicationManager (com.intellij.openapi.application.ApplicationManager)3 UsageInfo (com.intellij.usageView.UsageInfo)3 ContainerUtil (com.intellij.util.containers.ContainerUtil)3 java.awt (java.awt)3 ActionEvent (java.awt.event.ActionEvent)3 List (java.util.List)3 javax.swing (javax.swing)3 PropertiesComponent (com.intellij.ide.util.PropertiesComponent)2 DefaultActionGroup (com.intellij.openapi.actionSystem.DefaultActionGroup)2