本文整理匯總了Java中org.eclipse.swt.widgets.Shell.pack方法的典型用法代碼示例。如果您正苦於以下問題:Java Shell.pack方法的具體用法?Java Shell.pack怎麽用?Java Shell.pack使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.swt.widgets.Shell
的用法示例。
在下文中一共展示了Shell.pack方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: open
import org.eclipse.swt.widgets.Shell; //導入方法依賴的package包/類
public void open() {
final Shell shell = new Shell(getParent(), getStyle());
shell.setText("Find/replace");
createContents(shell);
shell.pack();
shell.open();
Listener researcherListener = new Listener() {
public void handleEvent(Event event) {
if (resultsIterator != null)
resultsIterator = null;
}
};
text.addListener(SWT.Modify, researcherListener);
Display display = getParent().getDisplay();
while (!shell.isDisposed())
if (!display.readAndDispatch())
display.sleep();
text.removeListener(SWT.Modify, researcherListener);
clearSearchResults();
}
示例2: openWithWaitShell
import org.eclipse.swt.widgets.Shell; //導入方法依賴的package包/類
protected void openWithWaitShell ( final Shell parentShell, final String detailViewId, final Map<String, String> parameters )
{
final Shell waitShell = new Shell ( parentShell, SWT.PRIMARY_MODAL | SWT.BORDER );
waitShell.setLayout ( new FillLayout () );
final Label label = new Label ( waitShell, SWT.NONE );
label.setText ( "Opening view…" );
waitShell.pack ();
waitShell.open ();
// make sure the text is visible
waitShell.getDisplay ().update ();
try
{
open ( parentShell, detailViewId, parameters );
}
finally
{
// close the wait shell
waitShell.close ();
}
}
示例3: createShell
import org.eclipse.swt.widgets.Shell; //導入方法依賴的package包/類
@Override
protected Shell createShell(Display display) throws Exception {
this.viewer = interfaceService.createModelViewer();
Shell shell = new Shell(display);
shell.setText("Point Model");
shell.setLayout(new GridLayout(1, false));
viewer.createPartControl(shell);
shell.pack();
shell.setSize(500, 500);
shell.open();
return shell;
}
示例4: createShell
import org.eclipse.swt.widgets.Shell; //導入方法依賴的package包/類
@Override
protected Shell createShell(Display display) throws Exception {
this.viewer = new ScannableViewer();
Shell shell = new Shell(display);
shell.setText("Monitors");
shell.setLayout(new GridLayout(1, false));
viewer.createPartControl(shell);
shell.pack();
shell.setSize(500, 500);
shell.open();
return shell;
}
示例5: createShell
import org.eclipse.swt.widgets.Shell; //導入方法依賴的package包/類
@Override
protected Shell createShell(Display display) throws Exception {
this.controlTree = getControlTree("control_tree.xml");
this.viewer = new ControlTreeViewer(controlTree, Services.getConnector());
viewer.setUseFilteredTree(false);
Shell shell = new Shell(display);
shell.setText("Control Tree");
shell.setLayout(new GridLayout(1, false));
viewer.createPartControl(shell, controlTree);
shell.pack();
shell.setSize(500, 500);
shell.open();
return shell;
}
示例6: createShell
import org.eclipse.swt.widgets.Shell; //導入方法依賴的package包/類
@Override
protected Shell createShell(Display display) throws Exception {
this.model = new MultiStepModel();
Shell shell = new Shell(display);
shell.setText("Multi-Step");
shell.setLayout(new GridLayout(1, false));
this.ui = new MultiStepComposite(shell, SWT.NONE);
this.controller = BeanService.getInstance().createController(ui, model);
controller.beanToUI();
controller.switchState(true);
this.service = new MockScannableConnector(null);
AnnotationManager manager = new AnnotationManager(Inject.class);
manager.addDevices(ui);
manager.invoke(Inject.class, service, model);
shell.pack();
shell.setSize(500, 500);
shell.open();
return shell;
}
示例7: createShell
import org.eclipse.swt.widgets.Shell; //導入方法依賴的package包/類
@Override
protected Shell createShell(Display display) throws Exception {
this.bbox = new BoundingBox();
bbox.setFastAxisName("stage_x");
bbox.setSlowAxisName("T");
bbox.setFastAxisStart(0);
bbox.setSlowAxisStart(1);
bbox.setFastAxisLength(10);
bbox.setSlowAxisLength(11);
bbox.setRegionName("fred");
this.viewer = interfaceService.createModelViewer();
Shell shell = new Shell(display);
shell.setText("Bounding Box");
shell.setLayout(new GridLayout(1, false));
viewer.createPartControl(shell);
viewer.setModel(bbox);
shell.pack();
shell.setSize(500, 500);
shell.open();
return shell;
}
示例8: createShell
import org.eclipse.swt.widgets.Shell; //導入方法依賴的package包/類
@Override
protected Shell createShell(Display display) throws Exception {
this.config = new SampleData();
config.setName("Sample name");
config.setDescription("Hello World");
this.viewer = interfaceService.createModelViewer();
Shell shell = new Shell(display);
shell.setText("Sample");
shell.setLayout(new GridLayout(1, false));
viewer.createPartControl(shell);
viewer.setModel(config);
shell.pack();
shell.setSize(500, 500);
shell.open();
return shell;
}
示例9: main
import org.eclipse.swt.widgets.Shell; //導入方法依賴的package包/類
public static void main(String[] args) {
Display display = new Display();
Shell shell = new Shell(display);
int formWidth = 750;
int formHeight = 280;
shell.setSize(formWidth, formHeight);
GridLayout gridLayout = new GridLayout(1, true);
gridLayout.makeColumnsEqualWidth = false;
shell.setLayout(gridLayout);
Composite composite = new Composite(shell, SWT.NONE);
composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
DirBrowseComposite dirBrowseComposite2 = new DirBrowseComposite(composite);
dirBrowseComposite2.pack();
DirBrowseComposite dirBrowseComposite3 = new DirBrowseComposite(shell);
dirBrowseComposite3.pack();
shell.pack();
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
}
示例10: open
import org.eclipse.swt.widgets.Shell; //導入方法依賴的package包/類
public void open() {
// Create the dialog window
Shell shell = new Shell(getParent(), getStyle());
shell.setText(getText());
createContents(shell);
shell.pack();
shell.open();
Display display = getParent().getDisplay();
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
}
}
示例11: createShell
import org.eclipse.swt.widgets.Shell; //導入方法依賴的package包/類
@Override
protected Shell createShell(Display display) throws Exception {
this.config = new AxisConfiguration();
config.setApplyModels(true);
config.setApplyRegions(true);
config.setFastAxisName("stage_x");
config.setFastAxisStart(0);
config.setFastAxisEnd(100);
config.setSlowAxisName("stage_y");
config.setSlowAxisStart(-100);
config.setSlowAxisEnd(-200);
config.setMicroscopeImage("C:/tmp/fred.png");
this.viewer = interfaceService.createModelViewer();
Shell shell = new Shell(display);
shell.setText("Scan Area");
shell.setLayout(new GridLayout(1, false));
viewer.createPartControl(shell);
viewer.setModel(config);
shell.pack();
shell.setSize(500, 500);
shell.open();
return shell;
}