use of com.intellij.ui.components.JBScrollPane in project intellij-community by JetBrains.
the class CodeStyleXmlPanel method createUIComponents.
private void createUIComponents() {
myJBScrollPane = new JBScrollPane() {
@Override
public Dimension getPreferredSize() {
Dimension prefSize = super.getPreferredSize();
return new Dimension(prefSize.width + 15, prefSize.height);
}
};
myRightMarginForm = new RightMarginForm(StdFileTypes.XML.getLanguage(), getSettings());
myRightMarginPanel = myRightMarginForm.getTopPanel();
}
use of com.intellij.ui.components.JBScrollPane in project azure-tools-for-java by Microsoft.
the class ServerExplorerToolWindowFactory method createToolWindowContent.
@Override
public void createToolWindowContent(@NotNull final Project project, @NotNull final ToolWindow toolWindow) {
// initialize azure service module
AzureModule azureModule = new AzureModuleImpl(project);
HDInsightUtil.setHDInsightRootModule(azureModule);
// initialize with all the service modules
DefaultTreeModel treeModel = new DefaultTreeModel(initRoot(project, azureModule));
treeModelMap.put(project, treeModel);
// initialize tree
final JTree tree = new Tree(treeModel);
tree.setRootVisible(false);
tree.setCellRenderer(new NodeTreeCellRenderer());
tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
// add a click handler for the tree
tree.addMouseListener(new MouseAdapter() {
@Override
public void mousePressed(MouseEvent e) {
treeMousePressed(e, tree);
}
});
// add the tree to the window
toolWindow.getComponent().add(new JBScrollPane(tree));
// setup toolbar icons
addToolbarItems(toolWindow, azureModule);
// try {
// azureModule.registerSubscriptionsChanged();
// } catch (AzureCmdException ignored) {
// }
}
use of com.intellij.ui.components.JBScrollPane in project flutter-intellij by flutter.
the class ChoseProjectTypeStep method createGallery.
@NotNull
private JComponent createGallery() {
myProjectTypeGallery = new ASGallery<ModuleGalleryEntry>(JBList.createDefaultListModel(), image -> image == null ? null : image.getIcon() == null ? null : IconUtil.toImage(image.getIcon()), label -> label == null ? message("android.wizard.gallery.item.none") : label.getName(), DEFAULT_GALLERY_THUMBNAIL_SIZE, null) {
@Override
public Dimension getPreferredScrollableViewportSize() {
// The default implementation assigns a height as tall as the screen.
// When calling setVisibleRowCount(2), the underlying implementation is buggy, and will have a gap on the right and when the user
// resizes, it enters on an adjustment loop at some widths (can't decide to fit 3 or for elements, and loops between the two)
Dimension cellSize = computeCellSize();
int heightInsets = getInsets().top + getInsets().bottom;
int widthInsets = getInsets().left + getInsets().right;
// Don't want to show an exact number of rows, since then it's not obvious there's another row available.
return new Dimension(cellSize.width * 5 + widthInsets, (int) (cellSize.height * 1.2) + heightInsets);
}
};
myProjectTypeGallery.setBorder(BorderFactory.createLineBorder(JBColor.border()));
AccessibleContext accessibleContext = myProjectTypeGallery.getAccessibleContext();
if (accessibleContext != null) {
accessibleContext.setAccessibleDescription(getTitle());
}
return new JBScrollPane(myProjectTypeGallery);
}
use of com.intellij.ui.components.JBScrollPane in project checkstyle-idea by jshiell.
the class ErrorPanel method initialise.
private void initialise() {
setBorder(new EmptyBorder(8, 8, 8, 8));
final JLabel infoLabel = new JLabel(CheckStyleBundle.message("config.file.error.caption"));
infoLabel.setBorder(new EmptyBorder(0, 0, 8, 0));
add(infoLabel, BorderLayout.NORTH);
errorField.setEditable(false);
errorField.setTabSize(2);
final JScrollPane errorScrollPane = new JBScrollPane(errorField, VERTICAL_SCROLLBAR_ALWAYS, HORIZONTAL_SCROLLBAR_ALWAYS);
add(errorScrollPane, BorderLayout.CENTER);
}
use of com.intellij.ui.components.JBScrollPane in project checkstyle-idea by jshiell.
the class PropertiesPanel method initialise.
private void initialise() {
setBorder(new EmptyBorder(8, 8, 4, 8));
setPreferredSize(new Dimension(500, 400));
propertiesTable.setToolTipText(CheckStyleBundle.message("config.file.properties.tooltip"));
propertiesTable.setStriped(true);
propertiesTable.getTableHeader().setReorderingAllowed(false);
final JScrollPane propertiesScrollPane = new JBScrollPane(propertiesTable, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
add(propertiesScrollPane, BorderLayout.CENTER);
}
Aggregations