use of com.intellij.ui.components.JBScrollPane in project buck by facebook.
the class BuckToolWindowFactory method createBuildInfoPanel.
private JComponent createBuildInfoPanel(Project project) {
Tree result = new Tree(BuckUIManager.getInstance(project).getTreeModel());
result.addMouseListener(new MouseListener() {
@Override
public void mouseClicked(MouseEvent e) {
Tree tree = (Tree) e.getComponent();
int selRow = tree.getRowForLocation(e.getX(), e.getY());
TreePath selPath = tree.getPathForLocation(e.getX(), e.getY());
if (selRow != -1 && e.getClickCount() == 2) {
TreeNode node = (TreeNode) selPath.getLastPathComponent();
if (node.isLeaf()) {
BuckTreeNodeDetail buckNode = (BuckTreeNodeDetail) node;
if (buckNode instanceof BuckTreeNodeDetailError) {
BuckToolWindowFactory.this.handleClickOnError((BuckTreeNodeDetailError) buckNode);
}
}
}
}
@Override
public void mousePressed(MouseEvent e) {
}
@Override
public void mouseReleased(MouseEvent e) {
}
@Override
public void mouseEntered(MouseEvent e) {
}
@Override
public void mouseExited(MouseEvent e) {
}
});
result.setCellRenderer(new BuckTreeCellRenderer());
result.setShowsRootHandles(false);
result.setRowHeight(0);
JBScrollPane treeView = new JBScrollPane(result);
return treeView;
}
use of com.intellij.ui.components.JBScrollPane in project intellij-community by JetBrains.
the class SelectorBasedResponseHandler method getConfigurationComponent.
@NotNull
@Override
public JComponent getConfigurationComponent(@NotNull Project project) {
FileType fileType = getResponseType().getSelectorFileType();
HighlightedSelectorsTable table = new HighlightedSelectorsTable(fileType, project, getSelectors());
return new JBScrollPane(table);
}
use of com.intellij.ui.components.JBScrollPane in project intellij-community by JetBrains.
the class AssociationsEditor method initUI.
private void initUI() {
myComponent = new JPanel(new BorderLayout());
mySplitter = new JBSplitter("AssociationsEditor.dividerProportion", 0.3f);
myComponent.add(mySplitter, BorderLayout.CENTER);
JPanel leftPanel = new JPanel(new BorderLayout());
leftPanel.setBorder(IdeBorderFactory.createTitledBorder("Project XSLT Files", false, new Insets(0, 0, 0, 0)));
myTree = new Tree();
myTree.setRootVisible(false);
myTree.setShowsRootHandles(false);
leftPanel.add(new JBScrollPane(myTree), BorderLayout.CENTER);
mySplitter.setFirstComponent(leftPanel);
myList = new JBList();
myList.setCellRenderer(new MyCellRenderer());
myList.setMinimumSize(new Dimension(120, 200));
myList.getEmptyText().setText("No associated files");
JPanel rightPanel = ToolbarDecorator.createDecorator(myList).addExtraAction(AnActionButton.fromAction(new AddAssociationActionWrapper())).addExtraAction(AnActionButton.fromAction(new RemoveAssociationAction())).disableUpDownActions().disableAddAction().disableRemoveAction().createPanel();
UIUtil.addBorder(rightPanel, IdeBorderFactory.createTitledBorder("Associated Files", false, new Insets(0, 0, 0, 0)));
mySplitter.setSecondComponent(rightPanel);
}
use of com.intellij.ui.components.JBScrollPane in project azure-tools-for-java by Microsoft.
the class SparkSubmissionContentPanel method addConfigurationLineItem.
private void addConfigurationLineItem() {
JLabel jobConfigurationLabel = new JLabel("Job configurations");
add(jobConfigurationLabel, new GridBagConstraints(0, ++displayLayoutCurrentRow, 1, 1, 1, 0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(margin, margin, 0, 0), 0, 0));
String[] columns = { "Key", "Value", "" };
jobConfigurationTable = new JBTable();
Dimension jobConfigurationTableSize = new Dimension(320, 100);
jobConfigurationTable.setPreferredScrollableViewportSize(jobConfigurationTableSize);
jobConfigurationTable.setSurrendersFocusOnKeystroke(true);
jobConfigurationTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
jobConfigurationTable.setColumnSelectionAllowed(true);
JBScrollPane scrollPane = new JBScrollPane(jobConfigurationTable);
jobConfigurationTable.setFillsViewportHeight(true);
scrollPane.setMinimumSize(jobConfigurationTableSize);
jobConfigurationTable.addPropertyChangeListener((evt) -> {
if ((evt.getPropertyName().equals("tableCellEditor") || evt.getPropertyName().equals("model")) && jobConfigurationTable.getModel() instanceof SubmissionTableModel) {
SubmissionTableModel model = (SubmissionTableModel) jobConfigurationTable.getModel();
setVisibleForFixedErrorMessageLabel(ErrorMessageLabelTag.JobConfiguration.ordinal(), false);
SparkSubmissionJobConfigCheckResult result = model.getFirstCheckResults();
if (result != null) {
setStatusForMessageLabel(ErrorMessageLabelTag.JobConfiguration.ordinal(), true, result.getMessaqge(), result.getStatus() == SparkSubmissionJobConfigCheckStatus.Warning);
}
}
});
add(scrollPane, new GridBagConstraints(1, displayLayoutCurrentRow, 1, 1, 1, 0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(margin, margin, 0, 0), 0, 0));
JButton loadJobConfigurationButton = new JButton("...");
loadJobConfigurationButton.setPreferredSize(selectedArtifactTextField.getButton().getPreferredSize());
FixedSizeButton loadJobConfigurationFixedSizeButton = new FixedSizeButton(loadJobConfigurationButton);
add(loadJobConfigurationFixedSizeButton, new GridBagConstraints(2, displayLayoutCurrentRow, 0, 1, 0, 0, GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, new Insets(margin, margin / 2, 0, margin), 0, 0));
loadJobConfigurationFixedSizeButton.setToolTipText("Load Spark config from property file");
loadJobConfigurationFixedSizeButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
FileChooserDescriptor fileChooserDescriptor = new FileChooserDescriptor(true, false, false, false, false, false);
fileChooserDescriptor.setTitle("Select Spark property file");
VirtualFile chooseFile = FileChooser.chooseFile(fileChooserDescriptor, null, null);
if (chooseFile != null) {
submitModel.loadJobConfigMapFromPropertyFile(chooseFile.getCanonicalPath());
}
}
});
errorMessageLabels[ErrorMessageLabelTag.JobConfiguration.ordinal()] = new JLabel();
errorMessageLabels[ErrorMessageLabelTag.JobConfiguration.ordinal()].setForeground(DarkThemeManager.getInstance().getErrorMessageColor());
errorMessageLabels[ErrorMessageLabelTag.JobConfiguration.ordinal()].setVisible(false);
add(errorMessageLabels[ErrorMessageLabelTag.JobConfiguration.ordinal()], new GridBagConstraints(1, ++displayLayoutCurrentRow, 0, 1, 1, 0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(0, margin, 0, margin), 0, 0));
}
use of com.intellij.ui.components.JBScrollPane in project intellij-community by JetBrains.
the class CustomizePluginsStepPanel method createScrollPane.
static JBScrollPane createScrollPane(JPanel gridPanel) {
JBScrollPane scrollPane = new JBScrollPane(gridPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
// to disallow resetting border on LaF change
scrollPane.setBorder(JBUI.Borders.empty());
return scrollPane;
}
Aggregations