use of javax.swing.JSplitPane in project sonarqube by SonarSource.
the class ScannerReportViewerApp method initialize.
/**
* Initialize the contents of the frame.
*/
private void initialize() {
try {
for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (Exception e) {
// If Nimbus is not available, you can set the GUI to another look and feel.
}
frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
splitPane = new JSplitPane();
frame.getContentPane().add(splitPane, BorderLayout.CENTER);
tabbedPane = new JTabbedPane(JTabbedPane.TOP);
tabbedPane.setPreferredSize(new Dimension(500, 7));
splitPane.setRightComponent(tabbedPane);
componentDetailsTab = new JScrollPane();
tabbedPane.addTab("Component details", null, componentDetailsTab, null);
componentEditor = new JEditorPane();
componentDetailsTab.setViewportView(componentEditor);
sourceTab = new JScrollPane();
tabbedPane.addTab("Source", null, sourceTab, null);
sourceEditor = createSourceEditor();
sourceEditor.setEditable(false);
sourceTab.setViewportView(sourceEditor);
textLineNumber = createTextLineNumber();
sourceTab.setRowHeaderView(textLineNumber);
highlightingTab = new JScrollPane();
tabbedPane.addTab("Highlighting", null, highlightingTab, null);
highlightingEditor = new JEditorPane();
highlightingTab.setViewportView(highlightingEditor);
symbolTab = new JScrollPane();
tabbedPane.addTab("Symbol references", null, symbolTab, null);
symbolEditor = new JEditorPane();
symbolTab.setViewportView(symbolEditor);
coverageTab = new JScrollPane();
tabbedPane.addTab("Coverage", null, coverageTab, null);
coverageEditor = new JEditorPane();
coverageTab.setViewportView(coverageEditor);
duplicationTab = new JScrollPane();
tabbedPane.addTab("Duplications", null, duplicationTab, null);
duplicationEditor = new JEditorPane();
duplicationTab.setViewportView(duplicationEditor);
testsTab = new JScrollPane();
tabbedPane.addTab("Tests", null, testsTab, null);
testsEditor = new JEditorPane();
testsTab.setViewportView(testsEditor);
issuesTab = new JScrollPane();
tabbedPane.addTab("Issues", null, issuesTab, null);
issuesEditor = new JEditorPane();
issuesTab.setViewportView(issuesEditor);
measuresTab = new JScrollPane();
tabbedPane.addTab("Measures", null, measuresTab, null);
measuresEditor = new JEditorPane();
measuresTab.setViewportView(measuresEditor);
scmTab = new JScrollPane();
tabbedPane.addTab("SCM", null, scmTab, null);
scmEditor = new JEditorPane();
scmTab.setViewportView(scmEditor);
treeScrollPane = new JScrollPane();
treeScrollPane.setPreferredSize(new Dimension(200, 400));
splitPane.setLeftComponent(treeScrollPane);
componentTree = new JTree();
componentTree.setModel(new DefaultTreeModel(new DefaultMutableTreeNode("empty") {
{
}
}));
treeScrollPane.setViewportView(componentTree);
componentTree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
componentTree.addTreeSelectionListener(new TreeSelectionListener() {
@Override
public void valueChanged(TreeSelectionEvent e) {
DefaultMutableTreeNode node = (DefaultMutableTreeNode) componentTree.getLastSelectedPathComponent();
if (node == null) {
// Nothing is selected.
return;
}
frame.setCursor(new Cursor(Cursor.WAIT_CURSOR));
updateDetails((Component) node.getUserObject());
frame.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
}
});
frame.pack();
}
use of javax.swing.JSplitPane in project zaproxy by zaproxy.
the class CustomScanDialog method getCustomPanel.
private JPanel getCustomPanel() {
if (customPanel == null) {
customPanel = new JPanel(new GridBagLayout());
JScrollPane scrollPane = new JScrollPane();
scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
scrollPane.setViewportView(getRequestField());
JPanel buttonPanel = new JPanel(new GridBagLayout());
getRequestField().addCaretListener(new CaretListener() {
@Override
public void caretUpdate(CaretEvent event) {
setFieldStates();
}
});
// Spacer
buttonPanel.add(new JLabel(""), LayoutHelper.getGBC(0, 0, 1, 0.5));
buttonPanel.add(getAddCustomButton(), LayoutHelper.getGBC(1, 0, 1, 1, 0.0D, 0.0D, GridBagConstraints.BOTH, GridBagConstraints.NORTHWEST, new Insets(5, 5, 5, 5)));
// Spacer
buttonPanel.add(new JLabel(""), LayoutHelper.getGBC(2, 0, 1, 0.5));
// Spacer
buttonPanel.add(new JLabel(""), LayoutHelper.getGBC(0, 1, 1, 0.5));
buttonPanel.add(getRemoveCustomButton(), LayoutHelper.getGBC(1, 1, 1, 1, 0.0D, 0.0D, GridBagConstraints.BOTH, GridBagConstraints.NORTHWEST, new Insets(5, 5, 5, 5)));
// Spacer
buttonPanel.add(new JLabel(""), LayoutHelper.getGBC(2, 1, 1, 0.5));
JScrollPane scrollPane2 = new JScrollPane(getInjectionPointList());
scrollPane2.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
buttonPanel.add(new JLabel(Constant.messages.getString("ascan.custom.label.vectors")), LayoutHelper.getGBC(0, 2, 3, 0.0D, 0.0D));
buttonPanel.add(scrollPane2, LayoutHelper.getGBC(0, 3, 3, 1.0D, 1.0D));
JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, scrollPane, buttonPanel);
splitPane.setDividerLocation(550);
customPanel.add(splitPane, LayoutHelper.getGBC(0, 0, 1, 1, 1.0D, 1.0D));
customPanel.add(customPanelStatus, LayoutHelper.getGBC(0, 1, 1, 1, 1.0D, 0.0D));
customPanel.add(getDisableNonCustomVectors(), LayoutHelper.getGBC(0, 2, 1, 1, 1.0D, 0.0D));
}
return customPanel;
}
use of javax.swing.JSplitPane in project zaproxy by zaproxy.
the class AlertPanel method getSplitPane.
private JSplitPane getSplitPane() {
if (splitPane == null) {
splitPane = new JSplitPane();
splitPane.setName("AlertPanels");
splitPane.setDividerSize(3);
splitPane.setDividerLocation(400);
splitPane.setOrientation(JSplitPane.HORIZONTAL_SPLIT);
// Add toolbar
JPanel panel = new JPanel();
panel.setLayout(new GridBagLayout());
panel.add(this.getPanelToolbar(), LayoutHelper.getGBC(0, 0, 1, 0.0D));
panel.add(getPaneScroll(), LayoutHelper.getGBC(0, 1, 1, 1.0D, 1.0D));
splitPane.setLeftComponent(panel);
splitPane.setRightComponent(getAlertViewPanel());
splitPane.setPreferredSize(new Dimension(100, 200));
}
return splitPane;
}
use of javax.swing.JSplitPane in project zaproxy by zaproxy.
the class WorkbenchPanel method createStatusPanelsSplit.
/**
* Creates a split pane between the {@code status} area (bottom component) and {@code work} area or a split between
* {@code work} and {@code select} areas (top component), if the layout is {@link Layout#EXPAND_SELECT EXPAND_SELECT} or
* {@link Layout#EXPAND_STATUS EXPAND_STATUS}, respectively.
*
* @return a {@code JSplitPane} between the {@code status} area and other areas
*/
private JSplitPane createStatusPanelsSplit() {
JSplitPane splitVert = new JSplitPane();
splitVert.setDividerLocation(restoreDividerLocation(DIVIDER_VERTICAL, 300));
splitVert.addPropertyChangeListener(JSplitPane.DIVIDER_LOCATION_PROPERTY, new DividerResizedListener(DIVIDER_VERTICAL));
splitVert.setDividerSize(3);
splitVert.setOrientation(JSplitPane.VERTICAL_SPLIT);
splitVert.setResizeWeight(0.5D);
switch(layout) {
case EXPAND_SELECT:
splitVert.setTopComponent(getPaneWork());
break;
case EXPAND_STATUS:
default:
splitVert.setTopComponent(createSelectPanelsSplit());
break;
}
splitVert.setBottomComponent(getPaneStatus());
splitVert.setContinuousLayout(false);
splitVert.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
return splitVert;
}
use of javax.swing.JSplitPane in project zaproxy by zaproxy.
the class WorkbenchPanel method splitResponsePanelWithWorkTabbedPanel.
private void splitResponsePanelWithWorkTabbedPanel(int orientation) {
responseTabbedPanel.removeAll();
String name = showTabNames ? responsePanel.getName() : "";
responseTabbedPanel.addTab(name, DisplayUtils.getScaledIcon(responsePanel.getIcon()), responsePanel);
getPaneWork().removeAll();
JSplitPane split = new JSplitPane(orientation);
split.setDividerSize(3);
split.setResizeWeight(0.5D);
split.setContinuousLayout(false);
split.setDoubleBuffered(true);
split.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
split.setRightComponent(responseTabbedPanel);
split.setLeftComponent(getTabbedWork());
getPaneWork().add(split);
getPaneWork().validate();
}
Aggregations