本文整理汇总了Java中com.intellij.ui.BooleanTableCellRenderer类的典型用法代码示例。如果您正苦于以下问题:Java BooleanTableCellRenderer类的具体用法?Java BooleanTableCellRenderer怎么用?Java BooleanTableCellRenderer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BooleanTableCellRenderer类属于com.intellij.ui包,在下文中一共展示了BooleanTableCellRenderer类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createDefaultRenderers
import com.intellij.ui.BooleanTableCellRenderer; //导入依赖的package包/类
@Override
protected void createDefaultRenderers() {
super.createDefaultRenderers();
UIDefaults.LazyValue booleanRenderer = new UIDefaults.LazyValue() {
@Override
public Object createValue(@NotNull UIDefaults table) {
DefaultCellEditor editor = new DefaultCellEditor(GuiUtils.createUndoableTextField());
editor.setClickCountToStart(1);
return new BooleanTableCellRenderer();
}
};
//noinspection unchecked
defaultRenderersByColumnClass.put(boolean.class, booleanRenderer);
//noinspection unchecked
defaultRenderersByColumnClass.put(Boolean.class, booleanRenderer);
}
示例2: setTableEditor
import com.intellij.ui.BooleanTableCellRenderer; //导入依赖的package包/类
public void setTableEditor(JTable table) {
this.table = table;
TableColumnModel columnModel = table.getColumnModel();
columnModel.getColumn(COL_CHECK).setCellRenderer(new BooleanTableCellRenderer());
columnModel.getColumn(COL_CHECK).setCellEditor(new BooleanTableCellEditor());
columnModel.getColumn(COL_CHECK).setPreferredWidth(50);
columnModel.getColumn(COL_TABLE).setPreferredWidth(100);
JTableHeader header = table.getTableHeader();
header.setDefaultRenderer(new ClassTableHeaderRenderer(table, true));
}
示例3: getRenderer
import com.intellij.ui.BooleanTableCellRenderer; //导入依赖的package包/类
@Override
public TableCellRenderer getRenderer(final IdeaPluginDescriptor ideaPluginDescriptor) {
return new BooleanTableCellRenderer() {
@Override
public Component getTableCellRendererComponent(JTable table,
Object value,
boolean isSelected,
boolean hasFocus,
int row,
int column) {
return super.getTableCellRendererComponent(table, value == null ? Boolean.TRUE : value, isSelected, hasFocus, row, column);
}
};
}
示例4: methodsSize
import com.intellij.ui.BooleanTableCellRenderer; //导入依赖的package包/类
public void methodsSize(int methods) {
myTableModel = new DefaultTableModel(methods, 2);
myMethodsTable.setModel(myTableModel);
TableColumn checkColumn = myMethodsTable.getColumnModel().getColumn(0);
TableUtil.setupCheckboxColumn(checkColumn);
checkColumn.setCellRenderer(new BooleanTableCellRenderer());
checkColumn.setCellEditor(new DefaultCellEditor(new JCheckBox()));
myMethodsTable.getColumnModel().getColumn(1).setHeaderValue("Test method");
checkColumn.setHeaderValue("");
getOKAction().setEnabled(true);
}
示例5: getTableCellRendererComponent
import com.intellij.ui.BooleanTableCellRenderer; //导入依赖的package包/类
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, final boolean hasFocus, int row, int column) {
JPanel panel = new JPanel();
final Component component = super.getTableCellRendererComponent(table, ((Pair)value).getFirst(), isSelected, hasFocus, row, column);
panel.add(component);
final Component component1 =
new BooleanTableCellRenderer().getTableCellRendererComponent(table, ((Pair)value).getSecond(), isSelected, hasFocus, row, column);
panel.add(component1);
return panel;
}
示例6: setColumns
import com.intellij.ui.BooleanTableCellRenderer; //导入依赖的package包/类
public static void setColumns(@NotNull JTable table) {
StringResourceTableModel model = (StringResourceTableModel) table.getModel();
Enumeration<TableColumn> columns = table.getColumnModel().getColumns();
while (columns.hasMoreElements()) {
TableColumn column = columns.nextElement();
if (column.getModelIndex() == ConstantColumn.UNTRANSLATABLE.ordinal()) {
column.setCellRenderer(new BooleanTableCellRenderer());
}
else {
column.setCellRenderer(CELL_RENDERER);
}
int index = column.getModelIndex();
FontMetrics fontMetrics = table.getFontMetrics(table.getFont());
Locale locale = model.localeOfColumn(index);
HeaderCellRenderer renderer =
locale == null ? new ConstantHeaderCellRenderer(index, fontMetrics) : new TranslationHeaderCellRenderer(fontMetrics, locale);
column.setHeaderRenderer(renderer);
// Sets Key and Default Value columns to initially display at full width and all others to be collapsed
int width;
if (ConstantColumn.KEY.ordinal() == index ||
ConstantColumn.DEFAULT_VALUE.ordinal() == index) {
width = renderer.getFullExpandedWidth();
} else {
width = renderer.getCollapsedWidth();
}
setPreferredWidth(column, width);
}
expandToViewportWidthIfNecessary(table, -1);
}
示例7: CloudLibraryTable
import com.intellij.ui.BooleanTableCellRenderer; //导入依赖的package包/类
CloudLibraryTable(List<CloudLibrary> libraries) {
super(new CloudLibraryTableModel(libraries));
setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
setDefaultRenderer(CloudLibrary.class, new CloudLibraryRenderer());
setDefaultRenderer(Boolean.class, new BooleanTableCellRenderer());
setDefaultEditor(Boolean.class, new BooleanTableCellEditor());
TableUtil.setupCheckboxColumn(getColumnModel().getColumn(1));
}
示例8: getRenderer
import com.intellij.ui.BooleanTableCellRenderer; //导入依赖的package包/类
public TableCellRenderer getRenderer(final IdeaPluginDescriptor ideaPluginDescriptor) {
return new BooleanTableCellRenderer() {
@Override
public Component getTableCellRendererComponent(JTable table,
Object value,
boolean isSelected,
boolean hasFocus,
int row,
int column) {
return super.getTableCellRendererComponent(table, value == null ? Boolean.TRUE : value, isSelected, hasFocus, row, column);
}
};
}
示例9: getRenderer
import com.intellij.ui.BooleanTableCellRenderer; //导入依赖的package包/类
@Override
public TableCellRenderer getRenderer(final IdeaPluginDescriptor ideaPluginDescriptor) {
return new BooleanTableCellRenderer() {
@Override
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
return super.getTableCellRendererComponent(table, value == null ? Boolean.TRUE : value, isSelected, hasFocus, row, column);
}
};
}
示例10: createTablePanel
import com.intellij.ui.BooleanTableCellRenderer; //导入依赖的package包/类
private JScrollPane createTablePanel() {
myTableModel = new MyTableModel();
myTable = new Table(myTableModel);
myTable.setSurrendersFocusOnKeystroke(true);
myTable.getTableHeader().setReorderingAllowed(false);
final TableColumnModel columnModel = myTable.getColumnModel();
columnModel.getColumn(SKIP_SETTER).setCellRenderer(new BooleanTableCellRenderer());
myTable.registerKeyboardAction(
new ActionListener() {
public void actionPerformed(ActionEvent e) {
final int[] selectedRows = myTable.getSelectedRows();
for (final int selectedRow : selectedRows) {
final ParameterData parameterData = myTableModel.getParamData(selectedRow);
if (parameterData.getDefaultValue() != null) {
parameterData.setInsertSetter(!parameterData.isInsertSetter());
}
}
TableUtil.selectRows(myTable, selectedRows);
}
},
KeyStroke.getKeyStroke(KeyEvent.VK_SPACE, 0),
JComponent.WHEN_FOCUSED
);
myTable.setPreferredScrollableViewportSize(new Dimension(550, myTable.getRowHeight() * 12));
myTable.getSelectionModel().setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
final JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(myTable);
//final Border titledBorder = IdeBorderFactory.createBoldTitledBorder("Parameters to Pass to the Builder");
//final Border emptyBorder = BorderFactory.createEmptyBorder(0, 5, 5, 5);
//final Border border = BorderFactory.createCompoundBorder(titledBorder, emptyBorder);
//scrollPane.setBorder(border);
return scrollPane;
}
示例11: BooleanColumnInfo
import com.intellij.ui.BooleanTableCellRenderer; //导入依赖的package包/类
public BooleanColumnInfo(final String name) {
super(name, new BooleanTableCellRenderer());
}
示例12: getRenderer
import com.intellij.ui.BooleanTableCellRenderer; //导入依赖的package包/类
@Nullable
@Override
public TableCellRenderer getRenderer(AbstractVariableData data) {
return new BooleanTableCellRenderer();
}