Search in sources :

Example 6 with TableView

use of com.intellij.ui.table.TableView in project intellij-plugins by JetBrains.

the class DartProblemsViewPanel method createTable.

@NotNull
private TableView<DartProblem> createTable() {
    final TableView<DartProblem> table = new TableView<>(new DartProblemsTableModel(myProject, myPresentationHelper));
    table.addKeyListener(new KeyAdapter() {

        @Override
        public void keyPressed(KeyEvent e) {
            if (e.getKeyCode() == KeyEvent.VK_ENTER) {
                // as in NewErrorTreeViewPanel
                navigate(false);
            }
        }
    });
    EditSourceOnDoubleClickHandler.install(table);
    table.addMouseListener(new PopupHandler() {

        @Override
        public void invokePopup(Component comp, int x, int y) {
            popupInvoked(comp, x, y);
        }
    });
    //noinspection unchecked
    ((DefaultRowSorter) table.getRowSorter()).setRowFilter(myPresentationHelper.getRowFilter());
    table.getRowSorter().addRowSorterListener(e -> {
        final List<? extends RowSorter.SortKey> sortKeys = myTable.getRowSorter().getSortKeys();
        assert sortKeys.size() == 1 : sortKeys;
        ((DartProblemsTableModel) myTable.getModel()).setSortKey(sortKeys.get(0));
    });
    new TableSpeedSearch(table, object -> object instanceof DartProblem ? ((DartProblem) object).getErrorMessage() + " " + ((DartProblem) object).getPresentableLocation() : "");
    table.setShowVerticalLines(false);
    table.setShowHorizontalLines(false);
    table.setStriped(true);
    table.setRowHeight(table.getRowHeight() + JBUI.scale(4));
    JTableHeader tableHeader = table.getTableHeader();
    tableHeader.setPreferredSize(new Dimension(0, table.getRowHeight()));
    return table;
}
Also used : KeyAdapter(java.awt.event.KeyAdapter) JTableHeader(javax.swing.table.JTableHeader) RelativePoint(com.intellij.ui.awt.RelativePoint) KeyEvent(java.awt.event.KeyEvent) TableView(com.intellij.ui.table.TableView) NotNull(org.jetbrains.annotations.NotNull)

Example 7 with TableView

use of com.intellij.ui.table.TableView in project android by JetBrains.

the class ChooseSystemImageStepFixture method selectSystemImage.

@NotNull
public ChooseSystemImageStepFixture selectSystemImage(@NotNull String releaseName, @NotNull String apiLevel, @NotNull String abiType, @NotNull String targetName) {
    final TableView systemImageList = robot().finder().findByType(target(), TableView.class, true);
    JTableFixture systemImageListFixture = new JTableFixture(robot(), systemImageList);
    JTableCellFixture cell = systemImageListFixture.cell(rowWithValue(releaseName, apiLevel, abiType, targetName).column(0));
    cell.select();
    return this;
}
Also used : JTableCellFixture(org.fest.swing.fixture.JTableCellFixture) JTableFixture(org.fest.swing.fixture.JTableFixture) TableView(com.intellij.ui.table.TableView) NotNull(org.jetbrains.annotations.NotNull)

Example 8 with TableView

use of com.intellij.ui.table.TableView in project android by JetBrains.

the class AvdManagerDialogFixture method deleteAvd.

public AvdManagerDialogFixture deleteAvd(String name) {
    TableView tableView = robot().finder().findByType(target(), TableView.class, true);
    JTableFixture tableFixture = new JTableFixture(robot(), tableView);
    JTableCellFixture cell = tableFixture.cell(name);
    cell.click(RIGHT_BUTTON);
    JPopupMenuFixture contextMenuFixture = new JPopupMenuFixture(robot(), robot().findActivePopupMenu());
    contextMenuFixture.menuItemWithPath("Delete").click();
    MessagesFixture.findByTitle(robot(), "Confirm Deletion").clickYes();
    return this;
}
Also used : JTableCellFixture(org.fest.swing.fixture.JTableCellFixture) JTableFixture(org.fest.swing.fixture.JTableFixture) JPopupMenuFixture(org.fest.swing.fixture.JPopupMenuFixture) TableView(com.intellij.ui.table.TableView)

Example 9 with TableView

use of com.intellij.ui.table.TableView in project android by JetBrains.

the class AvdManagerDialogFixture method editAvdWithName.

public AvdEditWizardFixture editAvdWithName(@NotNull String name) {
    final TableView tableView = robot().finder().findByType(target(), TableView.class, true);
    JTableFixture tableFixture = new JTableFixture(robot(), tableView);
    JTableCellFixture cell = tableFixture.cell(name);
    final TableCell actionCell = TableCell.row(cell.row()).column(7);
    JTableCellFixture actionCellFixture = tableFixture.cell(actionCell);
    execute(new GuiTask() {

        @Override
        protected void executeInEDT() throws Throwable {
            tableView.editCellAt(actionCell.row, actionCell.column);
        }
    });
    JPanel actionPanel = (JPanel) actionCellFixture.editor();
    HyperlinkLabel editButtonLabel = robot().finder().find(actionPanel, new GenericTypeMatcher<HyperlinkLabel>(HyperlinkLabel.class) {

        @Override
        protected boolean isMatching(@NotNull HyperlinkLabel component) {
            return "Edit this AVD".equals(component.getToolTipText());
        }
    });
    robot().click(editButtonLabel);
    return AvdEditWizardFixture.find(robot());
}
Also used : JTableCellFixture(org.fest.swing.fixture.JTableCellFixture) GuiTask(org.fest.swing.edt.GuiTask) JTableFixture(org.fest.swing.fixture.JTableFixture) TableCell(org.fest.swing.data.TableCell) HyperlinkLabel(com.intellij.ui.HyperlinkLabel) TableView(com.intellij.ui.table.TableView)

Example 10 with TableView

use of com.intellij.ui.table.TableView in project android by JetBrains.

the class AvdManagerDialogFixture method selectAvd.

public AvdManagerDialogFixture selectAvd(@NotNull String name) {
    TableView tableView = robot().finder().findByType(target(), TableView.class, true);
    JTableFixture tableFixture = new JTableFixture(robot(), tableView);
    tableFixture.cell(name).select();
    return this;
}
Also used : JTableFixture(org.fest.swing.fixture.JTableFixture) TableView(com.intellij.ui.table.TableView)

Aggregations

TableView (com.intellij.ui.table.TableView)13 NotNull (org.jetbrains.annotations.NotNull)6 JTableFixture (org.fest.swing.fixture.JTableFixture)3 AnActionEvent (com.intellij.openapi.actionSystem.AnActionEvent)2 DumbAwareAction (com.intellij.openapi.project.DumbAwareAction)2 MessageType (com.intellij.openapi.ui.MessageType)2 Splitter (com.intellij.openapi.ui.Splitter)2 VirtualFile (com.intellij.openapi.vfs.VirtualFile)2 ColumnInfo (com.intellij.util.ui.ColumnInfo)2 ListTableModel (com.intellij.util.ui.ListTableModel)2 KeyAdapter (java.awt.event.KeyAdapter)2 KeyEvent (java.awt.event.KeyEvent)2 ArrayList (java.util.ArrayList)2 TableCellRenderer (javax.swing.table.TableCellRenderer)2 JTableCellFixture (org.fest.swing.fixture.JTableCellFixture)2 ModulesComboBox (com.intellij.application.options.ModulesComboBox)1 AllIcons (com.intellij.icons.AllIcons)1 PropertiesComponent (com.intellij.ide.util.PropertiesComponent)1 JsonBundle (com.intellij.json.JsonBundle)1 Disposable (com.intellij.openapi.Disposable)1