[jboss-cvs] jbosside/core/plugins/org.jboss.ide.eclipse.firstrun/src/main/org/jboss/ide/eclipse/firstrun ...
Robert Stryker
rawblem at gmail.com
Tue Sep 12 17:25:22 EDT 2006
User: rawb
Date: 06/09/12 17:25:22
Modified: core/plugins/org.jboss.ide.eclipse.firstrun/src/main/org/jboss/ide/eclipse/firstrun
FirstRunPlugin.java FirstRunMessages.properties
FirstRunStartup.java
Log:
Substantial changes, including an extension point, to allow conversion and updates between JBoss IDE versions. Plugins requiring conversions between versions should use this extension point in their own plug-in rather than adding upgrade wizard pages to the firstrun plugin.
Text for upgrade to 2.0 will need to be decided upon. (Pages created, text is fluff)
Revision Changes Path
1.3 +13 -0 jbosside/core/plugins/org.jboss.ide.eclipse.firstrun/src/main/org/jboss/ide/eclipse/firstrun/FirstRunPlugin.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: FirstRunPlugin.java
===================================================================
RCS file: /cvsroot/jboss/jbosside/core/plugins/org.jboss.ide.eclipse.firstrun/src/main/org/jboss/ide/eclipse/firstrun/FirstRunPlugin.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- FirstRunPlugin.java 29 Jan 2006 04:21:00 -0000 1.2
+++ FirstRunPlugin.java 12 Sep 2006 21:25:22 -0000 1.3
@@ -35,6 +35,19 @@
private static FirstRunPlugin plugin;
public static final String FIRST_RUN_PROPERTY = "org.jboss.ide.eclipse.firstrun";
+ public static final String PLUGIN_ID = "org.jboss.ide.eclipse.firstrun";
+ public static final String EXTENSION_WIZARD_PAGE = "FirstRunWizardPage";
+
+
+ public static final String NEW_WORKSPACE = "NEW_WORKSPACE";
+
+ // The largest JBoss IDE version used in this workspace
+ public static final String FIRST_RUN_PROPERTY_LATEST_VERSION =
+ "org.jboss.ide.eclipse.firstrun.latest.version";
+
+ public static final String FIRST_RUN_VERSION_PREFIX =
+ "org.jboss.ide.eclipse.firstrun.version";
+
public static final String ICON_JBOSSIDE_LOGO = "icons/jbosside-logo.png";
1.4 +13 -1 jbosside/core/plugins/org.jboss.ide.eclipse.firstrun/src/main/org/jboss/ide/eclipse/firstrun/FirstRunMessages.properties
(In the diff below, changes in quantity of whitespace are not shown.)
Index: FirstRunMessages.properties
===================================================================
RCS file: /cvsroot/jboss/jbosside/core/plugins/org.jboss.ide.eclipse.firstrun/src/main/org/jboss/ide/eclipse/firstrun/FirstRunMessages.properties,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- FirstRunMessages.properties 18 Aug 2006 19:10:58 -0000 1.3
+++ FirstRunMessages.properties 12 Sep 2006 21:25:22 -0000 1.4
@@ -25,3 +25,15 @@
FinalPage.info=\
The projects you selected will be converted as soon as you press "Finish".\n\n\n\
Thanks for installing JBoss Eclipse IDE 1.6!
\ No newline at end of file
+
+
+
+
+InfoPage20.title=Welcome
+InfoPage20.info=\
+Welcome to the JBoss Eclipse IDE 2.0! Convert stuff here
+
+FinalPage20.title=Finished
+FinalPage20.info=\
+The conversions you've selected will be completed as soon as you press "Finish"\n\n\n\
+Thanks for installing JBoss Eclipse IDE 2.0!
\ No newline at end of file
1.3 +51 -35 jbosside/core/plugins/org.jboss.ide.eclipse.firstrun/src/main/org/jboss/ide/eclipse/firstrun/FirstRunStartup.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: FirstRunStartup.java
===================================================================
RCS file: /cvsroot/jboss/jbosside/core/plugins/org.jboss.ide.eclipse.firstrun/src/main/org/jboss/ide/eclipse/firstrun/FirstRunStartup.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- FirstRunStartup.java 29 Jan 2006 04:21:00 -0000 1.2
+++ FirstRunStartup.java 12 Sep 2006 21:25:22 -0000 1.3
@@ -25,55 +25,71 @@
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IStartup;
+import org.jboss.ide.eclipse.core.CorePlugin;
import org.jboss.ide.eclipse.firstrun.wizard.FirstRunWizard;
import org.jboss.ide.eclipse.packaging.core.PackagingCorePlugin;
import org.jboss.ide.eclipse.xdoclet.run.XDocletRunPlugin;
-public class FirstRunStartup implements IStartup
-{
+public class FirstRunStartup implements IStartup {
- public void earlyStartup()
- {
-
- try
- {
- Display.getDefault().asyncExec(new Runnable()
- {
- public void run()
- {
- try
- {
- // force initialization
- PackagingCorePlugin.getDefault();
- XDocletRunPlugin.getDefault();
+ public void earlyStartup() {
+ try {
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ try {
+ // legacyMethod();
IPreferenceStore store = FirstRunPlugin.getDefault().getPreferenceStore();
- if (!store.contains(FirstRunPlugin.FIRST_RUN_PROPERTY)
- || !store.getBoolean(FirstRunPlugin.FIRST_RUN_PROPERTY))
- {
- FirstRunWizard wizard = new FirstRunWizard();
- WizardDialog dialog = new WizardDialog(null, wizard);
+ String currentVersion = CorePlugin.getCurrentVersion();
+ String workspaceLatest = store.getString(FirstRunPlugin.FIRST_RUN_PROPERTY_LATEST_VERSION);
- dialog.open();
+ // TODO: uncomment
+ // short circuit if already done
+ //int compare = CorePlugin.compare(currentVersion, workspaceLatest);
+ //if( workspaceLatest != null && compare <= 0) return;
+
+ if( workspaceLatest == null ) {
+ // this isn't set... are we at least at 1.6?
+ boolean at16 = false;
+ if (store.contains(FirstRunPlugin.FIRST_RUN_PROPERTY)) {
+ at16 = store.getBoolean(FirstRunPlugin.FIRST_RUN_PROPERTY);
+ }
- // TODO UNCOMMENT ME
- store.setValue(FirstRunPlugin.FIRST_RUN_PROPERTY, true);
+ if( at16 ) {
+ workspaceLatest = "1.6.0.GA";
+ } else {
+ // we're either pre-1.6, or its a new workspace
+ workspaceLatest = FirstRunPlugin.NEW_WORKSPACE;
}
}
- catch (Exception e)
- {
+
+ // Temp
+ workspaceLatest = "1.6.0.GA";
+ showWizard(workspaceLatest);
+
+ store.setValue(FirstRunPlugin.FIRST_RUN_PROPERTY_LATEST_VERSION, currentVersion);
+
+ } catch (Exception e) {
e.printStackTrace();
}
}
});
}
- catch (Exception e)
- {
+ catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
-
}
+
+ private void showWizard(String workspaceLatest) {
+ FirstRunWizard wizard = new FirstRunWizard(workspaceLatest);
+
+ // short circuit if no pages
+ if( wizard.numPages() == 0 ) return;
+
+ WizardDialog dialog = new WizardDialog(null, wizard);
+ dialog.open();
+ }
}
More information about the jboss-cvs-commits
mailing list