view2.java

来自「此源码程序实现的是eclipse开发工具中插件的开发实现参考程序」· Java 代码 · 共 32 行

JAVA
32
字号
package cn.com.chengang.myplugin;

import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.part.ViewPart;

public class View2 extends ViewPart {
	private Text text;

	public void createPartControl(Composite parent) {
		Composite topComp = new Composite(parent, SWT.NONE);
		topComp.setLayout(new FillLayout());
		text = new Text(topComp, SWT.BORDER);
		text.setText("我是text框");

	}

	public void setFocus() {}

	// 文本框text相应的Setter/Getter方法
	public Text getText() {
		return text;
	}

	public void setText(Text text) {
		this.text = text;
	}

}

⌨️ 快捷键说明

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