当前位置: 首页>>代码示例>>Java>>正文


Java ShellListener类代码示例

本文整理汇总了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);
        }
    };
}
 
开发者ID:prasser,项目名称:swtpreferences,代码行数:10,代码来源:PreferencesDialog.java

示例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();
		}
	};
}
 
开发者ID:freeVM,项目名称:freeVM,代码行数:13,代码来源:SwtDialog.java

示例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);
        }
    };
}
 
开发者ID:arx-deidentifier,项目名称:arx,代码行数:11,代码来源:DialogTopBottomCoding.java

示例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;
        }
    };
}
 
开发者ID:arx-deidentifier,项目名称:arx,代码行数:10,代码来源:DialogOpenHierarchy.java

示例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);
        }
    };
}
 
开发者ID:arx-deidentifier,项目名称:arx,代码行数:12,代码来源:DialogLocalAnonymization.java

示例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;
}
 
开发者ID:pentaho,项目名称:pdi-platform-utils-plugin,代码行数:72,代码来源:BAServerCommonDialog.java

示例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();
			}
		}
	};
}
 
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:24,代码来源:Window.java

示例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);
}
 
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:35,代码来源:Shell.java

示例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);
}
 
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:35,代码来源:Shell.java


注:本文中的org.eclipse.swt.events.ShellListener类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。