Search in sources :

Example 11 with JBSplitter

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

the class SplitFileEditor method createComponent.

@NotNull
private JComponent createComponent() {
    final JBSplitter splitter = new JBSplitter(false, 0.5f, 0.15f, 0.85f);
    splitter.setSplitterProportionKey(MY_PROPORTION_KEY);
    splitter.setFirstComponent(myMainEditor.getComponent());
    splitter.setSecondComponent(mySecondEditor.getComponent());
    myToolbarWrapper = new SplitEditorToolbar(splitter);
    if (myMainEditor instanceof TextEditor) {
        myToolbarWrapper.addGutterToTrack(((EditorGutterComponentEx) ((TextEditor) myMainEditor).getEditor().getGutter()));
    }
    if (mySecondEditor instanceof TextEditor) {
        myToolbarWrapper.addGutterToTrack(((EditorGutterComponentEx) ((TextEditor) mySecondEditor).getEditor().getGutter()));
    }
    final JPanel result = new JPanel(new BorderLayout());
    result.add(myToolbarWrapper, BorderLayout.NORTH);
    result.add(splitter, BorderLayout.CENTER);
    adjustEditorsVisibility();
    return result;
}
Also used : EditorGutterComponentEx(com.intellij.openapi.editor.ex.EditorGutterComponentEx) JBSplitter(com.intellij.ui.JBSplitter) NotNull(org.jetbrains.annotations.NotNull)

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