dialog.jvt
来自「SWT_designer安装软件」· JVT 代码 · 共 60 行
JVT
60 行
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 + =
减小字号Ctrl + -
显示快捷键?