📄 dialog.jvt
字号:
import
org.eclipse.swt.SWT
org.eclipse.swt.widgets.Dialog
org.eclipse.swt.widgets.Display
org.eclipse.swt.widgets.Shell
field
protected Object result;
field
protected Shell shell;
method
/**
* Create the dialog
* @param parent
* @param style
*/
public %TypeName% (Shell parent, int style) {
super (parent, style);
}
method
/**
* Create the dialog
* @param parent
*/
public %TypeName% (Shell parent) {
this (parent, SWT.NONE);
}
method
/**
* Open the dialog
* @return the result
*/
public Object open () {
%CreateMethod%();
%this%shell.open();
%this%shell.layout();
Display display = getParent().getDisplay();
while (!%this%shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
return %this%result;
}
method
/**
* Create contents of the dialog
*/
protected void %CreateMethod%() {
%this%shell = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL);
%this%shell.setSize(%DefaultFormSize%);
%this%shell.setText("SWT Dialog");
%SWTShellLayout%
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -