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