本文整理汇总了Java中org.eclipse.swt.custom.TableEditor.setEditor方法的典型用法代码示例。如果您正苦于以下问题:Java TableEditor.setEditor方法的具体用法?Java TableEditor.setEditor怎么用?Java TableEditor.setEditor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.swt.custom.TableEditor
的用法示例。
在下文中一共展示了TableEditor.setEditor方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addTextBoxInTable
import org.eclipse.swt.custom.TableEditor; //导入方法依赖的package包/类
private Text addTextBoxInTable(TableViewer tableViewer, TableItem tableItem, String textBoxName,
String valueTextPane, String editorName, int columnIndex, Listener listener) {
final Composite buttonPane = new Composite(tableViewer.getTable(), SWT.NONE);
buttonPane.setLayout(new FillLayout());
final Text text = new Text(buttonPane, SWT.NONE);
text.addListener(SWT.Modify, listener);
text.setData(FilterConstants.ROW_INDEX, tableViewer.getTable().indexOf(tableItem));
tableItem.setData(textBoxName, text);
tableItem.setData(valueTextPane, buttonPane);
//text.addModifyListener(FilterHelper.INSTANCE.getTextModifyListener());
final TableEditor editor = new TableEditor(tableViewer.getTable());
editor.grabHorizontal = true;
editor.grabVertical = true;
editor.setEditor(buttonPane, tableItem, columnIndex);
editor.layout();
text.setData(editorName, editor);
return text;
}
示例2: addComboInTable
import org.eclipse.swt.custom.TableEditor; //导入方法依赖的package包/类
private CCombo addComboInTable(TableViewer tableViewer, TableItem tableItem, String comboName, String comboPaneName,
String editorName, int columnIndex, String[] relationalOperators, SelectionListener dropDownSelectionListener,
ModifyListener modifyListener,FocusListener focusListener) {
final Composite buttonPane = new Composite(tableViewer.getTable(), SWT.NONE);
buttonPane.setLayout(new FillLayout());
final CCombo combo = new CCombo(buttonPane, SWT.NONE);
combo.setItems(relationalOperators);
combo.setData(FilterConstants.ROW_INDEX, tableViewer.getTable().indexOf(tableItem));
tableItem.setData(comboName, combo);
tableItem.setData(comboPaneName, buttonPane);
combo.addSelectionListener(dropDownSelectionListener);
combo.addModifyListener(modifyListener);
combo.addFocusListener(focusListener);
new AutoCompleteField(combo, new CComboContentAdapter(), combo.getItems());
final TableEditor editor = new TableEditor(tableViewer.getTable());
editor.grabHorizontal = true;
editor.grabVertical = true;
editor.setEditor(buttonPane, tableItem, columnIndex);
editor.layout();
combo.setData(editorName, editor);
return combo;
}
示例3: addButtonInTable
import org.eclipse.swt.custom.TableEditor; //导入方法依赖的package包/类
private void addButtonInTable(TableViewer tableViewer, TableItem tableItem, String columnName,
String buttonPaneName, String editorName, int columnIndex, SelectionListener buttonSelectionListener,
ImagePathConstant imagePath) {
final Composite buttonPane = new Composite(tableViewer.getTable(), SWT.NONE);
buttonPane.setLayout(new FillLayout());
final Button button = new Button(buttonPane, SWT.NONE);
//button.setText(columnName);
button.setData(FilterConstants.ROW_INDEX, tableViewer.getTable().indexOf(tableItem));
tableItem.setData(columnName, button);
tableItem.setData(buttonPaneName, buttonPane);
button.addSelectionListener(buttonSelectionListener);
button.setImage(imagePath.getImageFromRegistry());
final TableEditor editor = new TableEditor(tableViewer.getTable());
editor.grabHorizontal = true;
editor.grabVertical = true;
editor.setEditor(buttonPane, tableItem, columnIndex);
editor.layout();
button.setData(editorName, editor);
}
示例4: addCheckButtonInTable
import org.eclipse.swt.custom.TableEditor; //导入方法依赖的package包/类
private void addCheckButtonInTable(TableViewer tableViewer, TableItem tableItem, String columnName,
String groupPaneName, String editorName, int columnIndex, SelectionListener buttonSelectionListener) {
final Composite buttonPane = new Composite(tableViewer.getTable(), SWT.NONE);
buttonPane.setLayout(new FillLayout());
final Button button = new Button(buttonPane, SWT.CHECK);
button.setData(FilterConstants.ROW_INDEX, tableViewer.getTable().indexOf(tableItem));
if(null != buttonSelectionListener){
button.addSelectionListener(buttonSelectionListener);
}
tableItem.setData(columnName, button);
tableItem.setData(groupPaneName, buttonPane);
final TableEditor editor = new TableEditor(tableViewer.getTable());
editor.grabHorizontal = true;
editor.grabVertical = true;
editor.setEditor(buttonPane, tableItem, columnIndex);
editor.layout();
button.setData(editorName, editor);
}
示例5: edit
import org.eclipse.swt.custom.TableEditor; //导入方法依赖的package包/类
private void edit(final TableItem item, final TableEditor tableEditor) {
final Text text = new Text(table, SWT.NONE);
text.setText(item.getText(targetColumn));
text.addFocusListener(new FocusAdapter() {
@Override
public void focusLost(final FocusEvent e) {
item.setText(targetColumn, text.getText());
text.dispose();
}
});
tableEditor.setEditor(text, item, targetColumn);
text.setFocus();
text.selectAll();
}
示例6: setTableEditor
import org.eclipse.swt.custom.TableEditor; //导入方法依赖的package包/类
private void setTableEditor(final NormalColumn normalColumn, final TableItem tableItem, final Boolean desc) {
final Button descCheckButton = new Button(indexColumnList, SWT.CHECK);
descCheckButton.pack();
if (DBManagerFactory.getDBManager(table.getDiagram()).isSupported(DBManager.SUPPORT_DESC_INDEX)) {
final TableEditor editor = new TableEditor(indexColumnList);
editor.minimumWidth = descCheckButton.getSize().x;
editor.horizontalAlignment = SWT.CENTER;
editor.setEditor(descCheckButton, tableItem, 1);
columnCheckMap.put(normalColumn, editor);
}
descCheckBoxMap.put(normalColumn, descCheckButton);
descCheckButton.setSelection(desc.booleanValue());
}
示例7: initNodeTable
import org.eclipse.swt.custom.TableEditor; //导入方法依赖的package包/类
private void initNodeTable() {
nodeTable.removeAll();
nodeCheckMap = new HashMap<NodeElement, TableEditor>();
for (final NodeElement nodeElement : diagram.getDiagramContents().getContents()) {
final TableItem tableItem = new TableItem(nodeTable, SWT.NONE);
final Button selectCheckButton = new Button(nodeTable, SWT.CHECK);
selectCheckButton.pack();
final TableEditor editor = new TableEditor(nodeTable);
editor.minimumWidth = selectCheckButton.getSize().x;
editor.horizontalAlignment = SWT.CENTER;
editor.setEditor(selectCheckButton, tableItem, 0);
tableItem.setText(1, ResourceString.getResourceString("label.object.type." + nodeElement.getObjectType()));
tableItem.setText(2, Format.null2blank(nodeElement.getName()));
nodeCheckMap.put(nodeElement, editor);
}
}
示例8: createCheckBoxTableEditor
import org.eclipse.swt.custom.TableEditor; //导入方法依赖的package包/类
public static TableEditor createCheckBoxTableEditor(TableItem tableItem,
boolean selection, int column) {
Table table = tableItem.getParent();
final Button checkBox = new Button(table, SWT.CHECK);
checkBox.pack();
TableEditor editor = new TableEditor(table);
editor.minimumWidth = checkBox.getSize().x;
editor.horizontalAlignment = SWT.CENTER;
editor.setEditor(checkBox, tableItem, column);
checkBox.setSelection(selection);
return editor;
}
示例9: column2TableItem
import org.eclipse.swt.custom.TableEditor; //导入方法依赖的package包/类
private void column2TableItem(NormalColumn referencedColumn) {
TableItem tableItem = new TableItem(this.comparisonTable, SWT.NONE);
tableItem.setText(0,
Format.null2blank(referencedColumn.getLogicalName()));
List<NormalColumn> foreignKeyList = this.referencedMap
.get(referencedColumn.getRootReferencedColumn());
TableEditor tableEditor = new TableEditor(this.comparisonTable);
tableEditor.grabHorizontal = true;
tableEditor.setEditor(this.createForeignKeyCombo(foreignKeyList),
tableItem, 1);
this.tableEditorList.add(tableEditor);
this.editorReferencedMap.put(tableEditor, foreignKeyList);
}
示例10: edit
import org.eclipse.swt.custom.TableEditor; //导入方法依赖的package包/类
private void edit(final TableItem item, final TableEditor tableEditor) {
final Text text = new Text(table, SWT.NONE);
text.setText(item.getText(targetColumn));
text.addFocusListener(new FocusAdapter() {
@Override
public void focusLost(FocusEvent e) {
item.setText(targetColumn, text.getText());
text.dispose();
}
});
tableEditor.setEditor(text, item, targetColumn);
text.setFocus();
text.selectAll();
}
示例11: setTableEditor
import org.eclipse.swt.custom.TableEditor; //导入方法依赖的package包/类
private void setTableEditor(final NormalColumn normalColumn,
TableItem tableItem, Boolean desc) {
Button descCheckButton = new Button(this.indexColumnList, SWT.CHECK);
descCheckButton.pack();
if (DBManagerFactory.getDBManager(this.table.getDiagram()).isSupported(
DBManager.SUPPORT_DESC_INDEX)) {
TableEditor editor = new TableEditor(this.indexColumnList);
editor.minimumWidth = descCheckButton.getSize().x;
editor.horizontalAlignment = SWT.CENTER;
editor.setEditor(descCheckButton, tableItem, 1);
this.columnCheckMap.put(normalColumn, editor);
}
this.descCheckBoxMap.put(normalColumn, descCheckButton);
descCheckButton.setSelection(desc.booleanValue());
}
示例12: edit
import org.eclipse.swt.custom.TableEditor; //导入方法依赖的package包/类
private void edit(final TableItem item, final TableEditor tableEditor) {
final Text text = new Text(table, SWT.NONE);
text.setText(item.getText(targetColumn));
text.addFocusListener(new FocusAdapter() {
@Override
public void focusLost(FocusEvent e) {
item.setText(targetColumn, text.getText());
text.dispose();
}
});
tableEditor.setEditor(text, item, targetColumn);
text.setFocus();
text.selectAll();
}
示例13: initNodeTable
import org.eclipse.swt.custom.TableEditor; //导入方法依赖的package包/类
private void initNodeTable() {
nodeTable.removeAll();
nodeCheckMap = new HashMap<>();
for (final DiagramWalker walker : getTableWalkers()) {
final TableItem tableItem = new TableItem(nodeTable, SWT.NONE);
final Button selectCheckButton = new Button(nodeTable, SWT.CHECK);
selectCheckButton.pack();
final TableEditor editor = new TableEditor(nodeTable);
editor.minimumWidth = selectCheckButton.getSize().x;
editor.horizontalAlignment = SWT.CENTER;
editor.setEditor(selectCheckButton, tableItem, 0);
tableItem.setText(1, DisplayMessages.getMessage("label.object.type." + walker.getObjectType()));
tableItem.setText(2, walker.getName());
nodeCheckMap.put(walker, editor);
}
}
示例14: initNodeTable
import org.eclipse.swt.custom.TableEditor; //导入方法依赖的package包/类
private void initNodeTable() {
nodeTable.removeAll();
nodeCheckMap = new HashMap<>();
for (final DiagramWalker nodeElement : diagram.getDiagramContents().getDiagramWalkers()) {
final TableItem tableItem = new TableItem(nodeTable, SWT.NONE);
final Button selectCheckButton = new Button(nodeTable, SWT.CHECK);
selectCheckButton.pack();
final TableEditor editor = new TableEditor(nodeTable);
editor.minimumWidth = selectCheckButton.getSize().x;
editor.horizontalAlignment = SWT.CENTER;
editor.setEditor(selectCheckButton, tableItem, 0);
tableItem.setText(1, DisplayMessages.getMessage("label.object.type." + nodeElement.getObjectType()));
tableItem.setText(2, nodeElement.getName());
nodeCheckMap.put(nodeElement, editor);
}
}
示例15: updateCellControls
import org.eclipse.swt.custom.TableEditor; //导入方法依赖的package包/类
private void updateCellControls() {
final TableItem[] items = table.getItems();
for (int i = 0; i < items.length; i++) {
TableEditor editor = new TableEditor(table);
final Text text = new Text(table, SWT.NONE);
text.setText(items[i].getText(2));
final int index = i;
text.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
items[index].setText(2, text.getText());
}
});
editor.grabHorizontal = true;
editor.setEditor(text, items[i], 2);
}
}