本文整理汇总了Java中com.intellij.ui.table.JBTable.setShowGrid方法的典型用法代码示例。如果您正苦于以下问题:Java JBTable.setShowGrid方法的具体用法?Java JBTable.setShowGrid怎么用?Java JBTable.setShowGrid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.ui.table.JBTable
的用法示例。
在下文中一共展示了JBTable.setShowGrid方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: RevisionsList
import com.intellij.ui.table.JBTable; //导入方法依赖的package包/类
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);
}
示例2: createTable
import com.intellij.ui.table.JBTable; //导入方法依赖的package包/类
private JComponent createTable(List<String[]> properties) {
JPanel panel = new JPanel();
panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
JBTable table = new JBTable(new AuditModel(properties));
table.setDefaultRenderer(String.class, new MyTableCellRenderer());
table.setRowSelectionAllowed(false);
table.setColumnSelectionAllowed(false);
table.setCellSelectionEnabled(false);
table.setShowGrid(false);
table.setShowHorizontalLines(true);
table.setGridColor(table.getGridColor().brighter());
table.getTableHeader().setResizingAllowed(false);
table.getTableHeader().setDefaultRenderer(new MyHeaderCellRenderer());
panel.add(table.getTableHeader());
panel.add(table);
return panel;
}
示例3: createUIComponents
import com.intellij.ui.table.JBTable; //导入方法依赖的package包/类
/** 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.setPreferredScrollableViewportSize(new Dimension(-1,
languagesTable.getRowHeight() * IgnoreBundle.LANGUAGES.size() / 2));
languagesTable.setStriped(true);
languagesTable.setShowGrid(false);
languagesTable.setBorder(createEmptyBorder());
languagesTable.setDragEnabled(false);
languagesPanel = ScrollPaneFactory.createScrollPane(languagesTable);
donatePanel = new JBPanel(new BorderLayout());
donatePanel.setBorder(new EmptyBorder(10, 0, 10, 0));
donatePanel.add(new JBLabel(IgnoreBundle.message("settings.general.donate")), BorderLayout.WEST);
donatePanel.add(createLink(
"Donate with PayPal",
"https://www.paypal.me/hsz"
), BorderLayout.CENTER);
}
示例4: apply
import com.intellij.ui.table.JBTable; //导入方法依赖的package包/类
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);
}
示例5: OrderPanel
import com.intellij.ui.table.JBTable; //导入方法依赖的package包/类
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);
}
}