當前位置: 首頁>>代碼示例>>Java>>正文


Java ShellEvent類代碼示例

本文整理匯總了Java中org.eclipse.swt.events.ShellEvent的典型用法代碼示例。如果您正苦於以下問題:Java ShellEvent類的具體用法?Java ShellEvent怎麽用?Java ShellEvent使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ShellEvent類屬於org.eclipse.swt.events包,在下文中一共展示了ShellEvent類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: configureShell

import org.eclipse.swt.events.ShellEvent; //導入依賴的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.ShellEvent; //導入依賴的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.ShellEvent; //導入依賴的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.ShellEvent; //導入依賴的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: shellDeactivated

import org.eclipse.swt.events.ShellEvent; //導入依賴的package包/類
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();
				}
			}
		});
	}
}
 
開發者ID:apicloudcom,項目名稱:APICloud-Studio,代碼行數:22,代碼來源:PopupCloser.java

示例6: setAutoDownload

import org.eclipse.swt.events.ShellEvent; //導入依賴的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

示例7: createDropDown

import org.eclipse.swt.events.ShellEvent; //導入依賴的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

示例8: createDropDown

import org.eclipse.swt.events.ShellEvent; //導入依賴的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

示例9: checkRollback

import org.eclipse.swt.events.ShellEvent; //導入依賴的package包/類
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();
	}
}
 
開發者ID:icholy,項目名稱:geokettle-2.0,代碼行數:24,代碼來源:RepositoryExplorerDialog.java

示例10: checkCancel

import org.eclipse.swt.events.ShellEvent; //導入依賴的package包/類
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();
	}
}
 
開發者ID:icholy,項目名稱:geokettle-2.0,代碼行數:24,代碼來源:ExecSQLDialog.java

示例11: checkCancel

import org.eclipse.swt.events.ShellEvent; //導入依賴的package包/類
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();
}
  }
 
開發者ID:icholy,項目名稱:geokettle-2.0,代碼行數:24,代碼來源:EnterTextDialog.java

示例12: shellClosed

import org.eclipse.swt.events.ShellEvent; //導入依賴的package包/類
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 );
		}
	}
}
 
開發者ID:eclipse,項目名稱:birt,代碼行數:25,代碼來源:SubtaskSheetImpl.java

示例13: open

import org.eclipse.swt.events.ShellEvent; //導入依賴的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

示例14: minimizeBehavior

import org.eclipse.swt.events.ShellEvent; //導入依賴的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

示例15: addEventListeners

import org.eclipse.swt.events.ShellEvent; //導入依賴的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


注:本文中的org.eclipse.swt.events.ShellEvent類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。