Search in sources :

Example 66 with JBScrollPane

use of com.intellij.ui.components.JBScrollPane in project azure-tools-for-java by Microsoft.

the class ActivityLogToolWindowFactory method createToolWindowContent.

@Override
public void createToolWindowContent(@NotNull final Project project, @NotNull final ToolWindow toolWindow) {
    this.project = project;
    table = new TableView<DeploymentTableItem>(new ListTableModel<DeploymentTableItem>(DESC, PROGRESS, STATUS, START_TIME));
    table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    // add mouse listener for links in table
    table.addMouseListener(createTableMouseListener());
    toolWindow.getComponent().add(new JBScrollPane(table));
    registerDeploymentListener();
}
Also used : ListTableModel(com.intellij.util.ui.ListTableModel) JBScrollPane(com.intellij.ui.components.JBScrollPane)

Example 67 with JBScrollPane

use of com.intellij.ui.components.JBScrollPane in project sonarlint-intellij by SonarSource.

the class SearchProjectKeyDialog method createProjectList.

private void createProjectList() {
    projectList = new JBList();
    projectList.setEmptyText("No projects found in the selected SonarQube Server");
    projectList.setCellRenderer(new ProjectListRenderer());
    projectList.addListSelectionListener(new ProjectItemListener());
    projectList.addMouseListener(new ProjectMouseListener());
    projectList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    projectList.setVisibleRowCount(10);
    projectList.setBorder(IdeBorderFactory.createBorder());
    Convertor<Object, String> convertor = o -> {
        RemoteModule module = (RemoteModule) o;
        return module.getName() + " " + module.getKey();
    };
    new ListSpeedSearch(projectList, convertor);
    scrollPane = new JBScrollPane(projectList);
}
Also used : ListSelectionModel(javax.swing.ListSelectionModel) RemoteModule(org.sonarsource.sonarlint.core.client.api.connected.RemoteModule) DialogWrapper(com.intellij.openapi.ui.DialogWrapper) Map(java.util.Map) MouseAdapter(java.awt.event.MouseAdapter) SimpleTextAttributes(com.intellij.ui.SimpleTextAttributes) ListSelectionEvent(javax.swing.event.ListSelectionEvent) Nullable(javax.annotation.Nullable) JComponent(javax.swing.JComponent) JBList(com.intellij.ui.components.JBList) Collection(java.util.Collection) Convertor(com.intellij.util.containers.Convertor) JList(javax.swing.JList) CollectionListModel(com.intellij.ui.CollectionListModel) Component(java.awt.Component) Collectors(java.util.stream.Collectors) MouseEvent(java.awt.event.MouseEvent) JBScrollPane(com.intellij.ui.components.JBScrollPane) List(java.util.List) IdeBorderFactory(com.intellij.ui.IdeBorderFactory) ColoredListCellRenderer(com.intellij.ui.ColoredListCellRenderer) Comparator(java.util.Comparator) ListSelectionListener(javax.swing.event.ListSelectionListener) CheckForNull(javax.annotation.CheckForNull) JPanel(javax.swing.JPanel) ListSpeedSearch(com.intellij.ui.ListSpeedSearch) RemoteModule(org.sonarsource.sonarlint.core.client.api.connected.RemoteModule) ListSpeedSearch(com.intellij.ui.ListSpeedSearch) JBList(com.intellij.ui.components.JBList) 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