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;
}
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();
});
}
}
}
Aggregations