Search in sources :

Example 21 with Splitter

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

the class GitCompareBranchesLogPanel method createCenterPanel.

private JComponent createCenterPanel() {
    final ChangesBrowser changesBrowser = new ChangesBrowser(myProject, null, Collections.<Change>emptyList(), null, false, true, null, ChangesBrowser.MyUseCase.COMMITTED_CHANGES, null);
    myHeadToBranchListPanel = new GitCommitListPanel(getHeadToBranchCommits(myInitialRepo), String.format("Branch %s is fully merged to %s", myBranchName, myCurrentBranchName));
    myBranchToHeadListPanel = new GitCommitListPanel(getBranchToHeadCommits(myInitialRepo), String.format("Branch %s is fully merged to %s", myCurrentBranchName, myBranchName));
    addSelectionListener(myHeadToBranchListPanel, myBranchToHeadListPanel, changesBrowser);
    addSelectionListener(myBranchToHeadListPanel, myHeadToBranchListPanel, changesBrowser);
    myHeadToBranchListPanel.registerDiffAction(changesBrowser.getDiffAction());
    myBranchToHeadListPanel.registerDiffAction(changesBrowser.getDiffAction());
    JPanel htb = layoutCommitListPanel(myCurrentBranchName, true);
    JPanel bth = layoutCommitListPanel(myCurrentBranchName, false);
    JPanel listPanel = null;
    switch(getInfoType()) {
        case HEAD_TO_BRANCH:
            listPanel = htb;
            break;
        case BRANCH_TO_HEAD:
            listPanel = bth;
            break;
        case BOTH:
            Splitter lists = new Splitter(true, 0.5f);
            lists.setFirstComponent(htb);
            lists.setSecondComponent(bth);
            listPanel = lists;
    }
    Splitter rootPanel = new Splitter(false, 0.7f);
    rootPanel.setSecondComponent(changesBrowser);
    rootPanel.setFirstComponent(listPanel);
    return rootPanel;
}
Also used : ChangesBrowser(com.intellij.openapi.vcs.changes.ui.ChangesBrowser) Splitter(com.intellij.openapi.ui.Splitter) GitCommitListPanel(git4idea.ui.GitCommitListPanel)

Example 22 with Splitter

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

the class SdkComponentsStep method createUIComponents.

private void createUIComponents() {
    Splitter splitter = new Splitter(false, 0.5f, 0.2f, 0.8f);
    myBody = splitter;
    myComponentsTable = new JBTable();
    myComponentDescription = new JTextPane();
    splitter.setShowDividerIcon(false);
    splitter.setShowDividerControls(false);
    splitter.setFirstComponent(ScrollPaneFactory.createScrollPane(myComponentsTable, false));
    splitter.setSecondComponent(ScrollPaneFactory.createScrollPane(myComponentDescription, false));
    myComponentDescription.setFont(UIUtil.getLabelFont());
    myComponentDescription.setEditable(false);
    myComponentDescription.setBorder(BorderFactory.createEmptyBorder(WizardConstants.STUDIO_WIZARD_INSET_SIZE, WizardConstants.STUDIO_WIZARD_INSET_SIZE, WizardConstants.STUDIO_WIZARD_INSET_SIZE, WizardConstants.STUDIO_WIZARD_INSET_SIZE));
}
Also used : Splitter(com.intellij.openapi.ui.Splitter) JBTable(com.intellij.ui.table.JBTable)

Example 23 with Splitter

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

the class SidePanelTest method testTwoVisibleTools.

@Test
public void testTwoVisibleTools() {
    when(myModel.getVisibleTools(Side.LEFT)).thenReturn(ImmutableList.of(myToolWindow1, myToolWindow2));
    when(myModel.getHiddenTools(Side.LEFT)).thenReturn(Collections.emptyList());
    myPanel.modelChanged(myModel, SideModel.EventType.LOCAL_UPDATE);
    assertThat(myPanel.isVisible()).isTrue();
    Component visible = findVisibleComponent();
    Splitter splitter = visible instanceof Splitter ? (Splitter) visible : null;
    assertThat(splitter).isNotNull();
    assertThat(splitter.getFirstComponent()).isEqualTo(myToolWindowComponent1);
    assertThat(splitter.getSecondComponent()).isEqualTo(myToolWindowComponent2);
    assertThat(findHiddenComponents()).containsNoneOf(myToolWindowComponent1, myToolWindowComponent2);
}
Also used : Splitter(com.intellij.openapi.ui.Splitter) Test(org.junit.Test)

Example 24 with Splitter

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

the class ProjectProfileSelectionDialog method createConflictsPanel.

@NotNull
private JComponent createConflictsPanel() {
    createConflictTree();
    myConflictDetails = new DetailsComponent();
    myConflictDetails.setText("Conflict Detail");
    myConflictDetails.setContent(createTreePanel(myConflictTree));
    removeEmptyBorder(myConflictDetails);
    createConflictsTable();
    myConflictsTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() {

        @Override
        public void valueChanged(ListSelectionEvent e) {
            if (e.getValueIsAdjusting()) {
                return;
            }
            showConflictDetail();
        }
    });
    Splitter splitter = new Splitter(true, .25f);
    splitter.setHonorComponentsMinimumSize(true);
    DetailsComponent details = new DetailsComponent();
    details.setText("Variant Selection Conflicts");
    details.setContent(ScrollPaneFactory.createScrollPane(myConflictsTable));
    removeEmptyBorder(details);
    splitter.setFirstComponent(details.getComponent());
    splitter.setSecondComponent(myConflictDetails.getComponent());
    return splitter;
}
Also used : DetailsComponent(com.intellij.openapi.ui.DetailsComponent) Splitter(com.intellij.openapi.ui.Splitter) ListSelectionEvent(javax.swing.event.ListSelectionEvent) ListSelectionListener(javax.swing.event.ListSelectionListener) NotNull(org.jetbrains.annotations.NotNull)

Example 25 with Splitter

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

the class MemoryInstanceView method buildComponent.

@Nullable
public JComponent buildComponent(@NotNull ClassObject targetClass) {
    myClassObject = targetClass;
    mySplitter = new Splitter(true);
    JPanel instancesPanel = new JPanel(new BorderLayout());
    JPanel headingPanel = new JPanel(new BorderLayout());
    headingPanel.add(new JLabel("Instance View"), BorderLayout.WEST);
    JButton close = new JButton(AllIcons.Actions.Close);
    close.addActionListener(e -> myStage.selectClass(null));
    headingPanel.add(close, BorderLayout.EAST);
    instancesPanel.add(headingPanel, BorderLayout.NORTH);
    buildTree(instancesPanel);
    mySplitter.setFirstComponent(instancesPanel);
    return mySplitter;
}
Also used : Splitter(com.intellij.openapi.ui.Splitter) Nullable(org.jetbrains.annotations.Nullable)

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