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;
}
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;
}
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;
}
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());
}
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;
}
Aggregations