Java 类org.eclipse.swt.events.ShellEvent 实例源码

项目:pgcodekeeper    文件:DbStoreEditorDialog.java   
@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$
            }
        }
    });
}
项目:robotFrameworkDebugger    文件:RobotFrameworkDebuggerUIThread.java   
/**
 * 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();
}
项目:vTM-eclipse    文件:CustomDialog.java   
/**
 * 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;
      }

   } );
}
项目:vTM-eclipse    文件:BrokenZXTMDialog.java   
/**
 * 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; 
      }

   } );
}
项目:APICloud-Studio    文件:PopupCloser.java   
public void shellDeactivated(ShellEvent e)
{
    if (fContentAssistant != null && fDisplay != null)
    {
        fDisplay.asyncExec(new Runnable()
        {
            public void run()
            {
                /*
                 * The asyncExec is a workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=235556 :
                 * fContentAssistant.hasProposalPopupFocus() is still true during the shellDeactivated(..) event.
                 */
                if (fContentAssistant != null && !fContentAssistant.hasProposalPopupFocus()
                        && !isAdditionalInfoInFocus())
                {
                    fContentAssistant.hide();
                }
            }
        });
    }
}
项目:mytourbook    文件:DataTransferWizard.java   
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();
                        }
                    }
                });
            }
        });

    }
项目:mytourbook    文件:DateChooser.java   
/**
 * 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;
}
项目:mytourbook    文件:TimeChooser.java   
/**
 * 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;
}
项目:geokettle-2.0    文件:RepositoryExplorerDialog.java   
public void checkRollback(ShellEvent e)
{
    if (changedInDialog)
    {
        int save = JobGraph.showChangedWarning(shell, "repository");
        if (save == SWT.CANCEL)
        {
            e.doit = false;
        }
        else if (save == SWT.YES)
        {
            commit();
        }
        else
        {
            rollback();
        }
    }
    else
    {
        rollback();
    }
}
项目:geokettle-2.0    文件:ExecSQLDialog.java   
private void checkCancel(ShellEvent e)
{
    if (changedInDialog)
    {
        int save = JobGraph.showChangedWarning(shell, wStepname.getText());
        if (save == SWT.CANCEL)
        {
            e.doit = false;
        }
        else if (save == SWT.YES)
        {
            ok();
        }
        else
        {
            cancel();
        }
    }
    else
    {
        cancel();
    }
}
项目:geokettle-2.0    文件:TableInputDialog.java   
private void checkCancel(ShellEvent e)
{
    if (changedInDialog)
    {
        int save = JobGraph.showChangedWarning(shell, wStepname.getText());
        if (save == SWT.CANCEL)
        {
            e.doit = false;
        }
        else if (save == SWT.YES)
        {
            ok();
        }
        else
        {
            cancel();
        }
    }
    else
    {
        cancel();
    }
}
项目:geokettle-2.0    文件:EnterTextDialog.java   
public void checkCancel(ShellEvent e) {
     String newText = wDesc.getText();
if (!newText.equals(origText))
{
    int save = JobGraph.showChangedWarning(shell, title);
    if (save == SWT.CANCEL)
    {
        e.doit = false;
    }
    else if (save == SWT.YES)
    {
        ok();
    }
    else
    {
        cancel();
    }
}
else
{
    cancel();
}
  }
项目:birt    文件:SubtaskSheetImpl.java   
public void shellClosed( ShellEvent e )
{
    Control focusControl = Display.getDefault( ).getFocusControl( );
    if ( focusControl instanceof Text )
    {
        // Focus saving the text by focus out
        focusControl.notifyListeners( SWT.FocusOut, null );
    }

    if ( e.widget.equals( popupShell ) )
    {
        if ( !POPUP_ATTACHING )
        {
            selectAllButtons( false );
        }

        if ( ChartWizard.POPUP_CLOSING_BY_USER )
        {
            // Clear selection if user closed the popup.
            setCurrentPopupSelection( null );
            getParentTask( ).setPopupSelection( null );
        }
    }
}
项目:read-open-source-code    文件:ExecSQLDialog.java   
private void checkCancel(ShellEvent e)
{
    if (changedInDialog)
    {
        int save = JobGraph.showChangedWarning(shell, wStepname.getText());
        if (save == SWT.CANCEL)
        {
            e.doit = false;
        }
        else if (save == SWT.YES)
        {
            ok();
        }
        else
        {
            cancel();
        }
    }
    else
    {
        cancel();
    }
}
项目:read-open-source-code    文件:TableInputDialog.java   
private void checkCancel(ShellEvent e)
{
    if (changedInDialog)
    {
        int save = JobGraph.showChangedWarning(shell, wStepname.getText());
        if (save == SWT.CANCEL)
        {
            e.doit = false;
        }
        else if (save == SWT.YES)
        {
            ok();
        }
        else
        {
            cancel();
        }
    }
    else
    {
        cancel();
    }
}
项目:read-open-source-code    文件:EnterTextDialog.java   
public void checkCancel(ShellEvent e) {
     String newText = wDesc.getText();
if (!newText.equals(origText))
{
    int save = JobGraph.showChangedWarning(shell, title);
    if (save == SWT.CANCEL)
    {
        e.doit = false;
    }
    else if (save == SWT.YES)
    {
        ok();
    }
    else
    {
        cancel();
    }
}
else
{
    cancel();
}
  }
项目:kettle-4.4.0-stable    文件:ExecSQLDialog.java   
private void checkCancel(ShellEvent e)
{
    if (changedInDialog)
    {
        int save = JobGraph.showChangedWarning(shell, wStepname.getText());
        if (save == SWT.CANCEL)
        {
            e.doit = false;
        }
        else if (save == SWT.YES)
        {
            ok();
        }
        else
        {
            cancel();
        }
    }
    else
    {
        cancel();
    }
}
项目:kettle-4.4.0-stable    文件:TableInputDialog.java   
private void checkCancel(ShellEvent e)
{
    if (changedInDialog)
    {
        int save = JobGraph.showChangedWarning(shell, wStepname.getText());
        if (save == SWT.CANCEL)
        {
            e.doit = false;
        }
        else if (save == SWT.YES)
        {
            ok();
        }
        else
        {
            cancel();
        }
    }
    else
    {
        cancel();
    }
}
项目:kettle-4.4.0-stable    文件:EnterTextDialog.java   
public void checkCancel(ShellEvent e) {
     String newText = wDesc.getText();
if (!newText.equals(origText))
{
    int save = JobGraph.showChangedWarning(shell, title);
    if (save == SWT.CANCEL)
    {
        e.doit = false;
    }
    else if (save == SWT.YES)
    {
        ok();
    }
    else
    {
        cancel();
    }
}
else
{
    cancel();
}
  }
项目:kettle-trunk    文件:ExecSQLDialog.java   
private void checkCancel(ShellEvent e)
{
    if (changedInDialog)
    {
        int save = JobGraph.showChangedWarning(shell, wStepname.getText());
        if (save == SWT.CANCEL)
        {
            e.doit = false;
        }
        else if (save == SWT.YES)
        {
            ok();
        }
        else
        {
            cancel();
        }
    }
    else
    {
        cancel();
    }
}
项目:kettle-trunk    文件:EnterTextDialog.java   
public void checkCancel(ShellEvent e) {
     String newText = wDesc.getText();
if (!newText.equals(origText))
{
    int save = JobGraph.showChangedWarning(shell, title);
    if (save == SWT.CANCEL)
    {
        e.doit = false;
    }
    else if (save == SWT.YES)
    {
        ok();
    }
    else
    {
        cancel();
    }
}
else
{
    cancel();
}
  }
项目:seg.jUCMNav    文件:StubBindingsDialog.java   
/**
 * 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();
}
项目:srimporter    文件:Overview.java   
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
            }
        }
    });
}
项目:cogtool    文件:FrameEditorUI.java   
/**
 * 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();
        }
    });
}
项目:pentaho-kettle    文件:LibFormulaEditor.java   
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;
}
项目:pentaho-cassandra-plugin    文件:CassandraInputDialog.java   
private void checkCancel(ShellEvent e) {
    if (this.changedInDialog) {
        int save = JobGraph.showChangedWarning(this.shell, this.wStepname.getText());
        if (save == 256) {
            e.doit = false;
        } else if (save == 64) {
            ok();
        } else {
            cancel();
        }
    } else {
        cancel();
    }
}
项目:EarthquakeBulletin    文件:TrayIcon.java   
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();
            }
        }
    });
}
项目:logbook    文件:SelectVisibleColumnDialog.java   
@Override
public void shellClosed(ShellEvent e) {
    TreeItem[] items = this.tree.getItems();
    for (int i = 0; i < items.length; i++) {
        this.visibles[i + 1] = items[i].getChecked();
    }
}
项目:logbook    文件:SaveWindowLocationAdapter.java   
@Override
public void shellClosed(ShellEvent e) {
    if (e.widget instanceof Shell) {
        Shell shell = (Shell) e.widget;
        // 最大化の状態では保存しない
        if (!shell.getMaximized()) {
            LayoutLogic.saveWindowLocation(this.dialogClass, shell);
        }
    }
}
项目:swtpreferences    文件:PreferencesDialog.java   
@Override
protected ShellListener getShellListener() {
    return new ShellAdapter() {
        @Override
        public void shellClosed(final ShellEvent event) {
            setReturnCode(Window.CANCEL);
        }
    };
}
项目:SMVHunter    文件:CaptureDisplay.java   
@Override
public void shellClosed(ShellEvent e) {
    e.doit = false;
    sShell.setVisible(false);
    if (sViewNode != null) {
        sViewNode.dereferenceImage();
    }
}
项目:RouterLogger    文件:CloseListener.java   
@Override
public void shellClosed(final ShellEvent event) {
    if (canClose()) {
        disposeShellAndDisplay();
    }
    else if (event != null) {
        event.doit = false;
    }
}
项目:RouterLogger    文件:TrayIcon.java   
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();
            }
        }
    });
}
项目:APICloud-Studio    文件:PopupCloser.java   
public void shellClosed(ShellEvent e)
{
    if (fContentAssistant != null)
    {
        fContentAssistant.hide();
    }
}
项目:Eclipse-Postfix-Code-Completion    文件:JavaReconciler.java   
@Override
public void shellActivated(ShellEvent e) {
    if (!fControl.isDisposed() && fControl.isVisible()) {
        if (hasJavaModelChanged())
            JavaReconciler.this.forceReconciling();
        setEditorActive(true);
    }
}
项目:Eclipse-Postfix-Code-Completion    文件:JavaReconciler.java   
@Override
public void shellDeactivated(ShellEvent e) {
    if (!fControl.isDisposed() && fControl.getShell() == e.getSource()) {
        setJavaModelChanged(false);
        setEditorActive(false);
    }
}
项目:translationstudio8    文件:TermDbManagerDialog.java   
@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();
            }
        }
    });
}
项目:translationstudio8    文件:TmDbManagerDialog.java   
@Override
protected void configureShell(Shell newShell) {
    super.configureShell(newShell);
    newShell.setText(Messages.getString("dialog.TmDbManagerDialog.title"));
    newShell.addShellListener(new ShellAdapter() {
        public void shellActivated(ShellEvent e) {
            if (lastShellSize == null) {
                lastShellSize = getShell().getSize();
            }
        }
    });
}
项目:learning-hadoop    文件:EnterCQLDialog.java   
public void checkCancel(ShellEvent e) {
  String newText = m_cqlText.getText();
  if (!newText.equals(m_originalCQL)) {
    int save = JobGraph.showChangedWarning(m_shell, m_title);
    if (save == SWT.CANCEL) {
      e.doit = false;
    } else if (save == SWT.YES) {
      ok();
    } else {
      cancel();
    }
  } else {
    cancel();
  }
}
项目:DroidNavi    文件:MainWindow.java   
/**
 * Sets up the listeners needed for showing tray
 * icon when shell is minimized.
 */
private void initTrayIconListeners() {
    final MainWindow mw = this;
    getWindowShell().addShellListener(new ShellAdapter() {
        @Override
        public void shellIconified(ShellEvent e) {
            getWindowShell().setVisible(false);
            new TrayIcon(getMainDisplay(), mw);
        }
    });
}