Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 122652 Details for
Bug 260018
[Wizards] [JFace] Method to finsish&close wizard programmatically
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
initial proposal for new IWizardContainer API
wizard.finish.patch.20090115.txt (text/plain), 5.64 KB, created by
Danail Nachev
on 2009-01-15 05:13:27 EST
(
hide
)
Description:
initial proposal for new IWizardContainer API
Filename:
MIME Type:
Creator:
Danail Nachev
Created:
2009-01-15 05:13:27 EST
Size:
5.64 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jface >Index: src/org/eclipse/jface/wizard/WizardDialog.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jface/src/org/eclipse/jface/wizard/WizardDialog.java,v >retrieving revision 1.65 >diff -u -r1.65 WizardDialog.java >--- src/org/eclipse/jface/wizard/WizardDialog.java 24 Mar 2008 19:21:52 -0000 1.65 >+++ src/org/eclipse/jface/wizard/WizardDialog.java 15 Jan 2009 10:11:49 -0000 >@@ -72,7 +72,7 @@ > * required. > * </p> > */ >-public class WizardDialog extends TitleAreaDialog implements IWizardContainer2, >+public class WizardDialog extends TitleAreaDialog implements IWizardContainer3, > IPageChangeProvider { > /** > * Image registry key for error message image (value >@@ -731,24 +731,7 @@ > * The Finish button has been pressed. > */ > protected void finishPressed() { >- // Wizards are added to the nested wizards list in setWizard. >- // This means that the current wizard is always the last wizard in the >- // list. >- // Note that we first call the current wizard directly (to give it a >- // chance to >- // abort, do work, and save state) then call the remaining n-1 wizards >- // in the >- // list (to save state). >- if (wizard.performFinish()) { >- // Call perform finish on outer wizards in the nested chain >- // (to allow them to save state for example) >- for (int i = 0; i < nestedWizards.size() - 1; i++) { >- ((IWizard) nestedWizards.get(i)).performFinish(); >- } >- // Hard close the dialog. >- setReturnCode(OK); >- hardClose(); >- } >+ finishWizard(); > } > > /* >@@ -1509,4 +1492,40 @@ > }); > } > } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.jface.wizard.IWizardContainer3#cancelWizard() >+ */ >+ public boolean cancelWizard() { >+ if (activeRunningOperations > 0) >+ return false; >+ setReturnCode(CANCEL); >+ return close(); >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.jface.wizard.IWizardContainer3#finishWizard() >+ */ >+ public boolean finishWizard() { >+ // Wizards are added to the nested wizards list in setWizard. >+ // This means that the current wizard is always the last wizard in the >+ // list. >+ // Note that we first call the current wizard directly (to give it a >+ // chance to >+ // abort, do work, and save state) then call the remaining n-1 wizards >+ // in the >+ // list (to save state). >+ if (wizard.performFinish()) { >+ // Call perform finish on outer wizards in the nested chain >+ // (to allow them to save state for example) >+ for (int i = 0; i < nestedWizards.size() - 1; i++) { >+ ((IWizard) nestedWizards.get(i)).performFinish(); >+ } >+ // Hard close the dialog. >+ setReturnCode(OK); >+ hardClose(); >+ return true; >+ } >+ return false; >+ } > } >Index: src/org/eclipse/jface/wizard/IWizardContainer3.java >=================================================================== >RCS file: src/org/eclipse/jface/wizard/IWizardContainer3.java >diff -N src/org/eclipse/jface/wizard/IWizardContainer3.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/jface/wizard/IWizardContainer3.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,68 @@ >+/******************************************************************************* >+ * Copyright (c) 2009 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM Corporation - initial API and implementation >+ ******************************************************************************/ >+ >+package org.eclipse.jface.wizard; >+ >+/** >+ * <p> >+ * <code>IWizardContainer3</code> is a supplement to >+ * <code>IWizardContainer</code> that adds methods for finishing and canceling >+ * the contained wizard. >+ * </p> >+ * >+ * <p> >+ * The class <code>WizardDialog</code> provides a fully functional >+ * implementation of this interface which will meet the needs of most clients. >+ * However, clients are also free to implement this interface if >+ * <code>WizardDialog</code> does not suit their needs. >+ * </p> >+ * >+ * @see org.eclipse.jface.wizard.IWizardContainer >+ * @see org.eclipse.jface.wizard.IWizardContainer2 >+ * @since 3.5 >+ */ >+public interface IWizardContainer3 extends IWizardContainer2 { >+ >+ /** >+ * Finishes the contained wizard. >+ * <p> >+ * This method should be used by clients, which wants to finish the wizard >+ * (and execute all complementing actions) in response to some custom action >+ * such as double clicking in a list. >+ * </p> >+ * >+ * @see #cancelWizard() >+ * >+ * @return true if the wizard has finished successfully, false otherwise. >+ * After this method returns true, clients should expect that the >+ * contained wizard and the wizard container itslef have been >+ * disposed and are no longer accessible. >+ */ >+ public boolean finishWizard(); >+ >+ /** >+ * Cancels the contained wizard. >+ * <p> >+ * This method should be used by clients, which wants to cancel the wizard >+ * (and execute all complementing actions) in response to some custom action >+ * such as double clicking in a list. >+ * </p> >+ * >+ * @see #finishWizard() >+ * >+ * @return true if the wizard has accepted the cancel request, false >+ * otherwise. After this method returns true, clients should expect >+ * that the contained wizard and the wizard container itslef have >+ * been disposed and are no longer accessible. >+ */ >+ public boolean cancelWizard(); >+ >+}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 260018
: 122652