本文整理汇总了Java中org.eclipse.swt.SWT.VIRTUAL属性的典型用法代码示例。如果您正苦于以下问题:Java SWT.VIRTUAL属性的具体用法?Java SWT.VIRTUAL怎么用?Java SWT.VIRTUAL使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.eclipse.swt.SWT
的用法示例。
在下文中一共展示了SWT.VIRTUAL属性的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
public void init(int attributes) {
if (table != null)
throw new InvalidParameterException("init already called on table!");
attributes |= SWT.VIRTUAL;
isVirtual = (attributes & SWT.VIRTUAL) != 0;
table = new Table(parent, attributes);
table.setHeaderVisible(true);
if (oddEvenColors)
enableBasicOddEvenColors();
changeTableLayout(numColumns);
table.setData(this);
if (sortMenu != null)
table.setMenu(sortMenu);
table.setFont(FontShop.tableFont());
initCallbacks();
addKeyBoardListener();
addSelectionListener(this);
}
示例2: InterfacesComponent
/**
* Creates a new interfaces component inside the parent composite using the given model.
*
* @param interfacesContainingModel
* A interface containing model
* @param container
* The component container
*/
public InterfacesComponent(InterfacesContainingModel interfacesContainingModel,
WizardComponentContainer container) {
super(container);
this.model = interfacesContainingModel;
Composite parent = getParentComposite();
Label interfacesLabel = new Label(parent, SWT.NONE);
GridData interfacesLabelGridData = fillLabelDefaults();
interfacesLabelGridData.verticalAlignment = SWT.TOP;
interfacesLabel.setLayoutData(interfacesLabelGridData);
interfacesLabel.setText("Interfaces:");
interfacesTable = new Table(parent, SWT.BORDER | SWT.FULL_SELECTION | SWT.VIRTUAL);
interfacesTable.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
Composite interfacesButtonsComposite = new Composite(parent, SWT.NONE);
interfacesButtonsComposite.setLayoutData(GridDataFactory.fillDefaults().create());
interfacesButtonsComposite.setLayout(GridLayoutFactory.swtDefaults().numColumns(1).margins(0, 0).create());
interfacesAddButton = new Button(interfacesButtonsComposite, SWT.NONE);
interfacesAddButton.setText("Add...");
interfacesAddButton.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).create());
interfacesRemoveButton = new Button(interfacesButtonsComposite, SWT.NONE);
interfacesRemoveButton.setText("Remove");
interfacesRemoveButton.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).create());
setupBindings();
}
示例3: initTableViewer
private static void initTableViewer(TableViewer tableViewer, ElementTypes elementTypes, Object input,
IElementBinding elementBinding) {
IViewerType viewerType = new TableViewerType();
Table table = tableViewer.getTable();
Class<?> contentProviderInterfaceType = IStructuredContentProvider.class;
if ((table.getStyle() & SWT.VIRTUAL) != 0) {
contentProviderInterfaceType = ILazyContentProvider.class;
}
registerTableListeners(table);
initViewer(tableViewer, elementTypes, input, elementBinding, viewerType, contentProviderInterfaceType);
}
示例4: createTable
private void createTable(Composite parent) {
GridData gridData = new GridData();
gridData.horizontalSpan = numColumns;
gridData.horizontalAlignment = GridData.FILL;
gridData.grabExcessHorizontalSpace = true;
gridData.grabExcessVerticalSpace = true;
gridData.verticalAlignment = GridData.FILL;
table = new Table(parent, SWT.VIRTUAL | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
table.setLayoutData(gridData);
table.setHeaderVisible(true);
table.setLinesVisible(true);
}
示例5: createTable
private void createTable() {
GridData gridData = new org.eclipse.swt.layout.GridData();
gridData.horizontalAlignment = org.eclipse.swt.layout.GridData.FILL;
gridData.grabExcessHorizontalSpace = true;
gridData.grabExcessVerticalSpace = true;
gridData.verticalAlignment = org.eclipse.swt.layout.GridData.FILL;
table = new Table(this, SWT.VIRTUAL | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
table.setLayoutData(gridData);
table.setHeaderVisible(true);
table.setLinesVisible(true);
}
示例6: initialize
public void initialize(Composite composite, int defaultOrientation) {
display = composite.getDisplay();
composite.addDisposeListener((DisposeListener) this::dispose);
tableViewer = new TableViewer(composite, SWT.MULTI | SWT.FULL_SELECTION | SWT.VIRTUAL | SWT.NO_BACKGROUND | SWT.DOUBLE_BUFFERED );
table = tableViewer.getTable();
GridData gridData = new GridData();
gridData.verticalAlignment = GridData.FILL;
gridData.horizontalSpan = 2;
gridData.grabExcessHorizontalSpace = true;
gridData.grabExcessVerticalSpace = true;
gridData.horizontalAlignment = GridData.FILL;
tableViewer.getControl().setLayoutData(gridData);
tableViewer.setContentProvider((ILazyContentProvider) rowIndex -> tableViewer.replace(contentProvider().getTableEntries().get(rowIndex), rowIndex));
table.addListener(SWT.Selection, event-> {
TableItem item = (TableItem) event.item;
contentProvider().setCursorIndex(contentProvider().getRowIndex((RankedItem<T>) item.getData()));
handleSelection();
});
composite.getShell().addListener(SWT.Resize, event -> autoAdjustColumnWidths(composite));
// TODO try throttleLast or custom scheduler
//subjectFilter.debounce(0, TimeUnit.MILLISECONDS).subscribe( filter -> handleRefresh(filter));
}
示例7: createTableViewer
public TableViewer createTableViewer(Composite composite, String[] prop,
int[] bounds, int columnWidth,
IStructuredContentProvider iStructuredContentProvider,
ITableLabelProvider iTableLabelProvider) {
final TableViewer tableViewer = new TableViewer(composite, SWT.BORDER
| SWT.MULTI | SWT.FULL_SELECTION | SWT.VIRTUAL);
Table table = tableViewer.getTable();
table.setBounds(bounds[0], bounds[1], bounds[2], bounds[3]);
tableViewer.setContentProvider(iStructuredContentProvider);
tableViewer.setLabelProvider(iTableLabelProvider);
tableViewer.setColumnProperties(prop);
tableViewer.getTable().addTraverseListener(new TraverseListener() {
@Override
public void keyTraversed(TraverseEvent e) {
if (e.keyCode == SWT.ARROW_UP) {
e.doit = false;
} else if (e.keyCode == SWT.ARROW_DOWN) {
e.doit = false;
} else if (e.keyCode == SWT.TRAVERSE_ARROW_NEXT) {
e.doit = false;
} else if (e.keyCode == SWT.TRAVERSE_ARROW_PREVIOUS) {
e.doit = false;
}
}
});
table.setVisible(true);
table.setLinesVisible(true);
table.setHeaderVisible(true);
/*
* createTableColumns(table,prop, columnWidth); CellEditor[] editors
* =createCellEditorList(table,1); tableViewer.setCellEditors(editors);
*/
return tableViewer;
}
示例8: createContent
private void createContent() {
treeViewer = new TMTreeViewer(this, SWT.VIRTUAL | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL | SWT.FULL_SELECTION);
GridData layoutData = new GridData(SWT.FILL, SWT.FILL, true, true);
treeViewer.getControl().setLayoutData(layoutData);
}
示例9: initTreeViewer
private static void initTreeViewer(TreeViewer treeViewer, ElementTypes elementTypes, Object input,
IElementBinding elementBinding) {
IViewerType viewerType = new TreeViewerType();
Class<?> contentProviderInterfaceType = ITreeContentProvider.class;
if ((treeViewer.getTree().getStyle() & SWT.VIRTUAL) != 0) {
contentProviderInterfaceType = ILazyTreeContentProvider.class;
}
initViewer(treeViewer, elementTypes, input, elementBinding, viewerType, contentProviderInterfaceType);
}