sampletableview.java

来自「用java 实现的IE browser适合于学者」· Java 代码 · 共 62 行

JAVA
62
字号
/** * (c) Copyright Mirasol Op'nWorks Inc. 2002, 2003.  * http://www.opnworks.com * Created on June 29, 2003 by lgauthier@opnworks.com *  */package com.hnjchina.example;import org.eclipse.swt.events.SelectionAdapter;import org.eclipse.swt.events.SelectionEvent;import org.eclipse.swt.widgets.Composite;import org.eclipse.ui.part.*;import com.hnjchina.example.tableviewer.TableViewerExample;/** * This sample class demonstrates how to use the TableViewerExample  * inside a workbench view. The view is essentially a wrapper for * the TableViewerExample. It handles the Selection event for the close  * button. */public class SampleTableView extends ViewPart {	private TableViewerExample viewer;	/**	 * The constructor.	 */	public SampleTableView() {	}	/**	 * This is a callback that will allow us	 * to create the viewer and initialize it.	 */	public void createPartControl(Composite parent) {		viewer = new TableViewerExample(parent);		viewer.getCloseButton().addSelectionListener(new SelectionAdapter() {       				// Close the view i.e. dispose of the composite's parent			public void widgetSelected(SelectionEvent e) {				handleDispose();			}		});	}	/**	 * Passing the focus request to the viewer's control.	 */	public void setFocus() {		viewer.getControl().setFocus();	}		/**	 * Handle a 'close' event by disposing of the view	 */	public void handleDispose() {			this.getSite().getPage().hideView(this);	}}

⌨️ 快捷键说明

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