[jboss-cvs] jbosside/core/plugins/org.jboss.ide.eclipse.firstrun/src/main/org/jboss/ide/eclipse/firstrun/wizard/pages ...
Robert Stryker
rawblem at gmail.com
Mon Nov 13 18:39:49 EST 2006
User: rawb
Date: 06/11/13 18:39:49
Modified: core/plugins/org.jboss.ide.eclipse.firstrun/src/main/org/jboss/ide/eclipse/firstrun/wizard/pages
FirstRunInfoPage.java FirstRunFinalPage.java
AbstractFirstRunPage.java
Log:
The API has been changed. Three new boolean methods have been added. hasPossibleChanges() returns whether a page performs changes to a workspace
shouldShow() designates whether the page should show anyway, so long as one page hasPossibleChanges()
isDefaultPage() designates that this page should show even if 0 pages return true for hasPossibleChanges()
Revision Changes Path
1.6 +5 -0 jbosside/core/plugins/org.jboss.ide.eclipse.firstrun/src/main/org/jboss/ide/eclipse/firstrun/wizard/pages/FirstRunInfoPage.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: FirstRunInfoPage.java
===================================================================
RCS file: /cvsroot/jboss/jbosside/core/plugins/org.jboss.ide.eclipse.firstrun/src/main/org/jboss/ide/eclipse/firstrun/wizard/pages/FirstRunInfoPage.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- FirstRunInfoPage.java 2 Oct 2006 20:39:35 -0000 1.5
+++ FirstRunInfoPage.java 13 Nov 2006 23:39:49 -0000 1.6
@@ -54,6 +54,11 @@
public void initialize() {
}
+ public boolean hasPossibleChanges() {
+ return false;
+ }
+
+
public void performFinishWithProgress(IProgressMonitor monitor) {
monitor.beginTask("", 1);
monitor.worked(1);
1.6 +4 -0 jbosside/core/plugins/org.jboss.ide.eclipse.firstrun/src/main/org/jboss/ide/eclipse/firstrun/wizard/pages/FirstRunFinalPage.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: FirstRunFinalPage.java
===================================================================
RCS file: /cvsroot/jboss/jbosside/core/plugins/org.jboss.ide.eclipse.firstrun/src/main/org/jboss/ide/eclipse/firstrun/wizard/pages/FirstRunFinalPage.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- FirstRunFinalPage.java 2 Oct 2006 20:39:35 -0000 1.5
+++ FirstRunFinalPage.java 13 Nov 2006 23:39:49 -0000 1.6
@@ -62,4 +62,8 @@
monitor.done();
}
+ public boolean hasPossibleChanges() {
+ return false;
+ }
+
}
1.4 +65 -1 jbosside/core/plugins/org.jboss.ide.eclipse.firstrun/src/main/org/jboss/ide/eclipse/firstrun/wizard/pages/AbstractFirstRunPage.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: AbstractFirstRunPage.java
===================================================================
RCS file: /cvsroot/jboss/jbosside/core/plugins/org.jboss.ide.eclipse.firstrun/src/main/org/jboss/ide/eclipse/firstrun/wizard/pages/AbstractFirstRunPage.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- AbstractFirstRunPage.java 2 Oct 2006 20:39:35 -0000 1.3
+++ AbstractFirstRunPage.java 13 Nov 2006 23:39:49 -0000 1.4
@@ -26,13 +26,77 @@
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.widgets.Composite;
+/**
+ * This class represents a page in the firstRun wizard.
+ *
+ * There are three types of pages.
+ * 1) A page helping a user upgrade a plugin from one version to another.
+ * 2) An introduction / conclusion page to be shown when there is at least one page of type 1
+ * 3) A page to be shown only when zero pages of type 2 occur.
+ *
+ *
+ * For example:
+ * 1) BulkIntroPage ( !hasPossibleChanges, shouldShow, !isDefaultPage )
+ * 2) BulkExitPage ( !hasPossibleChanges, shouldShow, !isDefaultPage )
+ * 3) PackagingUpgradePage ( hasPossibleChanges, ???, !isDefaultPage )
+ * 4) DefaultWelcomePage ( ???, ??? isDefaultPage )
+ *
+ * If PackagingUpgradePage.shouldShow() returns true,
+ * BulkIntroPage, PackagingUpgradePage, and BulkExitPage will all be shown.
+ * DefaultWelcomePage may or may not be shown depending on the value of shouldShow
+ *
+ * If PackagingUpgradePage.shouldShow() returns false,
+ * ONLY DefaultWelcomePage will be shown.
+ *
+ *
+ * @author rob.stryker at jboss.com
+ */
public abstract class AbstractFirstRunPage extends WizardPage {
protected AbstractFirstRunPage(String pageName, String title,
ImageDescriptor titleImage) {
super(pageName, title, titleImage);
}
- public abstract void createControl(Composite parent);
+
+ /* Lifecycle methods */
public abstract void initialize();
+ public abstract void createControl(Composite parent);
public abstract void performFinishWithProgress(IProgressMonitor monitor);
+
+ /**
+ * Indicates whether this page will make some change or upgrade.
+ * Intro / finish pages should return false.
+ *
+ * Other pages with upgradable content should return whether this workspace
+ * has any possibility to upgrade.
+ * @return
+ */
+ public boolean hasPossibleChanges() {
+ return true;
+ }
+
+
+ /**
+ * Should this page be shown even if it contains no upgrade information?
+ * This method allows an intro / finish page to be shown even though it
+ * will make no changes.
+ *
+ * A page for packaging, for example, even if the workspace contains no
+ * upgradable configurations, could still return true simply to inform the
+ * user about the changes to the packaging plug-in.
+ *
+ * @return
+ */
+ public boolean shouldShow() {
+ return true;
+ }
+
+
+ /**
+ * This page is a page to show when zero pages MUST be shown.
+ * @return
+ */
+ public boolean isDefaultPage() {
+ return false;
+ }
}
More information about the jboss-cvs-commits
mailing list