Java Code Examples for com.intellij.ui.table.JBTable#setShowGrid()
The following examples show how to use
com.intellij.ui.table.JBTable#setShowGrid() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RevisionsList.java From consulo with Apache License 2.0 | 6 votes |
public RevisionsList(SelectionListener l) { table = new JBTable(); table.setModel(new MyModel(Collections.<RevisionItem>emptyList(), Collections.<RevisionItem, Period>emptyMap())); table.setTableHeader(null); table.setShowGrid(false); table.setRowMargin(0); table.getColumnModel().setColumnMargin(0); table.resetDefaultFocusTraversalKeys(); table.setDefaultRenderer(Object.class, new MyCellRenderer(table)); table.getEmptyText().setText(VcsBundle.message("history.empty")); addSelectionListener(l); }
Example 2
Source File: InitializrUtil.java From intellij-spring-assistant with MIT License | 5 votes |
/** * Set defaults so that the table looks & acts more like a list * * @param table table */ public static void resetTableLookAndFeelToSingleSelect(JBTable table) { table.setRowMargin(0); table.setShowColumns(false); table.setShowGrid(false); table.setShowVerticalLines(false); table.setCellSelectionEnabled(false); table.setRowSelectionAllowed(true); table.setSelectionMode(SINGLE_SELECTION); }
Example 3
Source File: IgnoreSettingsPanel.java From idea-gitignore with MIT License | 5 votes |
/** Create UI components. */ private void createUIComponents() { templatesListPanel = new TemplatesListPanel(); editorPanel = new EditorPanel(); editorPanel.setPreferredSize(new Dimension(Integer.MAX_VALUE, 200)); templatesSplitter = new Splitter(false, 0.3f); templatesSplitter.setFirstComponent(templatesListPanel); templatesSplitter.setSecondComponent(editorPanel); languagesTable = new JBTable(); languagesTable.setModel(new LanguagesTableModel()); languagesTable.getSelectionModel().setSelectionMode(ListSelectionModel.SINGLE_SELECTION); languagesTable.setColumnSelectionAllowed(false); languagesTable.setRowHeight(22); languagesTable.getColumnModel().getColumn(2).setCellRenderer(new BooleanTableCellRenderer() { @Override public Component getTableCellRendererComponent(JTable table, Object value, boolean isSel, boolean hasFocus, int row, int column) { boolean editable = table.isCellEditable(row, column); Object newValue = editable ? value : null; return super.getTableCellRendererComponent(table, newValue, isSel, hasFocus, row, column); } }); languagesTable.setPreferredScrollableViewportSize( new Dimension(-1, languagesTable.getRowHeight() * IgnoreBundle.LANGUAGES.size() / 2) ); languagesTable.setStriped(true); languagesTable.setShowGrid(false); languagesTable.setBorder(JBUI.Borders.empty()); languagesTable.setDragEnabled(false); languagesPanel = ScrollPaneFactory.createScrollPane(languagesTable); }
Example 4
Source File: StripeTable.java From consulo with Apache License 2.0 | 5 votes |
public static void apply(@Nonnull JBTable table) { table.setAutoResizeMode(AUTO_RESIZE_OFF); table.setTableHeader(createTableHeader(table.getColumnModel())); table.getTableHeader().setReorderingAllowed(false); //setOpaque(false); table.setGridColor(GRID_COLOR); table.setIntercellSpacing(new Dimension(1, 0)); table.setShowGrid(false); table.setStriped(true); }
Example 5
Source File: PatternFilterEditor.java From KodeBeagle with Apache License 2.0 | 4 votes |
public PatternFilterEditor(final Project project, final String patternsHelpId) { super(new BorderLayout()); myPatternsHelpId = patternsHelpId; myTable = new JBTable(); myProject = project; final ToolbarDecorator decorator = ToolbarDecorator.createDecorator(myTable); decorator.addExtraAction(new AnActionButton(getAddPatternButtonText(), getAddPatternButtonIcon()) { @Override public void actionPerformed(final AnActionEvent e) { addPatternFilter(); } }); add(decorator.setRemoveAction(new AnActionButtonRunnable() { @Override public void run(final AnActionButton button) { TableUtil.removeSelectedItems(myTable); } }).setButtonComparator(getAddPatternButtonText(), "Remove") .disableUpDownActions().createPanel(), BorderLayout.CENTER); myTableModel = new FilterTableModel(); myTable.setModel(myTableModel); myTable.setShowGrid(false); myTable.setShowGrid(false); myTable.setIntercellSpacing(new Dimension(0, 0)); myTable.setTableHeader(null); myTable.setAutoResizeMode(JTable.AUTO_RESIZE_LAST_COLUMN); myTable.setColumnSelectionAllowed(false); myTable.setPreferredScrollableViewportSize(new Dimension(WIDTH, myTable.getRowHeight() * PREFERRED_SCROLLABLE_VIEWPORT_HEIGHT_IN_ROWS)); TableColumnModel columnModel = myTable.getColumnModel(); TableColumn column = columnModel.getColumn(FilterTableModel.CHECK_MARK); TableUtil.setupCheckboxColumn(column); column.setCellRenderer(new EnabledCellRenderer(myTable.getDefaultRenderer(Boolean.class))); columnModel.getColumn(FilterTableModel.FILTER).setCellRenderer(new FilterCellRenderer()); getEmptyText().setText(EMPTY_PATTERNS); }
Example 6
Source File: OrderPanel.java From consulo with Apache License 2.0 | 4 votes |
protected OrderPanel(Class<T> entryClass, boolean showCheckboxes) { super(new BorderLayout()); myEntryClass = entryClass; myEntryTable = new JBTable(new MyTableModel(showCheckboxes)); myEntryTable.setShowGrid(false); myEntryTable.setDragEnabled(false); myEntryTable.setShowHorizontalLines(false); myEntryTable.setShowVerticalLines(false); myEntryTable.setIntercellSpacing(new Dimension(0, 0)); myEntryTable.getSelectionModel().setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); myEntryTable.registerKeyboardAction( new ActionListener() { public void actionPerformed(ActionEvent e) { if(getCheckboxColumn() == -1) return; final int[] selectedRows = myEntryTable.getSelectedRows(); boolean currentlyMarked = true; for (int idx = 0; idx < selectedRows.length; idx++) { final int selectedRow = selectedRows[idx]; if (selectedRow < 0 || !myEntryTable.isCellEditable(selectedRow, getCheckboxColumn())) { return; } currentlyMarked &= ((Boolean)myEntryTable.getValueAt(selectedRow, getCheckboxColumn())).booleanValue(); } for (int idx = 0; idx < selectedRows.length; idx++) { myEntryTable.setValueAt(currentlyMarked? Boolean.FALSE : Boolean.TRUE, selectedRows[idx], getCheckboxColumn()); } } }, KeyStroke.getKeyStroke(KeyEvent.VK_SPACE, 0), JComponent.WHEN_FOCUSED ); add(ScrollPaneFactory.createScrollPane(myEntryTable), BorderLayout.CENTER); if (myEntryTable.getRowCount() > 0) { myEntryTable.getSelectionModel().setSelectionInterval(0,0); } }