本文整理匯總了Java中javax.swing.DefaultCellEditor.setClickCountToStart方法的典型用法代碼示例。如果您正苦於以下問題:Java DefaultCellEditor.setClickCountToStart方法的具體用法?Java DefaultCellEditor.setClickCountToStart怎麽用?Java DefaultCellEditor.setClickCountToStart使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javax.swing.DefaultCellEditor
的用法示例。
在下文中一共展示了DefaultCellEditor.setClickCountToStart方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: GranteeTable
import javax.swing.DefaultCellEditor; //導入方法依賴的package包/類
public GranteeTable(GranteeTableModel granteeTableModel) {
super();
sorter = new TableSorter(granteeTableModel);
this.setModel(sorter);
sorter.setTableHeader(this.getTableHeader());
getSelectionModel().setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
getSelectionModel().addListSelectionListener(this);
DefaultCellEditor groupCellEditor = new DefaultCellEditor(groupGranteeComboBox);
groupCellEditor.setClickCountToStart(2);
setDefaultEditor(GroupGrantee.class, groupCellEditor);
setDefaultRenderer(GroupGrantee.class, new DefaultTableCellRenderer() {
private static final long serialVersionUID = 4938391147702620699L;
public Component getTableCellRendererComponent(JTable arg0, Object value, boolean arg2, boolean arg3, int arg4, int arg5) {
GroupGrantee groupGrantee = (GroupGrantee) value;
return super.getTableCellRendererComponent(arg0, groupGrantee.getIdentifier(), arg2, arg3, arg4, arg5);
}
});
DefaultCellEditor permissionCellEditor = new DefaultCellEditor(permissionComboBox);
permissionCellEditor.setClickCountToStart(2);
setDefaultEditor(Permission.class, permissionCellEditor);
}
示例2: createInputCellEditor
import javax.swing.DefaultCellEditor; //導入方法依賴的package包/類
/** Create cell editor for for the input columns / flow variables. */
private TableCellEditor createInputCellEditor() {
JComboBox comboBox = new JComboBox();
comboBox.setRenderer(new InputListCellRenderer());
if (null != m_spec) {
for (DataColumnSpec colSpec : m_spec) {
comboBox.addItem(colSpec);
}
}
if (null != m_flowVars) {
for (FlowVariable flowVar : m_flowVars.values()) {
comboBox.addItem(flowVar);
}
}
DefaultCellEditor editor = new DefaultCellEditor(comboBox);
editor.setClickCountToStart(2);
return editor;
}
示例3: getFunctionTableColumn
import javax.swing.DefaultCellEditor; //導入方法依賴的package包/類
/**
* Creates and returns a {@link TableColumn} in which channels functions
* are shown.
* @param model the model of this {@link JTable}
* @return the {@link TableColumn} showing the channel functions
*/
protected TableColumn getFunctionTableColumn(SourceMontageTableModel model) {
TableColumn tc = new TableColumn(SourceMontageTableModel.FUNCTION_COLUMN, 200);
tc.setHeaderValue(model.getColumnName(tc.getModelIndex()));
ChannelTableCellRenderer channelTableCellRenderer = new ChannelTableCellRenderer();
tc.setCellRenderer(channelTableCellRenderer);
ChannelComboBox channelComboBox = new ChannelComboBox();
channelComboBox.setModel(model.getChannelFunctionsListModel());
DefaultCellEditor channelCellEditor = new DefaultCellEditor(channelComboBox);
channelCellEditor.setClickCountToStart(2);
tc.setCellEditor(channelCellEditor);
return tc;
}
示例4: StringTable
import javax.swing.DefaultCellEditor; //導入方法依賴的package包/類
public StringTable(StringTableModel stm) {
super(stm);
setShowVerticalLines(true);
setShowHorizontalLines(true);
setColumnSelectionAllowed(true);
DefaultCellEditor dce = new DefaultCellEditor(new JTextField());
dce.setClickCountToStart(2);
setDefaultEditor(String.class, dce);
TableColumnModel cm = getColumnModel();
cm.getColumn(0).setPreferredWidth(800);
cm.getColumn(1).setPreferredWidth(2000);
sp.getViewport().setBackground(Globals.prefs.getColor(JabRefPreferences.TABLE_BACKGROUND));
getInputMap().put(Globals.getKeyPrefs().getKey(KeyBinding.CLOSE_DIALOG), "close");
getActionMap().put("close", closeAction);
getInputMap().put(Globals.getKeyPrefs().getKey(KeyBinding.HELP), "help");
getActionMap().put("help", helpAction);
}
示例5: TreeAttlistDeclAttributeListCustomizer
import javax.swing.DefaultCellEditor; //導入方法依賴的package包/類
public TreeAttlistDeclAttributeListCustomizer() {
initComponents ();
attrTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
// Cells should become editable on single mouse click
final JTextField editorComponent = new JTextField();
editorComponent.getCaret().setVisible(true);
final DefaultCellEditor singleClickEditor = new DefaultCellEditor(editorComponent);
singleClickEditor.setClickCountToStart(1);
attrTable.setDefaultEditor(String.class, singleClickEditor);
initAccessibility();
}
示例6: prepareTableEdition
import javax.swing.DefaultCellEditor; //導入方法依賴的package包/類
/**
*
*/
private void prepareTableEdition(JTable table) {
editableField = new JTextField();
DefaultCellEditor cellEditor = new DefaultCellEditor(editableField);
cellEditor.setClickCountToStart(1);
table.setCellEditor(cellEditor);
table.setEnabled(true);
}
示例7: initTable
import javax.swing.DefaultCellEditor; //導入方法依賴的package包/類
private void initTable() {
String[] columnNames = {"��Ʒ����", "��Ʒ���", "����", "��λ", "���", "��װ", "����",
"����"};
((DefaultTableModel) table.getModel())
.setColumnIdentifiers(columnNames);
TableColumn column = table.getColumnModel().getColumn(0);
final DefaultCellEditor editor = new DefaultCellEditor(sp);
editor.setClickCountToStart(2);
column.setCellEditor(editor);
}
示例8: initTable
import javax.swing.DefaultCellEditor; //導入方法依賴的package包/類
private void initTable() {
String[] columnNames = {"��Ʒ����", "��Ʒ���", "����", "��λ", "���", "��װ", "����",
"����", "����", "���ĺ�"};
((DefaultTableModel) table.getModel())
.setColumnIdentifiers(columnNames);
TableColumn column = table.getColumnModel().getColumn(0);
final DefaultCellEditor editor = new DefaultCellEditor(sp);
editor.setClickCountToStart(2);
column.setCellEditor(editor);
}
示例9: initTable
import javax.swing.DefaultCellEditor; //導入方法依賴的package包/類
private void initTable() {
String[] columnNames = {"��Ʒ����", "��Ʒ���", "��Ӧ��", "����", "��λ", "���", "����",
"����", "��װ", "����", "���ĺ�"};
((DefaultTableModel) table.getModel())
.setColumnIdentifiers(columnNames);
TableColumn column = table.getColumnModel().getColumn(0);
final DefaultCellEditor editor = new DefaultCellEditor(sp);
editor.setClickCountToStart(2);
column.setCellEditor(editor);
}
示例10: updateAnnotationSetsList
import javax.swing.DefaultCellEditor; //導入方法依賴的package包/類
protected void updateAnnotationSetsList() {
String corpusName =
(corpusToSearchIn.getSelectedItem()
.equals(Constants.ENTIRE_DATASTORE))
? null
: (String)corpusIds
.get(corpusToSearchIn.getSelectedIndex() - 1);
TreeSet<String> ts = new TreeSet<String>(stringCollator);
ts.addAll(getAnnotationSetNames(corpusName));
DefaultComboBoxModel<String> dcbm = new DefaultComboBoxModel<String>(ts.toArray(new String[ts.size()]));
dcbm.insertElementAt(Constants.ALL_SETS, 0);
annotationSetsToSearchIn.setModel(dcbm);
annotationSetsToSearchIn.setSelectedItem(Constants.ALL_SETS);
// used in the ConfigureStackViewFrame as Annotation type column
// cell editor
TreeSet<String> types = new TreeSet<String>(stringCollator);
types.addAll(getTypesAndFeatures(null, null).keySet());
// put all annotation types from the datastore
// combobox used as cell editor
JComboBox<String> annotTypesBox = new JComboBox<String>();
annotTypesBox.setMaximumRowCount(10);
annotTypesBox.setModel(new DefaultComboBoxModel<String>(types.toArray(new String[types.size()])));
DefaultCellEditor cellEditor = new DefaultCellEditor(annotTypesBox);
cellEditor.setClickCountToStart(0);
configureStackViewFrame.getTable().getColumnModel()
.getColumn(ANNOTATION_TYPE).setCellEditor(cellEditor);
}
示例11: createTreeCellEditor
import javax.swing.DefaultCellEditor; //導入方法依賴的package包/類
@Override
protected TreeCellEditor createTreeCellEditor() {
JTextField tf = new JTextField() {
@Override
public String getName() {
return "Tree.cellEditor";
}
};
DefaultCellEditor editor = new DefaultCellEditor(tf);
// One click to edit.
editor.setClickCountToStart(1);
return editor;
}
示例12: createTreeCellEditor
import javax.swing.DefaultCellEditor; //導入方法依賴的package包/類
@Override
protected TreeCellEditor createTreeCellEditor() {
@SuppressWarnings("serial") // anonymous class
JTextField tf = new JTextField() {
@Override
public String getName() {
return "Tree.cellEditor";
}
};
DefaultCellEditor editor = new DefaultCellEditor(tf);
// One click to edit.
editor.setClickCountToStart(1);
return editor;
}
示例13: createTreeCellEditor
import javax.swing.DefaultCellEditor; //導入方法依賴的package包/類
/**
* This is invoked if a <code>TreeCellEditor</code>
* is not supplied in the constructor.
* It returns a <code>TextField</code> editor.
* @return a new <code>TextField</code> editor
*/
protected TreeCellEditor createTreeCellEditor() {
Border aBorder = UIManager.getBorder("Tree.editorBorder");
DefaultCellEditor editor = new DefaultCellEditor
(new DefaultTextField(aBorder)) {
public boolean shouldSelectCell(EventObject event) {
boolean retValue = super.shouldSelectCell(event);
return retValue;
}
};
// One click to edit.
editor.setClickCountToStart(1);
return editor;
}
示例14: AbstractInstrumentsDbTable
import javax.swing.DefaultCellEditor; //導入方法依賴的package包/類
/**
* Creates a new instance of <code>AbstractInstrumentsDbTable</code>
*/
public AbstractInstrumentsDbTable(InstrumentsDbTableModel model, String tablePrefix) {
super(model);
setView(CC.getViewConfig().getInstrumentsDbTableView());
this.tablePrefix = tablePrefix;
loadColumnsVisibleState();
loadColumnWidths();
setAutoResizeMode(AUTO_RESIZE_OFF);
rowSorter = new InstrumentsDbTableRowSorter(getModel());
setRowSorter(rowSorter);
loadSortOrder();
RowSorterListener l = new RowSorterListener() {
public void
sorterChanged(RowSorterEvent e) {
if(e.getType() != SORT_ORDER_CHANGED) return;
rowSorterChanged();
}
};
getRowSorter().addRowSorterListener(l);
putClientProperty("JTable.autoStartsEdit", false);
nameEditor = new DefaultCellEditor(tfEditor);
nameEditor.setClickCountToStart(5);
if( getModel().getShowDummyColumn()) {
TableColumn dummy;
dummy = getColumnModel().getColumn(getModel().getDummyColumnIndex());
dummy.setPreferredWidth(10);
}
}
示例15: createTreeCellEditor
import javax.swing.DefaultCellEditor; //導入方法依賴的package包/類
/**
* This is invoked if a TreeCellEditor is not supplied in the constructor.
* It returns a TextField editor.
*
* @return a new TextField editor
*/
protected TreeCellEditor createTreeCellEditor()
{
Border border = UIManager.getBorder("Tree.editorBorder");
JTextField tf = new DefaultTreeCellEditor.DefaultTextField(border);
DefaultCellEditor editor = new DefaultCellEditor(tf);
editor.setClickCountToStart(1);
realEditor = editor;
return editor;
}