当前位置: 首页>>代码示例>>Java>>正文


Java ILazyContentProvider类代码示例

本文整理汇总了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();
		}
	});
}
 
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:24,代码来源:LocalizationEditor.java

示例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);
}
 
开发者ID:baloise,项目名称:eZooKeeper,代码行数:16,代码来源:ViewerFactory.java

示例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));

}
 
开发者ID:dakaraphi,项目名称:eclipse-plugin-commander,代码行数:28,代码来源:KaviList.java

示例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);
		    }
		}
	}
 
开发者ID:Transkribus,项目名称:TranskribusSwtGui,代码行数:28,代码来源:DocTableWidget.java

示例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();
        }
    });
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:28,代码来源:LocalizationEditor.java


注:本文中的org.eclipse.jface.viewers.ILazyContentProvider类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。