📄 view2.java
字号:
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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -