本文整理匯總了Java中org.eclipse.swt.widgets.Shell.setVisible方法的典型用法代碼示例。如果您正苦於以下問題:Java Shell.setVisible方法的具體用法?Java Shell.setVisible怎麽用?Java Shell.setVisible使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.swt.widgets.Shell
的用法示例。
在下文中一共展示了Shell.setVisible方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: show
import org.eclipse.swt.widgets.Shell; //導入方法依賴的package包/類
/**
* Build and show the Windows, dispose it after is is not longer needed.
* @param parentShell The parent windows' Shell.
* @param classLoader The system MugglClassLoader.
* @param classFile The classFile the initial Method belongs to.
* @param method The initial Method.
*/
public void show(Shell parentShell, MugglClassLoader classLoader, ClassFile classFile, Method method) {
try {
this.display = Display.getDefault();
if (createShell(parentShell, classLoader, classFile, method))
this.shell.open();
// Now make the parent shell invisible.
parentShell.setVisible(false);
// Keep the window alive.
while (!this.shell.isDisposed()) {
if (!this.display.readAndDispatch())
this.display.sleep();
}
} catch (Throwable t) {
StaticGuiSupport.processGuiError(t, "Step by step execution", parentShell);
} finally {
//Make the parent shell visible.
parentShell.setVisible(true);
// Make sure execution is aborted. Otherwise the Thread would not be stopped and the memory released after this window is closed.
if (this.stepByStepExecutionComposite != null) this.stepByStepExecutionComposite.abortExecution(false);
doExit();
}
}
示例2: show
import org.eclipse.swt.widgets.Shell; //導入方法依賴的package包/類
/**
* Build and show the Windows, dispose it after is is not longer needed.
* @param parentShell The parent windows' Shell.
* @param classLoader The system MugglClassLoader.
* @param classFile The classFile the initial Method belongs to.
* @param method The initial Method.
*/
public void show(Shell parentShell, MugglClassLoader classLoader, ClassFile classFile, Method method) {
try {
this.parentShell = parentShell;
this.display = Display.getDefault();
if (createShell(parentShell, classLoader, classFile, method))
this.shell.open();
// Now make the parent shell invisible.
parentShell.setVisible(false);
// Keep the window alive.
while (!this.shell.isDisposed()) {
if (!this.display.readAndDispatch())
this.display.sleep();
}
} catch (Throwable t) {
StaticGuiSupport.processGuiError(t, "step by step execution", parentShell);
} finally {
// Make the parent shell visible.
if (!parentShell.isDisposed())
parentShell.setVisible(true);
// Make sure execution is aborted. Otherwise the Thread would not be stopped and the memory released after this window is closed.
if (this.executionComposite != null) this.executionComposite.abortExecution();
doExit();
}
}
示例3: open
import org.eclipse.swt.widgets.Shell; //導入方法依賴的package包/類
/**
* Opens this window, creating it first if it has not yet been created.
* <p>
* This method is reimplemented for special configuration of PopupDialogs.
* It never blocks on open, immediately returning <code>OK</code> if the
* open is successful, or <code>CANCEL</code> if it is not. It provides
* framework hooks that allow subclasses to set the focus and tab order, and
* avoids the use of <code>shell.open()</code> in cases where the focus
* should not be given to the shell initially.
*
* @return the return code
*
* @see org.eclipse.jface.window.Window#open()
*/
public int open() {
Shell shell = getShell();
if (shell == null || shell.isDisposed()) {
shell = null;
// create the window
create();
shell = getShell();
}
// provide a hook for adjusting the bounds. This is only
// necessary when there is content driven sizing that must be
// adjusted each time the dialog is opened.
adjustBounds();
// limit the shell size to the display size
constrainShellSize();
// set up the tab order for the dialog
setTabOrder((Composite) getContents());
// initialize flags for listening to deactivate
listenToDeactivate = false;
listenToParentDeactivate = false;
// open the window
if (takeFocusOnOpen) {
shell.open();
getFocusControl().setFocus();
} else {
shell.setVisible(true);
}
return OK;
}
示例4: open
import org.eclipse.swt.widgets.Shell; //導入方法依賴的package包/類
@Override
public void open() {
UIFunctionsSWT uiFunctions = UIFunctionsManagerSWT.getUIFunctionsSWT();
if (uiFunctions != null) {
Boolean bringToFront = (Boolean)getData( "bringToFront" );
if ( bringToFront == null || bringToFront ){
Shell mainShell = uiFunctions.getMainShell();
if (mainShell != null && mainShell.getMinimized()) {
uiFunctions.bringToFront();
}
}
}
Shell firstShellWithStyle = Utils.findFirstShellWithStyle(SWT.APPLICATION_MODAL);
if (firstShellWithStyle != null && firstShellWithStyle != this) {
// ok, there's a window with application_modal set, which on OSX will mean
// that if we open our window, it will be on top, but users won't be able
// to interact with it. So, wait until the modal window goes away..
firstShellWithStyle.addDisposeListener(new DisposeListener() {
@Override
public void widgetDisposed(DisposeEvent e) {
// wait for dispose to complete, then run open again to check for
// any new application modal shells to wait for
Utils.execSWTThreadLater(0, new AERunnable() {
@Override
public void runSupport() {
AEShell.this.open();
}
});
}
});
firstShellWithStyle.setVisible(true);
firstShellWithStyle.forceActive();
} else {
if (!isDisposed()) {
super.open();
}
}
}