Search in sources :

Example 56 with JBScrollPane

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();
}
Also used : RightMarginForm(com.intellij.application.options.codeStyle.RightMarginForm) JBScrollPane(com.intellij.ui.components.JBScrollPane)

Example 57 with JBScrollPane

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) {
//        }
}
Also used : MouseEvent(java.awt.event.MouseEvent) AzureModuleImpl(com.microsoft.intellij.serviceexplorer.azure.AzureModuleImpl) AzureModule(com.microsoft.tooling.msservices.serviceexplorer.azure.AzureModule) MouseAdapter(java.awt.event.MouseAdapter) Tree(com.intellij.ui.treeStructure.Tree) JBScrollPane(com.intellij.ui.components.JBScrollPane)

Example 58 with JBScrollPane

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);
}
Also used : FormScalingUtil(com.android.tools.adtui.util.FormScalingUtil) HashMap(com.intellij.util.containers.HashMap) ModelWizard(com.android.tools.idea.wizard.model.ModelWizard) ArrayList(java.util.ArrayList) Lists(com.google.common.collect.Lists) Map(java.util.Map) DEFAULT_GALLERY_THUMBNAIL_SIZE(com.android.tools.idea.wizard.WizardConstants.DEFAULT_GALLERY_THUMBNAIL_SIZE) Logger(com.intellij.openapi.diagnostic.Logger) FlutterGalleryEntry(io.flutter.module.FlutterDescriptionProvider.FlutterGalleryEntry) JBList(com.intellij.ui.components.JBList) AndroidBundle.message(org.jetbrains.android.util.AndroidBundle.message) FlutterDescriptionProvider(io.flutter.module.FlutterDescriptionProvider) Collection(java.util.Collection) AccessibleContext(javax.accessibility.AccessibleContext) ModelWizardStep(com.android.tools.idea.wizard.model.ModelWizardStep) ActionEvent(java.awt.event.ActionEvent) JBScrollPane(com.intellij.ui.components.JBScrollPane) VerticalFlowLayout(com.intellij.openapi.ui.VerticalFlowLayout) java.awt(java.awt) ASGallery(com.android.tools.adtui.ASGallery) Nullable(org.jetbrains.annotations.Nullable) ModuleGalleryEntry(com.android.tools.idea.npw.module.ModuleGalleryEntry) List(java.util.List) NotNull(org.jetbrains.annotations.NotNull) JBColor(com.intellij.ui.JBColor) IconUtil(com.intellij.util.IconUtil) javax.swing(javax.swing) AccessibleContext(javax.accessibility.AccessibleContext) ModuleGalleryEntry(com.android.tools.idea.npw.module.ModuleGalleryEntry) JBScrollPane(com.intellij.ui.components.JBScrollPane) NotNull(org.jetbrains.annotations.NotNull)

Example 59 with JBScrollPane

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);
}
Also used : EmptyBorder(javax.swing.border.EmptyBorder) JBScrollPane(com.intellij.ui.components.JBScrollPane)

Example 60 with JBScrollPane

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);
}
Also used : EmptyBorder(javax.swing.border.EmptyBorder) JBScrollPane(com.intellij.ui.components.JBScrollPane)

Aggregations

JBScrollPane (com.intellij.ui.components.JBScrollPane)67 Tree (com.intellij.ui.treeStructure.Tree)12 JBList (com.intellij.ui.components.JBList)11 Nullable (org.jetbrains.annotations.Nullable)10 ActionEvent (java.awt.event.ActionEvent)9 VirtualFile (com.intellij.openapi.vfs.VirtualFile)8 MouseEvent (java.awt.event.MouseEvent)8 DialogWrapper (com.intellij.openapi.ui.DialogWrapper)7 List (java.util.List)7 ListSelectionEvent (javax.swing.event.ListSelectionEvent)7 NotNull (org.jetbrains.annotations.NotNull)7 ListSelectionListener (javax.swing.event.ListSelectionListener)6 JBTable (com.intellij.ui.table.JBTable)5 java.awt (java.awt)5 Map (java.util.Map)5 javax.swing (javax.swing)5 TreePath (javax.swing.tree.TreePath)5 Project (com.intellij.openapi.project.Project)4 ComboBox (com.intellij.openapi.ui.ComboBox)4 VerticalFlowLayout (com.intellij.openapi.ui.VerticalFlowLayout)4