本文整理汇总了Java中org.eclipse.swt.events.ShellListener类的典型用法代码示例。如果您正苦于以下问题:Java ShellListener类的具体用法?Java ShellListener怎么用?Java ShellListener使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ShellListener类属于org.eclipse.swt.events包,在下文中一共展示了ShellListener类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getShellListener
import org.eclipse.swt.events.ShellListener; //导入依赖的package包/类
@Override
protected ShellListener getShellListener() {
return new ShellAdapter() {
@Override
public void shellClosed(final ShellEvent event) {
setReturnCode(Window.CANCEL);
}
};
}
示例2: getShellListener
import org.eclipse.swt.events.ShellListener; //导入依赖的package包/类
protected ShellListener getShellListener()
{
return new ShellAdapter()
{
public void shellClosed(ShellEvent event)
{
event.doit= false; // don't close now
setReturnCode(CANCEL);
close();
}
};
}
示例3: getShellListener
import org.eclipse.swt.events.ShellListener; //导入依赖的package包/类
@Override
protected ShellListener getShellListener() {
return new ShellAdapter() {
@Override
public void shellClosed(final ShellEvent event) {
value = null;
setReturnCode(Window.CANCEL);
}
};
}
示例4: getShellListener
import org.eclipse.swt.events.ShellListener; //导入依赖的package包/类
@Override
protected ShellListener getShellListener() {
return new ShellAdapter() {
@Override
public void shellClosed(final ShellEvent event) {
event.doit = false;
}
};
}
示例5: getShellListener
import org.eclipse.swt.events.ShellListener; //导入依赖的package包/类
@Override
protected ShellListener getShellListener() {
return new ShellAdapter() {
@Override
public void shellClosed(final ShellEvent event) {
maxTimePerIteration = null;
minRecordsPerIteration = null;
setReturnCode(Window.CANCEL);
}
};
}
示例6: open
import org.eclipse.swt.events.ShellListener; //导入依赖的package包/类
@Override
public String open() {
Shell parent = getParent();
Display display = parent.getDisplay();
// create shell
shell = new Shell( parent, SWT.DIALOG_TRIM | SWT.RESIZE | SWT.MAX | SWT.MIN );
shell.setText( BaseMessages.getString( PKG, getTitleKey() ) );
changed = metaInfo.hasChanged();
// create form layout
FormLayout formLayout = new FormLayout();
formLayout.marginHeight = LARGE_MARGIN;
formLayout.marginWidth = LARGE_MARGIN;
shell.setLayout( formLayout );
shell.setMinimumSize( getMinimumWidth(), getMinimumHeight() );
shell.setSize( getMinimumWidth(), getMinimumHeight() );
props.setLook( shell );
setShellImage( shell, (StepMetaInterface) metaInfo );
final Control top = buildStepNameInput( this.shell );
final Composite container = new Composite( shell, SWT.NONE );
container.setLayout( new FormLayout() );
props.setLook( container );
buildContent( container );
Composite buttons = createButtons();
final Label bottomSeparator = new SeparatorBuilder( shell, props )
.setLeftPlacement( LEFT_PLACEMENT )
.setRightPlacement( RIGHT_PLACEMENT )
.build();
( (FormData) bottomSeparator.getLayoutData() ).bottom = new FormAttachment( buttons, -LARGE_MARGIN );
FormData containerLD = new FormData();
containerLD.top = new FormAttachment( top, LARGE_MARGIN );
containerLD.bottom = new FormAttachment( bottomSeparator, -LARGE_MARGIN );
containerLD.left = new FormAttachment( LEFT_PLACEMENT );
containerLD.right = new FormAttachment( RIGHT_PLACEMENT );
container.setLayoutData( containerLD );
stepName.addModifyListener( changeListener );
// listener to detect X or something that kills this window
ShellListener lsShell = new ShellAdapter() {
public void shellClosed( ShellEvent e ) {
cancel();
}
};
shell.addShellListener( lsShell );
// load information (based on previous usage)
loadData( metaInfo );
metaInfo.setChanged( changed );
// set focus on step name
stepName.selectAll();
stepName.setFocus();
// open shell
shell.open();
while ( !shell.isDisposed() ) {
if ( !display.readAndDispatch() ) {
display.sleep();
}
}
return stepname;
}
示例7: getShellListener
import org.eclipse.swt.events.ShellListener; //导入依赖的package包/类
/**
* Returns a shell listener. This shell listener gets registered with this
* window's shell.
* <p>
* The default implementation of this framework method returns a new
* listener that makes this window the active window for its window manager
* (if it has one) when the shell is activated, and calls the framework
* method <code>handleShellCloseEvent</code> when the shell is closed.
* Subclasses may extend or reimplement.
* </p>
*
* @return a shell listener
*/
protected ShellListener getShellListener() {
return new ShellAdapter() {
public void shellClosed(ShellEvent event) {
event.doit = false; // don't close now
if (canHandleShellCloseEvent()) {
handleShellCloseEvent();
}
}
};
}
示例8: addShellListener
import org.eclipse.swt.events.ShellListener; //导入依赖的package包/类
/**
* Adds the listener to the collection of listeners who will be notified
* when operations are performed on the receiver, by sending the listener
* one of the messages defined in the <code>ShellListener</code> interface.
*
* @param listener
* the listener which should be notified
*
* @exception IllegalArgumentException
* <ul>
* <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
* </ul>
* @exception SWTException
* <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been
* disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the
* thread that created the receiver</li>
* </ul>
*
* @see ShellListener
* @see #removeShellListener
*/
public void addShellListener(ShellListener listener) {
checkWidget();
if (listener == null)
error(SWT.ERROR_NULL_ARGUMENT);
TypedListener typedListener = new TypedListener(listener);
addListener(SWT.Close, typedListener);
addListener(SWT.Iconify, typedListener);
addListener(SWT.Deiconify, typedListener);
addListener(SWT.Activate, typedListener);
addListener(SWT.Deactivate, typedListener);
}
示例9: removeShellListener
import org.eclipse.swt.events.ShellListener; //导入依赖的package包/类
/**
* Removes the listener from the collection of listeners who will be
* notified when operations are performed on the receiver.
*
* @param listener
* the listener which should no longer be notified
*
* @exception IllegalArgumentException
* <ul>
* <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
* </ul>
* @exception SWTException
* <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been
* disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the
* thread that created the receiver</li>
* </ul>
*
* @see ShellListener
* @see #addShellListener
*/
public void removeShellListener(ShellListener listener) {
checkWidget();
if (listener == null)
error(SWT.ERROR_NULL_ARGUMENT);
if (eventTable == null)
return;
eventTable.unhook(SWT.Close, listener);
eventTable.unhook(SWT.Iconify, listener);
eventTable.unhook(SWT.Deiconify, listener);
eventTable.unhook(SWT.Activate, listener);
eventTable.unhook(SWT.Deactivate, listener);
}