本文整理了Java中org.eclipse.jface.window.Window
类的一些代码示例,展示了Window
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Window
类的具体详情如下:
包路径:org.eclipse.jface.window.Window
类名称:Window
[英]A JFace window is an object that has no visual representation (no widgets) until it is told to open.
Creating a window involves the following steps:
Window
create
(optional)WindowManager.add
(optional)open
The JFace window framework (this package) consists of this class, Window
, the abstract base of all windows, and one concrete window classes (ApplicationWindow
) which may also be subclassed. Clients may define additional window subclasses as required.
The Window
class provides methods that subclasses may override to configure the window, including:
close
- extend to free other SWT resourcesconfigureShell
- extend or reimplement to set shell properties before window openscreateContents
- extend or reimplement to create controls before window opensgetInitialSize
- reimplement to give the initial size for the shellgetInitialLocation
- reimplement to give the initial location for the shellgetShellListener
- extend or reimplement to receive shell eventshandleFontChange
- reimplement to respond to font changeshandleShellCloseEvent
- extend or reimplement to handle shell closingsWindow
的具体子类的实例create
创建窗口的外壳和小部件树(可选)WindowManager.add
将窗口分配给窗口管理器(可选)open
打开窗口Window
组成,它是所有窗口的抽象基础,还有一个具体的窗口类(ApplicationWindow
),也可以是子类。客户端可以根据需要定义其他窗口子类。Window
类提供了子类可以重写以配置窗口的方法,包括:代码示例来源:origin: org.eclipse.platform/org.eclipse.jface
/**
* Creates a window instance, whose shell will be created under the given
* parent shell. Note that the window will have no visual representation
* until it is told to open. By default, <code>open</code> does not block.
*
* @param parentShell
* the parent shell, or <code>null</code> to create a top-level
* shell. Try passing "(Shell)null" to this method instead of "null"
* if your compiler complains about an ambiguity error.
* @see #setBlockOnOpen
* @see #getDefaultOrientation()
*/
protected Window(Shell parentShell) {
this(new SameShellProvider(parentShell));
if(parentShell == null) {
setShellStyle(getShellStyle() | getDefaultOrientation());
}
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench
private void uninitializeImages() {
WorkbenchImages.dispose();
Image[] images = Window.getDefaultImages();
Window.setDefaultImage(null);
for (Image image : images) {
image.dispose();
}
}
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.jface
/**
* Notifies that the window's close button was pressed, the close menu was
* selected, or the ESCAPE key pressed.
* <p>
* The default implementation of this framework method sets the window's
* return code to <code>CANCEL</code> and closes the window using
* <code>close</code>. Subclasses may extend or reimplement.
* </p>
*/
protected void handleShellCloseEvent() {
setReturnCode(CANCEL);
close();
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.jface
@Override
public void shellClosed(ShellEvent event) {
event.doit = false; // don't close now
if (canHandleShellCloseEvent()) {
handleShellCloseEvent();
}
}
};
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface
/**
* Creates this window's widgetry in a new top-level shell.
* <p>
* The default implementation of this framework method creates this window's
* shell (by calling <code>createShell</code>), and its controls (by
* calling <code>createContents</code>), then initializes this window's
* shell bounds (by calling <code>initializeBounds</code>).
* </p>
*/
public void create() {
shell = createShell();
contents = createContents(shell);
//initialize the bounds of the shell to that appropriate for the
// contents
initializeBounds();
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.jface
Shell newParent = getParentShell();
if(newParent != null && newParent.isDisposed()){
parentShell = new SameShellProvider(null);
newParent = getParentShell();//Find a better parent
Shell newShell = new Shell(newParent, getShellStyle());
newShell.addShellListener(getShellListener());
configureShell(newShell);
代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench
@Override
public int getOrientation(){
//By default use the orientation in Window
return Window.getDefaultOrientation();
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface
shell = null;
create();
constrainShellSize();
runEventLoop(shell);
代码示例来源:origin: org.eclipse.platform/org.eclipse.jface
/**
* Attempts to close all windows managed by this window manager,
* as well as windows managed by any descendent window managers.
*
* @return <code>true</code> if all windows were sucessfully closed,
* and <code>false</code> if any window refused to close
*/
public boolean close() {
List<Window> t = new ArrayList<>(windows); // make iteration robust
Iterator<Window> e = t.iterator();
while (e.hasNext()) {
Window window = e.next();
boolean closed = window.close();
if (!closed) {
return false;
}
}
if (subManagers != null) {
Iterator<WindowManager> i = subManagers.iterator();
while (i.hasNext()) {
WindowManager wm = i.next();
boolean closed = wm.close();
if (!closed) {
return false;
}
}
}
return true;
}
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.jface
Image[] defaultImages = getDefaultImages();
if (defaultImages != null && defaultImages.length > 0) {
ArrayList nonDisposedImages = new ArrayList(defaultImages.length);
Layout layout = getLayout();
if (layout != null) {
newShell.setLayout(layout);
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.jface
public void handleEvent( Event event ) {
if( TextSizeUtil.isTemporaryResize() ) {
temporaryResize = true;
} else if( temporaryResize ) {
shell.removeListener( SWT.Resize, this );
initializeBounds();
} else {
shell.removeListener( SWT.Resize, this );
}
}
} );
代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.ide.application
shell.setImages(Window.getDefaultImages());
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface
preferredSize.width, preferredSize.height);
Monitor mon = getClosestMonitor(getShell().getDisplay(), Geometry
.centerPoint(result));
代码示例来源:origin: org.eclipse.platform/org.eclipse.jface
preferredSize.width, preferredSize.height);
Monitor mon = Util.getClosestMonitor(getShell().getDisplay(), Geometry
.centerPoint(result));
代码示例来源:origin: anb0s/EasyShell
dialog.close();
dialog = null;
list, getTitle());
dialog.open();
代码示例来源:origin: org.eclipse.platform/org.eclipse.jface
/**
* Extends the super implementation by creating the trim widgets using <code>createTrimWidgets</code>.
*/
@Override
protected void configureShell(Shell shell) {
super.configureShell(shell);
createTrimWidgets(shell);
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.jface
@Override
public void create() {
super.create();
applyDialogFont(buttonBar);
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface
@Override
protected boolean canHandleShellCloseEvent() {
return super.canHandleShellCloseEvent() && !operationInProgress;
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface
Shell newParent = getParentShell();
if(newParent != null && newParent.isDisposed()){
parentShell = new SameShellProvider(null);
newParent = getParentShell();//Find a better parent
Shell newShell = new Shell(newParent, getShellStyle());
newShell.addShellListener(getShellListener());
configureShell(newShell);
代码示例来源:origin: org.eclipse/org.eclipse.wst.server.ui
public int getOrientation() {
return Window.getDefaultOrientation();
}
}
内容来源于网络,如有侵权,请联系作者删除!