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


Java ShellAdapter类代码示例

本文整理汇总了Java中org.eclipse.swt.events.ShellAdapter的典型用法代码示例。如果您正苦于以下问题:Java ShellAdapter类的具体用法?Java ShellAdapter怎么用?Java ShellAdapter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ShellAdapter类属于org.eclipse.swt.events包,在下文中一共展示了ShellAdapter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: configureShell

import org.eclipse.swt.events.ShellAdapter; //导入依赖的package包/类
@Override
protected void configureShell(final Shell newShell) {
    super.configureShell(newShell);
    newShell.setText(Messages.dbStoreEditorDialog_db_store_editor);
    newShell.addShellListener(new ShellAdapter() {

        @Override
        public void shellActivated(ShellEvent e) {
            // one time listener
            newShell.removeShellListener(this);

            if (dbInitial != null){
                txtName.setText(dbInitial.getName());
                txtDbName.setText(dbInitial.getDbName());
                txtDbUser.setText(dbInitial.getDbUser());
                txtDbPass.setText(dbInitial.getDbPass());
                txtDbHost.setText(dbInitial.getDbHost());
                txtDbPort.setText("" + dbInitial.getDbPort()); //$NON-NLS-1$
            }
        }
    });
}
 
开发者ID:pgcodekeeper,项目名称:pgcodekeeper,代码行数:23,代码来源:DbStoreEditorDialog.java

示例2: createContents

import org.eclipse.swt.events.ShellAdapter; //导入依赖的package包/类
/**
 * Create contents of the window.
 */
protected void createContents() {
	shell = new Shell(SWT.SHELL_TRIM & (~SWT.RESIZE));
	shell.setSize(530, 505);
	shell.setText("Robot Framework Debugger");
	shell.setLayout(new GridLayout(1, false));

	// On close window kill RobotFramework Test
	shell.addShellListener(new ShellAdapter() {
		public void shellClosed(ShellEvent e) {
			System.exit(0);
		}
	});
	createToolbar();
	createLabelPanel();

	prefsDialog = new PreferencesDialog(shell, SWT.NONE);

	createTabFolder();
	createCallStackTab();
	createVariablesTab();
	createDocumentationTab();
	createBreakpointsTab();
	createTestResultsTab();
}
 
开发者ID:nspilka,项目名称:robotFrameworkDebugger,代码行数:28,代码来源:RobotFrameworkDebuggerUIThread.java

示例3: configureShell

import org.eclipse.swt.events.ShellAdapter; //导入依赖的package包/类
/**
 * Configure the shell the dialog is displayed in. Sets the title.
 */
/* Override */
protected void configureShell( Shell newShell )
{
   super.configureShell( newShell );
   newShell.setText( title );
   
   newShell.addShellListener( new ShellAdapter() {

      /* Override */
      public void shellClosed( ShellEvent e )
      {
         e.doit = false; // Do NOT close the shell please            
         
         // We should't close the shell, but eclipse seems to do it anyway
         // so we have a special option just in case...
         result = DialogOption.CLOSED_DIALOG;
      }
      
   } );
}
 
开发者ID:brocade,项目名称:vTM-eclipse,代码行数:24,代码来源:CustomDialog.java

示例4: configureShell

import org.eclipse.swt.events.ShellAdapter; //导入依赖的package包/类
/**
 * Setup the shell (sets its title)
 */
/* Override */
protected void configureShell( Shell newShell )
{
   super.configureShell( newShell );
   newShell.setText( ZLang.ZL_ProblemWithZXTMProjectConf );
   newShell.addShellListener( new ShellAdapter() {

      /* Override */
      public void shellClosed( ShellEvent e )
      {
         e.doit = false; // Do NOT close the shell please
         
         // We should't close the shell, but eclipse seems to do it anyway
         // so we have a special option just in case...
         choice = Choice.CLOSED_DIALOG; 
      }
      
   } );
}
 
开发者ID:brocade,项目名称:vTM-eclipse,代码行数:23,代码来源:BrokenZXTMDialog.java

示例5: setAutoDownload

import org.eclipse.swt.events.ShellAdapter; //导入依赖的package包/类
public void setAutoDownload() {

		getContainer().getShell().addShellListener(new ShellAdapter() {
			@Override
			public void shellActivated(final ShellEvent e) {

				Display.getCurrent().asyncExec(new Runnable() {
					public void run() {

						// start downloading
						final boolean importResult = receiveData();

						_dataTransferWizardPage.saveState();

						if (importResult) {
							getContainer().getShell().close();
						}
					}
				});
			}
		});

	}
 
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:24,代码来源:DataTransferWizard.java

示例6: createDropDown

import org.eclipse.swt.events.ShellAdapter; //导入依赖的package包/类
/**
 * Create the dropdown shell and the chooser panel.
 * 
 * @return the created Shell
 */
private Shell createDropDown() {
    Shell dropDown = new Shell(getShell(), SWT.NO_TRIM | SWT.BORDER);
    dropDown.setLayout(new FillLayout());
    _chooserPanel = new DateChooserPanel(dropDown, SWT.NULL | SWT.BORDER, false, true, _locale);
    _chooserPanel.setDate(getDate());
    _chooserPanel.addDateChooserListener(this);
    _chooserPanel.setHolidayEnumerator(_holidayEnumerator);
    _chooserPanel.setAdditionalDayInformationProvider(_dayInformationProvider);
    _chooserPanel.setBackground(getBackground());

    _chooserPanel.addFocusListener(this);
    /*
     * The dropdown should be hidden if the focus gets assigned to any other component. This is accomplished by
     * using a ShellListener and hide the dropdown on deactivation. The drawback of this mechanism is that the mouse
     * event of the deactivation will get lost. This seems to be acceptable.
     */
    dropDown.addShellListener(new ShellAdapter() {
        public void shellDeactivated(ShellEvent event) {
            setDropped(false);
        }
    });
    return dropDown;
}
 
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:29,代码来源:DateChooser.java

示例7: createDropDown

import org.eclipse.swt.events.ShellAdapter; //导入依赖的package包/类
/**
 * Create the dropdown shell and the chooser panel.
 * 
 * @return the created Shell
 */
private Shell createDropDown() {
    Shell dropDown = new Shell(getShell(), SWT.NO_TRIM | SWT.BORDER);
    dropDown.setLayout(new FillLayout());
    _chooserPanel = new TimeChooserPanel(dropDown, SWT.NULL | SWT.BORDER);
    _chooserPanel.setDate(getDate());
    _chooserPanel.addDateChooserListener(this);
    _chooserPanel.setBackground(getBackground());
    _chooserPanel.addFocusListener(this);
    /*
     * The dropdown should be hidden if the focus gets assigned to any other component. This is accomplished by
     * using a ShellListener and hide the dropdown on deactivation. The drawback of this mechanism is that the mouse
     * event of the deactivation will get lost. This seems to be acceptable.
     */
    dropDown.addShellListener(new ShellAdapter() {
        public void shellDeactivated(ShellEvent event) {
            setDropped(false);
        }
    });
    return dropDown;
}
 
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:26,代码来源:TimeChooser.java

示例8: open

import org.eclipse.swt.events.ShellAdapter; //导入依赖的package包/类
/**
 * Open the window with a predefined stub. This is the official way to open this dialog.
 * 
 * @param newStub
 *            The stub to initialize the dialog with.
 * @return the return code
 */
public int open(Stub newStub) {
    create();
    getShell().setActive();
    getShell().setText(Messages.getString("StubBindingsDialog.stubBindings")); //$NON-NLS-1$
    Image image = (JUCMNavPlugin.getImage("icons/Binding16.gif")); //$NON-NLS-1$
    images.add(image);
    getShell().setImage(image);
    getShell().addShellListener(new ShellAdapter() {
        public void shellClosed(ShellEvent e) {
            dispose();
        }
    });
    setStub(newStub);
    updateColumnWidth();
    return super.open();
}
 
开发者ID:McGill-DP-Group,项目名称:seg.jUCMNav,代码行数:24,代码来源:StubBindingsDialog.java

示例9: minimizeBehavior

import org.eclipse.swt.events.ShellAdapter; //导入依赖的package包/类
private void minimizeBehavior(
		@Named(IServiceConstants.ACTIVE_SHELL) final Shell shell) {
	shell.addShellListener(new ShellAdapter() {
		// If the window is minimized hide the window
		public void shellIconified(ShellEvent e) {
			shell.setVisible(false);
		}
	});
	// If user double-clicks on the tray icons the application will be
	// visible again
	trayItem.addListener(SWT.DefaultSelection, new Listener() {
		public void handleEvent(Event event) {

			if (!shell.isVisible()) {
				shell.setMinimized(false);
				shell.setVisible(true);
				// shell.setFullScreen(true); //is making bugs in displaying
				// of menu
			}
		}
	});
}
 
开发者ID:imadk,项目名称:srimporter,代码行数:23,代码来源:Overview.java

示例10: addEventListeners

import org.eclipse.swt.events.ShellAdapter; //导入依赖的package包/类
/**
 * Add the important event listeners to the contents.
 *
 * Includes both the Mouse & Mouse Motion listeners as well as the Keyboard
 *
 */
protected void addEventListeners()
{
    // Add them to the contents.
    InteractionFigure interactionLayer =
        view.getEditor().getInteractionFigure();

    // let mouseState handle delete key events
    interactionLayer.addKeyListener(mouseState);
    getShell().addShellListener(new ShellAdapter() {
        @Override
        public void shellDeactivated(ShellEvent e)
        {
            mouseState.cancelDynamicOperation();
        }
    });
}
 
开发者ID:cogtool,项目名称:cogtool,代码行数:23,代码来源:FrameEditorUI.java

示例11: open

import org.eclipse.swt.events.ShellAdapter; //导入依赖的package包/类
public String open() {
  shell.layout();
  shell.open();

  // Detect X or ALT-F4 or something that kills this window...
  shell.addShellListener( new ShellAdapter() {
    public void shellClosed( ShellEvent e ) {
      cancel();
    }
  } );

  while ( !shell.isDisposed() ) {
    if ( !shell.getDisplay().readAndDispatch() ) {
      shell.getDisplay().sleep();
    }
  }
  return formula;
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:19,代码来源:LibFormulaEditor.java

示例12: TrayIcon

import org.eclipse.swt.events.ShellAdapter; //导入依赖的package包/类
public TrayIcon(final EarthquakeBulletinGui gui) {
	this.gui = gui;
	gui.getShell().addShellListener(new ShellAdapter() {
		@Override
		public void shellIconified(final ShellEvent se) {
			if (configuration.getBoolean(MINIMIZE_TRAY, Defaults.MINIMIZE_TRAY)) {
				iconify();
			}
		}
	});
}
 
开发者ID:Albertus82,项目名称:EarthquakeBulletin,代码行数:12,代码来源:TrayIcon.java

示例13: getShellListener

import org.eclipse.swt.events.ShellAdapter; //导入依赖的package包/类
@Override
protected ShellListener getShellListener() {
    return new ShellAdapter() {
        @Override
        public void shellClosed(final ShellEvent event) {
            setReturnCode(Window.CANCEL);
        }
    };
}
 
开发者ID:prasser,项目名称:swtpreferences,代码行数:10,代码来源:PreferencesDialog.java

示例14: TrayIcon

import org.eclipse.swt.events.ShellAdapter; //导入依赖的package包/类
protected TrayIcon(final RouterLoggerGui gui) {
	this.gui = gui;
	gui.getShell().addShellListener(new ShellAdapter() {
		@Override
		public void shellIconified(ShellEvent e) {
			if (configuration.getBoolean("gui.minimize.tray", Defaults.GUI_MINIMIZE_TRAY)) {
				iconify();
			}
		}
	});
}
 
开发者ID:Albertus82,项目名称:RouterLogger,代码行数:12,代码来源:TrayIcon.java

示例15: configureShell

import org.eclipse.swt.events.ShellAdapter; //导入依赖的package包/类
@Override
protected void configureShell(Shell newShell) {
	super.configureShell(newShell);
	newShell.setText(Messages.getString("dialog.TermDbManagerDialog.title"));
	newShell.addShellListener(new ShellAdapter() {
		public void shellActivated(ShellEvent e) {
			if (lastShellSize == null) {
				lastShellSize = getShell().getSize();
			}
		}
	});
}
 
开发者ID:heartsome,项目名称:translationstudio8,代码行数:13,代码来源:TermDbManagerDialog.java


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