update for first preview
diff --git a/plugins/org.eclipse.epp.wizard.model/src/org/eclipse/epp/wizard/model/EPPModelDeserializer.java b/plugins/org.eclipse.epp.wizard.model/src/org/eclipse/epp/wizard/model/EPPModelDeserializer.java index 21ca1e6..2109901 100644 --- a/plugins/org.eclipse.epp.wizard.model/src/org/eclipse/epp/wizard/model/EPPModelDeserializer.java +++ b/plugins/org.eclipse.epp.wizard.model/src/org/eclipse/epp/wizard/model/EPPModelDeserializer.java
@@ -25,6 +25,7 @@ public class EPPModelDeserializer { + private static final String TAG_INFO = "info"; private static final String TAG_DESCRIPTION = "description"; private static final String TAG_SCREEN = "screen"; private static final String TAG_GROUP = "group"; @@ -108,7 +109,7 @@ String groupLabel = groupElement.getAttributeValue( TAG_LABEL ); String groupAlias = groupElement.getAttributeValue( TAG_ALIAS ); String groupIcon = groupElement.getAttributeValue( TAG_ICON ); - String description = groupElement.getChildTextTrim( TAG_DESCRIPTION ); + String description = groupElement.getChildTextTrim( TAG_INFO ); return new Group( groupLabel, groupAlias, groupIcon,
diff --git a/plugins/org.eclipse.epp.wizard.model/src/org/eclipse/epp/wizard/model/Group.java b/plugins/org.eclipse.epp.wizard.model/src/org/eclipse/epp/wizard/model/Group.java index 1daee32..f920024 100644 --- a/plugins/org.eclipse.epp.wizard.model/src/org/eclipse/epp/wizard/model/Group.java +++ b/plugins/org.eclipse.epp.wizard.model/src/org/eclipse/epp/wizard/model/Group.java
@@ -25,11 +25,11 @@ private final String label; private final String alias; private final String icon; - private final String description; + private final String info; - public String getDescription() { - return description; + public String getInfo() { + return info; } public String getIcon() { @@ -52,14 +52,14 @@ public Group( final String label, final String alias, final String icon, - final String description, + final String info, final List<FeatureRef> featureRefs ) { super(); this.label = label; this.alias = alias; this.icon = icon; - this.description = description == null?"":description; + this.info = info == null?"":info; this.featureRefs = featureRefs; for( FeatureRef featureRef : featureRefs ) { featureRef.setParent( this );
diff --git a/plugins/org.eclipse.epp.wizard.model/test/org/eclipse/epp/wizard/model/Model_Test.java b/plugins/org.eclipse.epp.wizard.model/test/org/eclipse/epp/wizard/model/Model_Test.java index c1c89f7..e3ca463 100644 --- a/plugins/org.eclipse.epp.wizard.model/test/org/eclipse/epp/wizard/model/Model_Test.java +++ b/plugins/org.eclipse.epp.wizard.model/test/org/eclipse/epp/wizard/model/Model_Test.java
@@ -42,8 +42,8 @@ Group[] groups = screens[0].getGroups(); assertEquals(5, groups.length); assertEquals("group.png", groups[0].getIcon()); - assertEquals("Classic description", groups[0].getDescription()); - assertEquals("", groups[1].getDescription()); + assertEquals("Classic info", groups[0].getInfo()); + assertEquals("", groups[1].getInfo()); assertEquals("Screen 1", screens[0].getLabel());
diff --git a/plugins/org.eclipse.epp.wizard.model/test/org/eclipse/epp/wizard/model/eppmodel.xml b/plugins/org.eclipse.epp.wizard.model/test/org/eclipse/epp/wizard/model/eppmodel.xml index c2a2b71..bfbbc43 100644 --- a/plugins/org.eclipse.epp.wizard.model/test/org/eclipse/epp/wizard/model/eppmodel.xml +++ b/plugins/org.eclipse.epp.wizard.model/test/org/eclipse/epp/wizard/model/eppmodel.xml
@@ -3,7 +3,7 @@ <structure> <screen label="Screen 1"> <group label="Eclipse Classic" alias="Classic" icon="group.png"> - <description>Classic description</description> + <info>Classic info</info> <featureref id="org.eclipse.rcp" alias="RCP"/> <featureref id="org.eclipse.jdt" alias="JDT"/> <featureref id="org.eclipse.pde" alias="PDE"/>
diff --git a/plugins/org.eclipse.epp.wizard/EPP wizard OSGi.launch b/plugins/org.eclipse.epp.wizard/EPP wizard OSGi.launch index c98175c..2ee9cb8 100644 --- a/plugins/org.eclipse.epp.wizard/EPP wizard OSGi.launch +++ b/plugins/org.eclipse.epp.wizard/EPP wizard OSGi.launch
@@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="UTF-8"?> +<?xml version="1.0" encoding="UTF-8" standalone="no"?> <launchConfiguration type="org.eclipse.pde.ui.EquinoxLauncher"> <booleanAttribute key="append.args" value="true"/> <booleanAttribute key="automaticAdd" value="false"/> @@ -14,10 +14,11 @@ <stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -console"/> <stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/> <stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Declipse.ignoreApp=true -Dosgi.noShutdown=true -Dorg.osgi.service.http.port=8008 -Dorg.eclipse.equinox.http.jetty.context.sessioninactiveinterval=300 -Xms128m -Xmx512m"/> +<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${workspace_loc:org.eclipse.epp.wizard}"/> <stringAttribute key="pde.version" value="3.3"/> <booleanAttribute key="show_selected_only" value="false"/> -<stringAttribute key="target_bundles" value="org.eclipse.core.jobs@default:default,org.eclipse.osgi.services@default:default,org.apache.ant@default:default,javax.servlet@default:default,org.eclipse.core.commands@default:default,org.eclipse.equinox.preferences@default:default,org.eclipse.core.expressions@default:default,org.eclipse.equinox.common@default:default,org.eclipse.equinox.app@default:default,org.eclipse.osgi@:,org.apache.commons.logging@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.core.contenttype@default:default,org.eclipse.core.runtime@default:default"/> +<stringAttribute key="target_bundles" value="org.eclipse.equinox.preferences@default:default,org.apache.commons.logging@default:default,org.eclipse.osgi@:,org.eclipse.core.jobs@default:default,org.eclipse.equinox.app@default:default,org.apache.ant@default:default,javax.servlet@default:default,org.eclipse.core.runtime@default:default,org.eclipse.osgi.services@default:default,org.eclipse.core.expressions@default:default,org.eclipse.core.commands@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.core.contenttype@default:default,org.eclipse.equinox.common@default:default"/> <booleanAttribute key="tracing" value="false"/> <booleanAttribute key="useDefaultConfigArea" value="true"/> -<stringAttribute key="workspace_bundles" value="org.eclipse.equinox.http.jetty@default:default,org.eclipse.epp.wizard@default:default,org.mortbay.jetty@default:default,org.eclipse.epp.wizard.model@default:default,org.eclipse.rap.ui.workbench@default:default,org.jdom@default:default,org.eclipse.equinox.http.registry@default:default,org.eclipse.epp.installerbuilder@default:default,org.eclipse.rap.jface@default:default,org.apache.commons.logging@default:default,javax.servlet@default:default,org.eclipse.equinox.http.servlet@default:default,org.eclipse.rap.ui@default:default,org.eclipse.rap.rwt@default:default,org.eclipse.rap.ui.forms@default:default,org.eclipse.rap.rwt.q07@default:false"/> +<stringAttribute key="workspace_bundles" value="org.eclipse.rap.jface@default:default,org.eclipse.equinox.http.jetty@default:default,org.jdom@default:default,org.eclipse.rap.ui.workbench@default:default,org.eclipse.equinox.http.servlet@default:default,org.eclipse.epp.wizard.installerbuilder@default:default,org.eclipse.equinox.http.registry@default:default,org.eclipse.rap.ui@default:default,org.eclipse.epp.wizard@default:default,javax.servlet@default:default,org.eclipse.rap.rwt.q07@default:false,org.apache.commons.logging@default:default,org.eclipse.epp.wizard.model@default:default,org.eclipse.rap.rwt@default:default,org.mortbay.jetty@default:default"/> </launchConfiguration>
diff --git a/plugins/org.eclipse.epp.wizard/META-INF/MANIFEST.MF b/plugins/org.eclipse.epp.wizard/META-INF/MANIFEST.MF index 9eb50a0..1ec9e27 100644 --- a/plugins/org.eclipse.epp.wizard/META-INF/MANIFEST.MF +++ b/plugins/org.eclipse.epp.wizard/META-INF/MANIFEST.MF
@@ -8,7 +8,7 @@ org.eclipse.rap.ui, org.jdom, org.eclipse.epp.wizard.model, - org.eclipse.epp.installerbuilder, + org.eclipse.epp.wizard.installerbuilder, org.eclipse.equinox.http.servlet Eclipse-LazyStart: true Import-Package: javax.servlet;version="2.4.0",
diff --git a/plugins/org.eclipse.epp.wizard/build.properties b/plugins/org.eclipse.epp.wizard/build.properties index eb7e482..61f0a1e 100644 --- a/plugins/org.eclipse.epp.wizard/build.properties +++ b/plugins/org.eclipse.epp.wizard/build.properties
@@ -2,5 +2,4 @@ output.. = bin/ bin.includes = META-INF/,\ plugin.xml,\ - .,\ - eppmodel.xml + . \ No newline at end of file
diff --git a/plugins/org.eclipse.epp.wizard/data/model/c.png b/plugins/org.eclipse.epp.wizard/data/model/c.png new file mode 100644 index 0000000..5a527be --- /dev/null +++ b/plugins/org.eclipse.epp.wizard/data/model/c.png Binary files differ
diff --git a/plugins/org.eclipse.epp.wizard/data/model/classic.png b/plugins/org.eclipse.epp.wizard/data/model/classic.png new file mode 100644 index 0000000..af53823 --- /dev/null +++ b/plugins/org.eclipse.epp.wizard/data/model/classic.png Binary files differ
diff --git a/plugins/org.eclipse.epp.wizard/data/model/connectors.png b/plugins/org.eclipse.epp.wizard/data/model/connectors.png new file mode 100644 index 0000000..a635086 --- /dev/null +++ b/plugins/org.eclipse.epp.wizard/data/model/connectors.png Binary files differ
diff --git a/plugins/org.eclipse.epp.wizard/data/model/eppmodel.xml b/plugins/org.eclipse.epp.wizard/data/model/eppmodel.xml new file mode 100644 index 0000000..723bab1 --- /dev/null +++ b/plugins/org.eclipse.epp.wizard/data/model/eppmodel.xml
@@ -0,0 +1,282 @@ +<?xml version="1.0" encoding="UTF-8"?> +<eppmodel> + <structure> + <screen label="General"> + <group label="Java" alias="Java" icon="java.png"> + <info> + The classic Eclipse download: the Eclipse Platform, Java Development Tools, and Plug-in Development Environment, including source and both user and programmer documentation. + </info> + <featureref id="epp.java" alias="Java"/> + </group> + <group label="Java EE" alias="JEE" icon="jee.png"> + <info> + The classic Eclipse download: the Eclipse Platform, Java Development Tools, and Plug-in Development Environment, including source and both user and programmer documentation. + </info> + <featureref id="epp.jee" alias="JEE"/> + </group> + <group label="RCP" alias="RCP" icon="classic.png"> + <info> + The classic Eclipse download: the Eclipse Platform, Java Development Tools, and Plug-in Development Environment, including source and both user and programmer documentation. + </info> + <featureref id="epp.rcp" alias="RCP"/> + </group> + <group label="C/C++" alias="C" icon="c.png"> + <info> + The classic Eclipse download: the Eclipse Platform, Java Development Tools, and Plug-in Development Environment, including source and both user and programmer documentation. + </info> + <featureref id="org.eclipse.cdt" alias="CPP"/> + </group> + </screen> + <screen label="Tools"> + <group label="Connectors" alias="Connectors" icon="connectors.png"> + <info> + The classic Eclipse download: the Eclipse Platform, Java Development Tools, and Plug-in Development Environment, including source and both user and programmer documentation. + </info> + <featureref id="epp.subversive" alias="Subversive"/> + </group> + </screen> + <screen label="Stuff"> + <group label="Modelling" alias="Modelling Group" icon="modelling.png"> + <info> + The classic Eclipse download: the Eclipse Platform, Java Development Tools, and Plug-in Development Environment, including source and both user and programmer documentation. + </info> + <featureref id="epp.modeling" alias="Modelling"/> + <featureref id="epp.uml" alias="UML"/> + <featureref id="epp.uml" alias="UML2"/> + <featureref id="epp.uml" alias="UML3"/> + <featureref id="epp.uml" alias="UML4"/> + </group> + <group label="Reporting" alias="Reporting" icon="reporting.png"> + <info> + The classic Eclipse download: the Eclipse Platform, Java Development Tools, and Plug-in Development Environment, including source and both user and programmer documentation. + </info> + <featureref id="epp.reporting" alias="Reporting"/> + </group> + </screen> + </structure> + + <features> + <feature + id="epp.subversive" + version="1.0.0.qualifier"> + <includes id="org.eclipse.team.svn.feature.group"/> + <includes id="org.eclipse.team.svn.resource.ignore.rules.jdt.feature.group"/> + <includes id="org.eclipse.team.svn.mylyn.feature.group"/> + </feature> + <feature + id="epp.rcp" + version="1.0.0.qualifier"> + <includes id="org.eclipse.platform.feature.group"/> + <includes id="org.eclipse.sdk.feature.group"/> + <includes id="org.eclipse.mylyn_feature.feature.group"/> + <includes id="org.eclipse.mylyn.context_feature.feature.group"/> + <includes id="org.eclipse.mylyn.ide_feature.feature.group"/> + <includes id="org.eclipse.mylyn.java_feature.feature.group"/> + <includes id="org.eclipse.mylyn.bugzilla_feature.feature.group"/> + <includes id="org.eclipse.mylyn.pde_feature.feature.group"/> + <includes id="org.eclipse.emf.common.feature.group"/> + <includes id="org.eclipse.emf.common.ui.feature.group"/> + <includes id="org.eclipse.emf.ecore.feature.group"/> + <includes id="org.eclipse.emf.edit.feature.group"/> + <includes id="org.eclipse.emf.ecore.edit.feature.group"/> + <includes id="org.eclipse.emf.edit.ui.feature.group"/> + <includes id="org.eclipse.xsd.feature.group"/> + <includes id="org.eclipse.xsd.edit.feature.group"/> + <includes id="org.eclipse.gef.feature.group"/> + <includes id="org.eclipse.wst.common_ui.feature.feature.group"/> + <includes id="org.eclipse.wst.xml_ui.feature.feature.group"/> + <includes id="org.eclipse.ecf.core.feature.group"/> + <includes id="org.eclipse.ecf.examples.feature.group"/> + <includes id="org.eclipse.epp.usagedata.feature.feature.group"/> + </feature> + <feature + id="epp.java" + version="1.0.0.qualifier"> + <includes id="org.eclipse.platform.feature.group"/> + <includes id="org.eclipse.cvs.feature.group"/> + <includes id="org.eclipse.jdt.feature.group"/> + <includes id="org.eclipse.mylyn_feature.feature.group"/> + <includes id="org.eclipse.mylyn.context_feature.feature.group"/> + <includes id="org.eclipse.mylyn.ide_feature.feature.group"/> + <includes id="org.eclipse.mylyn.java_feature.feature.group"/> + <includes id="org.eclipse.mylyn.bugzilla_feature.feature.group"/> + <includes id="org.eclipse.emf.common.feature.group"/> + <includes id="org.eclipse.emf.common.ui.feature.group"/> + <includes id="org.eclipse.emf.ecore.feature.group"/> + <includes id="org.eclipse.emf.edit.feature.group"/> + <includes id="org.eclipse.emf.ecore.edit.feature.group"/> + <includes id="org.eclipse.emf.edit.ui.feature.group"/> + <includes id="org.eclipse.xsd.feature.group"/> + <includes id="org.eclipse.xsd.edit.feature.group"/> + <includes id="org.eclipse.gef.feature.group"/> + <includes id="org.eclipse.wst.common_ui.feature.feature.group"/> + <includes id="org.eclipse.wst.xml_ui.feature.feature.group"/> + <includes id="org.eclipse.epp.usagedata.feature.feature.group"/> + </feature> + <feature + id="epp.uml" + version="1.0.0.qualifier"/> + + <feature + id="epp.modeling" + version="1.0.0.qualifier"> + <includes id="org.eclipse.sdk.feature.group"/> + <includes id="org.eclipse.emf.sdk.feature.group"/> + <includes id="org.eclipse.xsd.sdk.feature.group"/> + <includes id="org.eclipse.emf.ecore.sdo.sdk.feature.group"/> + <includes id="org.eclipse.emf.emfqtv.all.sdk.feature.group"/> + <includes id="org.eclipse.gef.sdk.feature.group"/> + <includes id="org.eclipse.uml2.sdk.feature.group"/> + <includes id="org.eclipse.uml2tools.sdk.feature.group"/> + <includes id="org.eclipse.ocl.all.sdk.feature.group"/> + <includes id="org.eclipse.gmf.sdk.feature.group"/> + <includes id="org.eclipse.m2m.qvt.oml.sdk.feature.group"/> + <includes id="org.eclipse.m2m.atl.sdk.feature.group"/> + <includes id="org.eclipse.jet.sdk.feature.group"/> + <includes id="org.eclipse.emf.cdo.sdk.feature.group"/> + <includes id="org.eclipse.net4j.sdk.feature.group"/> + <includes id="org.eclipse.emf.teneo.sdk.feature.group"/> --> + <includes id="org.eclipse.emf.search.sdk.feature.group"/> + <includes id="org.eclipse.uml2.diagram.clazz.search.feature.group"/> + <includes id="org.eclipse.emf.ecoretools.diagram.search.feature.group"/> + <includes id="org.eclipse.uml2.search.feature.group"/> + <includes id="org.eclipse.emf.ecoretools.sdk.feature.group"/> + <includes id="org.eclipse.emf.mint.sdk.feature.group"/> + <includes id="org.eclipse.emf.compare.sdk.feature.group"/> + <includes id="org.eclipse.epp.usagedata.feature.feature.group"/> + </feature> + <feature + id="org.eclipse.cdt" + version="1.0.0.qualifier"> + <includes id="org.eclipse.platform.feature.group"/> + <includes id="org.eclipse.cdt.platform.feature.group"/> + <includes id="org.eclipse.cdt.feature.group"/> + <includes id="org.eclipse.cvs.feature.group"/> + <includes id="org.eclipse.mylyn_feature.feature.group"/> + <includes id="org.eclipse.mylyn.context_feature.feature.group"/> + <includes id="org.eclipse.mylyn.ide_feature.feature.group"/> + <includes id="org.eclipse.mylyn.bugzilla_feature.feature.group"/> + <includes id="org.eclipse.cdt.mylyn.feature.group"/> + <includes id="org.eclipse.epp.usagedata.feature.feature.group"/> + </feature> + <feature + id="epp.reporting" + version="1.0.0.qualifier"> + <includes id="org.eclipse.platform.feature.group"/> + <includes id="org.eclipse.cvs.feature.group"/> + <includes id="org.eclipse.jdt.feature.group"/> + <includes id="org.eclipse.pde.feature.group"/> + <includes id="org.eclipse.mylyn_feature.feature.group"/> + <includes id="org.eclipse.mylyn.context_feature.feature.group"/> + <includes id="org.eclipse.mylyn.ide_feature.feature.group"/> + <includes id="org.eclipse.mylyn.java_feature.feature.group"/> + <includes id="org.eclipse.mylyn.pde_feature.feature.group"/> + <includes id="org.eclipse.mylyn.bugzilla_feature.feature.group"/> + <includes id="org.eclipse.emf.common.feature.group"/> + <includes id="org.eclipse.emf.common.ui.feature.group"/> + <includes id="org.eclipse.emf.ecore.feature.group"/> + <includes id="org.eclipse.emf.edit.feature.group"/> + <includes id="org.eclipse.emf.ecore.edit.feature.group"/> + <includes id="org.eclipse.emf.edit.ui.feature.group"/> + <includes id="org.eclipse.xsd.feature.group"/> + <includes id="org.eclipse.xsd.edit.feature.group"/> + <includes id="org.eclipse.gef.feature.group"/> + <includes id="org.eclipse.wst.common_ui.feature.feature.group"/> + <includes id="org.eclipse.wst.xml_ui.feature.feature.group"/> + <includes id="org.eclipse.emf.feature.group"/> + <includes id="org.eclipse.emf.ecore.sdo.feature.group"/> + <includes id="org.eclipse.datatools.connectivity.oda.feature.feature.group"/> + <includes id="org.eclipse.datatools.doc.user.feature.group"/> + <includes id="org.eclipse.datatools.connectivity.oda.designer.feature.feature.group"/> + <includes id="org.eclipse.datatools.modelbase.feature.feature.group"/> + <includes id="org.eclipse.datatools.connectivity.feature.feature.group"/> + <includes id="org.eclipse.datatools.sqldevtools.results.feature.feature.group"/> + <includes id="org.eclipse.datatools.sqldevtools.ddlgen.feature.feature.group"/> + <includes id="org.eclipse.datatools.sqldevtools.ddl.feature.feature.group"/> + <includes id="org.eclipse.datatools.sqldevtools.data.feature.feature.group"/> + <includes id="org.eclipse.datatools.sqldevtools.feature.feature.group"/> + <includes id="org.eclipse.datatools.enablement.jdbc.feature.feature.group"/> + <includes id="org.eclipse.datatools.sqldevtools.parsers.feature.feature.group"/> + <includes id="org.eclipse.datatools.enablement.feature.feature.group"/> + <includes id="org.eclipse.datatools.intro.feature.group"/> + <includes id="org.eclipse.datatools.enablement.apache.derby.feature.feature.group"/> + <includes id="org.eclipse.datatools.enablement.hsqldb.feature.feature.group"/> + <includes id="org.eclipse.datatools.enablement.ibm.feature.feature.group"/> + <includes id="org.eclipse.datatools.enablement.msft.feature.feature.group"/> + <includes id="org.eclipse.datatools.enablement.mysql.feature.feature.group"/> + <includes id="org.eclipse.datatools.enablement.oda.feature.feature.group"/> + <includes id="org.eclipse.datatools.enablement.oda.designer.feature.feature.group"/> + <includes id="org.eclipse.datatools.enablement.oracle.feature.feature.group"/> + <includes id="org.eclipse.datatools.enablement.postgresql.feature.feature.group"/> + <includes id="org.eclipse.datatools.enablement.sap.feature.feature.group"/> + <includes id="org.eclipse.datatools.enablement.sybase.feature.feature.group"/> + <includes id="org.eclipse.wst.feature.group"/> + <includes id="org.eclipse.jst.feature.group"/> + <includes id="org.eclipse.jpt.feature.feature.group"/> + <includes id="com.lowagie.itext.feature.group"/> + <includes id="org.apache.commons.codec.feature.group"/> + <includes id="org.apache.derby.core.feature.group"/> + <includes id="org.mozilla.rhino.feature.group"/> + <includes id="org.w3c.sac.feature.group"/> + <includes id="org.eclipse.birt.feature.group"/> + <includes id="org.eclipse.birt.doc.feature.group"/> + <includes id="org.eclipse.epp.usagedata.feature.feature.group"/> + </feature> + <feature + id="epp.jee" + version="1.0.0.qualifier"> + <includes id="org.eclipse.platform.feature.group"/> + <includes id="org.eclipse.cvs.feature.group"/> + <includes id="org.eclipse.jdt.feature.group"/> + <includes id="org.eclipse.pde.feature.group"/> + <includes id="org.eclipse.mylyn_feature.feature.group"/> + <includes id="org.eclipse.mylyn.context_feature.feature.group"/> + <includes id="org.eclipse.mylyn.ide_feature.feature.group"/> + <includes id="org.eclipse.mylyn.java_feature.feature.group"/> + <includes id="org.eclipse.mylyn.pde_feature.feature.group"/> + <includes id="org.eclipse.mylyn.bugzilla_feature.feature.group"/> + <includes id="org.eclipse.emf.common.feature.group"/> + <includes id="org.eclipse.emf.common.ui.feature.group"/> + <includes id="org.eclipse.emf.ecore.feature.group"/> + <includes id="org.eclipse.emf.edit.feature.group"/> + <includes id="org.eclipse.emf.ecore.edit.feature.group"/> + <includes id="org.eclipse.emf.edit.ui.feature.group"/> + <includes id="org.eclipse.xsd.feature.group"/> + <includes id="org.eclipse.xsd.edit.feature.group"/> + <includes id="org.eclipse.gef.feature.group"/> + <includes id="org.eclipse.wst.common_ui.feature.feature.group"/> + <includes id="org.eclipse.wst.xml_ui.feature.feature.group"/> + <includes id="org.eclipse.emf.feature.group"/> + <includes id="org.eclipse.emf.ecore.sdo.feature.group"/> + <includes id="org.eclipse.datatools.connectivity.oda.feature.feature.group"/> + <includes id="org.eclipse.datatools.doc.user.feature.group"/> + <includes id="org.eclipse.datatools.connectivity.oda.designer.feature.feature.group"/> + <includes id="org.eclipse.datatools.modelbase.feature.feature.group"/> + <includes id="org.eclipse.datatools.connectivity.feature.feature.group"/> + <includes id="org.eclipse.datatools.sqldevtools.results.feature.feature.group"/> + <includes id="org.eclipse.datatools.sqldevtools.ddlgen.feature.feature.group"/> + <includes id="org.eclipse.datatools.sqldevtools.ddl.feature.feature.group"/> + <includes id="org.eclipse.datatools.sqldevtools.data.feature.feature.group"/> + <includes id="org.eclipse.datatools.sqldevtools.feature.feature.group"/> + <includes id="org.eclipse.datatools.enablement.jdbc.feature.feature.group"/> + <includes id="org.eclipse.datatools.sqldevtools.parsers.feature.feature.group"/> + <includes id="org.eclipse.datatools.enablement.feature.feature.group"/> + <includes id="org.eclipse.datatools.enablement.apache.derby.feature.feature.group"/> + <includes id="org.eclipse.datatools.enablement.hsqldb.feature.feature.group"/> + <includes id="org.eclipse.datatools.enablement.ibm.feature.feature.group"/> + <includes id="org.eclipse.datatools.enablement.msft.feature.feature.group"/> + <includes id="org.eclipse.datatools.enablement.mysql.feature.feature.group"/> + <includes id="org.eclipse.datatools.enablement.oda.feature.feature.group"/> + <includes id="org.eclipse.datatools.enablement.oda.designer.feature.feature.group"/> + <includes id="org.eclipse.datatools.enablement.oracle.feature.feature.group"/> + <includes id="org.eclipse.datatools.enablement.postgresql.feature.feature.group"/> + <includes id="org.eclipse.datatools.enablement.sap.feature.feature.group"/> + <includes id="org.eclipse.datatools.enablement.sybase.feature.feature.group"/> + <includes id="org.eclipse.wst.feature.group"/> + <includes id="org.eclipse.jst.feature.group"/> + <includes id="org.eclipse.jpt.feature.feature.group"/> + <includes id="org.eclipse.rse.feature.group"/> + <includes id="org.eclipse.epp.usagedata.feature.feature.group"/> + </feature> + </features> +</eppmodel> \ No newline at end of file
diff --git a/plugins/org.eclipse.epp.wizard/data/model/java.png b/plugins/org.eclipse.epp.wizard/data/model/java.png new file mode 100644 index 0000000..fd2bad8 --- /dev/null +++ b/plugins/org.eclipse.epp.wizard/data/model/java.png Binary files differ
diff --git a/plugins/org.eclipse.epp.wizard/data/model/jee.png b/plugins/org.eclipse.epp.wizard/data/model/jee.png new file mode 100644 index 0000000..3834d6c --- /dev/null +++ b/plugins/org.eclipse.epp.wizard/data/model/jee.png Binary files differ
diff --git a/plugins/org.eclipse.epp.wizard/data/model/reporting.png b/plugins/org.eclipse.epp.wizard/data/model/reporting.png new file mode 100644 index 0000000..12c4fa7 --- /dev/null +++ b/plugins/org.eclipse.epp.wizard/data/model/reporting.png Binary files differ
diff --git a/plugins/org.eclipse.epp.wizard/data/outgoing/ondemand.png b/plugins/org.eclipse.epp.wizard/data/outgoing/ondemand.png new file mode 100644 index 0000000..e30f1da --- /dev/null +++ b/plugins/org.eclipse.epp.wizard/data/outgoing/ondemand.png Binary files differ
diff --git a/plugins/org.eclipse.epp.wizard/data/outgoing/outgoing.properties b/plugins/org.eclipse.epp.wizard/data/outgoing/outgoing.properties new file mode 100644 index 0000000..111765b --- /dev/null +++ b/plugins/org.eclipse.epp.wizard/data/outgoing/outgoing.properties
@@ -0,0 +1,14 @@ +ondemand=Yoxos On Demand +ondemand.description=Even more features and plugins! +ondemand.icon=ondemand.png +ondemand.url=http://yoxos.ka.innoopract:8080/yoxosenterprise/rap?features=%s + +ondemandEnterprise=Yoxos On Demand Enterprise +ondemandEnterprise.description=Even more features and plugins! Even more enterprisey! +ondemandEnterprise.icon=ondemand.png +ondemandEnterprise.url=http://yoxos.ka.innoopract:8080/yoxosenterprise/rap?features=%s + +ondemandExtreme=Yoxos On Demand Extreme +ondemandExtreme.description=Even less NullPointerExceptions! +ondemandExtreme.icon=ondemand.png +ondemandExtreme.url=http://yoxos.ka.innoopract:8080/yoxosenterprise/rap?features=%s \ No newline at end of file
diff --git a/plugins/org.eclipse.epp.wizard/eppwizard.properties b/plugins/org.eclipse.epp.wizard/eppwizard.properties new file mode 100644 index 0000000..4ebbe88 --- /dev/null +++ b/plugins/org.eclipse.epp.wizard/eppwizard.properties
@@ -0,0 +1,3 @@ +model=data/model +outgoing=data/outgoing +downloads=../org.eclipse.epp.wizard.installerbuilder/opt/epp \ No newline at end of file
diff --git a/plugins/org.eclipse.epp.wizard/icons/cb_grayed.png b/plugins/org.eclipse.epp.wizard/icons/cb_grayed.png index da2bf74..c8b8915 100644 --- a/plugins/org.eclipse.epp.wizard/icons/cb_grayed.png +++ b/plugins/org.eclipse.epp.wizard/icons/cb_grayed.png Binary files differ
diff --git a/plugins/org.eclipse.epp.wizard/icons/cb_notselected.png b/plugins/org.eclipse.epp.wizard/icons/cb_notselected.png index d97086a..55f3b26 100644 --- a/plugins/org.eclipse.epp.wizard/icons/cb_notselected.png +++ b/plugins/org.eclipse.epp.wizard/icons/cb_notselected.png Binary files differ
diff --git a/plugins/org.eclipse.epp.wizard/icons/cb_selected.png b/plugins/org.eclipse.epp.wizard/icons/cb_selected.png index 17d75d2..870522b 100644 --- a/plugins/org.eclipse.epp.wizard/icons/cb_selected.png +++ b/plugins/org.eclipse.epp.wizard/icons/cb_selected.png Binary files differ
diff --git a/plugins/org.eclipse.epp.wizard/icons/download.png b/plugins/org.eclipse.epp.wizard/icons/download.png new file mode 100644 index 0000000..4901df8 --- /dev/null +++ b/plugins/org.eclipse.epp.wizard/icons/download.png Binary files differ
diff --git a/plugins/org.eclipse.epp.wizard/icons/expand0.png b/plugins/org.eclipse.epp.wizard/icons/expand0.png index 7eb5d02..f3854bf 100644 --- a/plugins/org.eclipse.epp.wizard/icons/expand0.png +++ b/plugins/org.eclipse.epp.wizard/icons/expand0.png Binary files differ
diff --git a/plugins/org.eclipse.epp.wizard/icons/expand1.png b/plugins/org.eclipse.epp.wizard/icons/expand1.png index 429b9bc..6e2c970 100644 --- a/plugins/org.eclipse.epp.wizard/icons/expand1.png +++ b/plugins/org.eclipse.epp.wizard/icons/expand1.png Binary files differ
diff --git a/plugins/org.eclipse.epp.wizard/icons/group_fallback.png b/plugins/org.eclipse.epp.wizard/icons/group_fallback.png new file mode 100644 index 0000000..011c198 --- /dev/null +++ b/plugins/org.eclipse.epp.wizard/icons/group_fallback.png Binary files differ
diff --git a/plugins/org.eclipse.epp.wizard/icons/map_center-focus.png b/plugins/org.eclipse.epp.wizard/icons/map_center-focus.png new file mode 100644 index 0000000..41e4d8d --- /dev/null +++ b/plugins/org.eclipse.epp.wizard/icons/map_center-focus.png Binary files differ
diff --git a/plugins/org.eclipse.epp.wizard/icons/map_center.png b/plugins/org.eclipse.epp.wizard/icons/map_center.png new file mode 100644 index 0000000..9b0ce82 --- /dev/null +++ b/plugins/org.eclipse.epp.wizard/icons/map_center.png Binary files differ
diff --git a/plugins/org.eclipse.epp.wizard/icons/map_connection.png b/plugins/org.eclipse.epp.wizard/icons/map_connection.png new file mode 100644 index 0000000..379771c --- /dev/null +++ b/plugins/org.eclipse.epp.wizard/icons/map_connection.png Binary files differ
diff --git a/plugins/org.eclipse.epp.wizard/icons/map_left-focus.png b/plugins/org.eclipse.epp.wizard/icons/map_left-focus.png new file mode 100644 index 0000000..8ed8351 --- /dev/null +++ b/plugins/org.eclipse.epp.wizard/icons/map_left-focus.png Binary files differ
diff --git a/plugins/org.eclipse.epp.wizard/icons/map_left.png b/plugins/org.eclipse.epp.wizard/icons/map_left.png new file mode 100644 index 0000000..5d00a28 --- /dev/null +++ b/plugins/org.eclipse.epp.wizard/icons/map_left.png Binary files differ
diff --git a/plugins/org.eclipse.epp.wizard/icons/map_next.png b/plugins/org.eclipse.epp.wizard/icons/map_next.png new file mode 100644 index 0000000..14cbcd5 --- /dev/null +++ b/plugins/org.eclipse.epp.wizard/icons/map_next.png Binary files differ
diff --git a/plugins/org.eclipse.epp.wizard/icons/map_next_off.png b/plugins/org.eclipse.epp.wizard/icons/map_next_off.png new file mode 100644 index 0000000..91d688a --- /dev/null +++ b/plugins/org.eclipse.epp.wizard/icons/map_next_off.png Binary files differ
diff --git a/plugins/org.eclipse.epp.wizard/icons/map_prev.png b/plugins/org.eclipse.epp.wizard/icons/map_prev.png new file mode 100644 index 0000000..f275e1c --- /dev/null +++ b/plugins/org.eclipse.epp.wizard/icons/map_prev.png Binary files differ
diff --git a/plugins/org.eclipse.epp.wizard/icons/map_prev_off.png b/plugins/org.eclipse.epp.wizard/icons/map_prev_off.png new file mode 100644 index 0000000..bcfce5d --- /dev/null +++ b/plugins/org.eclipse.epp.wizard/icons/map_prev_off.png Binary files differ
diff --git a/plugins/org.eclipse.epp.wizard/icons/map_right-focus.png b/plugins/org.eclipse.epp.wizard/icons/map_right-focus.png new file mode 100644 index 0000000..f4b2b89 --- /dev/null +++ b/plugins/org.eclipse.epp.wizard/icons/map_right-focus.png Binary files differ
diff --git a/plugins/org.eclipse.epp.wizard/icons/map_right.png b/plugins/org.eclipse.epp.wizard/icons/map_right.png new file mode 100644 index 0000000..43cb16f --- /dev/null +++ b/plugins/org.eclipse.epp.wizard/icons/map_right.png Binary files differ
diff --git a/plugins/org.eclipse.epp.wizard/icons/map_spacing.png b/plugins/org.eclipse.epp.wizard/icons/map_spacing.png new file mode 100644 index 0000000..c8ea7d2 --- /dev/null +++ b/plugins/org.eclipse.epp.wizard/icons/map_spacing.png Binary files differ
diff --git a/plugins/org.eclipse.epp.wizard/icons/my_selection.png b/plugins/org.eclipse.epp.wizard/icons/my_selection.png new file mode 100644 index 0000000..c26576e --- /dev/null +++ b/plugins/org.eclipse.epp.wizard/icons/my_selection.png Binary files differ
diff --git a/plugins/org.eclipse.epp.wizard/icons/webstart.png b/plugins/org.eclipse.epp.wizard/icons/webstart.png new file mode 100644 index 0000000..f6a4605 --- /dev/null +++ b/plugins/org.eclipse.epp.wizard/icons/webstart.png Binary files differ
diff --git "a/plugins/org.eclipse.epp.wizard/rap_pointer \050apply to org.eclipse.rap.rwt.q07\051.patch" "b/plugins/org.eclipse.epp.wizard/rap_pointer \050apply to org.eclipse.rap.rwt.q07\051.patch" new file mode 100644 index 0000000..a8c1d10 --- /dev/null +++ "b/plugins/org.eclipse.epp.wizard/rap_pointer \050apply to org.eclipse.rap.rwt.q07\051.patch"
@@ -0,0 +1,21 @@ +### Eclipse Workspace Patch 1.0 +#P org.eclipse.rap.rwt.q07 +Index: js/org/eclipse/swt/theme/AppearancesBase.js +=================================================================== +RCS file: /cvsroot/technology/org.eclipse.rap/org.eclipse.rap.rwt.q07/js/org/eclipse/swt/theme/AppearancesBase.js,v +retrieving revision 1.11 +diff -u -r1.11 AppearancesBase.js +--- js/org/eclipse/swt/theme/AppearancesBase.js 12 Jul 2008 17:09:56 -0000 1.11 ++++ js/org/eclipse/swt/theme/AppearancesBase.js 18 Jul 2008 11:43:16 -0000 +@@ -129,6 +129,11 @@ + style : function( states ) { + var tv = new org.eclipse.swt.theme.ThemeValues( states ); + var result = {}; ++ if(states.variant_link) ++ { ++ result.cursor = "pointer"; ++ } ++ + result.font = tv.getFont( "widget.font" ); + if( states.rwt_BORDER ) { + result.border = tv.getBorder( "label.BORDER.border" );
diff --git a/plugins/org.eclipse.epp.wizard/src/org/eclipse/epp/wizard/internal/Activator.java b/plugins/org.eclipse.epp.wizard/src/org/eclipse/epp/wizard/internal/Activator.java index 2239073..21551fb 100644 --- a/plugins/org.eclipse.epp.wizard/src/org/eclipse/epp/wizard/internal/Activator.java +++ b/plugins/org.eclipse.epp.wizard/src/org/eclipse/epp/wizard/internal/Activator.java
@@ -1,15 +1,22 @@ /******************************************************************************* - * Copyright (c) 2008 Innoopract Informationssysteme GmbH. - * 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 + * Copyright (c) 2008 Innoopract Informationssysteme GmbH. 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: + * Innoopract Informationssysteme GmbH - initial API and implementation * * Contributors: * Innoopract Informationssysteme GmbH - initial API and implementation ******************************************************************************/ package org.eclipse.epp.wizard.internal; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.util.Properties; + +import javax.imageio.stream.FileImageInputStream; + import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; import org.eclipse.ui.plugin.AbstractUIPlugin; @@ -20,54 +27,90 @@ */ public class Activator extends AbstractUIPlugin { - // The plug-in ID - public static final String PLUGIN_ID = "org.eclipse.epp.wizard"; + public static final String PROPERTY_CONFIGURATION = "org.eclipse.epp.wizard.configuration"; + public static final String PROPERTY_CONFIGURATION_DEFAULT_VALUE = "eppwizard.properties"; + // The plug-in ID + public static final String PLUGIN_ID = "org.eclipse.epp.wizard"; + // The shared instance + private static Activator plugin; - // The shared instance - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - } + /** + * The constructor + */ + public Activator() { + } - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } + /* + * (non-Javadoc) + * @see + * org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext + * ) + */ + public void start( BundleContext context ) throws Exception { + super.start( context ); + plugin = this; + try + { + getConfiguration(); + } catch (Throwable t) + { + t.printStackTrace(); + throw new RuntimeException("Invalid configuration",t); + } + } - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } + /* + * (non-Javadoc) + * @see + * org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext + * ) + */ + public void stop( BundleContext context ) throws Exception { + plugin = null; + super.stop( context ); + } - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static Activator getDefault() { - return plugin; - } - - public static void log( final Exception exc ) { - IStatus status - = new Status( IStatus.ERROR, PLUGIN_ID, exc.getMessage(), exc ); - getDefault().getLog().log( status ); - } + /** + * Returns the shared instance + * + * @return the shared instance + */ + public static Activator getDefault() { + return plugin; + } - public static void log( final IStatus status ) { - System.err.println( status.getMessage() + "\n" + status.getException() ); - getDefault().getLog().log( status ); - } - + public static void log( final Exception exc ) { + IStatus status = new Status( IStatus.ERROR, + PLUGIN_ID, + exc.getMessage(), + exc ); + getDefault().getLog().log( status ); + } + + public static void log( final IStatus status ) { + System.err.println( status.getMessage() + "\n" + status.getException() ); + getDefault().getLog().log( status ); + } + private Configuration configuration = null; + + public synchronized Configuration getConfiguration() { + if( configuration == null ) { + String configurationFile = System.getProperty( PROPERTY_CONFIGURATION, + PROPERTY_CONFIGURATION_DEFAULT_VALUE ); + System.out.println( "Loading configuration from file: " + + configurationFile ); + Properties properties = new Properties(); + try { + properties.load( new FileInputStream( configurationFile ) ); + configuration = new Configuration(properties); + } catch( FileNotFoundException exc ) { + // TODO Auto-generated catch block + exc.printStackTrace(); + } catch( IOException exc ) { + // TODO Auto-generated catch block + exc.printStackTrace(); + } + } + return configuration; + } }
diff --git a/plugins/org.eclipse.epp.wizard/src/org/eclipse/epp/wizard/internal/Configuration.java b/plugins/org.eclipse.epp.wizard/src/org/eclipse/epp/wizard/internal/Configuration.java new file mode 100644 index 0000000..4bb581a --- /dev/null +++ b/plugins/org.eclipse.epp.wizard/src/org/eclipse/epp/wizard/internal/Configuration.java
@@ -0,0 +1,60 @@ +package org.eclipse.epp.wizard.internal; + +import java.io.File; +import java.util.Properties; + + +public class Configuration { + final static String MODEL = "model"; + final static String OUTGOING = "outgoing"; + + protected File modelDirectory; + protected File outgoingDirectory; + protected OutgoingApiConfiguration outgoingApiConfiguration; + + public OutgoingApiConfiguration getOutgoingApiConfiguration() { + return outgoingApiConfiguration; + } + + private Properties properties; + + public File getModelDirectory() { + return modelDirectory; + } + + public File getOutgoingDirectory() { + return outgoingDirectory; + } + + + public Configuration(Properties properties) + { + this.properties = properties; + modelDirectory = createDirectoryObject(MODEL); + outgoingDirectory = createDirectoryObject(OUTGOING); + loadOutgoingApiConfiguration(); + } + + private void loadOutgoingApiConfiguration() { + outgoingApiConfiguration = new OutgoingApiConfiguration(outgoingDirectory); + + } + + private File createDirectoryObject( String key ) { + String value = properties.getProperty( key ); + if(value == null) + { + throw new RuntimeException("Configuration value for '"+key +"' not defined in configuration properties"); + } + File file = new File(value); + if(!file.canRead()) + { + throw new RuntimeException("Cannot read from file '"+file.getAbsolutePath()+"'"); + } + if(!file.isDirectory()) + { + throw new RuntimeException("'"+file.getAbsolutePath()+"' is not a directory"); + } + return file; + } +}
diff --git a/plugins/org.eclipse.epp.wizard/src/org/eclipse/epp/wizard/internal/OutgoingApiConfiguration.java b/plugins/org.eclipse.epp.wizard/src/org/eclipse/epp/wizard/internal/OutgoingApiConfiguration.java new file mode 100644 index 0000000..825901e --- /dev/null +++ b/plugins/org.eclipse.epp.wizard/src/org/eclipse/epp/wizard/internal/OutgoingApiConfiguration.java
@@ -0,0 +1,77 @@ +package org.eclipse.epp.wizard.internal; + +import java.io.File; +import java.io.FileInputStream; +import java.util.ArrayList; +import java.util.Enumeration; +import java.util.List; +import java.util.Properties; + + +public class OutgoingApiConfiguration { + public static class Entry + { + public String label; + public String description; + public File icon; + + public String getLabel() { + return label; + } + + public String getDescription() { + return description; + } + + public File getIcon() { + return icon; + } + + public String getUrlTemplate() { + return urlTemplate; + } + public Entry( String label, + File icon, + String description, + String urlTemplate ) + { + super(); + this.description = description; + this.icon = icon; + this.label = label; + this.urlTemplate = urlTemplate; + } + public String urlTemplate; + } + + private List<Entry> entries = new ArrayList<Entry>(); + + + public OutgoingApiConfiguration( File outgoingDirectory ) { + Properties properties = new Properties(); + File propertiesFile = new File(outgoingDirectory, "outgoing.properties"); + try { + properties.load( new FileInputStream(propertiesFile )); + Enumeration<String> propertyNames = ( Enumeration<String> )properties.propertyNames(); + while( propertyNames.hasMoreElements() ) { + String key = ( String )propertyNames.nextElement(); + if(!key.contains( "." )) + { + String label = properties.getProperty( key ); + String description = properties.getProperty( key + ".description" ); + String icon = properties.getProperty( key + ".icon" ); + String url = properties.getProperty( key + ".url" ); + Entry entry = new Entry(label,new File(outgoingDirectory, icon ),description, url); + entries.add( entry ); + } + } + } catch( Exception exc ) { + throw new RuntimeException("Could not load configuration file'"+propertiesFile.getAbsolutePath()+"'", exc); + } + } + + + public List<Entry> getEntries() { + return entries; + } +}
diff --git a/plugins/org.eclipse.epp.wizard/src/org/eclipse/epp/wizard/internal/Wishlist.java b/plugins/org.eclipse.epp.wizard/src/org/eclipse/epp/wizard/internal/Wishlist.java index 0cadcc9..48982c2 100644 --- a/plugins/org.eclipse.epp.wizard/src/org/eclipse/epp/wizard/internal/Wishlist.java +++ b/plugins/org.eclipse.epp.wizard/src/org/eclipse/epp/wizard/internal/Wishlist.java
@@ -1,9 +1,9 @@ /******************************************************************************* - * Copyright (c) 2008 Innoopract Informationssysteme GmbH. - * 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 + * Copyright (c) 2008 Innoopract Informationssysteme GmbH. 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: + * Innoopract Informationssysteme GmbH - initial API and implementation * * Contributors: * Innoopract Informationssysteme GmbH - initial API and implementation @@ -13,13 +13,17 @@ import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; +import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Set; +import org.eclipse.epp.wizard.model.EPPModel; import org.eclipse.epp.wizard.model.FeatureRef; import org.eclipse.epp.wizard.model.Group; +import org.eclipse.epp.wizard.model.Screen; +import org.eclipse.epp.wizard.util.StringUtil; import org.eclipse.rwt.SessionSingletonBase; /** @@ -27,182 +31,215 @@ */ public class Wishlist extends SessionSingletonBase { - public static enum Inclusion { - FULL, PARTIAL, NONE - } + public static enum Inclusion { + FULL, PARTIAL, NONE + } + private Set<Group> groups = new HashSet<Group>(); + private Set<FeatureRef> featureRefs = new HashSet<FeatureRef>(); + private List<IWishlistListener> listeners = new ArrayList<IWishlistListener>(); + private EPPModel model = null; + private HashMap<String, FeatureRef> featureRefMap; - private Set<Group> groups = new HashSet<Group>(); - private Set<FeatureRef> featureRefs = new HashSet<FeatureRef>(); - private List<IWishlistListener> listeners = new ArrayList<IWishlistListener>(); + Wishlist() { + // prevent instantiation + } - Wishlist() { - // prevent instantiation - } + public static Wishlist getDefault() { + return ( Wishlist )getInstance( Wishlist.class ); + } - public static Wishlist getDefault() { - return (Wishlist) getInstance(Wishlist.class); - } - - public Group[] getGroups() - { - List<Group> groupList = new ArrayList<Group>(groups); - Collections.sort(groupList, new Comparator<Group>() - { + public Group[] getGroups() { + List<Group> groupList = new ArrayList<Group>( groups ); + Collections.sort( groupList, new Comparator<Group>() { - public int compare(Group o1, Group o2) { - return o1.getLabel().compareTo(o2.getLabel()); - } - - }); - return groupList.toArray(new Group[groupList.size()]); - } + public int compare( Group o1, Group o2 ) { + return o1.getLabel().compareTo( o2.getLabel() ); + } + } ); + return groupList.toArray( new Group[ groupList.size() ] ); + } - public FeatureRef[] getFeatureRefs() - { - return featureRefs.toArray(new FeatureRef[featureRefs.size()]); - } + public FeatureRef[] getFeatureRefs() { + return featureRefs.toArray( new FeatureRef[ featureRefs.size() ] ); + } - public void add(final Group group) { - groups.add(group); - for(FeatureRef featureRef: group.getFeatureRefs()) - { - featureRefs.remove(featureRef); - } - fireChange(); - } + public void add( final Group group ) { + groups.add( group ); + for( FeatureRef featureRef : group.getFeatureRefs() ) { + featureRefs.remove( featureRef ); + } + fireChange(); + } - public void remove(final Group group) { - groups.remove(group); - for(FeatureRef featureRef: group.getFeatureRefs()) - { - featureRefs.remove(featureRef); - } - fireChange(); - } + public void remove( final Group group ) { + groups.remove( group ); + for( FeatureRef featureRef : group.getFeatureRefs() ) { + featureRefs.remove( featureRef ); + } + fireChange(); + } - public void add(final FeatureRef featureRef) { - if (!groups.contains(featureRef.getParent())) { - featureRefs.add(featureRef); - List<FeatureRef> includedSiblings = includedFeatureRefsInGroup(featureRef - .getParent()); - FeatureRef[] siblingFeatureRefs = featureRef.getParent() - .getFeatureRefs(); - if (includedSiblings.size() == siblingFeatureRefs.length) { - // all included - groups.add(featureRef.getParent()); - for (FeatureRef siblingFeatureRef : siblingFeatureRefs) { - featureRefs.remove(siblingFeatureRef); - } - } - fireChange(); - } - } + public void add( final FeatureRef featureRef ) { + if( !groups.contains( featureRef.getParent() ) ) { + featureRefs.add( featureRef ); + List<FeatureRef> includedSiblings = includedFeatureRefsInGroup( featureRef.getParent() ); + FeatureRef[] siblingFeatureRefs = featureRef.getParent().getFeatureRefs(); + if( includedSiblings.size() == siblingFeatureRefs.length ) { + // all included + groups.add( featureRef.getParent() ); + for( FeatureRef siblingFeatureRef : siblingFeatureRefs ) { + featureRefs.remove( siblingFeatureRef ); + } + } + fireChange(); + } + } - private List<FeatureRef> includedFeatureRefsInGroup(Group group) { - List<FeatureRef> result = new ArrayList<FeatureRef>(); - for (FeatureRef featureRef : group.getFeatureRefs()) { - if (featureRefs.contains(featureRef)) { - result.add(featureRef); - } - } - return result; - } + private List<FeatureRef> includedFeatureRefsInGroup( Group group ) { + List<FeatureRef> result = new ArrayList<FeatureRef>(); + for( FeatureRef featureRef : group.getFeatureRefs() ) { + if( featureRefs.contains( featureRef ) ) { + result.add( featureRef ); + } + } + return result; + } - public void remove(final FeatureRef featureRef) { - if(groups.contains(featureRef.getParent())) - { - groups.remove(featureRef.getParent()); - for(FeatureRef siblingFeatureRef: featureRef.getParent().getFeatureRefs()) - { - featureRefs.add(siblingFeatureRef); - } - } - featureRefs.remove(featureRef); - fireChange(); - } + public void remove( final FeatureRef featureRef ) { + if( groups.contains( featureRef.getParent() ) ) { + groups.remove( featureRef.getParent() ); + for( FeatureRef siblingFeatureRef : featureRef.getParent() + .getFeatureRefs() ) + { + featureRefs.add( siblingFeatureRef ); + } + } + featureRefs.remove( featureRef ); + fireChange(); + } - public void addListener(final IWishlistListener listener) { - listeners.add(listener); - } + public void addListener( final IWishlistListener listener ) { + listeners.add( listener ); + } - public void removeListener(final IWishlistListener listener) { - listeners.remove(listener); - } + public void removeListener( final IWishlistListener listener ) { + listeners.remove( listener ); + } - public String[] getAliases() { - List<String> result = new ArrayList<String>(); - Iterator<Group> groupIter = groups.iterator(); - while (groupIter.hasNext()) { - Group group = groupIter.next(); - result.add(group.getAlias()); - } - Iterator<FeatureRef> featureIter = featureRefs.iterator(); - while (featureIter.hasNext()) { - FeatureRef feature = featureIter.next(); - result.add(feature.getAlias()); - } - return result.toArray(new String[result.size()]); - } + public String[] getAliases() { + List<String> result = new ArrayList<String>(); + Iterator<Group> groupIter = groups.iterator(); + while( groupIter.hasNext() ) { + Group group = groupIter.next(); + result.add( group.getAlias() ); + } + Iterator<FeatureRef> featureIter = featureRefs.iterator(); + while( featureIter.hasNext() ) { + FeatureRef feature = featureIter.next(); + result.add( feature.getAlias() ); + } + return result.toArray( new String[ result.size() ] ); + } - public String[] getInstallerIDs() { - Set<String> result = new HashSet<String>(); - Iterator<Group> groupIter = groups.iterator(); - while (groupIter.hasNext()) { - Group group = groupIter.next(); - FeatureRef[] featureRefs = group.getFeatureRefs(); - for (int i = 0; i < featureRefs.length; i++) { - result.add(featureRefs[i].getId()); - } - } - Iterator<FeatureRef> featureIter = featureRefs.iterator(); - while (featureIter.hasNext()) { - FeatureRef feature = featureIter.next(); - result.add(feature.getId()); - } - return result.toArray(new String[result.size()]); - } + public String[] getInstallerIDs() { + Set<String> result = new HashSet<String>(); + Iterator<Group> groupIter = groups.iterator(); + while( groupIter.hasNext() ) { + Group group = groupIter.next(); + FeatureRef[] featureRefs = group.getFeatureRefs(); + for( int i = 0; i < featureRefs.length; i++ ) { + result.add( featureRefs[ i ].getId() ); + } + } + Iterator<FeatureRef> featureIter = featureRefs.iterator(); + while( featureIter.hasNext() ) { + FeatureRef feature = featureIter.next(); + result.add( feature.getId() ); + } + return result.toArray( new String[ result.size() ] ); + } + + public String getSelectedFeatureIds() + { + ArrayList<String> featureIds = new ArrayList<String>(); + for(Group group: groups) + { + for(FeatureRef featureRef: group.getFeatureRefs()){ + featureIds.add(featureRef.getId()); + } + + } + for(FeatureRef featureRef: featureRefs){ + featureIds.add(featureRef.getId()); + } + return StringUtil.toCommaList( featureIds.toArray(new String[featureIds.size()]), false ); + } - // //////////////// - // helping methods - // //////////////// + // //////////////// + // helping methods + // //////////////// + private void fireChange() { + Iterator<IWishlistListener> iter = listeners.iterator(); + while( iter.hasNext() ) { + IWishlistListener wishlistListener = ( IWishlistListener )iter.next(); + wishlistListener.wishlistChanged(); + } + } - private void fireChange() { - Iterator<IWishlistListener> iter = listeners.iterator(); - while (iter.hasNext()) { - IWishlistListener wishlistListener = (IWishlistListener) iter - .next(); - wishlistListener.wishlistChanged(); - } - } + public Inclusion isIncluded( FeatureRef featureRef ) { + Inclusion result = Inclusion.NONE; + if( featureRefs.contains( featureRef ) ) { + result = Inclusion.FULL; + } else if( groups.contains( featureRef.getParent() ) ) { + result = Inclusion.FULL; + } + return result; + } - public Inclusion isIncluded(FeatureRef featureRef) { - Inclusion result = Inclusion.NONE; - if (featureRefs.contains(featureRef)) { - result = Inclusion.FULL; - } else if (groups.contains(featureRef.getParent())) { - result = Inclusion.FULL; - } - return result; - } + public Inclusion isIncluded( Group group ) { + Inclusion result = Inclusion.NONE; + if( groups.contains( group ) ) { + result = Inclusion.FULL; + } else { + for( FeatureRef featureRef : group.getFeatureRefs() ) { + if( featureRefs.contains( featureRef ) ) { + result = Inclusion.PARTIAL; + break; + } + } + } + return result; + } - public Inclusion isIncluded(Group group) { - Inclusion result = Inclusion.NONE; - if (groups.contains(group)) { - result = Inclusion.FULL; - } else { - for (FeatureRef featureRef : group.getFeatureRefs()) { - if (featureRefs.contains(featureRef)) { - result = Inclusion.PARTIAL; - break; - } - } - } - return result; - } - - public boolean isEmpty() - { - return featureRefs.isEmpty() && groups.isEmpty(); - } + public boolean isEmpty() { + return featureRefs.isEmpty() && groups.isEmpty(); + } + public void setModel( EPPModel eppModel ) { + this.model = eppModel; + featureRefMap = new HashMap<String, FeatureRef>(); + for( Screen screen : model.getStructure().getScreens() ) { + for( Group group : screen.getGroups() ) { + for( FeatureRef featureRef : group.getFeatureRefs() ) { + featureRefMap.put( featureRef.getId(), featureRef ); + } + } + } + } + + public String[] addFeatureRefs( String[] strings ) { + if( model == null ) { + throw new IllegalStateException( "EPP model is not set" ); + } + List<String> unresolvedFeatureRefs = new ArrayList<String>(); + for( String featureRefId : strings ) { + FeatureRef featureRef = featureRefMap.get( featureRefId ); + if( featureRef != null ) { + add( featureRef ); + } else { + unresolvedFeatureRefs.add( featureRefId ); + } + } + return unresolvedFeatureRefs.toArray( new String[ 0 ] ); + } } \ No newline at end of file
diff --git a/plugins/org.eclipse.epp.wizard/src/org/eclipse/epp/wizard/internal/ui/Checkbox.java b/plugins/org.eclipse.epp.wizard/src/org/eclipse/epp/wizard/internal/ui/Checkbox.java index 78aa581..f4bde27 100644 --- a/plugins/org.eclipse.epp.wizard/src/org/eclipse/epp/wizard/internal/ui/Checkbox.java +++ b/plugins/org.eclipse.epp.wizard/src/org/eclipse/epp/wizard/internal/ui/Checkbox.java
@@ -10,14 +10,65 @@ ******************************************************************************/ package org.eclipse.epp.wizard.internal.ui; +import org.eclipse.rwt.lifecycle.WidgetUtil; import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Label; - +/** + * @author Jordi Boehme Lopez <jboehme@innoopract.com> + */ public class Checkbox extends Label { + boolean selected = false; + boolean grayed = false; + public Checkbox( final Composite parent ) { super( parent, SWT.NONE ); + setData( WidgetUtil.CUSTOM_VARIANT, "link" ); + updateImage(); } -} + + public boolean isSelected() { + return selected; + } + + public void setSelected( boolean selected ) { + this.selected = selected; + updateImage(); + } + + public boolean isGrayed() { + return grayed; + } + + public void setGrayed( boolean grayed ) { + this.grayed = grayed; + updateImage(); + } + + public void pressed() { + if( isGrayed() ) { + setGrayed( false ); + setSelected( true ); + } else if( isSelected() ) { + setSelected( false ); + } else { + setSelected( true ); + } + } + + // helping methods + ////////////////// + + private void updateImage() { + if( isGrayed() ) { + setImage( Images.CHECKBOX_GRAYED.get() ); + } else if( isSelected() ) { + setImage( Images.CHECKBOX_CHECKED.get() ); + } else { + setImage( Images.CHECKBOX_UNCHECKED.get() ); + } + } + +} \ No newline at end of file
diff --git a/plugins/org.eclipse.epp.wizard/src/org/eclipse/epp/wizard/internal/ui/Colors.java b/plugins/org.eclipse.epp.wizard/src/org/eclipse/epp/wizard/internal/ui/Colors.java new file mode 100644 index 0000000..2fe932b --- /dev/null +++ b/plugins/org.eclipse.epp.wizard/src/org/eclipse/epp/wizard/internal/ui/Colors.java
@@ -0,0 +1,22 @@ +package org.eclipse.epp.wizard.internal.ui; + +import org.eclipse.rwt.graphics.Graphics; +import org.eclipse.swt.graphics.Color; +import org.eclipse.swt.graphics.RGB; + +public enum Colors { + WHITE(255,255,255), + ECLIPSE_BLUE(51,51,102), + ECLIPSE_VIOLET(102,51,102), + SASH(180,180,180),; + + private final RGB rgb; + + private Colors( final int red, final int green, final int blue ) { + rgb = new RGB( red, green, blue ); + } + + public Color get() { + return Graphics.getColor( rgb ); + } +}
diff --git a/plugins/org.eclipse.epp.wizard/src/org/eclipse/epp/wizard/internal/ui/Fonts.java b/plugins/org.eclipse.epp.wizard/src/org/eclipse/epp/wizard/internal/ui/Fonts.java index 946edbd..945f6b5 100644 --- a/plugins/org.eclipse.epp.wizard/src/org/eclipse/epp/wizard/internal/ui/Fonts.java +++ b/plugins/org.eclipse.epp.wizard/src/org/eclipse/epp/wizard/internal/ui/Fonts.java
@@ -17,11 +17,13 @@ public enum Fonts { + TEXT("sans-serif", 14, SWT.NONE), TITLE("sans-serif", 18, SWT.BOLD), + H2("sans-serif", 15, SWT.BOLD), DESCRIPTION("sans-serif", 14, SWT.NONE), - GROUP("sans-serif", 16, SWT.BOLD), + GROUP("Georgia,Times,serif", 18, SWT.NONE), FEATURE("sans-serif", 14, SWT.NONE), - BUTTON("sans-serif", 16, SWT.NONE), + BUTTON("sans-serif", 14, SWT.BOLD), WISHLIST_ITEM("sans-serif", 16, SWT.NONE), ;
diff --git a/plugins/org.eclipse.epp.wizard/src/org/eclipse/epp/wizard/internal/ui/GroupSelection.java b/plugins/org.eclipse.epp.wizard/src/org/eclipse/epp/wizard/internal/ui/GroupSelection.java index 515cee1..2883dde 100644 --- a/plugins/org.eclipse.epp.wizard/src/org/eclipse/epp/wizard/internal/ui/GroupSelection.java +++ b/plugins/org.eclipse.epp.wizard/src/org/eclipse/epp/wizard/internal/ui/GroupSelection.java
@@ -1,21 +1,24 @@ /******************************************************************************* - * Copyright (c) 2008 Innoopract Informationssysteme GmbH. - * 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 + * Copyright (c) 2008 Innoopract Informationssysteme GmbH. 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: + * Innoopract Informationssysteme GmbH - initial API and implementation * * Contributors: * Innoopract Informationssysteme GmbH - initial API and implementation ******************************************************************************/ package org.eclipse.epp.wizard.internal.ui; +import java.io.File; + +import org.eclipse.epp.wizard.internal.Activator; import org.eclipse.epp.wizard.internal.IWishlistListener; import org.eclipse.epp.wizard.internal.Wishlist; import org.eclipse.epp.wizard.internal.Wishlist.Inclusion; import org.eclipse.epp.wizard.model.FeatureRef; import org.eclipse.epp.wizard.model.Group; -import org.eclipse.rwt.graphics.Graphics; +import org.eclipse.rwt.lifecycle.WidgetUtil; import org.eclipse.swt.SWT; import org.eclipse.swt.events.MouseAdapter; import org.eclipse.swt.events.MouseEvent; @@ -28,27 +31,26 @@ import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Label; - +/** + * @author Jordi Boehme Lopez <jboehme@innoopract.com> + */ public class GroupSelection extends Composite { private final Group group; private boolean expanded = false; private Label expandButton; private Composite expandableComposite; - + GroupSelection( final Composite parent, final Group group ) { super( parent, SWT.NONE ); this.group = group; - - this.setLayoutData( new GridData(GridData.FILL_HORIZONTAL) ); - + this.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) ); GridLayout layout = new GridLayout( 3, false ); layout.verticalSpacing = 1; layout.horizontalSpacing = 1; layout.marginHeight = 1; layout.marginWidth = 1; this.setLayout( layout ); - createGroupContent(); setExpanded( false ); } @@ -60,16 +62,13 @@ ( ( GridData )expandableComposite.getLayoutData() ).exclude = !expanded; getParent().layout(); } - public boolean isExpanded() { return this.expanded; } - - + // helping methods - ////////////////// - + // //////////////// private void updateExpandedButton() { Image image = Images.ICON_COLLAPSED.get(); if( isExpanded() ) { @@ -83,7 +82,7 @@ createGroupIcon(); createGroupDescription(); createExpandedSection(); - createSeparator(); + createSeparator(); } private void createGroupDescription() { @@ -91,15 +90,15 @@ label.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) ); label.setText( group.getLabel() ); label.setFont( Fonts.GROUP.get() ); - Label labelDescription = new Label( this, SWT.WRAP); + label.setForeground( Colors.ECLIPSE_VIOLET.get() ); + Label labelDescription = new Label( this, SWT.WRAP ); labelDescription.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) ); - labelDescription.setText( group.getDescription() ); + labelDescription.setText( group.getInfo() ); labelDescription.setFont( Fonts.DESCRIPTION.get() ); - } private void createSeparator() { - Label labelSeparator = new Label(this, SWT.SEPARATOR | SWT.HORIZONTAL); + Label labelSeparator = new Label( this, SWT.SEPARATOR | SWT.HORIZONTAL ); GridData gridData = new GridData( GridData.FILL_HORIZONTAL ); gridData.horizontalSpan = 3; labelSeparator.setLayoutData( gridData ); @@ -107,7 +106,10 @@ private void createGroupIcon() { Composite groupIcon = new Composite( this, SWT.NONE ); - GridData groupIconGD = new GridData( SWT.CENTER, SWT.BEGINNING, false, false ); + GridData groupIconGD = new GridData( SWT.CENTER, + SWT.BEGINNING, + false, + false ); groupIconGD.verticalSpan = 3; groupIconGD.heightHint = 48; groupIconGD.widthHint = 48; @@ -118,15 +120,27 @@ groupIconLayout.marginHeight = 1; groupIconLayout.marginWidth = 1; groupIcon.setLayout( groupIconLayout ); - groupIcon.setBackgroundImage( Images.ICON_GROUP.get() ); + File modelDirectory = Activator.getDefault().getConfiguration().getModelDirectory(); + File file = new File( modelDirectory,group.getIcon() ); + Image image = Images.load( file ); + if( image == null ) { + image = Images.ICON_GROUP_FALLBACK.get(); + } + groupIcon.setBackgroundImage( image ); groupIcon.setBackgroundMode( SWT.INHERIT_DEFAULT ); groupIcon.setSize( 48, 48 ); - final Button groupCheckBox = new Button( groupIcon, SWT.CHECK ); - groupCheckBox.setLayoutData( new GridData( SWT.BEGINNING, SWT.END, true, true ) ); - groupCheckBox.addSelectionListener( new SelectionAdapter() { + final Checkbox groupCheckBox = new Checkbox( groupIcon ); + groupCheckBox.setLayoutData( new GridData( SWT.BEGINNING, + SWT.END, + true, + true ) ); + groupCheckBox.addMouseListener( new MouseAdapter() { + @Override - public void widgetSelected( SelectionEvent e ) { - boolean isSelected = ( ( Button )e.getSource() ).getSelection(); + public void mouseDown( MouseEvent e ) { + groupCheckBox.pressed(); + boolean isSelected = !groupCheckBox.isGrayed() + && groupCheckBox.isSelected(); if( isSelected ) { Wishlist.getDefault().add( group ); } else { @@ -134,14 +148,15 @@ } } } ); - Wishlist.getDefault().addListener(new IWishlistListener(){ + Wishlist.getDefault().addListener( new IWishlistListener() { + public void wishlistChanged() { Wishlist wishlist = Wishlist.getDefault(); - Inclusion inclusion = wishlist.isIncluded( group ); - groupCheckBox.setSelection(inclusion == Inclusion.FULL); + Inclusion inclusion = wishlist.isIncluded( group ); + groupCheckBox.setSelected( inclusion == Inclusion.FULL ); + groupCheckBox.setGrayed( inclusion == Inclusion.PARTIAL ); } - }); - + } ); } private void createExpandTrigger() { @@ -150,18 +165,23 @@ expBtnGD.verticalSpan = 3; expandButton.setLayoutData( expBtnGD ); expandButton.setImage( Images.ICON_COLLAPSED.get() ); + expandButton.setData( WidgetUtil.CUSTOM_VARIANT, "link" ); expandButton.addMouseListener( new MouseAdapter() { - @Override + + @Override public void mouseDown( final MouseEvent me ) { - setExpanded( !isExpanded() ); - } + setExpanded( !isExpanded() ); + } } ); } private void createExpandedSection() { expandableComposite = new Composite( this, SWT.NONE ); expandableComposite.setVisible( false ); - expandableComposite.setLayoutData( new GridData( SWT.FILL, SWT.FILL, true, true ) ); + expandableComposite.setLayoutData( new GridData( SWT.FILL, + SWT.FILL, + true, + true ) ); expandableComposite.setLayout( new GridLayout( 1, false ) ); FeatureRef[] featureRefs = group.getFeatureRefs(); for( int j = 0; j < featureRefs.length; j++ ) { @@ -171,7 +191,9 @@ featureCheckBox.setLayoutData( new GridData() ); featureCheckBox.setText( featureRef.getAlias() ); featureCheckBox.setFont( Fonts.FEATURE.get() ); + featureCheckBox.setData( WidgetUtil.CUSTOM_VARIANT, "link" ); featureCheckBox.addSelectionListener( new SelectionAdapter() { + @Override public void widgetSelected( SelectionEvent e ) { boolean isSelected = featureCheckBox.getSelection(); @@ -182,7 +204,8 @@ } } } ); - Wishlist.getDefault().addListener(new IWishlistListener(){ + Wishlist.getDefault().addListener( new IWishlistListener() { + public void wishlistChanged() { Wishlist wishlist = Wishlist.getDefault(); Inclusion inclusion = wishlist.isIncluded( featureRef );
diff --git a/plugins/org.eclipse.epp.wizard/src/org/eclipse/epp/wizard/internal/ui/Images.java b/plugins/org.eclipse.epp.wizard/src/org/eclipse/epp/wizard/internal/ui/Images.java index 9940a32..5736713 100644 --- a/plugins/org.eclipse.epp.wizard/src/org/eclipse/epp/wizard/internal/ui/Images.java +++ b/plugins/org.eclipse.epp.wizard/src/org/eclipse/epp/wizard/internal/ui/Images.java
@@ -10,20 +10,41 @@ ******************************************************************************/ package org.eclipse.epp.wizard.internal.ui; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; + import org.eclipse.epp.wizard.internal.Activator; import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.rwt.graphics.Graphics; import org.eclipse.swt.graphics.Image; public enum Images { + DOWNLOAD("download.png"), + WEBSTART("webstart.png"), ITEM_GROUP("group16.png"), ITEM_FEATURE("feature16.png"), ICON_COLLAPSED("expand0.png"), ICON_EXPANDED("expand1.png"), ICON_GROUP("group48.png"), - CHECKBOX_CHECKED("expand0.png"), - CHECKBOX_UNCHECKED("expand1.png"), - CHECKBOX_GRAYEXD("expand1.png"), + ICON_GROUP_FALLBACK("group_fallback.png"), + CHECKBOX_CHECKED("cb_selected.png"), + CHECKBOX_UNCHECKED("cb_notselected.png"), + CHECKBOX_GRAYED("cb_grayed.png"), + MAP_CONNECTION("map_connection.png"), + MAP_LEFT("map_left.png"), + MAP_RIGHT("map_right.png"), + MAP_CENTER("map_center.png"), + MAP_LEFT_FOCUS("map_left-focus.png"), + MAP_RIGHT_FOCUS("map_right-focus.png"), + MAP_CENTER_FOCUS("map_center-focus.png"), + MAP_NEXT("map_next.png"), + MAP_PREV("map_prev.png"), + MAP_NEXT_OFF("map_next_off.png"), + MAP_PREV_OFF("map_prev_off.png"), + MAP_SPACING("map_spacing.png"), + MY_SELECTION("my_selection.png"), ; private final String location; @@ -39,4 +60,15 @@ = Activator.imageDescriptorFromPlugin( Activator.PLUGIN_ID, location ); return imgDescr.createImage(); } + + public static Image load(File file) + { + Image image = null; + try { + image = Graphics.getImage( file.getName(), new FileInputStream(file)); + } catch( FileNotFoundException exc ) { + System.err.println("Image file '"+file.getAbsolutePath()+ "' not found."); + } + return image; + } }
diff --git a/plugins/org.eclipse.epp.wizard/src/org/eclipse/epp/wizard/internal/ui/Roadmap.java b/plugins/org.eclipse.epp.wizard/src/org/eclipse/epp/wizard/internal/ui/Roadmap.java new file mode 100644 index 0000000..9783a44 --- /dev/null +++ b/plugins/org.eclipse.epp.wizard/src/org/eclipse/epp/wizard/internal/ui/Roadmap.java
@@ -0,0 +1,189 @@ +/******************************************************************************* + * Copyright (c) 2008 Innoopract Informationssysteme GmbH. + * 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: + * Innoopract Informationssysteme GmbH - initial API and implementation + ******************************************************************************/ +package org.eclipse.epp.wizard.internal.ui; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; + +import org.eclipse.rwt.lifecycle.WidgetUtil; +import org.eclipse.swt.SWT; +import org.eclipse.swt.custom.StackLayout; +import org.eclipse.swt.events.MouseAdapter; +import org.eclipse.swt.events.MouseEvent; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.RowLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Label; + +/** + * @author Jordi Boehme Lopez <jboehme@innoopract.com> + */ +public class Roadmap extends Composite { + + public interface IRoadmapListener + { + void screenActivated( final IWizardScreen activeScreen ); + } + private final IWizardScreen[] screens; + private final StackLayout stackLayout; + private IWizardScreen activeScreen; + Map<IWizardScreen, RoadmapItem> items + = new HashMap<IWizardScreen, RoadmapItem>(); + protected HashSet<IRoadmapListener> listeners = new HashSet<IRoadmapListener>(); + private Label navPrev; + private Label navNext; + + public Roadmap( final Composite parent, + final IWizardScreen[] screens, + final StackLayout stackLayout ) + { + super( parent, SWT.NONE ); + this.screens = screens; + this.stackLayout = stackLayout; + createContents(); + } + + public void addListener(final IRoadmapListener listener) + { + listeners.add( listener ); + } + + public void removeListener(final IRoadmapListener listener) + { + listeners.remove( listener ); + } + private void createContents() { + setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) ); + RowLayout layout = new RowLayout(); + layout.spacing = 0; + setLayout( layout ); + setBackgroundMode( SWT.INHERIT_DEFAULT ); + createNavPrev(); + for( int i = 0; i < screens.length; i++ ) { + final IWizardScreen screen = screens[ i ]; + boolean isFirst = ( i == 0 ); + boolean hasNext = ( i + 1 < screens.length ); + RoadmapItem item = new RoadmapItem( this, screen, isFirst, hasNext ); + items.put( screen, item ); + } + createNavNext(); + } + + private void createNavNext() { + new Label( this, SWT.NONE ).setImage( Images.MAP_SPACING.get() ); + navNext = new Label( this, SWT.NONE ); + navNext.setData( WidgetUtil.CUSTOM_VARIANT, "link" ); + navNext.setImage( Images.MAP_NEXT.get() ); + + MouseAdapter mouseListener = new MouseAdapter() { + @Override + public void mouseDown( final MouseEvent e ) { + IWizardScreen nextScreen = getNextScreen(); + if( nextScreen != null ) { + setActiveScreen( nextScreen ); + } + } + }; + navNext.addMouseListener( mouseListener ); + } + + private void createNavPrev() { + navPrev = new Label( this, SWT.NONE ); + navPrev.setImage( Images.MAP_PREV_OFF.get() ); + navPrev.setData( WidgetUtil.CUSTOM_VARIANT, "link" ); + new Label( this, SWT.NONE ).setImage( Images.MAP_SPACING.get() ); + + MouseAdapter mouseListener = new MouseAdapter() { + @Override + public void mouseDown( final MouseEvent e ) { + IWizardScreen prevScreen = getPrevScreen(); + if( prevScreen != null ) { + setActiveScreen( prevScreen ); + } + } + }; + navPrev.addMouseListener( mouseListener ); + } + + public void setActiveScreen( final IWizardScreen activeScreen ) { + this.activeScreen = activeScreen; + stackLayout.topControl = activeScreen.getControl(); + stackLayout.topControl.getParent().layout(); + for( IWizardScreen screen : this.screens ) { + boolean isActive = ( screen.equals( activeScreen ) ); + items.get( screen ).setActive( isActive ); + if( isActive) { + updateNav(); + } + } + for(IRoadmapListener listener: listeners) + { + listener.screenActivated( activeScreen ); + } + + } + + private void updateNav() { + if( getPrevScreen() == null ) { + navPrev.setImage( Images.MAP_PREV_OFF.get() ); + navPrev.setData( WidgetUtil.CUSTOM_VARIANT, "nolink" ); + } else { + navPrev.setImage( Images.MAP_PREV.get() ); + navPrev.setData( WidgetUtil.CUSTOM_VARIANT, "link" ); + } + if( getNextScreen() != null ) { + navNext.setImage( Images.MAP_NEXT.get() ); + navNext.setData( WidgetUtil.CUSTOM_VARIANT, "link" ); + } else { + navNext.setImage( Images.MAP_NEXT_OFF.get() ); + navNext.setData( WidgetUtil.CUSTOM_VARIANT, "nolink" ); + } + } + + private IWizardScreen getNextScreen() { + IWizardScreen result = null; + for( int i = 0; result == null && i < screens.length; i++ ) { + IWizardScreen screen = screens[ i ]; + boolean isActive = ( screen.equals( getActiveScreen() ) ); + if( isActive ) { + if( hasNext( i, screens ) ) { + result = screens[ i + 1 ]; + } + } + } + return result; + } + + private IWizardScreen getPrevScreen() { + IWizardScreen result = null; + IWizardScreen previous = null; + for( int i = 0; result == null && i < screens.length; i++ ) { + IWizardScreen screen = screens[ i ]; + boolean isActive = ( screen.equals( getActiveScreen() ) ); + if( isActive ) { + if( previous != null ) { + result = previous; + } + } + previous = screen; + } + return result; + } + + private boolean hasNext( final int i, final Object[] array ) { + return i + 1 < array.length; + } + + private IWizardScreen getActiveScreen() { + return activeScreen; + } +} \ No newline at end of file
diff --git a/plugins/org.eclipse.epp.wizard/src/org/eclipse/epp/wizard/internal/ui/RoadmapItem.java b/plugins/org.eclipse.epp.wizard/src/org/eclipse/epp/wizard/internal/ui/RoadmapItem.java new file mode 100644 index 0000000..136f94f --- /dev/null +++ b/plugins/org.eclipse.epp.wizard/src/org/eclipse/epp/wizard/internal/ui/RoadmapItem.java
@@ -0,0 +1,106 @@ +package org.eclipse.epp.wizard.internal.ui; + +import org.eclipse.rwt.lifecycle.WidgetUtil; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.MouseAdapter; +import org.eclipse.swt.events.MouseEvent; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.layout.RowData; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Label; + + +public class RoadmapItem { + + private boolean active; + private Label prevConnection; + private Label nextConnection; + private Composite center; + private Label right; + private Label left; + private final Roadmap roadmap; + + public RoadmapItem( final Roadmap roadmap, + final IWizardScreen screen, + final boolean isFirst, + final boolean hasNext ) + { + this.roadmap = roadmap; + prevConnection = new Label( roadmap, SWT.NONE ); + prevConnection.setLayoutData( new RowData() ); + if( isFirst ) { + prevConnection.setImage( Images.MAP_SPACING.get() ); + } else { + prevConnection.setImage( Images.MAP_CONNECTION.get() ); + } + left = new Label( roadmap, SWT.NONE ); + left.setImage( Images.MAP_LEFT.get() ); + left.setToolTipText( screen.getLabel() ); + center = new Composite( roadmap, SWT.NONE ); + center.setLayoutData( new RowData( SWT.DEFAULT, 50 ) ); + GridLayout centerLayout = new GridLayout(); + centerLayout.marginHeight = 0; + centerLayout.marginWidth = 0; + center.setLayout( centerLayout ); + center.setBackgroundImage( Images.MAP_CENTER.get() ); + Label label = new Label( center, SWT.NONE ); + label.setLayoutData( new GridData( SWT.CENTER, SWT.CENTER, true, true ) ); + label.setText( screen.getLabel() ); + label.setForeground( Colors.WHITE.get() ); + label.setFont(Fonts.BUTTON.get()); + right = new Label( roadmap, SWT.NONE ); + right.setImage( Images.MAP_RIGHT.get() ); + right.setToolTipText( screen.getLabel() ); + nextConnection = new Label( roadmap, SWT.NONE ); + nextConnection.setLayoutData( new RowData() ); + if( hasNext ) { + nextConnection.setImage( Images.MAP_CONNECTION.get() ); + } else { + nextConnection.setImage( Images.MAP_SPACING.get() ); + } + left.setData( WidgetUtil.CUSTOM_VARIANT, "link" ); + right.setData( WidgetUtil.CUSTOM_VARIANT, "link" ); + label.setData( WidgetUtil.CUSTOM_VARIANT, "link" ); + + MouseAdapter mouseListener = new MouseAdapter() { + @Override + public void mouseDown( final MouseEvent e ) { + roadmap.setActiveScreen( screen ); + } + }; + left.addMouseListener( mouseListener ); + center.addMouseListener( mouseListener ); + right.addMouseListener( mouseListener ); + label.addMouseListener( mouseListener ); + } + + public void setActive( final boolean active ) { + this.active = active; + updateImages(); + } + + // helping methods + ////////////////// + + private void updateImages() { + if( active ) { + prevConnection.setVisible( false ); + ( ( RowData )prevConnection.getLayoutData() ).exclude = true; + nextConnection.setVisible( false ); + ( ( RowData )nextConnection.getLayoutData() ).exclude = true; + right.setImage( Images.MAP_RIGHT_FOCUS.get() ); + center.setBackgroundImage( Images.MAP_CENTER_FOCUS.get() ); + left.setImage( Images.MAP_LEFT_FOCUS.get() ); + } else { + ( ( RowData )prevConnection.getLayoutData() ).exclude = false; + prevConnection.setVisible( true ); + ( ( RowData )nextConnection.getLayoutData() ).exclude = false; + nextConnection.setVisible( true ); + center.setBackgroundImage( Images.MAP_CENTER.get() ); + right.setImage( Images.MAP_RIGHT.get() ); + left.setImage( Images.MAP_LEFT.get() ); + } + roadmap.layout(); + } +} \ No newline at end of file
diff --git a/plugins/org.eclipse.epp.wizard/src/org/eclipse/epp/wizard/internal/ui/WishlistComposite.java b/plugins/org.eclipse.epp.wizard/src/org/eclipse/epp/wizard/internal/ui/WishlistComposite.java index 2570eb4..8611037 100644 --- a/plugins/org.eclipse.epp.wizard/src/org/eclipse/epp/wizard/internal/ui/WishlistComposite.java +++ b/plugins/org.eclipse.epp.wizard/src/org/eclipse/epp/wizard/internal/ui/WishlistComposite.java
@@ -14,7 +14,6 @@ import org.eclipse.epp.wizard.internal.Wishlist; import org.eclipse.epp.wizard.model.FeatureRef; import org.eclipse.epp.wizard.model.Group; -import org.eclipse.rwt.graphics.Graphics; import org.eclipse.swt.SWT; import org.eclipse.swt.custom.ScrolledComposite; import org.eclipse.swt.graphics.Image; @@ -37,20 +36,29 @@ public WishlistComposite( Composite parent, Wishlist wishlist ) { super( parent, SWT.NONE ); this.wishlist = wishlist; - setLayout( new GridLayout( 1, true ) ); - // setBackground( Graphics.getColor( new RGB(255,0,0) ) ); + setLayout( new GridLayout( 2, false ) ); createContent(); wishlist.addListener( this ); } public void createContent() { + Label iconLabel = new Label( this, SWT.NONE ); + iconLabel.setImage( Images.MY_SELECTION.get() ); titleLabel = new Label( this, SWT.NONE ); titleLabel.setText( "My Selection" ); titleLabel.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) ); titleLabel.setFont( Fonts.TITLE.get() ); + titleLabel.setForeground( Colors.ECLIPSE_BLUE.get() ); + Label labelSeparator = new Label(this, SWT.SEPARATOR | SWT.HORIZONTAL); + GridData gridData = new GridData( GridData.FILL_HORIZONTAL ); + gridData.horizontalSpan = 2; + labelSeparator.setLayoutData( gridData ); + scrolledComposite = new ScrolledComposite( this, SWT.H_SCROLL | SWT.V_SCROLL ); - scrolledComposite.setLayoutData( new GridData( GridData.FILL_BOTH ) ); + GridData gridDataScrolled = new GridData( GridData.FILL_BOTH ); + gridDataScrolled.horizontalSpan = 2; + scrolledComposite.setLayoutData( gridDataScrolled) ; listComposite = new Composite( scrolledComposite, SWT.NONE ); listComposite.setLayout( new GridLayout( 2, false ) ); // listComposite.setSize( 400, 400 ); @@ -64,7 +72,7 @@ scrolledComposite.setAlwaysShowScrollBars( false ); // listComposite.layout(); // scrolledComposite.setSize( new Point(400, 200) ); - // updateItems(); + updateItems(); } public void wishlistChanged() {
diff --git a/plugins/org.eclipse.epp.wizard/src/org/eclipse/epp/wizard/internal/ui/Wizard.java b/plugins/org.eclipse.epp.wizard/src/org/eclipse/epp/wizard/internal/ui/Wizard.java index a9d8aa8..d32bf91 100644 --- a/plugins/org.eclipse.epp.wizard/src/org/eclipse/epp/wizard/internal/ui/Wizard.java +++ b/plugins/org.eclipse.epp.wizard/src/org/eclipse/epp/wizard/internal/ui/Wizard.java
@@ -1,44 +1,44 @@ /******************************************************************************* - * Copyright (c) 2008 Innoopract Informationssysteme GmbH. - * 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 + * Copyright (c) 2008 Innoopract Informationssysteme GmbH. 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: * * Contributors: * Innoopract Informationssysteme GmbH - initial API and implementation ******************************************************************************/ package org.eclipse.epp.wizard.internal.ui; +import java.io.File; import java.io.IOException; import java.net.URL; import java.util.ArrayList; -import java.util.Iterator; import java.util.List; import org.eclipse.core.runtime.FileLocator; import org.eclipse.core.runtime.Path; import org.eclipse.epp.wizard.internal.Activator; +import org.eclipse.epp.wizard.internal.OutgoingApiConfiguration; import org.eclipse.epp.wizard.internal.Wishlist; +import org.eclipse.epp.wizard.internal.ui.Roadmap.IRoadmapListener; import org.eclipse.epp.wizard.model.EPPModel; import org.eclipse.epp.wizard.model.Screen; import org.eclipse.epp.wizard.model.Structure; +import org.eclipse.jface.layout.GridDataFactory; +import org.eclipse.rwt.RWT; import org.eclipse.rwt.lifecycle.IEntryPoint; import org.eclipse.swt.SWT; import org.eclipse.swt.custom.SashForm; import org.eclipse.swt.custom.StackLayout; import org.eclipse.swt.events.ControlAdapter; import org.eclipse.swt.events.ControlEvent; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.layout.FillLayout; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.layout.RowLayout; -import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Shell; import org.jdom.JDOMException; import org.osgi.framework.Bundle; @@ -46,115 +46,146 @@ /** * @author Jordi Boehme Lopez <jboehme@innoopract.com> */ -public class Wizard implements IEntryPoint { +public class Wizard implements IEntryPoint, IRoadmapListener { private List<IWizardScreen> screens = new ArrayList<IWizardScreen>(); private StackLayout stackLayout = new StackLayout(); + @SuppressWarnings("unused") private Composite screenArea; + @SuppressWarnings("unused") + private WishlistComposite wishlistComposite; + private Label screenTitle; + private EPPModel model; public Wizard() { } public int createUI() { try { + loadModel(); + Display display = new Display(); + final Shell shell = new Shell( display, SWT.NO_TRIM ); + shell.setMaximized( true ); + shell.setText( "EPP Download Wizard" ); + shell.setLayout( new FillLayout() ); + Composite parent = new Composite( shell, SWT.NONE ); + parent.setLayout( new GridLayout() ); + + + SashForm sashForm = new SashForm( parent, SWT.HORIZONTAL ); + sashForm.setBackground( Colors.SASH.get() ); + sashForm.setLayoutData( new GridData( GridData.FILL_BOTH ) ); + Composite screenArea = createScreenArea( sashForm ); - Display display = new Display(); - final Shell shell = new Shell( display, SWT.NO_TRIM ); - shell.setMaximized( true ); - shell.setText( "EPP Download Wizard" ); - shell.setLayout( new FillLayout() ); - - Composite parent = new Composite( shell, SWT.NONE ); - parent.setLayout( new GridLayout() ); - - Path modelPath = new Path( "eppmodel.xml" ); - Bundle bundle = Activator.getDefault().getBundle(); - URL entry = FileLocator.find( bundle, modelPath, null ); - EPPModel model = null; - try { - URL resolvedModel = FileLocator.resolve( entry ); - model = EPPModel.read( resolvedModel ); - } catch( IOException exc ) { - Activator.log( exc ); - } catch( JDOMException exc ) { - Activator.log( exc ); - } - SashForm sashForm = new SashForm(parent, SWT.HORIZONTAL); - sashForm.setLayoutData( new GridData(GridData.FILL_BOTH) ); - Composite mainScreen = new Composite(sashForm, SWT.NONE); - WishlistComposite wishlistComposite = new WishlistComposite(sashForm, Wishlist.getDefault()); -// wishlistComposite.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) ); - mainScreen.setLayout( new GridLayout() ); - sashForm.setWeights( new int[] {2,1} ); - - if( model != null ) { - screenArea = createScreenArea( mainScreen ); - Structure structure = model.getStructure(); - Screen[] screens = structure.getScreens(); - for( int i = 0; i < screens.length; i++ ) { - Screen screen = screens[ i ]; - WizardSelectionScreen wizardScreen = new WizardSelectionScreen( screen, screenArea ); - addWizardScreen( wizardScreen ); - } - WizardDownloadScreen screen = new WizardDownloadScreen( screenArea ); - addWizardScreen( screen ); - createRoadmap( parent ); - } + + Wishlist wishlist = Wishlist.getDefault(); + wishlist.setModel( model ); + wishlistComposite = new WishlistComposite( sashForm, + wishlist); + sashForm.setWeights( new int[]{ + 2, 1 + } ); + OutgoingApiConfiguration outgoingApiConfiguration = Activator.getDefault().getConfiguration().getOutgoingApiConfiguration(); - stackLayout.topControl = ( Control )screens.get( 0 ); - shell.layout(); - shell.addControlListener( new ControlAdapter() { - public void controlResized( final ControlEvent event ) { - shell.layout(); + + if( model != null ) { + Structure structure = model.getStructure(); + Screen[] structScreens = structure.getScreens(); + for( int i = 0; i < structScreens.length; i++ ) { + Screen screen = structScreens[ i ]; + WizardSelectionScreen wizardScreen = new WizardSelectionScreen( screen, + screenArea ); + addWizardScreen( wizardScreen ); + } + WizardDownloadScreen screen = new WizardDownloadScreen( screenArea, outgoingApiConfiguration ); + addWizardScreen( screen ); + screenArea.layout(); + Roadmap roadmap = createRoadmap( parent ); + roadmap.addListener( this ); + roadmap.setActiveScreen( this.screens.get( 0 ) ); } - } ); - shell.open(); - while( !shell.isDisposed() ) { - if( !display.readAndDispatch() ) { - display.sleep(); + setInputFeatureIds( wishlist ); + + shell.layout(); + shell.addControlListener( new ControlAdapter() { + + public void controlResized( final ControlEvent event ) { + shell.layout(); + } + } ); + shell.open(); + while( !shell.isDisposed() ) { + if( !display.readAndDispatch() ) { + display.sleep(); + } } - } - return 0; + return 0; } catch( Exception exc ) { exc.printStackTrace(); return 0; } } - - ////////////////// - // helping methods - ////////////////// + private void loadModel() { + File modelDirectory = Activator.getDefault().getConfiguration().getModelDirectory(); + File modelXML = new File(modelDirectory, "eppmodel.xml"); + model = null; + try { + model = EPPModel.read( modelXML.toURI().toURL() ); + } catch( IOException exc ) { + Activator.log( exc ); + } catch( JDOMException exc ) { + Activator.log( exc ); + } + } + + private void setInputFeatureIds( Wishlist wishlist ) { + String featureIdString = RWT.getRequest().getParameter( "featureid" ); + if(featureIdString != null) + { + String[] featureIds = featureIdString.split( "," ); + wishlist.addFeatureRefs( featureIds ); + + } + } + + // //////////////// + // helping methods + // //////////////// private Composite createScreenArea( final Composite parent ) { - Composite result = new Composite( parent, SWT.NONE ); + Composite leftSide = new Composite( parent, SWT.NONE ); + leftSide.setLayout( new GridLayout() ); + screenTitle = new Label(leftSide, SWT.NONE); + screenTitle.setText( "Title" ); + screenTitle.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) ); + screenTitle.setFont( Fonts.TITLE.get() ); + screenTitle.setForeground( Colors.ECLIPSE_BLUE.get() ); + Label labelSeparator = new Label(leftSide, SWT.None /*SWT.SEPARATOR | SWT.HORIZONTAL*/); + labelSeparator.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) ); + + Composite result = new Composite( leftSide, SWT.NONE ); result.setLayoutData( new GridData( GridData.FILL_BOTH ) ); result.setLayout( this.stackLayout ); return result; } - private void createRoadmap( final Composite parent ) { - Composite comp = new Composite( parent, SWT.NONE ); - comp.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) ); - comp.setLayout( new RowLayout() ); - Iterator<IWizardScreen> iter = this.screens.iterator(); - while( iter.hasNext() ) { - final IWizardScreen screen = iter.next(); - final Button button = new Button( comp, SWT.PUSH ); - button.setText( screen.getLabel() ); - button.setToolTipText( screen.getLabel() ); - button.addSelectionListener( new SelectionAdapter() { - @Override - public void widgetSelected( SelectionEvent e ) { - stackLayout.topControl = screen.getControl(); - screenArea.layout(); - } - } ); - } + private Roadmap createRoadmap( final Composite parent ) { + IWizardScreen[] screensArray = screens.toArray( new IWizardScreen[ screens.size() ] ); + + Roadmap roadmap = new Roadmap( parent, screensArray, stackLayout ); + GridDataFactory.fillDefaults().grab(true, false).align( SWT.CENTER, SWT.CENTER ).applyTo( roadmap ); + + return roadmap; } private void addWizardScreen( final IWizardScreen wizardScreen ) { screens.add( wizardScreen ); } + public void screenActivated( IWizardScreen activeScreen ) { + screenTitle.setText( activeScreen.getLabel() ); + + } + } \ No newline at end of file
diff --git a/plugins/org.eclipse.epp.wizard/src/org/eclipse/epp/wizard/internal/ui/WizardDownloadScreen.java b/plugins/org.eclipse.epp.wizard/src/org/eclipse/epp/wizard/internal/ui/WizardDownloadScreen.java index d6b5a99..efa2e11 100644 --- a/plugins/org.eclipse.epp.wizard/src/org/eclipse/epp/wizard/internal/ui/WizardDownloadScreen.java +++ b/plugins/org.eclipse.epp.wizard/src/org/eclipse/epp/wizard/internal/ui/WizardDownloadScreen.java
@@ -1,33 +1,39 @@ /******************************************************************************* - * Copyright (c) 2008 Innoopract Informationssysteme GmbH. - * 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: - * Innoopract Informationssysteme GmbH - initial API and implementation + * Copyright (c) 2008 Innoopract Informationssysteme GmbH. 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: + * Innoopract Informationssysteme GmbH - initial API and implementation ******************************************************************************/ package org.eclipse.epp.wizard.internal.ui; import java.io.IOException; -import org.eclipse.epp.installerbuilder.BuildInstaller; -import org.eclipse.epp.jnlpbuilder.CustomJnlp; -import org.eclipse.epp.util.OsUtil; -import org.eclipse.epp.util.StringUtil; +import org.eclipse.epp.wizard.installerbuilder.BuildInstaller; import org.eclipse.epp.wizard.internal.IWishlistListener; +import org.eclipse.epp.wizard.internal.OutgoingApiConfiguration; import org.eclipse.epp.wizard.internal.Wishlist; +import org.eclipse.epp.wizard.jnlpbuilder.CustomJnlp; +import org.eclipse.epp.wizard.util.OsUtil; +import org.eclipse.epp.wizard.util.StringUtil; +import org.eclipse.jface.layout.GridDataFactory; import org.eclipse.rwt.RWT; +import org.eclipse.rwt.lifecycle.WidgetUtil; import org.eclipse.swt.SWT; import org.eclipse.swt.browser.Browser; +import org.eclipse.swt.custom.ScrolledComposite; +import org.eclipse.swt.events.ControlEvent; +import org.eclipse.swt.events.MouseAdapter; +import org.eclipse.swt.events.MouseEvent; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Link; /** * @author Jordi Boehme Lopez <jboehme@innoopract.com> @@ -36,9 +42,13 @@ private Browser browser; private Wishlist wishlist; + private OutgoingApiConfiguration outgoingApiConfiguration; - public WizardDownloadScreen( final Composite parent ) { + public WizardDownloadScreen( final Composite parent, + OutgoingApiConfiguration outgoingApiConfiguration ) + { super( parent, SWT.NONE ); + this.outgoingApiConfiguration = outgoingApiConfiguration; createContent( this ); } @@ -50,31 +60,114 @@ layout.marginHeight = 1; layout.marginWidth = 1; parent.setLayout( layout ); + createHiddenBrowser( parent ); + createNotification( parent ); + Composite downloadArea = new Composite(parent, SWT.NONE); + + downloadArea.setLayout( new GridLayout( 1, false ) ); + createDownloadButton( downloadArea ); + createWebstartButton( downloadArea ); + createSpacing(parent); + createOutgoingApiComposite( parent ); + } + + private void createSpacing(Composite parent) { + new Label(parent, SWT.NONE); + + } + + private void createHiddenBrowser( final Composite parent ) { browser = new Browser( parent, SWT.NONE ); browser.setSize( 1, 1 ); - createNotification( parent ); - createDownloadButton( parent ); - createWebstartButton( parent ); + browser.setVisible( false ); + // don't show + browser.setLayoutData( GridDataFactory.fillDefaults().exclude( true ).create() ); + } + + private void createOutgoingApiComposite( final Composite parent ) { + final ScrolledComposite scrolledComposite = new ScrolledComposite(parent, SWT.H_SCROLL|SWT.V_SCROLL); + scrolledComposite.setLayoutData( GridDataFactory.fillDefaults().grab( true, true ).indent( 20, 40 ).create() ); + scrolledComposite.setExpandVertical( true ); + scrolledComposite.setExpandHorizontal( true ); + final Composite composite = new Composite( scrolledComposite, SWT.NONE ); + scrolledComposite.addControlListener( new org.eclipse.swt.events.ControlAdapter() { + + @Override + public void controlResized( ControlEvent e ) { + super.controlResized( e ); + scrolledComposite.setMinSize( composite.computeSize( SWT.DEFAULT, SWT.DEFAULT ) ); + } + } ); + + + scrolledComposite.setContent( composite ); + composite.setLayout( new GridLayout( 2, false ) ); + Label title = new Label( composite, SWT.NONE ); + title.setText( "Additional configuration options" ); + title.setFont( Fonts.TITLE.get() ); + title.setForeground( Colors.ECLIPSE_BLUE.get() ); + title.setLayoutData( GridDataFactory.fillDefaults() + .span( 2, 1 ) + .grab( true, false ) + .create() ); + Label separator = new Label( composite, SWT.SEPARATOR | SWT.HORIZONTAL ); + separator.setLayoutData( GridDataFactory.fillDefaults() + .span( 2, 1 ) + .minSize( 10, 10 ) + .create() ); + separator.setForeground( Colors.ECLIPSE_BLUE.get() ); + for( final OutgoingApiConfiguration.Entry entry : outgoingApiConfiguration.getEntries() ) + { + Label icon = new Label( composite, SWT.NONE ); + icon.setImage( Images.load(entry.getIcon()) ); + icon.setLayoutData( GridDataFactory.fillDefaults().span( 1, 2 ).create() ); + Label link = new Label( composite, SWT.NONE ); + link.setFont( Fonts.H2.get() ); + title.setForeground( Colors.ECLIPSE_VIOLET.get() ); + link.setText( entry.getLabel() ); + link.setData( WidgetUtil.CUSTOM_VARIANT, "link" ); + link.addMouseListener( new MouseAdapter() { + + @Override + public void mouseDown( MouseEvent e ) { + super.mouseDown( e ); + String location = String.format( entry.getUrlTemplate(), Wishlist.getDefault().getSelectedFeatureIds() ); + browser.execute( "window.top.location.href='"+location+"'" ); + } + } ); + Label description = new Label( composite, SWT.NONE ); + description.setFont( Fonts.TEXT.get() ); + description.setText( entry.getDescription() ); + } + composite.pack(); } private void createNotification( final Composite parent ) { - final Label label = new Label(parent, SWT.NONE); - label.setText( "You have not items selected. Please go back to the previous pages and select your desired items, then return to this page to complete your installation." ); + final Label label = new Label( parent, SWT.WRAP ); + final String noItemsText = "You have no items selected. Please go back to the previous pages and select your desired items, then return to this page to complete your installation."; + final String gotItemsText = "Your configuration is now ready to be downloaded"; + label.setText( noItemsText); + label.setFont( Fonts.TEXT.get() ); + label.setLayoutData( GridDataFactory.swtDefaults().grab( true, false ).hint(600,SWT.DEFAULT).create() ); wishlist.addListener( new IWishlistListener() { public void wishlistChanged() { - label.setVisible( wishlist.isEmpty() ); + label.setText( wishlist.isEmpty()? noItemsText:gotItemsText ); + //label.setLayoutData( GridDataFactory.swtDefaults().exclude( !wishlist.isEmpty() ).grab( true, false ).create() ); + parent.layout(); } - - }); - - + } ); } private void createDownloadButton( final Composite parent ) { final Button button = new Button( parent, SWT.NONE ); - button.setText( "Download Eclipse P2 Installer" ); + button.setText( " Download Eclipse P2 Installer" ); + button.setImage( Images.DOWNLOAD.get() ); + button.setFont( Fonts.BUTTON.get() ); + button.setLayoutData( GridDataFactory.swtDefaults().align( SWT.FILL, SWT.CENTER).create() ); + button.addSelectionListener( new SelectionAdapter() { + @Override public void widgetSelected( final SelectionEvent se ) { String[] ids = Wishlist.getDefault().getInstallerIDs(); @@ -101,14 +194,18 @@ public void wishlistChanged() { button.setEnabled( !wishlist.isEmpty() ); } - - }); + } ); } private void createWebstartButton( final Composite parent ) { Button button = new Button( parent, SWT.NONE ); - button.setText( "Start Eclipse P2 Installer" ); + button.setText( " Start Eclipse P2 Installer" ); + button.setFont( Fonts.BUTTON.get() ); + button.setImage( Images.WEBSTART.get() ); + button.setLayoutData( GridDataFactory.swtDefaults().align( SWT.FILL, SWT.CENTER).create() ); + button.addSelectionListener( new SelectionAdapter() { + @Override public void widgetSelected( final SelectionEvent se ) { String[] ids = Wishlist.getDefault().getInstallerIDs(); @@ -127,7 +224,7 @@ } ); addButtonEnabler( button ); } - + public String getLabel() { return "Finish"; } @@ -135,27 +232,26 @@ public Control getControl() { return this; } - - ///////////////// - //helping methods - ///////////////// - + + // /////////////// + // helping methods + // /////////////// private String getDefaultOs() { String header = RWT.getRequest().getHeader( "User-Agent" ); //$NON-NLS-1$ String[] platformNames = OsUtil.getPlatforms(); - int platform = 0; // Check if we can autodetect the platform for( int i = 0; i < platformNames.length; i++ ) { String platformHeader = platformNames[ i ].substring( 0, 3 ); - if( header.indexOf( platformHeader ) > -1 - || header.indexOf( platformHeader.toUpperCase() ) > -1 - || header.indexOf( platformHeader.substring( 0, 1 ).toUpperCase() - + platformHeader.substring( 1, platformHeader.length() ) ) > -1 ) { + if( header.indexOf( platformHeader ) > -1 + || header.indexOf( platformHeader.toUpperCase() ) > -1 + || header.indexOf( platformHeader.substring( 0, 1 ).toUpperCase() + + platformHeader.substring( 1, + platformHeader.length() ) ) > -1 ) + { platform = i; } - } + } return platformNames[ platform ]; } - }
diff --git a/plugins/org.eclipse.epp.wizard/src/org/eclipse/epp/wizard/internal/ui/WizardSelectionScreen.java b/plugins/org.eclipse.epp.wizard/src/org/eclipse/epp/wizard/internal/ui/WizardSelectionScreen.java index 987cfc0..5cddcb0 100644 --- a/plugins/org.eclipse.epp.wizard/src/org/eclipse/epp/wizard/internal/ui/WizardSelectionScreen.java +++ b/plugins/org.eclipse.epp.wizard/src/org/eclipse/epp/wizard/internal/ui/WizardSelectionScreen.java
@@ -1,31 +1,67 @@ /******************************************************************************* - * Copyright (c) 2008 Innoopract Informationssysteme GmbH. - * 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: - * Innoopract Informationssysteme GmbH - initial API and implementation + * Copyright (c) 2008 Innoopract Informationssysteme GmbH. 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: + * Innoopract Informationssysteme GmbH - initial API and implementation ******************************************************************************/ package org.eclipse.epp.wizard.internal.ui; import org.eclipse.epp.wizard.model.Group; import org.eclipse.epp.wizard.model.Screen; import org.eclipse.swt.SWT; +import org.eclipse.swt.custom.ScrolledComposite; +import org.eclipse.swt.events.ControlEvent; +import org.eclipse.swt.graphics.Rectangle; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; - -public class WizardSelectionScreen extends Composite implements IWizardScreen { +/** + * @author Jordi Boehme Lopez <jboehme@innoopract.com> + */ +public class WizardSelectionScreen extends ScrolledComposite + implements IWizardScreen +{ private final Screen screen; + private Composite content; public WizardSelectionScreen( final Screen screen, final Composite parent ) { - super( parent, SWT.NONE ); + super( parent, SWT.H_SCROLL | SWT.V_SCROLL ); + setExpandVertical( true ); + setExpandHorizontal( true ); this.screen = screen; - createContent( this ); + content = new Composite( this, SWT.NONE ) { + + @Override + public void layout() { + super.layout(); + fixScroll(); + } + }; + this.setContent( content ); + createContent( content ); + layout(); + addControlListener( new org.eclipse.swt.events.ControlAdapter() { + + @Override + public void controlResized( ControlEvent e ) { + super.controlResized( e ); + fixScroll(); + } + } ); + } + + @Override + public void layout() { + super.layout(); + // fixScroll(); + } + + private void fixScroll() { + Rectangle r = getClientArea(); + setMinSize( content.computeSize( r.width - 30, SWT.DEFAULT ) ); } public void createContent( final Composite parent ) { @@ -36,7 +72,6 @@ layout.marginWidth = 1; parent.setLayout( layout ); createSelectionArea( parent ); - } private void createSelectionArea( final Composite parent ) { @@ -46,7 +81,7 @@ GroupSelection groupUi = new GroupSelection( parent, group ); } } - + public Control getControl() { return this; } @@ -54,13 +89,11 @@ public String getLabel() { return getScreen().getLabel(); } - - ////////////////// + + // //////////////// // helping methods - ////////////////// - + // //////////////// private Screen getScreen() { return screen; } - }