本文整理汇总了Java中org.eclipse.jface.viewers.ILazyContentProvider类的典型用法代码示例。如果您正苦于以下问题:Java ILazyContentProvider类的具体用法?Java ILazyContentProvider怎么用?Java ILazyContentProvider使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ILazyContentProvider类属于org.eclipse.jface.viewers包,在下文中一共展示了ILazyContentProvider类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createTableViewer
import org.eclipse.jface.viewers.ILazyContentProvider; //导入依赖的package包/类
private void createTableViewer() {
table = new Table(tableComposite, SWT.VIRTUAL | SWT.FULL_SELECTION | SWT.MULTI);
tableViewer = new TableViewer(table);
table.setHeaderVisible(true);
toolkit.adapt(table);
toolkit.paintBordersFor(table);
toolkit.adapt(table, true, true);
tableViewer.setContentProvider(new ILazyContentProvider() {
public void updateElement(int index) {
tableViewer.replace(entryList.getKey(index), index);
}
public void dispose() {
}
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
}
});
tableViewer.addDoubleClickListener(new IDoubleClickListener() {
public void doubleClick(DoubleClickEvent event) {
new EditEntryAction().run();
}
});
}
示例2: initTableViewer
import org.eclipse.jface.viewers.ILazyContentProvider; //导入依赖的package包/类
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);
}
示例3: initialize
import org.eclipse.jface.viewers.ILazyContentProvider; //导入依赖的package包/类
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));
}
示例4: DocTableWidget
import org.eclipse.jface.viewers.ILazyContentProvider; //导入依赖的package包/类
public DocTableWidget(Composite parent, int style) {
super(parent, style);
tv = new TableViewer(this, 0);
createColumns();
class ContentProvider implements ILazyContentProvider, IStructuredContentProvider {
@Override public Object[] getElements(Object inputElement) {
return docs.toArray();
}
@Override public void dispose() {
}
@Override public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
System.out.println("inputChanged");
// this.model = (Model) newInput;
}
@Override public void updateElement(int index) {
Object row = docs.get(index);
// row[2] = row[0] + " " + row[1];
tv.replace(row, index);
}
}
}
示例5: createTableViewer
import org.eclipse.jface.viewers.ILazyContentProvider; //导入依赖的package包/类
private void createTableViewer() {
table = new Table(tableComposite, SWT.VIRTUAL | SWT.FULL_SELECTION
| SWT.MULTI);
tableViewer = new TableViewer(table);
table.setHeaderVisible(true);
toolkit.adapt(table);
toolkit.paintBordersFor(table);
toolkit.adapt(table, true, true);
tableViewer.setContentProvider(new ILazyContentProvider() {
public void updateElement(int index) {
tableViewer.replace(entryList.getKey(index), index);
}
public void dispose() {
}
public void inputChanged(Viewer viewer, Object oldInput,
Object newInput) {
}
});
tableViewer.addDoubleClickListener(new IDoubleClickListener() {
public void doubleClick(DoubleClickEvent event) {
new EditEntryAction().run();
}
});
}