本文整理汇总了Java中org.eclipse.swt.custom.TableEditor.layout方法的典型用法代码示例。如果您正苦于以下问题:Java TableEditor.layout方法的具体用法?Java TableEditor.layout怎么用?Java TableEditor.layout使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.swt.custom.TableEditor
的用法示例。
在下文中一共展示了TableEditor.layout方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: init
import org.eclipse.swt.custom.TableEditor; //导入方法依赖的package包/类
private void init() throws Exception {
InputStream is = null;
// is = Test.class.getResourceAsStream("/LeedsUni10-12-13.ttf");
is = Test.class.getResourceAsStream("/Andron Scriptor Web.ttf");
System.out.println("is = "+is);
font = Font.createFont(Font.TRUETYPE_FONT, is);
font = font.deriveFont(20.0f);
is.close();
System.out.println("font = "+font);
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
ge.registerFont(font);
////////////////////////////
GridData data = new GridData(SWT.FILL, SWT.FILL, true, true);
TableViewer tableViewer = new TableViewer(this, SWT.MULTI | SWT.BORDER | SWT.FULL_SELECTION);
table = tableViewer.getTable();
table.setHeaderVisible(true);
table.setLinesVisible(true);
data.heightHint = 200;
table.setLayoutData(data);
for (int i=0; i<16; i++) {
TableColumn column = new TableColumn (table, SWT.NONE);
column.setText (Integer.toHexString(i));
}
for (int i=0; i<100; ++i) {
TableItem ti = new TableItem(table, SWT.PUSH);
for (int j=0; j<16; ++j)
ti.setText(j, ""+i);
TableEditor editor = new TableEditor(table);
editor.grabHorizontal = true;
editor.grabVertical = true;
int colI = 0;
editor.setEditor(new Button(table, SWT.PUSH), ti, 0);
editor.layout();
editor.getEditor();
}
for (int i=0; i<16; i++) {
table.getColumn (i).pack ();
}
// tableViewer.setLabelProvider(new ColumnLabelProvider() {
// @Override
// public void update(ViewerCell cell) {
// TableItem item = (TableItem) cell.getItem();
//
// Composite buttonPane = new Composite(table, SWT.NONE);
// buttonPane.setLayout(new FillLayout());
//
// Button button = new Button(buttonPane,SWT.NONE);
// button.setText("Edit");
//
// button = new Button(buttonPane,SWT.NONE);
// button.setText("Remove");
//
// button = new Button(buttonPane,SWT.NONE);
// button.setText("Deactivate");
//
// TableEditor editor = new TableEditor(table);
// editor.grabHorizontal = true;
// editor.grabVertical = true;
// int colI = 0;
// editor.setEditor(buttonPane, item, colI);
// editor.layout();
// }
// });
}