本文整理匯總了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();
// }
// });
}