filelistview.java

来自「基于Java RCP 应用的属性编辑, 可以对RCP 程序进行属性的设置」· Java 代码 · 共 58 行

JAVA
58
字号
package commonproperties.views;import org.eclipse.jface.viewers.TreeViewer;import org.eclipse.swt.widgets.Composite;import org.eclipse.ui.part.ViewPart;import org.eclipse.ui.views.properties.IPropertySheetPage;import org.eclipse.ui.views.properties.tabbed.ITabbedPropertySheetPageContributor;import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;import commonproperties.tree.FileListTree;/** * This sample class demonstrates how to plug-in a new workbench view. The view * shows data obtained from the model. The sample creates a dummy model on the * fly, but a real implementation would connect to the model available either in * this or another plug-in (e.g. the workspace). The view is connected to the * model using a content provider. * <p> * The view uses a label provider to define how model objects should be * presented in the view. Each view can present the same model objects using * different labels and icons, if needed. Alternatively, a single label provider * can be shared between views in order to ensure that objects of the same type * are presented in the same way everywhere. * <p> */public class FileListView extends ViewPart implements ITabbedPropertySheetPageContributor {	private TreeViewer treeViewer;	@Override	public void createPartControl(Composite parent) {		treeViewer = FileListTree.createFileListTreeViewer(parent);		getSite().setSelectionProvider(treeViewer);	}	@Override	public void setFocus() {	}	public String getContributorId() {		// TODO Auto-generated method stub		return getSite().getId();	}	@Override	public Object getAdapter(Class adapter) {		if(adapter==IPropertySheetPage.class){			return new TabbedPropertySheetPage(this);		}		return super.getAdapter(adapter);	}		}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?