You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(7) |
Aug
|
Sep
(46) |
Oct
(102) |
Nov
(10) |
Dec
(21) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(1) |
Feb
(3) |
Mar
(14) |
Apr
(9) |
May
(12) |
Jun
(4) |
Jul
(40) |
Aug
(60) |
Sep
(38) |
Oct
(2) |
Nov
(1) |
Dec
(42) |
2008 |
Jan
(23) |
Feb
(29) |
Mar
(107) |
Apr
(27) |
May
(3) |
Jun
(1) |
Jul
(15) |
Aug
(7) |
Sep
(19) |
Oct
|
Nov
(2) |
Dec
|
2009 |
Jan
(36) |
Feb
(4) |
Mar
(2) |
Apr
(1) |
May
(1) |
Jun
(15) |
Jul
(30) |
Aug
(32) |
Sep
(11) |
Oct
(21) |
Nov
(12) |
Dec
(15) |
2010 |
Jan
(29) |
Feb
(9) |
Mar
(25) |
Apr
|
May
(7) |
Jun
(5) |
Jul
(21) |
Aug
(32) |
Sep
(10) |
Oct
(8) |
Nov
(29) |
Dec
(8) |
2011 |
Jan
(9) |
Feb
(35) |
Mar
(11) |
Apr
(4) |
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
(3) |
Dec
(30) |
2012 |
Jan
(5) |
Feb
(7) |
Mar
(10) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <hu...@us...> - 2006-10-08 15:08:05
|
Revision: 253 http://svn.sourceforge.net/cishell/?rev=253&view=rev Author: huangb Date: 2006-10-08 08:07:59 -0700 (Sun, 08 Oct 2006) Log Message: ----------- Added Paths: ----------- trunk/libs/coltlib/ Removed Paths: ------------- trunk/libs/cern.colt/ Copied: trunk/libs/coltlib (from rev 252, trunk/libs/cern.colt) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hu...@us...> - 2006-10-08 15:01:17
|
Revision: 252 http://svn.sourceforge.net/cishell/?rev=252&view=rev Author: huangb Date: 2006-10-08 08:01:10 -0700 (Sun, 08 Oct 2006) Log Message: ----------- Added Paths: ----------- trunk/libs/edu.uci.ics.jung/ Removed Paths: ------------- trunk/libs/edu.uci.ics.junglib/ Copied: trunk/libs/edu.uci.ics.jung (from rev 251, trunk/libs/edu.uci.ics.junglib) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hu...@us...> - 2006-10-08 15:00:48
|
Revision: 251 http://svn.sourceforge.net/cishell/?rev=251&view=rev Author: huangb Date: 2006-10-08 08:00:40 -0700 (Sun, 08 Oct 2006) Log Message: ----------- Added Paths: ----------- trunk/libs/cern.colt/ Removed Paths: ------------- trunk/libs/coltlib/ Copied: trunk/libs/cern.colt (from rev 250, trunk/libs/coltlib) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hu...@us...> - 2006-10-06 03:49:06
|
Revision: 250 http://svn.sourceforge.net/cishell/?rev=250&view=rev Author: huangb Date: 2006-10-05 20:48:36 -0700 (Thu, 05 Oct 2006) Log Message: ----------- initial version Added Paths: ----------- trunk/libs/org.apache.commons.collections/.classpath trunk/libs/org.apache.commons.collections/.project trunk/libs/org.apache.commons.collections/.settings/ trunk/libs/org.apache.commons.collections/.settings/org.eclipse.pde.core.prefs trunk/libs/org.apache.commons.collections/META-INF/ trunk/libs/org.apache.commons.collections/META-INF/MANIFEST.MF trunk/libs/org.apache.commons.collections/build.properties trunk/libs/org.apache.commons.collections/commons-collections-3.1.jar Added: trunk/libs/org.apache.commons.collections/.classpath =================================================================== --- trunk/libs/org.apache.commons.collections/.classpath (rev 0) +++ trunk/libs/org.apache.commons.collections/.classpath 2006-10-06 03:48:36 UTC (rev 250) @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry exported="true" kind="lib" path="commons-collections-3.1.jar"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> + <classpathentry kind="output" path="bin"/> +</classpath> Added: trunk/libs/org.apache.commons.collections/.project =================================================================== --- trunk/libs/org.apache.commons.collections/.project (rev 0) +++ trunk/libs/org.apache.commons.collections/.project 2006-10-06 03:48:36 UTC (rev 250) @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>org.apache.commons.collections</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.ManifestBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.SchemaBuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.pde.PluginNature</nature> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> Added: trunk/libs/org.apache.commons.collections/.settings/org.eclipse.pde.core.prefs =================================================================== --- trunk/libs/org.apache.commons.collections/.settings/org.eclipse.pde.core.prefs (rev 0) +++ trunk/libs/org.apache.commons.collections/.settings/org.eclipse.pde.core.prefs 2006-10-06 03:48:36 UTC (rev 250) @@ -0,0 +1,4 @@ +#Mon Sep 18 11:13:15 EDT 2006 +eclipse.preferences.version=1 +pluginProject.equinox=false +pluginProject.extensions=false Added: trunk/libs/org.apache.commons.collections/META-INF/MANIFEST.MF =================================================================== --- trunk/libs/org.apache.commons.collections/META-INF/MANIFEST.MF (rev 0) +++ trunk/libs/org.apache.commons.collections/META-INF/MANIFEST.MF 2006-10-06 03:48:36 UTC (rev 250) @@ -0,0 +1,8 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Apache Commons Plug-in +Bundle-SymbolicName: org.apache.commons.collections +Bundle-Version: 3.1.0 +Bundle-ClassPath: commons-collections-3.1.jar +Bundle-Localization: plugin +Export-Package: org.apache.commons.collections,org.apache.commons.collections.bag,org.apache.commons.collections.bidimap,org.apache.commons.collections.buffer,org.apache.commons.collections.collection,org.apache.commons.collections.comparators,org.apache.commons.collections.functors,org.apache.commons.collections.iterators,org.apache.commons.collections.keyvalue,org.apache.commons.collections.list,org.apache.commons.collections.map,org.apache.commons.collections.set Added: trunk/libs/org.apache.commons.collections/build.properties =================================================================== --- trunk/libs/org.apache.commons.collections/build.properties (rev 0) +++ trunk/libs/org.apache.commons.collections/build.properties 2006-10-06 03:48:36 UTC (rev 250) @@ -0,0 +1,2 @@ +bin.includes = META-INF/,\ + commons-collections-3.1.jar Added: trunk/libs/org.apache.commons.collections/commons-collections-3.1.jar =================================================================== (Binary files differ) Property changes on: trunk/libs/org.apache.commons.collections/commons-collections-3.1.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hu...@us...> - 2006-10-06 03:48:14
|
Revision: 249 http://svn.sourceforge.net/cishell/?rev=249&view=rev Author: huangb Date: 2006-10-05 20:48:00 -0700 (Thu, 05 Oct 2006) Log Message: ----------- Initial import. Added Paths: ----------- trunk/libs/org.apache.commons.collections/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hu...@us...> - 2006-10-05 15:03:01
|
Revision: 247 http://svn.sourceforge.net/cishell/?rev=247&view=rev Author: huangb Date: 2006-10-05 08:00:37 -0700 (Thu, 05 Oct 2006) Log Message: ----------- Initial import. Added Paths: ----------- trunk/libs/coltlib/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hu...@us...> - 2006-10-05 15:01:28
|
Revision: 248 http://svn.sourceforge.net/cishell/?rev=248&view=rev Author: huangb Date: 2006-10-05 08:01:05 -0700 (Thu, 05 Oct 2006) Log Message: ----------- initial version Added Paths: ----------- trunk/libs/coltlib/.classpath trunk/libs/coltlib/.project trunk/libs/coltlib/.settings/ trunk/libs/coltlib/.settings/org.eclipse.pde.core.prefs trunk/libs/coltlib/META-INF/ trunk/libs/coltlib/META-INF/MANIFEST.MF trunk/libs/coltlib/build.properties trunk/libs/coltlib/colt.jar Added: trunk/libs/coltlib/.classpath =================================================================== --- trunk/libs/coltlib/.classpath (rev 0) +++ trunk/libs/coltlib/.classpath 2006-10-05 15:01:05 UTC (rev 248) @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry exported="true" kind="lib" path="colt.jar"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> + <classpathentry kind="output" path="bin"/> +</classpath> Added: trunk/libs/coltlib/.project =================================================================== --- trunk/libs/coltlib/.project (rev 0) +++ trunk/libs/coltlib/.project 2006-10-05 15:01:05 UTC (rev 248) @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>coltlib</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.ManifestBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.SchemaBuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.pde.PluginNature</nature> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> Added: trunk/libs/coltlib/.settings/org.eclipse.pde.core.prefs =================================================================== --- trunk/libs/coltlib/.settings/org.eclipse.pde.core.prefs (rev 0) +++ trunk/libs/coltlib/.settings/org.eclipse.pde.core.prefs 2006-10-05 15:01:05 UTC (rev 248) @@ -0,0 +1,4 @@ +#Wed Oct 04 10:54:14 EDT 2006 +eclipse.preferences.version=1 +pluginProject.equinox=false +pluginProject.extensions=false Added: trunk/libs/coltlib/META-INF/MANIFEST.MF =================================================================== --- trunk/libs/coltlib/META-INF/MANIFEST.MF (rev 0) +++ trunk/libs/coltlib/META-INF/MANIFEST.MF 2006-10-05 15:01:05 UTC (rev 248) @@ -0,0 +1,8 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Coltlib Plug-in +Bundle-SymbolicName: coltlib +Bundle-Version: 1.2.0 +Bundle-ClassPath: colt.jar +Bundle-Localization: plugin +Export-Package: cern.clhep,cern.colt,cern.colt.bitvector,cern.colt.buffer,cern.colt.function,cern.colt.list,cern.colt.list.adapter,cern.colt.map,cern.colt.matrix,cern.colt.matrix.bench,cern.colt.matrix.doublealgo,cern.colt.matrix.impl,cern.colt.matrix.linalg,cern.colt.matrix.objectalgo,cern.jet.math,cern.jet.random,cern.jet.random.engine,cern.jet.random.sampling,cern.jet.stat,cern.jet.stat.quantile,corejava,hep.aida,hep.aida.bin,hep.aida.ref Added: trunk/libs/coltlib/build.properties =================================================================== --- trunk/libs/coltlib/build.properties (rev 0) +++ trunk/libs/coltlib/build.properties 2006-10-05 15:01:05 UTC (rev 248) @@ -0,0 +1,2 @@ +bin.includes = META-INF/,\ + colt.jar Added: trunk/libs/coltlib/colt.jar =================================================================== (Binary files differ) Property changes on: trunk/libs/coltlib/colt.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hu...@us...> - 2006-10-05 14:37:33
|
Revision: 245 http://svn.sourceforge.net/cishell/?rev=245&view=rev Author: huangb Date: 2006-10-05 07:36:38 -0700 (Thu, 05 Oct 2006) Log Message: ----------- Initial import. Added Paths: ----------- trunk/libs/edu.uci.ics.junglib/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hu...@us...> - 2006-10-05 14:37:33
|
Revision: 246 http://svn.sourceforge.net/cishell/?rev=246&view=rev Author: huangb Date: 2006-10-05 07:37:12 -0700 (Thu, 05 Oct 2006) Log Message: ----------- version 1.7.4 Added Paths: ----------- trunk/libs/edu.uci.ics.junglib/.classpath trunk/libs/edu.uci.ics.junglib/.project trunk/libs/edu.uci.ics.junglib/.settings/ trunk/libs/edu.uci.ics.junglib/.settings/org.eclipse.pde.core.prefs trunk/libs/edu.uci.ics.junglib/META-INF/ trunk/libs/edu.uci.ics.junglib/META-INF/MANIFEST.MF trunk/libs/edu.uci.ics.junglib/build.properties trunk/libs/edu.uci.ics.junglib/jung-1.7.4.jar Added: trunk/libs/edu.uci.ics.junglib/.classpath =================================================================== --- trunk/libs/edu.uci.ics.junglib/.classpath (rev 0) +++ trunk/libs/edu.uci.ics.junglib/.classpath 2006-10-05 14:37:12 UTC (rev 246) @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry exported="true" kind="lib" path="jung-1.7.4.jar"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> + <classpathentry kind="output" path="bin"/> +</classpath> Added: trunk/libs/edu.uci.ics.junglib/.project =================================================================== --- trunk/libs/edu.uci.ics.junglib/.project (rev 0) +++ trunk/libs/edu.uci.ics.junglib/.project 2006-10-05 14:37:12 UTC (rev 246) @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>edu.uci.ics.junglib</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.ManifestBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.SchemaBuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.pde.PluginNature</nature> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> Added: trunk/libs/edu.uci.ics.junglib/.settings/org.eclipse.pde.core.prefs =================================================================== --- trunk/libs/edu.uci.ics.junglib/.settings/org.eclipse.pde.core.prefs (rev 0) +++ trunk/libs/edu.uci.ics.junglib/.settings/org.eclipse.pde.core.prefs 2006-10-05 14:37:12 UTC (rev 246) @@ -0,0 +1,4 @@ +#Wed Oct 04 10:36:19 EDT 2006 +eclipse.preferences.version=1 +pluginProject.equinox=false +pluginProject.extensions=false Added: trunk/libs/edu.uci.ics.junglib/META-INF/MANIFEST.MF =================================================================== --- trunk/libs/edu.uci.ics.junglib/META-INF/MANIFEST.MF (rev 0) +++ trunk/libs/edu.uci.ics.junglib/META-INF/MANIFEST.MF 2006-10-05 14:37:12 UTC (rev 246) @@ -0,0 +1,53 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Jung Plug-in +Bundle-SymbolicName: edu.uci.ics.jung +Bundle-Version: 1.7.4 +Bundle-ClassPath: jung-1.7.4.jar +Bundle-Localization: plugin +Export-Package: edu.uci.ics.jung.algorithms, + edu.uci.ics.jung.algorithms.blockmodel, + edu.uci.ics.jung.algorithms.cluster, + edu.uci.ics.jung.algorithms.connectivity, + edu.uci.ics.jung.algorithms.flows, + edu.uci.ics.jung.algorithms.importance, + edu.uci.ics.jung.algorithms.metrics, + edu.uci.ics.jung.algorithms.shortestpath, + edu.uci.ics.jung.algorithms.transformation, + edu.uci.ics.jung.exceptions, + edu.uci.ics.jung.graph, + edu.uci.ics.jung.graph.decorators, + edu.uci.ics.jung.graph.event, + edu.uci.ics.jung.graph.filters, + edu.uci.ics.jung.graph.filters.impl, + edu.uci.ics.jung.graph.impl, + edu.uci.ics.jung.graph.predicates, + edu.uci.ics.jung.io, + edu.uci.ics.jung.random.generators, + edu.uci.ics.jung.random.permuters, + edu.uci.ics.jung.statistics, + edu.uci.ics.jung.utils, + edu.uci.ics.jung.visualization, + edu.uci.ics.jung.visualization.contrib, + edu.uci.ics.jung.visualization.control, + edu.uci.ics.jung.visualization.graphdraw, + edu.uci.ics.jung.visualization.subLayout, + edu.uci.ics.jung.visualization.transform, + edu.uci.ics.jung.visualization.transform.shape, + samples.graph, + samples.graph.southern, + samples.preview_new_graphdraw, + samples.preview_new_graphdraw.event, + samples.preview_new_graphdraw.impl, + samples.preview_new_graphdraw.impl.crooked, + samples.preview_new_graphdraw.iter, + samples.preview_new_graphdraw.iterablelayouts, + samples.preview_new_graphdraw.staticlayouts, + samples.preview_new_graphdraw.test, + samples.preview_new_graphdraw.transform +Import-Package: cern.colt.matrix, + cern.colt.matrix.impl, + cern.jet.random.engine, + org.apache.commons.collections, + org.apache.commons.collections.buffer, + org.apache.commons.collections.functors Added: trunk/libs/edu.uci.ics.junglib/build.properties =================================================================== --- trunk/libs/edu.uci.ics.junglib/build.properties (rev 0) +++ trunk/libs/edu.uci.ics.junglib/build.properties 2006-10-05 14:37:12 UTC (rev 246) @@ -0,0 +1,2 @@ +bin.includes = META-INF/,\ + jung-1.7.4.jar Added: trunk/libs/edu.uci.ics.junglib/jung-1.7.4.jar =================================================================== (Binary files differ) Property changes on: trunk/libs/edu.uci.ics.junglib/jung-1.7.4.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hu...@us...> - 2006-10-04 15:39:03
|
Revision: 244 http://svn.sourceforge.net/cishell/?rev=244&view=rev Author: huangb Date: 2006-10-04 08:38:05 -0700 (Wed, 04 Oct 2006) Log Message: ----------- clean up the converter after using it for the data conversion Modified Paths: -------------- trunk/clients/gui/org.cishell.reference.gui.menumanager/src/org/cishell/reference/gui/menumanager/menu/AlgorithmAction.java trunk/clients/gui/org.cishell.reference.gui.menumanager/src/org/cishell/reference/gui/menumanager/menu/AlgorithmWrapper.java Modified: trunk/clients/gui/org.cishell.reference.gui.menumanager/src/org/cishell/reference/gui/menumanager/menu/AlgorithmAction.java =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.menumanager/src/org/cishell/reference/gui/menumanager/menu/AlgorithmAction.java 2006-10-03 19:20:18 UTC (rev 243) +++ trunk/clients/gui/org.cishell.reference.gui.menumanager/src/org/cishell/reference/gui/menumanager/menu/AlgorithmAction.java 2006-10-04 15:38:05 UTC (rev 244) @@ -158,6 +158,7 @@ for (int j=0; j < data.length; j++) { if (converters[j] != null && converters[j].length > 0) { data[j] = converters[j][0].convert(data[j]); + converters[j] = null; } } Modified: trunk/clients/gui/org.cishell.reference.gui.menumanager/src/org/cishell/reference/gui/menumanager/menu/AlgorithmWrapper.java =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.menumanager/src/org/cishell/reference/gui/menumanager/menu/AlgorithmWrapper.java 2006-10-03 19:20:18 UTC (rev 243) +++ trunk/clients/gui/org.cishell.reference.gui.menumanager/src/org/cishell/reference/gui/menumanager/menu/AlgorithmWrapper.java 2006-10-04 15:38:05 UTC (rev 244) @@ -54,6 +54,7 @@ for (int i=0; i < data.length; i++) { if (converters[i] != null) { data[i] = converters[i][0].convert(data[i]); + converters[i] = null; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bh...@us...> - 2006-10-04 01:46:56
|
Revision: 219 http://svn.sourceforge.net/cishell/?rev=219&view=rev Author: bh2 Date: 2006-09-28 15:16:30 -0700 (Thu, 28 Sep 2006) Log Message: ----------- Initial commit of the new SWT-based GUIBuilder with no dependencies on old IVC code. This will be the official gui builder going forward. Multi-Valued AttributeDefinitions are not yet supported by this version of the GUI Builder. Added Paths: ----------- trunk/clients/gui/org.cishell.reference.gui.guibuilder.swt/.classpath trunk/clients/gui/org.cishell.reference.gui.guibuilder.swt/.project trunk/clients/gui/org.cishell.reference.gui.guibuilder.swt/.settings/ trunk/clients/gui/org.cishell.reference.gui.guibuilder.swt/.settings/org.eclipse.pde.core.prefs trunk/clients/gui/org.cishell.reference.gui.guibuilder.swt/META-INF/ trunk/clients/gui/org.cishell.reference.gui.guibuilder.swt/META-INF/MANIFEST.MF trunk/clients/gui/org.cishell.reference.gui.guibuilder.swt/build.properties trunk/clients/gui/org.cishell.reference.gui.guibuilder.swt/src/ trunk/clients/gui/org.cishell.reference.gui.guibuilder.swt/src/org/ trunk/clients/gui/org.cishell.reference.gui.guibuilder.swt/src/org/cishell/ trunk/clients/gui/org.cishell.reference.gui.guibuilder.swt/src/org/cishell/reference/ trunk/clients/gui/org.cishell.reference.gui.guibuilder.swt/src/org/cishell/reference/gui/ trunk/clients/gui/org.cishell.reference.gui.guibuilder.swt/src/org/cishell/reference/gui/guibuilder/ trunk/clients/gui/org.cishell.reference.gui.guibuilder.swt/src/org/cishell/reference/gui/guibuilder/swt/ trunk/clients/gui/org.cishell.reference.gui.guibuilder.swt/src/org/cishell/reference/gui/guibuilder/swt/SWTGui.java trunk/clients/gui/org.cishell.reference.gui.guibuilder.swt/src/org/cishell/reference/gui/guibuilder/swt/SWTGuiBuilderService.java trunk/clients/gui/org.cishell.reference.gui.guibuilder.swt/src/org/cishell/reference/gui/guibuilder/swt/SWTGuiComposite.java trunk/clients/gui/org.cishell.reference.gui.guibuilder.swt/src/org/cishell/reference/gui/guibuilder/swt/builder/ trunk/clients/gui/org.cishell.reference.gui.guibuilder.swt/src/org/cishell/reference/gui/guibuilder/swt/builder/AbstractComponent.java trunk/clients/gui/org.cishell.reference.gui.guibuilder.swt/src/org/cishell/reference/gui/guibuilder/swt/builder/AbstractDialog.java trunk/clients/gui/org.cishell.reference.gui.guibuilder.swt/src/org/cishell/reference/gui/guibuilder/swt/builder/ComponentProvider.java trunk/clients/gui/org.cishell.reference.gui.guibuilder.swt/src/org/cishell/reference/gui/guibuilder/swt/builder/GUIComponent.java trunk/clients/gui/org.cishell.reference.gui.guibuilder.swt/src/org/cishell/reference/gui/guibuilder/swt/builder/StringConverter.java trunk/clients/gui/org.cishell.reference.gui.guibuilder.swt/src/org/cishell/reference/gui/guibuilder/swt/builder/UpdateListener.java trunk/clients/gui/org.cishell.reference.gui.guibuilder.swt/src/org/cishell/reference/gui/guibuilder/swt/builder/components/ trunk/clients/gui/org.cishell.reference.gui.guibuilder.swt/src/org/cishell/reference/gui/guibuilder/swt/builder/components/BooleanComponent.java trunk/clients/gui/org.cishell.reference.gui.guibuilder.swt/src/org/cishell/reference/gui/guibuilder/swt/builder/components/DirectoryComponent.java trunk/clients/gui/org.cishell.reference.gui.guibuilder.swt/src/org/cishell/reference/gui/guibuilder/swt/builder/components/FileComponent.java trunk/clients/gui/org.cishell.reference.gui.guibuilder.swt/src/org/cishell/reference/gui/guibuilder/swt/builder/components/LabelingComponent.java trunk/clients/gui/org.cishell.reference.gui.guibuilder.swt/src/org/cishell/reference/gui/guibuilder/swt/builder/components/MultiValuedComponent.java trunk/clients/gui/org.cishell.reference.gui.guibuilder.swt/src/org/cishell/reference/gui/guibuilder/swt/builder/components/StringComponent.java Added: trunk/clients/gui/org.cishell.reference.gui.guibuilder.swt/.classpath =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.guibuilder.swt/.classpath (rev 0) +++ trunk/clients/gui/org.cishell.reference.gui.guibuilder.swt/.classpath 2006-09-28 22:16:30 UTC (rev 219) @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" path="src"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> + <classpathentry kind="output" path="bin"/> +</classpath> Added: trunk/clients/gui/org.cishell.reference.gui.guibuilder.swt/.project =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.guibuilder.swt/.project (rev 0) +++ trunk/clients/gui/org.cishell.reference.gui.guibuilder.swt/.project 2006-09-28 22:16:30 UTC (rev 219) @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>org.cishell.reference.gui.guibuilder.swt</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.ManifestBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.SchemaBuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.pde.PluginNature</nature> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> Added: trunk/clients/gui/org.cishell.reference.gui.guibuilder.swt/.settings/org.eclipse.pde.core.prefs =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.guibuilder.swt/.settings/org.eclipse.pde.core.prefs (rev 0) +++ trunk/clients/gui/org.cishell.reference.gui.guibuilder.swt/.settings/org.eclipse.pde.core.prefs 2006-09-28 22:16:30 UTC (rev 219) @@ -0,0 +1,4 @@ +#Thu Sep 14 16:30:07 EST 2006 +eclipse.preferences.version=1 +pluginProject.equinox=false +pluginProject.extensions=false Added: trunk/clients/gui/org.cishell.reference.gui.guibuilder.swt/META-INF/MANIFEST.MF =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.guibuilder.swt/META-INF/MANIFEST.MF (rev 0) +++ trunk/clients/gui/org.cishell.reference.gui.guibuilder.swt/META-INF/MANIFEST.MF 2006-09-28 22:16:30 UTC (rev 219) @@ -0,0 +1,12 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: GUI Builder Reference Implementation Using SWT +Bundle-SymbolicName: org.cishell.reference.gui.guibuilder.swt +Bundle-Version: 0.0.1 +Bundle-Localization: plugin +Import-Package: org.cishell.framework, + org.cishell.service.guibuilder, + org.osgi.framework;version="1.3.0", + org.osgi.service.metatype;version="1.1.0" +Require-Bundle: org.eclipse.swt +Export-Package: org.cishell.reference.gui.guibuilder.swt Added: trunk/clients/gui/org.cishell.reference.gui.guibuilder.swt/build.properties =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.guibuilder.swt/build.properties (rev 0) +++ trunk/clients/gui/org.cishell.reference.gui.guibuilder.swt/build.properties 2006-09-28 22:16:30 UTC (rev 219) @@ -0,0 +1,4 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + . Added: trunk/clients/gui/org.cishell.reference.gui.guibuilder.swt/src/org/cishell/reference/gui/guibuilder/swt/SWTGui.java =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.guibuilder.swt/src/org/cishell/reference/gui/guibuilder/swt/SWTGui.java (rev 0) +++ trunk/clients/gui/org.cishell.reference.gui.guibuilder.swt/src/org/cishell/reference/gui/guibuilder/swt/SWTGui.java 2006-09-28 22:16:30 UTC (rev 219) @@ -0,0 +1,212 @@ +/* **************************************************************************** + * CIShell: Cyberinfrastructure Shell, An Algorithm Integration Framework. + * + * All rights reserved. This program and the accompanying materials are made + * available under the terms of the Apache License v2.0 which accompanies + * this distribution, and is available at: + * http://www.apache.org/licenses/LICENSE-2.0.html + * + * Created on Sep 14, 2006 at Indiana University. + * + * Contributors: + * Indiana University - + * ***************************************************************************/ +package org.cishell.reference.gui.guibuilder.swt; + +import java.util.Dictionary; + +import org.cishell.reference.gui.guibuilder.swt.builder.GUIComponent; +import org.cishell.reference.gui.guibuilder.swt.builder.UpdateListener; +import org.cishell.service.guibuilder.GUI; +import org.cishell.service.guibuilder.SelectionListener; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.DisposeEvent; +import org.eclipse.swt.events.DisposeListener; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.graphics.Font; +import org.eclipse.swt.layout.FillLayout; +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.Display; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Shell; +import org.osgi.service.metatype.MetaTypeProvider; +import org.osgi.service.metatype.ObjectClassDefinition; + +/** + * + * @author Bruce Herr (bh...@bh...) + */ +public class SWTGui implements GUI, UpdateListener { + private Shell shell; + private SWTGuiComposite composite; + private SelectionListener listener; + private boolean hitOk = false; + + private Button okButton; + + public SWTGui(final Shell shell, int style, + String id, MetaTypeProvider provider) { + this.shell = shell; + + if (provider == null) { + throw new IllegalArgumentException("Null MetaTypeProvider given"); + } + + ObjectClassDefinition ocd = provider.getObjectClassDefinition(id, null); + shell.setText(ocd.getName()); + + GridLayout gridLayout = new GridLayout(); + gridLayout.numColumns = 1; + shell.setLayout(gridLayout); + + Font defaultFont = new Font(shell.getDisplay(), "SanSerif", 8, SWT.NONE); + + //stuff to display a message + String message = ocd.getDescription(); + if(message != null && !message.equals("")){ + Label msg = new Label(shell, SWT.CENTER); + msg.setText(message); + + GridData labelData = new GridData(); + labelData.horizontalAlignment = SWT.CENTER; + msg.setLayoutData(labelData); + } + + //set up the user area where the main GUI will be set up using Parameters + composite = new SWTGuiComposite(shell, style, id, provider); + composite.addUpdateListener(this); + + //the group w/ ok and cancel + Composite buttonsGroup = new Composite(shell, SWT.NONE); + FillLayout rowLayout = new FillLayout(); + rowLayout.spacing = 5; + buttonsGroup.setLayout(rowLayout); + + //place them at the bottom right + GridData gridData = new GridData(); + gridData.horizontalAlignment = GridData.END; + gridData.grabExcessHorizontalSpace = false; + buttonsGroup.setLayoutData(gridData); + + Button cancel = new Button(buttonsGroup, SWT.NONE); + cancel.setText("Cancel"); + cancel.setSize(40, 20); + cancel.setFont(defaultFont); + cancel.addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) { + close(); + } + }); + + okButton = new Button(buttonsGroup, SWT.PUSH); + okButton.setText("OK"); + okButton.setSize(40, 20); + okButton.setFont(defaultFont); + okButton.addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) { + hitOk = true; + close(); + + if (listener != null) { + listener.hitOk(composite.getEnteredResponses()); + } + } + }); + + shell.addDisposeListener(new DisposeListener() { + public void widgetDisposed(DisposeEvent e) { + if (!hitOk && listener != null) { + listener.cancelled(); + } + }}); + + validate(); + } + + /** + * @see org.cishell.service.guibuilder.GUI#close() + */ + public void close() { + shell.getDisplay().syncExec(new Runnable() { + public void run() { + shell.close(); + shell.dispose(); + }}); + } + + /** + * @see org.cishell.service.guibuilder.GUI#isClosed() + */ + public boolean isClosed() { + return shell.isDisposed(); + } + + /** + * @see org.cishell.service.guibuilder.GUI#open() + */ + public void open() { + shell.getDisplay().syncExec(new Runnable() { + public void run() { + shell.pack(); + shell.open(); + }}); + } + + /** + * @see org.cishell.service.guibuilder.GUI#openAndWait() + */ + public Dictionary openAndWait() { + open(); + final Display display = shell.getDisplay(); + + OpenAndWaitListener listener = new OpenAndWaitListener(); + setSelectionListener(listener); + + display.syncExec(new Runnable() { + public void run() { + while (!isClosed()) { + if (!display.readAndDispatch()) display.sleep(); + } + }}); + + return listener.valuesEntered; + } + + private static class OpenAndWaitListener implements SelectionListener { + Dictionary valuesEntered = null; + + public void cancelled() {} + + public void hitOk(Dictionary valuesEntered) { + this.valuesEntered = valuesEntered; + } + } + + /** + * @see org.cishell.service.guibuilder.GUI#setSelectionListener(org.cishell.service.guibuilder.SelectionListener) + */ + public void setSelectionListener(SelectionListener listener) { + this.listener = listener; + } + + public String validate() { + String valid = composite.validate(); + + //if valid is a string then the string is the error message + if (valid != null && valid.length() > 0) { + okButton.setEnabled(false); + } else { + okButton.setEnabled(true); + } + + return valid; + } + + public void componentUpdated(GUIComponent component) { + validate(); + } +} Added: trunk/clients/gui/org.cishell.reference.gui.guibuilder.swt/src/org/cishell/reference/gui/guibuilder/swt/SWTGuiBuilderService.java =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.guibuilder.swt/src/org/cishell/reference/gui/guibuilder/swt/SWTGuiBuilderService.java (rev 0) +++ trunk/clients/gui/org.cishell.reference.gui.guibuilder.swt/src/org/cishell/reference/gui/guibuilder/swt/SWTGuiBuilderService.java 2006-09-28 22:16:30 UTC (rev 219) @@ -0,0 +1,188 @@ +/* **************************************************************************** + * CIShell: Cyberinfrastructure Shell, An Algorithm Integration Framework. + * + * All rights reserved. This program and the accompanying materials are made + * available under the terms of the Apache License v2.0 which accompanies + * this distribution, and is available at: + * http://www.apache.org/licenses/LICENSE-2.0.html + * + * Created on Sep 14, 2006 at Indiana University. + * + * Contributors: + * Indiana University - + * ***************************************************************************/ +package org.cishell.reference.gui.guibuilder.swt; + +import java.io.PrintWriter; +import java.io.StringWriter; +import java.util.Dictionary; +import java.util.Hashtable; + +import org.cishell.reference.gui.guibuilder.swt.builder.AbstractDialog; +import org.cishell.service.guibuilder.GUI; +import org.cishell.service.guibuilder.GUIBuilderService; +import org.cishell.service.guibuilder.SelectionListener; +import org.eclipse.swt.SWT; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Shell; +import org.osgi.service.metatype.MetaTypeProvider; + +/** + * + * @author Bruce Herr (bh...@bh...) + */ +public class SWTGuiBuilderService implements GUIBuilderService { + private static final GUI NULL_GUI = new GUI() { + public void open() {} + public void close() {} + + public boolean isClosed() { + return true; + } + + public Dictionary openAndWait() { + return new Hashtable(); + } + + public void setSelectionListener(SelectionListener listener) { + if (listener != null) + listener.cancelled(); + }}; + + private Display display; + + + public SWTGuiBuilderService(Display display) { + this.display = display; + } + + + public GUI createGUI(String id, MetaTypeProvider parameters) { + GUICreator creator = new GUICreator(id, parameters); + display.syncExec(creator); + + return creator.gui; + } + + private class GUICreator implements Runnable { + GUI gui = NULL_GUI; + String id; + MetaTypeProvider parameters; + + public GUICreator(String id, MetaTypeProvider parameters) { + this.id = id; + this.parameters = parameters; + } + + public void run() { + try { + Shell activeShell = display.getActiveShell(); + + Shell shell = new Shell(activeShell, SWT.DIALOG_TRIM | SWT.RESIZE); + if (activeShell != null) { + shell.setImage(activeShell.getImage()); + } + + gui = new SWTGui(shell,SWT.NONE,id,parameters); + } catch (IllegalArgumentException e) {} + } + } + + private static class Returner { + Object returnValue; + } + + private Shell getActiveShell() { + final Returner returner = new Returner(); + guiRun(new Runnable() { + public void run() { + returner.returnValue = display.getActiveShell(); + }}); + + return (Shell) returner.returnValue; + } + + private void guiRun(Runnable runner) { + if (display.getThread() == Thread.currentThread()) { + runner.run(); + } else { + display.syncExec(runner); + } + } + + public Dictionary createGUIandWait(String id, MetaTypeProvider parameters) { + return createGUI(id, parameters).openAndWait(); + } + + /** + * @see org.cishell.service.guibuilder.GUIBuilderService#showConfirm(java.lang.String, java.lang.String, java.lang.String) + */ + public boolean showConfirm(final String title, final String message, final String detail) { + final Returner returner = new Returner(); + + guiRun(new Runnable() { + public void run() { + returner.returnValue = new Boolean( + AbstractDialog.openConfirm(getActiveShell(), title, message, detail)); + }}); + + return ((Boolean)returner.returnValue).booleanValue(); + } + + /** + * @see org.cishell.service.guibuilder.GUIBuilderService#showError(java.lang.String, java.lang.String, java.lang.String) + */ + public void showError(final String title, final String message, final String detail) { + guiRun(new Runnable() { + public void run() { + AbstractDialog.openError(getActiveShell(), title, message, detail); + }}); + } + + /** + * @see org.cishell.service.guibuilder.GUIBuilderService#showError(java.lang.String, java.lang.String, java.lang.Throwable) + */ + public void showError(String title, String message, Throwable error) { + if (error != null) { + StringWriter writer = new StringWriter(); + error.printStackTrace(new PrintWriter(writer)); + + showError(title, message, writer.getBuffer().toString()); + } + } + + /** + * @see org.cishell.service.guibuilder.GUIBuilderService#showInformation(java.lang.String, java.lang.String, java.lang.String) + */ + public void showInformation(final String title, final String message, final String detail) { + guiRun(new Runnable() { + public void run() { + AbstractDialog.openInformation(getActiveShell(), title, message, detail); + }}); + } + + /** + * @see org.cishell.service.guibuilder.GUIBuilderService#showQuestion(java.lang.String, java.lang.String, java.lang.String) + */ + public boolean showQuestion(final String title, final String message, final String detail) { + final Returner returner = new Returner(); + + guiRun(new Runnable() { + public void run() { + returner.returnValue = new Boolean( + AbstractDialog.openQuestion(getActiveShell(), title, message, detail)); + }}); + + return ((Boolean)returner.returnValue).booleanValue(); + } + + /** + * @see org.cishell.service.guibuilder.GUIBuilderService#showWarning(java.lang.String, java.lang.String, java.lang.String) + */ + public void showWarning(final String title, final String message, final String detail) { + guiRun(new Runnable() { + public void run() { + AbstractDialog.openWarning(getActiveShell(), title, message, detail); + }}); + } +} Added: trunk/clients/gui/org.cishell.reference.gui.guibuilder.swt/src/org/cishell/reference/gui/guibuilder/swt/SWTGuiComposite.java =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.guibuilder.swt/src/org/cishell/reference/gui/guibuilder/swt/SWTGuiComposite.java (rev 0) +++ trunk/clients/gui/org.cishell.reference.gui.guibuilder.swt/src/org/cishell/reference/gui/guibuilder/swt/SWTGuiComposite.java 2006-09-28 22:16:30 UTC (rev 219) @@ -0,0 +1,186 @@ +/* **************************************************************************** + * CIShell: Cyberinfrastructure Shell, An Algorithm Integration Framework. + * + * All rights reserved. This program and the accompanying materials are made + * available under the terms of the Apache License v2.0 which accompanies + * this distribution, and is available at: + * http://www.apache.org/licenses/LICENSE-2.0.html + * + * Created on Sep 14, 2006 at Indiana University. + * + * Contributors: + * Indiana University - + * ***************************************************************************/ +package org.cishell.reference.gui.guibuilder.swt; + +import java.util.Dictionary; +import java.util.HashSet; +import java.util.Hashtable; +import java.util.Iterator; +import java.util.Set; + +import org.cishell.reference.gui.guibuilder.swt.builder.ComponentProvider; +import org.cishell.reference.gui.guibuilder.swt.builder.GUIComponent; +import org.cishell.reference.gui.guibuilder.swt.builder.UpdateListener; +import org.eclipse.swt.SWT; +import org.eclipse.swt.custom.ScrolledComposite; +import org.eclipse.swt.events.DisposeEvent; +import org.eclipse.swt.events.DisposeListener; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Shell; +import org.osgi.service.metatype.AttributeDefinition; +import org.osgi.service.metatype.MetaTypeProvider; +import org.osgi.service.metatype.ObjectClassDefinition; + +/** + * + * @author Bruce Herr (bh...@bh...) + */ +public class SWTGuiComposite implements UpdateListener { + private ObjectClassDefinition ocd; + private Dictionary idToComponentMap; + private Dictionary enteredResponses; + protected Set listeners; + + private Composite parent; + private Composite userArea; + private ScrolledComposite userScroll; + private int style; + + public SWTGuiComposite(Composite parent, int style, + String id, MetaTypeProvider provider) { + if (provider == null) { + throw new IllegalArgumentException("Null MetaTypeProvider given"); + } + + this.idToComponentMap = new Hashtable(); + this.ocd = provider.getObjectClassDefinition(id, null); + this.parent = parent; + this.style = style; + this.listeners = new HashSet(); + this.enteredResponses = new Hashtable(); + + setupGUI(); + + AttributeDefinition[] attrs = ocd.getAttributeDefinitions(ObjectClassDefinition.ALL); + for (int i=0; i < attrs.length; i++) { + GUIComponent component = ComponentProvider.getInstance().createComponent(attrs[i]); + + component.setAttributeDefinition(attrs[i]); + component.createGUI(userArea, style); + idToComponentMap.put(attrs[i].getID(), component); + component.addUpdateListener(this); + + Object value = component.getValue(); + String valid = component.validate(); + + if (value != null && (valid == null || valid.length() == 0)) { + enteredResponses.put(component.getAttributeDefinition().getID(), value); + } + } + + userArea.addDisposeListener(new DisposeListener() { + public void widgetDisposed(DisposeEvent e) { + enteredResponses = getEnteredResponses(); + }}); + } + + private void setupGUI() { + userScroll = new ScrolledComposite(parent, style); + userScroll.setLayout(new GridLayout(1, true)); + userScroll.setExpandHorizontal(true); + userScroll.setExpandVertical(true); + userScroll.setAlwaysShowScrollBars(false); + + userArea = new Composite(userScroll, SWT.NONE); + userArea.setLayout(new GridLayout(GUIComponent.MAX_SPAN+1,false)); + + GridData gd = new GridData(SWT.FILL,SWT.FILL,true,true); + userArea.setLayoutData(gd); + + GridData userData = new GridData(); + userData.grabExcessVerticalSpace = true; + userData.grabExcessHorizontalSpace = true; + userData.verticalAlignment = SWT.FILL; + userData.horizontalAlignment = SWT.FILL; + + userScroll.setLayoutData(userData); + userScroll.setContent(userArea); + } + + + public ObjectClassDefinition getObjectClassDefinition() { + return ocd; + } + + public Object getResponse(String id) { + GUIComponent component = (GUIComponent) idToComponentMap.get(id); + + return component == null ? null : component.getValue(); + } + + public Dictionary getEnteredResponses() { + return enteredResponses; + } + + /** + * Get this GUI's associated shell. + * @return the shell + */ + public Shell getShell() { + return parent.getShell(); + } + + /** + * Return the created composite GUI. + * @return the composite + */ + public Composite getUserArea() { + return userArea; + } + + public Composite getComposite() { + return userScroll; + } + + public String validate() { + String totalValid = ""; + + AttributeDefinition[] attrs = ocd.getAttributeDefinitions(ObjectClassDefinition.REQUIRED); + + for (int i=0; i < attrs.length; i++) { + GUIComponent component = (GUIComponent) idToComponentMap.get(attrs[i].getID()); + String valid = component.validate(); + if (valid != null && valid.length() > 0) { + totalValid += "\"" + valid + "\"; "; + } + } + + return totalValid; + } + + public void componentUpdated(GUIComponent component) { + Object value = component.getValue(); + String valid = component.validate(); + + if (value != null && (valid == null || valid.length() == 0)) { + enteredResponses.put(component.getAttributeDefinition().getID(), value); + } else { + enteredResponses.remove(component.getAttributeDefinition().getID()); + } + + for (Iterator i=listeners.iterator(); i.hasNext(); ) { + ((UpdateListener) i.next()).componentUpdated(component); + } + } + + public void addUpdateListener(UpdateListener listener) { + listeners.add(listener); + } + + public void removeUpdateListener(UpdateListener listener) { + listeners.remove(listener); + } +} Added: trunk/clients/gui/org.cishell.reference.gui.guibuilder.swt/src/org/cishell/reference/gui/guibuilder/swt/builder/AbstractComponent.java =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.guibuilder.swt/src/org/cishell/reference/gui/guibuilder/swt/builder/AbstractComponent.java (rev 0) +++ trunk/clients/gui/org.cishell.reference.gui.guibuilder.swt/src/org/cishell/reference/gui/guibuilder/swt/builder/AbstractComponent.java 2006-09-28 22:16:30 UTC (rev 219) @@ -0,0 +1,76 @@ +/* **************************************************************************** + * CIShell: Cyberinfrastructure Shell, An Algorithm Integration Framework. + * + * All rights reserved. This program and the accompanying materials are made + * available under the terms of the Apache License v2.0 which accompanies + * this distribution, and is available at: + * http://www.apache.org/licenses/LICENSE-2.0.html + * + * Created on Sep 20, 2006 at Indiana University. + * + * Contributors: + * Indiana University - + * ***************************************************************************/ +package org.cishell.reference.gui.guibuilder.swt.builder; + +import java.util.HashSet; +import java.util.Iterator; +import java.util.Set; + +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.osgi.service.metatype.AttributeDefinition; + +/** + * + * @author Bruce Herr (bh...@bh...) + */ +public abstract class AbstractComponent implements GUIComponent { + protected AttributeDefinition attr; + protected boolean drawsLabel; + protected int numColumns; + protected Set listeners; + + public abstract void setValue(Object value); + public abstract Object getValue(); + public abstract String validate(); + public abstract Control createGUI(Composite parent, int style); + + public AbstractComponent(boolean drawsLabel, int numColumns) { + this.drawsLabel = drawsLabel; + this.numColumns = numColumns; + this.listeners = new HashSet(); + } + + public AttributeDefinition getAttributeDefinition() { + if (attr == null) { + throw new IllegalStateException("AttributeDefinition has not been set"); + } + + return attr; + } + + public void setAttributeDefinition(AttributeDefinition attr) { + this.attr = attr; + } + public boolean drawsLabel() { + return drawsLabel; + } + public int getColumns() { + return numColumns; + } + + protected void update() { + for (Iterator i=listeners.iterator(); i.hasNext(); ) { + ((UpdateListener) i.next()).componentUpdated(this); + } + } + + public void addUpdateListener(UpdateListener listener) { + listeners.add(listener); + } + + public void removeUpdateListener(UpdateListener listener) { + listeners.remove(listener); + } +} Added: trunk/clients/gui/org.cishell.reference.gui.guibuilder.swt/src/org/cishell/reference/gui/guibuilder/swt/builder/AbstractDialog.java =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.guibuilder.swt/src/org/cishell/reference/gui/guibuilder/swt/builder/AbstractDialog.java (rev 0) +++ trunk/clients/gui/org.cishell.reference.gui.guibuilder.swt/src/org/cishell/reference/gui/guibuilder/swt/builder/AbstractDialog.java 2006-09-28 22:16:30 UTC (rev 219) @@ -0,0 +1,493 @@ +/* + * InfoVis CyberInfrastructure: A Data-Code-Compute Resource for Research + * and Education in Information Visualization (http://iv.slis.indiana.edu/). + * + * Created on Feb 22, 2005 at Indiana University. + */ +package org.cishell.reference.gui.guibuilder.swt.builder; + +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.ShellAdapter; +import org.eclipse.swt.events.ShellEvent; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.graphics.Point; +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.Dialog; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.swt.widgets.Text; + + +/** + * This class provides a DialogBox structure that can be extended to create Dialogs for CIShell. + * This framework will enforce consistency in the look and feel of Dialogs in CIShell by providing a + * standard layout of description, content, and buttons[, along with a choice of icon images + * defined as constants in this class]. An optional details section allows the Dialog designer + * to provide additional information when the details button is pressed. + * + * @author Team IVC + */ +public abstract class AbstractDialog extends Dialog { + private static final int DETAILS_HEIGHT = 75; + + public static Image INFORMATION; + public static Image WARNING; + public static Image ERROR; + public static Image QUESTION; + public static Image WORKING; + + static { + Runnable runner = new Runnable() { + public void run() { + INFORMATION = Display.getDefault().getSystemImage(SWT.ICON_INFORMATION); + WARNING = Display.getDefault().getSystemImage(SWT.ICON_WARNING); + ERROR = Display.getDefault().getSystemImage(SWT.ICON_ERROR); + QUESTION = Display.getDefault().getSystemImage(SWT.ICON_QUESTION); + WORKING = Display.getDefault().getSystemImage(SWT.ICON_WORKING); + }}; + + if (Display.getDefault().getThread() == Thread.currentThread()) { + runner.run(); + } else { + Display.getDefault().asyncExec(runner); + } + } + + + private String description = ""; + private String detailsString = ""; + private Text detailsText; + private Shell shell; + private Image image; + private boolean success; + private Composite header; + private Composite content; + private Composite buttons; + private Shell parent; + + /** + * Creates a new AbstractDialog object. + * + * @param parent the parent Shell of this AbstractDialog + * @param title the title to put in the title bar of this AbstractDialog + * @param image the Image to display to the left of the description specified + * for this AbstractDialog. This will usually be one of: + * <ul> + * <li>AbstractDialog.WARNING</li> + * <li>AbstractDialog.INFORMATION</li> + * <li>AbstractDialog.ERROR</li> + * <li>AbstractDialog.WORKING</li> + * <li>AbstractDialog.QUESTION</li> + * </ul> + */ + public AbstractDialog(Shell parent, String title, Image image) { + super(parent, 0); + setText(title); + this.image = image; + this.parent = parent; + init(); + } + + /** + * Closes this AbstractDialog. + * + * @param success true if the dialog was successful, false if it + * was cancelled by the user (or closed prematurely) + */ + public void close(boolean success){ + shell.dispose(); + this.success = success; + } + + /** + * Returns the shell used by this AbstractDialog + * + * @return the shell used by this AbstractDialog + */ + public Shell getShell(){ + return shell; + } + + /** + * Initializes this AbstractDialog. This consists of resetting all of the + * customizable components like the content area, details pane, buttons, + * and description label, and readying the dialog to be refilled with + * new content. + */ + public void init(){ + if(shell != null) + shell.dispose(); + + shell = new Shell(parent, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL | SWT.RESIZE); + + if (parent != null) + shell.setImage(parent.getImage()); + + shell.setText(getText()); + GridLayout layout = new GridLayout(); + layout.numColumns = 1; + shell.setLayout(layout); + } + + /** + * Opens this AbstractDialog. + * + * @return true if this AbstractDialog was closed by clicking the 'x' in the upper right + * corner of the window, signifying a cancellation, false if the dialog is exited otherwise. + */ + public boolean open() { + if (shell.getDisplay().getThread() == Thread.currentThread()) { + doOpen(); + } else { + shell.getDisplay().syncExec(new Runnable() { + public void run() { + doOpen(); + }}); + } + + Display display = getParent().getDisplay(); + + while (!shell.isDisposed()) { + if (!display.readAndDispatch()) { + display.sleep(); + } + } + + return success; + } + + protected void doOpen() { + success = true; + + setupHeader(); + setupContent(); + setupButtons(); + + shell.pack(); + setLocation(); + shell.open(); + shell.addShellListener(new ShellAdapter(){ + public void shellClosed(ShellEvent e) { + success = false; + } + }); + } + + /* + * centers the dialog on its parents shell + */ + private void setLocation(){ + Point parentLocation = parent.getLocation(); + int parentWidth = parent.getSize().x; + int parentHeight = parent.getSize().y; + int shellWidth = shell.getSize().x; + int shellHeight = shell.getSize().y; + + int x = parentLocation.x + (parentWidth - shellWidth)/2; + int y = parentLocation.y + (parentHeight - shellHeight)/2; + shell.setLocation(x, y); + } + + /** + * Sets the Description of this AbstractDialog. This is the text that is displayed in the + * top section of the Dialog window, giving information about the question that is being + * asked or the information that is being given. + * + * @param description the description for this AbstractDialog to use + */ + public void setDescription(String description) { + this.description = description; + } + + /** + * Sets the details text of this AbstractDialog. This is the text that is displayed in the lower + * section of the Dialog window when the user presses the "Details >>" button. If this String + * is null or the empty string, the details button will be disabled. + * + * @param details DOCUMENT ME! + */ + public void setDetails(String details) { + this.detailsString = details; + } + + /** + * Creates the Buttons to use in this AbstractDialog based on the given parent. These are + * the buttons that show up at the bottom of the dialog for user input, such as a + * "Yes/No" group or "Continue/Cancel" or something like that. This does not encompass all + * Buttons created in the dialog (such as those created in the content section), just those + * to display at the bottom of the dialog. + * + * @param parent the parent to be used to create the Buttons for this AbstractDialog + */ + public abstract void createDialogButtons(Composite parent); + + /** + * Creates the content section of this AbstractDialog based on the given parent. + * This section is where all of the "guts" of the AbstractDialog go, specifying the controls + * that are needed to interact with the user and provide whatever questions or information + * are needed. + * + * @param parent the parent to be used to create the Buttosn for this AbstractDialog + * + * @return the Composite that is created to display the content of this AbstractDialog + */ + public abstract Composite createContent(Composite parent); + + /* + * Sets up the header section of the dialog. This section contains the image for the + * type of dialog it is, as well as the description label + */ + private void setupHeader() { + header = new Composite(shell, SWT.NONE); + header.setLayoutData(new GridData(GridData.FILL_BOTH)); + GridLayout layout = new GridLayout(); + layout.numColumns = 2; + header.setLayout(layout); + + Label canvas = new Label(header, SWT.NONE); + if (image != null) { + canvas.setImage(image); + } + GridData canvasData = new GridData(); + canvasData.heightHint = image.getBounds().height; + canvas.setLayoutData(canvasData); + + Label desc = new Label(header, SWT.WRAP); + + if ((description != null) && !description.equals("")) { + desc.setText(description); + } + + GridData data = new GridData(GridData.FILL_BOTH | GridData.VERTICAL_ALIGN_CENTER); + data.widthHint = 300; + desc.setLayoutData(data); + } + + /* + * sets up the content section of the dialog, this calls the abstract method to + * create the content that must be implemented by all subclasses + */ + private void setupContent() { + content = createContent(shell); + + if (content != null) { + content.setLayoutData(new GridData(GridData.FILL_BOTH)); + } + } + + /* + * sets up the button section in the bottom of the dialog. These buttons + * are created in the abstract method createDialogButtons(parent). In addition to + * any created buttons, a "Details >>" button is added to allow the user to see any + * details that are available in the current Dialog. + */ + private void setupButtons() { + buttons = new Composite(shell, SWT.NONE); + buttons.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.HORIZONTAL_ALIGN_END)); + + //there are two sections, all the user stuff to the left, and + //then the details button on the far right + //User Buttons Section + createDialogButtons(buttons); + Control[] controls = buttons.getChildren(); + GridLayout buttonsLayout = new GridLayout(); + buttonsLayout.numColumns = controls.length + 1; + buttonsLayout.makeColumnsEqualWidth = true; + buttons.setLayout(buttonsLayout); + + //setup the grid data for each button for standard look + for (int i = 0; i < controls.length; i++) { + controls[i].setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); + } + + //Details Button section + final Button details = new Button(buttons, SWT.PUSH); + details.setText("Details >>"); + details.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); + details.addSelectionListener(new SelectionAdapter() { + public synchronized void widgetSelected(SelectionEvent e) { + GridData data = (GridData) detailsText.getLayoutData(); + + if (detailsText.getVisible()) { + detailsText.setText(""); + details.setText("Details >>"); + data.heightHint = 0; + } else { + detailsText.setText(detailsString); + details.setText("Details <<"); + data.heightHint = DETAILS_HEIGHT; + } + + detailsText.setLayoutData(data); + detailsText.setVisible(!detailsText.getVisible()); + + shell.setSize(shell.computeSize(SWT.DEFAULT, SWT.DEFAULT)); + shell.layout(); + } + }); + + setupDetails(); + details.setEnabled(detailsString != null && !detailsString.equals("")); + } + + /* + * creates the details text box when the "Details >>" button is toggled + */ + private void setupDetails() { + detailsText = new Text(shell, SWT.BORDER | SWT.WRAP | SWT.V_SCROLL); + detailsText.setEditable(false); + detailsText.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE)); + + GridData data = new GridData(GridData.HORIZONTAL_ALIGN_CENTER); + data.grabExcessHorizontalSpace = true; + data.horizontalSpan = 2; + data.grabExcessVerticalSpace = false; + data.widthHint = 400; + data.heightHint = 0; + + detailsText.setLayoutData(data); + detailsText.setVisible(false); + } + + /** + * Open a standard error dialog with OK button + * + * @param parent the parent Shell of this dialog + * @param title the text to display in the title bar of this dialog + * @param message the message to give in the dialog's body + * @param details the text to put in the details pane to be visible when the + * "Details >>" button is pressed (can be null or empty, resulting + * in the "Details >>" button not being enabled) + * @return true if the dialog was exited by pressing the OK button, false + * if it was cancelled by pressing the 'x' in the title bar + */ + public static boolean openError(Shell parent, String title, String message, String details){ + return openOKDialog(parent, ERROR, title, message, details); + } + + /** + * Open a standard information dialog with OK button + * + * @param parent the parent Shell of this dialog + * @param title the text to display in the title bar of this dialog + * @param message the message to give in the dialog's body + * @param details the text to put in the details pane to be visible when the + * "Details >>" button is pressed (can be null or empty, resulting + * in the "Details >>" button not being enabled) * @return true if the dialog was exited by pressing the OK button, false + * if it was cancelled by pressing the 'x' in the title bar + */ + public static boolean openInformation(Shell parent, String title, String message, String details){ + return openOKDialog(parent, INFORMATION, title, message, details); + } + + /** + * Open a standard warning dialog with OK button + * + * @param parent the parent Shell of this dialog + * @param title the text to display in the title bar of this dialog + * @param message the message to give in the dialog's body + * @param details the text to put in the details pane to be visible when the + * "Details >>" button is pressed (can be null or empty, resulting + * in the "Details >>" button not being enabled) * @return true if the dialog was exited by pressing the OK button, false + * if it was cancelled by pressing the 'x' in the title bar + */ + public static boolean openWarning(Shell parent, String title, String message, String details){ + return openOKDialog(parent, WARNING, title, message, details); + } + + /** + * Open a standard question dialog with Yes/No buttons + * + * @param parent the parent Shell of this dialog + * @param title the text to display in the title bar of this dialog + * @param message the message to give in the dialog's body + * @param details the text to put in the details pane to be visible when the + * "Details >>" button is pressed (can be null or empty, resulting + * in the "Details >>" button not being enabled) * @return true if the dialog was exited by pressing the OK button, false + * if it was cancelled by pressing the 'x' in the title bar or pressing the + * No button + */ + public static boolean openQuestion(Shell parent, String title, String message, String details){ + return openConfirmDenyDialog(parent, QUESTION, title, message, details, "Yes", "No"); + } + + /** + * Open a standard confirmation dialog with OK/Cancel buttons + * + * @param parent the parent Shell of this dialog + * @param title the text to display in the title bar of this dialog + * @param message the message to give in the dialog's body + * @param details the text to put in the details pane to be visible when the + * "Details >>" button is pressed (can be null or empty, resulting + * in the "Details >>" button not being enabled) * @return true if the dialog was exited by pressing the OK button, false + * if it was cancelled by pressing the 'x' in the title bar or pressing + * the Cancel button + */ + public static boolean openConfirm(Shell parent, String title, String message, String details){ + return openConfirmDenyDialog(parent, QUESTION, title, message, details, "OK", "Cancel"); + } + + /* + * helper to create OK dialogs: error, warning, information + */ + private static boolean openOKDialog(Shell parent, Image image, String title, String message, String details){ + AbstractDialog okDialog = new AbstractDialog(parent, title, image){ + public void createDialogButtons(Composite parent) { + Button ok = new Button(parent, SWT.PUSH); + ok.setText("OK"); + ok.addSelectionListener(new SelectionAdapter(){ + public void widgetSelected(SelectionEvent e) { + close(true); + } + }); + } + + public Composite createContent(Composite parent) { + return null; + } + }; + okDialog.setDescription(message); + okDialog.setDetails(details); + return okDialog.open(); + } + + /* + * helper to create confirm/deny dialogs: question, confirmation + */ + private static boolean openConfirmDenyDialog(Shell parent, Image image, String title, String message, String details, final String confirmLabel, final String denyLabel){ + AbstractDialog dialog = new AbstractDialog(parent, title, image){ + public void createDialogButtons(Composite parent) { + Button confirm = new Button(parent, SWT.PUSH); + if(confirmLabel != null) + confirm.setText(confirmLabel); + confirm.addSelectionListener(new SelectionAdapter(){ + public void widgetSelected(SelectionEvent e) { + close(true); + } + }); + Button deny = new Button(parent, SWT.PUSH); + if(denyLabel != null) + deny.setText(denyLabel); + deny.addSelectionListener(new SelectionAdapter(){ + public void widgetSelected(SelectionEvent e) { + close(false); + } + }); + } + + public Composite createContent(Composite parent) { + return null; + } + }; + dialog.setDescription(message); + dialog.setDetails(details); + return dialog.open(); + } +} Added: trunk/clients/gui/org.cishell.reference.gui.guibuilder.swt/src/org/cishell/reference/gui/guibuilder/swt/builder/ComponentProvider.java =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.guibuilder.swt/src/org/cishell/reference/gui/guibuilder/swt/builder/ComponentProvider.java (rev 0) +++ trunk/clients/gui/org.cishell.reference.gui.guibuilder.swt/src/org/cishell/reference/gui/guibuilder/swt/builder/ComponentProvider.java 2006-09-28 22:16:30 UTC (rev 219) @@ -0,0 +1,77 @@ +/* **************************************************************************** + * CIShell: Cyberinfrastructure Shell, An Algorithm Integration Framework. + * + * All rights reserved. This program and the accompanying materials are made + * available under the terms of the Apache License v2.0 which accompanies + * this distribution, and is available at: + * http://www.apache.org/licenses/LICENSE-2.0.html + * + * Created on Sep 15, 2006 at Indiana University. + * + * Contributors: + * Indiana University - + * ***************************************************************************/ +package org.cishell.reference.gui.guibuilder.swt.builder; + +import org.cishell.reference.gui.guibuilder.swt.builder.components.BooleanComponent; +import org.cishell.reference.gui.guibuilder.swt.builder.components.DirectoryComponent; +import org.cishell.reference.gui.guibuilder.swt.builder.components.FileComponent; +import org.cishell.reference.gui.guibuilder.swt.builder.components.LabelingComponent; +import org.cishell.reference.gui.guibuilder.swt.builder.components.StringComponent; +import org.osgi.service.metatype.AttributeDefinition; + +/** + * + * @author Bruce Herr (bh...@bh...) + */ +public class ComponentProvider { + private static final ComponentProvider INSTANCE = new ComponentProvider(); + private ComponentProvider() {} + + public static ComponentProvider getInstance() { + return INSTANCE; + } + + public GUIComponent createComponent(AttributeDefinition attr) { + GUIComponent component = createBasicComponent(attr); + + component = new LabelingComponent(component); + + return component; + } + + public GUIComponent createBasicComponent(AttributeDefinition attr) { + GUIComponent component = null; + switch (attr.getType()) { + case (AttributeDefinition.BOOLEAN): + component = new BooleanComponent(); + break; + case (AttributeDefinition.STRING): + String[] defaultValue = attr.getDefaultValue(); + if (defaultValue != null && defaultValue.length == 1 + && defaultValue[0] != null) { + if (defaultValue[0].startsWith("file:")) { + component = new FileComponent(); + break; + } else if (defaultValue[0].startsWith("directory:")) { + component = new DirectoryComponent(); + break; + } + } + case (AttributeDefinition.BYTE): + case (AttributeDefinition.CHARACTER): + case (AttributeDefinition.DOUBLE): + case (AttributeDefinition.FLOAT): + case (AttributeDefinition.LONG): + case (AttributeDefinition.SHORT): + case (AttributeDefinition.INTEGER): + default: + component = new StringComponent(); + break; + } + + component.setAttributeDefinition(attr); + + return component; + } +} Added: trunk/clients/gui/org.cishell.reference.gui.guibuilder.swt/src/org/cishell/reference/gui/guibuilder/swt/builder/GUIComponent.java =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.guibuilder.swt/src/org/cishell/reference/gui/guibuilder/swt/builder/GUIComponent.java (rev 0) +++ trunk/clients/gui/org.cishell.reference.gui.guibuilder.swt/src/org/cishell/reference/gui/guibuilder/swt/builder/GUIComponent.java 2006-09-28 22:16:30 UTC (rev 219) @@ -0,0 +1,44 @@ +/* **************************************************************************** + * CIShell: Cyberinfrastructure Shell, An Algorithm Integration Framework. + * + * All rights reserved. This program and the accompanying materials are made + * available under the terms of the Apache License v2.0 which accompanies + * this distribution, and is available at: + * http://www.apache.org/licenses/LICENSE-2.0.html + * + * Created on Sep 15, 2006 at Indiana University. + * + * Contributors: + * Indiana University - + * ***************************************************************************/ +package org.cishell.reference.gui.guibuilder.swt.builder; + +import org.eclipse.swt.SWT; +import org.eclipse.swt.graphics.Color; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Display; +import org.osgi.service.metatype.AttributeDefinition; + +/** + * + * @author Bruce Herr (bh...@bh...) + */ +public interface GUIComponent { + public static final int MAX_SPAN = 3; + public static final Color ERROR_COLOR = Display.getDefault().getSystemColor(SWT.COLOR_RED); + + public Control createGUI(Composite parent, int style); + public int getColumns(); + public boolean drawsLabel(); + + public Object getValue(); + public void setValue(Object value); + public String validate(); + + public void setAttributeDefinition(AttributeDefinition attr); + public AttributeDefinition getAttributeDefinition(); + + public void addUpdateListener(UpdateListener listener); + public void removeUpdateListener(UpdateListener listener); +} Added: trunk/clients/gui/org.cishell.reference.gui.guibuilder.swt/src/org/cishell/reference/gui/guibuilder/swt/builder/StringConverter.java =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.guibuilder.swt/src/org/cishell/reference/gui/guibuilder/swt/builder/StringConverter.java (rev 0) +++ trunk/clients/gui/org.cishell.reference.gui.guibuilder.swt/src/org/cishell/reference/gui/guibuilder/swt/builder/StringConverter.java 2006-09-28 22:16:30 UTC (rev 219) @@ -0,0 +1,76 @@ +/* **************************************************************************** + * CIShell: Cyberinfrastructure Shell, An Algorithm Integration Framework. + * + * All rights reserved. This program and the accompanying materials are made + * available under the terms of the Apache License v2.0 which accompanies + * this distribution, and is available at: + * http://www.apache.org/licenses/LICENSE-2.0.html + * + * Created on Sep 15, 2006 at Indiana University. + * + * Contributors: + * Indiana University - + * ***************************************************************************/ +package org.cishell.reference.gui.guibuilder.swt.builder; + +import org.osgi.service.metatype.AttributeDefinition; + +/** + * + * @author Bruce Herr (bh...@bh...) + */ +public class StringConverter { + private static final StringConverter INSTANCE = new StringConverter(); + private StringConverter() {} + + public static StringConverter getInstance() { + return INSTANCE; + } + + public Object stringToObject(AttributeDefinition attr, String string) { + Object value; + + try { + ... [truncated message content] |
From: <bh...@us...> - 2006-10-04 01:46:44
|
Revision: 242 http://svn.sourceforge.net/cishell/?rev=242&view=rev Author: bh2 Date: 2006-10-02 12:25:15 -0700 (Mon, 02 Oct 2006) Log Message: ----------- Updated the cishell installer build system for the new release Added Paths: ----------- trunk/deployment/cishell-installer/cishell_macosx/plugins/org.eclipse.ui.carbon_3.2.0.I20060605-1400.jar Added: trunk/deployment/cishell-installer/cishell_macosx/plugins/org.eclipse.ui.carbon_3.2.0.I20060605-1400.jar =================================================================== (Binary files differ) Property changes on: trunk/deployment/cishell-installer/cishell_macosx/plugins/org.eclipse.ui.carbon_3.2.0.I20060605-1400.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bh...@us...> - 2006-10-04 01:46:34
|
Revision: 241 http://svn.sourceforge.net/cishell/?rev=241&view=rev Author: bh2 Date: 2006-10-02 12:24:41 -0700 (Mon, 02 Oct 2006) Log Message: ----------- Updated the cishell installer build system for the new release Modified Paths: -------------- trunk/deployment/cishell-installer/cishell.product trunk/deployment/cishell-installer/install.xml trunk/deployment/cishell-installer/thanks.txt Added Paths: ----------- trunk/deployment/cishell-installer/mac_instructions.txt Modified: trunk/deployment/cishell-installer/cishell.product =================================================================== --- trunk/deployment/cishell-installer/cishell.product 2006-10-02 17:05:45 UTC (rev 240) +++ trunk/deployment/cishell-installer/cishell.product 2006-10-02 19:24:41 UTC (rev 241) @@ -40,11 +40,11 @@ </plugins> <features> - <feature id="org.cishell.algorithm.examples.feature" version="0.0.1.qualifier"/> - <feature id="org.cishell.environment.equinox.feature" version="0.0.1"/> - <feature id="org.cishell.feature" version="0.0.1.qualifier"/> - <feature id="org.cishell.reference.feature" version="0.0.1.qualifier"/> - <feature id="org.cishell.reference.gui.feature" version="0.0.1.qualifier"/> + <feature id="org.cishell.algorithm.examples.feature" version="0.1.0.qualifier"/> + <feature id="org.cishell.environment.equinox.feature" version="0.1.0"/> + <feature id="org.cishell.feature" version="0.1.0.qualifier"/> + <feature id="org.cishell.reference.feature" version="0.1.0.qualifier"/> + <feature id="org.cishell.reference.gui.feature" version="0.1.0.qualifier"/> </features> </product> Modified: trunk/deployment/cishell-installer/install.xml =================================================================== --- trunk/deployment/cishell-installer/install.xml 2006-10-02 17:05:45 UTC (rev 240) +++ trunk/deployment/cishell-installer/install.xml 2006-10-02 19:24:41 UTC (rev 241) @@ -16,7 +16,7 @@ <info> <appname>CIShell: Cyberinfrastructure Shell</appname> <appsubpath>cishell</appsubpath> - <appversion>0.0.1</appversion> + <appversion>0.1.0</appversion> <authors> <author name="Bruce Herr" email="bh...@bh..." /> <author name="Weixia Huang" email="hu...@in..." /> @@ -60,7 +60,8 @@ id="shortcutSpec.xml" /> <!-- <res src="../unix_shortcut_specification.xml" id="Unix_shortcutSpec.xml"/> --> - <res id="InfoPanel.info" src="../thanks.txt" /> + <res id="InfoPanel.info" src="../thanks.txt" /> + <res id="XInfoPanel.info" src="../mac_instructions.txt" /> </resources> <native type="izpack" name="ShellLink.dll" /> @@ -72,10 +73,11 @@ <panels> <panel classname="HelloPanel" /> <panel classname="LicencePanel" /> - <panel classname="TargetPanel" /> + <panel classname="TargetPanel" /> <!-- <panel classname="PacksPanel"/> --> <panel classname="InstallPanel" /> - <panel os="windows" classname="ShortcutPanel" /> + <panel os="windows" classname="ShortcutPanel" /> + <panel os="mac" classname="XInfoPanel" /> <panel classname="InfoPanel" /> <panel classname="SimpleFinishPanel" /> </panels> Added: trunk/deployment/cishell-installer/mac_instructions.txt =================================================================== --- trunk/deployment/cishell-installer/mac_instructions.txt (rev 0) +++ trunk/deployment/cishell-installer/mac_instructions.txt 2006-10-02 19:24:41 UTC (rev 241) @@ -0,0 +1,7 @@ +Extra installation steps for Mac OSX users: + +In order to get certain Swing or AWT based algorithms to work, some additional +steps are needed. First, you need Java version 1.5.0 Release 4 (or greater). +Second, you must download and install the "SWT Compatibility Libraries" from +the Apple Developer Connection website at 'http://connect.apple.com'. See the +FAQ section at http://cishell.org for more information. Modified: trunk/deployment/cishell-installer/thanks.txt =================================================================== --- trunk/deployment/cishell-installer/thanks.txt 2006-10-02 17:05:45 UTC (rev 240) +++ trunk/deployment/cishell-installer/thanks.txt 2006-10-02 19:24:41 UTC (rev 241) @@ -1,6 +1,6 @@ Installation of CIShell: Cyberinfrastructure Shell was successful! -WARNING: This is an early pre-ALPHA release of CIShell. +WARNING: This is an early alpha release of CIShell. Also, there are no algorithms integrated. This release is mainly only useful for early adopters for testing integration of their own algorithms. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bh...@us...> - 2006-10-04 01:46:25
|
Revision: 240 http://svn.sourceforge.net/cishell/?rev=240&view=rev Author: bh2 Date: 2006-10-02 10:05:45 -0700 (Mon, 02 Oct 2006) Log Message: ----------- updated file load and save's loading and saving default directories Modified Paths: -------------- trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/load/FileLoad.java trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/save/FileSaver.java Modified: trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/load/FileLoad.java =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/load/FileLoad.java 2006-10-02 16:15:44 UTC (rev 239) +++ trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/load/FileLoad.java 2006-10-02 17:05:45 UTC (rev 240) @@ -99,7 +99,12 @@ FileDialog dialog = new FileDialog(window.getShell(), SWT.OPEN); if (currentDir == null) { currentDir = new File(System.getProperty("user.dir") + File.separator + "sampledata"); -// currentDir = new File(System.getProperty("user.dir") + File.separator + "sampledata" + File.separator + "anything"); + + if (!currentDir.exists()) { + currentDir = new File(System.getProperty("user.home") + File.separator + "anything"); + } else { + currentDir = new File(System.getProperty("user.dir") + File.separator + "sampledata" + File.separator + "anything"); + } } dialog.setFilterPath(currentDir.getPath()); dialog.setText("Select a File"); @@ -110,12 +115,12 @@ File file = new File(fileName); - if (file.isDirectory()) { - currentDir = file; - } else { - currentDir = new File(file.getPath()); - } - + if (file.isDirectory()) { + currentDir = new File(file + File.separator + "anything"); + } else { + currentDir = new File(file.getParent() + File.separator + "anything"); + } + String fileExtension = getFileExtension(file); String filter = "(&(type=converter)(in_data=file-ext:"+fileExtension+"))"; try { Modified: trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/save/FileSaver.java =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/save/FileSaver.java 2006-10-02 16:15:44 UTC (rev 239) +++ trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/save/FileSaver.java 2006-10-02 17:05:45 UTC (rev 240) @@ -44,14 +44,14 @@ private boolean confirmFileOverwrite(File file) { String message = "The file:\n" + file.getPath() + "\nalready exists. Are you sure you want to overwrite it?"; - return guiBuilder.showConfirm("File Overwrite", message, message); + return guiBuilder.showConfirm("File Overwrite", message, ""); } private boolean isSaveFileValid(File file) { boolean valid = false; if (file.isDirectory()) { String message = "Destination cannot be a directory. Please choose a file"; - guiBuilder.showError("Invalid Destination", message, message); + guiBuilder.showError("Invalid Destination", message, ""); valid = false; } else if (file.exists()) { valid = confirmFileOverwrite(file); @@ -68,21 +68,24 @@ String ext = outDataStr.substring(outDataStr.indexOf(':')+1); + if ((""+ext).startsWith(".")) { + ext = ext.substring(1); + } + FileDialog dialog = new FileDialog(parent, SWT.SAVE); if (currentDir == null) { - currentDir = new File(System.getProperty("user.home")); + currentDir = new File(System.getProperty("user.home") + File.separator + "anything"); } dialog.setFilterPath(currentDir.getPath()); - dialog.setFilterExtensions(new String[]{"*" + ext}); + dialog.setFilterExtensions(new String[]{"*." + ext}); dialog.setText("Choose File"); String fileLabel = (String)data.getMetaData().get(DataProperty.LABEL); if (fileLabel == null) { - dialog.setFileName("*" + ext); - } - else { + dialog.setFileName("*." + ext); + } else { dialog.setFileName(fileLabel + '.' + ext); } @@ -96,19 +99,19 @@ continue; if (ext != null && ext.length() != 0) if (!selectedFile.getPath().endsWith(ext)) - selectedFile = new File(selectedFile.getPath() + ext) ; + selectedFile = new File(selectedFile.getPath()+'.'+ ext); Data newData = converter.convert(data); copy((File)newData.getData(), selectedFile); if (selectedFile.isDirectory()) { - currentDir = selectedFile; + currentDir = new File(selectedFile + File.separator + "anything"); } else { - currentDir = new File(selectedFile.getParent()); + currentDir = new File(selectedFile.getParent() + File.separator + "anything"); } - done = true ; + done = true; logService.log(LogService.LOG_INFO, "Saved: " + selectedFile.getPath() + "\n"); } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bh...@us...> - 2006-10-04 01:44:16
|
Revision: 221 http://svn.sourceforge.net/cishell/?rev=221&view=rev Author: bh2 Date: 2006-09-28 15:52:25 -0700 (Thu, 28 Sep 2006) Log Message: ----------- added osgi-inf to build.properties and moved load and save to the start group of the File menu Modified Paths: -------------- trunk/clients/gui/org.cishell.reference.gui.persistence/OSGI-INF/load.properties trunk/clients/gui/org.cishell.reference.gui.persistence/OSGI-INF/save.properties trunk/clients/gui/org.cishell.reference.gui.persistence/build.properties Modified: trunk/clients/gui/org.cishell.reference.gui.persistence/OSGI-INF/load.properties =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.persistence/OSGI-INF/load.properties 2006-09-28 22:17:19 UTC (rev 220) +++ trunk/clients/gui/org.cishell.reference.gui.persistence/OSGI-INF/load.properties 2006-09-28 22:52:25 UTC (rev 221) @@ -1,4 +1,4 @@ -menu_path=file/additions/ +menu_path=File/start label=Load... description=This converter allows users to select file from the file system and load it to Data Model window in_data=null Modified: trunk/clients/gui/org.cishell.reference.gui.persistence/OSGI-INF/save.properties =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.persistence/OSGI-INF/save.properties 2006-09-28 22:17:19 UTC (rev 220) +++ trunk/clients/gui/org.cishell.reference.gui.persistence/OSGI-INF/save.properties 2006-09-28 22:52:25 UTC (rev 221) @@ -1,4 +1,4 @@ -menu_path=File/Save +menu_path=File/start label=Save... description=Saves data to disk in_data=java.lang.Object Modified: trunk/clients/gui/org.cishell.reference.gui.persistence/build.properties =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.persistence/build.properties 2006-09-28 22:17:19 UTC (rev 220) +++ trunk/clients/gui/org.cishell.reference.gui.persistence/build.properties 2006-09-28 22:52:25 UTC (rev 221) @@ -1,4 +1,5 @@ source.. = src/ output.. = bin/ bin.includes = META-INF/,\ - . + .,\ + OSGI-INF/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bh...@us...> - 2006-10-04 01:43:35
|
Revision: 237 http://svn.sourceforge.net/cishell/?rev=237&view=rev Author: bh2 Date: 2006-10-02 09:14:28 -0700 (Mon, 02 Oct 2006) Log Message: ----------- Cleaned up File/Save stuff Modified Paths: -------------- trunk/clients/gui/org.cishell.reference.gui.persistence/META-INF/MANIFEST.MF trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/save/FileSaver.java trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/save/Save.java trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/save/SaveFactory.java Modified: trunk/clients/gui/org.cishell.reference.gui.persistence/META-INF/MANIFEST.MF =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.persistence/META-INF/MANIFEST.MF 2006-10-02 15:53:38 UTC (rev 236) +++ trunk/clients/gui/org.cishell.reference.gui.persistence/META-INF/MANIFEST.MF 2006-10-02 16:14:28 UTC (rev 237) @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Persistence Plug-in -Bundle-SymbolicName: org.cishell.reference.gui.persistence +Bundle-SymbolicName: org.cishell.reference.gui.persistence;singleton:=true Bundle-Version: 0.1.0.qualifier Bundle-ClassPath: . Bundle-Localization: plugin Modified: trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/save/FileSaver.java =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/save/FileSaver.java 2006-10-02 15:53:38 UTC (rev 236) +++ trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/save/FileSaver.java 2006-10-02 16:14:28 UTC (rev 237) @@ -52,7 +52,6 @@ if (file.isDirectory()) { String message = "Destination cannot be a directory. Please choose a file"; guiBuilder.showError("Invalid Destination", message, message); - //logService.log(LogService.LOG_ERROR, "Invalid Destination: " + message); valid = false; } else if (file.exists()) { valid = confirmFileOverwrite(file); @@ -111,17 +110,8 @@ done = true ; - guiBuilder.showInformation("File Saved", - "File successfully Saved", - "File saved: " + selectedFile.getPath()); - //logService.log(LogService.LOG_INFO, "File saved: " + selectedFile.getPath() + "\n"); - //DataManagerService dms = (DataManagerService)context.getService(DataManagerService.class.getName()); - //dms.addData(data); + logService.log(LogService.LOG_INFO, "Saved: " + selectedFile.getPath() + "\n"); } else { - guiBuilder.showInformation("File Save Cancel", - "File save has been cancelled", - "File save has been cancelled"); - //logService.log(LogService.LOG_INFO, "File save cancelled.\n"); done = true; return false; } @@ -145,7 +135,6 @@ } catch (IOException ioe) { guiBuilder.showError("Copy Error", "IOException during copy", ioe.getMessage()); - logService.log(LogService.LOG_ERROR, ioe.getMessage()); return false; } } Modified: trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/save/Save.java =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/save/Save.java 2006-10-02 15:53:38 UTC (rev 236) +++ trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/save/Save.java 2006-10-02 16:14:28 UTC (rev 237) @@ -10,7 +10,6 @@ import org.cishell.service.guibuilder.GUIBuilderService; import org.eclipse.swt.widgets.Shell; import org.eclipse.ui.PlatformUI; -import org.osgi.service.log.LogService; public class Save implements Algorithm { Data[] data; @@ -21,7 +20,7 @@ private GUIBuilderService guiBuilder; private DataConversionService conversionManager; - private LogService logService; + //private LogService logService; public Save(Data[] data, Dictionary parameters, CIShellContext context) { this.data = data; @@ -33,7 +32,7 @@ this.conversionManager = (DataConversionService) context.getService( DataConversionService.class.getName()); - this.logService = (LogService)context.getService(LogService.class.getName()); + //this.logService = (LogService)context.getService(LogService.class.getName()); this.guiBuilder = (GUIBuilderService)context.getService(GUIBuilderService.class.getName()); } Modified: trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/save/SaveFactory.java =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/save/SaveFactory.java 2006-10-02 15:53:38 UTC (rev 236) +++ trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/save/SaveFactory.java 2006-10-02 16:14:28 UTC (rev 237) @@ -3,6 +3,7 @@ import java.util.Dictionary; import org.cishell.framework.CIShellContext; +import org.cishell.framework.LocalCIShellContext; import org.cishell.framework.algorithm.Algorithm; import org.cishell.framework.algorithm.AlgorithmFactory; import org.cishell.framework.algorithm.DataValidator; @@ -16,7 +17,9 @@ public class SaveFactory implements AlgorithmFactory, DataValidator { private CIShellContext context; - protected void activate(ComponentContext ctxt) {} + protected void activate(ComponentContext ctxt) { + context = new LocalCIShellContext(ctxt.getBundleContext()); + } protected void deactivate(ComponentContext ctxt) {} public Algorithm createAlgorithm(Data[] data, Dictionary parameters, CIShellContext context) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bh...@us...> - 2006-10-04 01:43:34
|
Revision: 238 http://svn.sourceforge.net/cishell/?rev=238&view=rev Author: bh2 Date: 2006-10-02 09:15:00 -0700 (Mon, 02 Oct 2006) Log Message: ----------- Added DataValidator checking for Algorithms on the menu Modified Paths: -------------- trunk/clients/gui/org.cishell.reference.gui.menumanager/src/org/cishell/reference/gui/menumanager/menu/AlgorithmAction.java Modified: trunk/clients/gui/org.cishell.reference.gui.menumanager/src/org/cishell/reference/gui/menumanager/menu/AlgorithmAction.java =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.menumanager/src/org/cishell/reference/gui/menumanager/menu/AlgorithmAction.java 2006-10-02 16:14:28 UTC (rev 237) +++ trunk/clients/gui/org.cishell.reference.gui.menumanager/src/org/cishell/reference/gui/menumanager/menu/AlgorithmAction.java 2006-10-02 16:15:00 UTC (rev 238) @@ -25,6 +25,7 @@ import org.cishell.framework.CIShellContext; import org.cishell.framework.algorithm.AlgorithmFactory; import org.cishell.framework.algorithm.AlgorithmProperty; +import org.cishell.framework.algorithm.DataValidator; import org.cishell.framework.data.Data; import org.cishell.service.conversion.Converter; import org.cishell.service.conversion.DataConversionService; @@ -141,9 +142,34 @@ } } } - setEnabled(data != null); + setEnabled(data != null && isValid()); } + private boolean isValid() { + String valid = null; + String[] classes = (String[]) ref.getProperty(Constants.OBJECTCLASS); + + if (classes != null && data != null) { + for (int i=0; i < classes.length; i++) { + if (classes[i].equals(DataValidator.class.getName())) { + DataValidator validator = (DataValidator) bContext.getService(ref); + + synchronized(this) { + for (int j=0; j < data.length; j++) { + if (converters[j] != null && converters[j].length > 0) { + data[j] = converters[j][0].convert(data[j]); + } + } + + valid = validator.validate(data); + } + } + } + } + + return valid == null || valid.length() == 0; + } + private boolean isAsignableFrom(String type, Data datum) { Object data = datum.getData(); boolean assignable = false; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
Revision: 239 http://svn.sourceforge.net/cishell/?rev=239&view=rev Author: bh2 Date: 2006-10-02 09:15:44 -0700 (Mon, 02 Oct 2006) Log Message: ----------- Better error checking of the MetaTypeProvider in the new GUIBuilder Modified Paths: -------------- trunk/clients/gui/org.cishell.reference.gui.guibuilder.swt/src/org/cishell/reference/gui/guibuilder/swt/SWTGuiBuilderService.java Modified: trunk/clients/gui/org.cishell.reference.gui.guibuilder.swt/src/org/cishell/reference/gui/guibuilder/swt/SWTGuiBuilderService.java =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.guibuilder.swt/src/org/cishell/reference/gui/guibuilder/swt/SWTGuiBuilderService.java 2006-10-02 16:15:00 UTC (rev 238) +++ trunk/clients/gui/org.cishell.reference.gui.guibuilder.swt/src/org/cishell/reference/gui/guibuilder/swt/SWTGuiBuilderService.java 2006-10-02 16:15:44 UTC (rev 239) @@ -59,10 +59,22 @@ public GUI createGUI(String id, MetaTypeProvider parameters) { - GUICreator creator = new GUICreator(id, parameters); - display.syncExec(creator); + boolean validParams = true; - return creator.gui; + try { + validParams = parameters.getObjectClassDefinition(id, null) != null; + } catch (IllegalArgumentException e) { + validParams = false; + } + + if (validParams) { + GUICreator creator = new GUICreator(id, parameters); + display.syncExec(creator); + + return creator.gui; + } else { + return NULL_GUI; + } } private class GUICreator implements Runnable { @@ -77,7 +89,7 @@ public void run() { try { - Shell activeShell = display.getActiveShell(); + Shell activeShell = getActiveShell(); Shell shell = new Shell(activeShell, SWT.DIALOG_TRIM | SWT.RESIZE); if (activeShell != null) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
Revision: 234 http://svn.sourceforge.net/cishell/?rev=234&view=rev Author: bh2 Date: 2006-10-02 07:10:08 -0700 (Mon, 02 Oct 2006) Log Message: ----------- Fixed GUIBuilderService so that a show* method that was run within the GUI thread properly created/used a non-null Shell Modified Paths: -------------- trunk/clients/gui/org.cishell.reference.gui.guibuilder.swt/src/org/cishell/reference/gui/guibuilder/swt/SWTGuiBuilderService.java Modified: trunk/clients/gui/org.cishell.reference.gui.guibuilder.swt/src/org/cishell/reference/gui/guibuilder/swt/SWTGuiBuilderService.java =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.guibuilder.swt/src/org/cishell/reference/gui/guibuilder/swt/SWTGuiBuilderService.java 2006-09-30 17:44:55 UTC (rev 233) +++ trunk/clients/gui/org.cishell.reference.gui.guibuilder.swt/src/org/cishell/reference/gui/guibuilder/swt/SWTGuiBuilderService.java 2006-10-02 14:10:08 UTC (rev 234) @@ -50,6 +50,7 @@ }}; private Display display; + private Shell lastShell; public SWTGuiBuilderService(Display display) { @@ -97,8 +98,17 @@ guiRun(new Runnable() { public void run() { returner.returnValue = display.getActiveShell(); + + if (returner.returnValue == null) { + if (lastShell != null) { + returner.returnValue = lastShell; + } else { + returner.returnValue = new Shell(); + } + } }}); + lastShell = (Shell) returner.returnValue; return (Shell) returner.returnValue; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bea...@us...> - 2006-10-03 19:20:28
|
Revision: 243 http://svn.sourceforge.net/cishell/?rev=243&view=rev Author: bearsfan Date: 2006-10-03 12:20:18 -0700 (Tue, 03 Oct 2006) Log Message: ----------- Added javadoc for all source files under the save package Modified Paths: -------------- trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/save/FileSaver.java trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/save/Save.java trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/save/SaveDataChooser.java trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/save/SaveFactory.java Modified: trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/save/FileSaver.java =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/save/FileSaver.java 2006-10-02 19:25:15 UTC (rev 242) +++ trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/save/FileSaver.java 2006-10-03 19:20:18 UTC (rev 243) @@ -19,34 +19,48 @@ import org.eclipse.swt.widgets.FileDialog; import org.eclipse.swt.widgets.Shell; import org.osgi.framework.ServiceReference; -import org.osgi.service.log.LogService; /** - * @author Team IVC + * Persist the file to disk for the user + * + * @author Team */ public class FileSaver { private static File currentDir; private Shell parent; - private LogService logService; - private CIShellContext ciContext; private GUIBuilderService guiBuilder; + /** + * Initializes services to output messages + * + * @param parent + * @param context + */ public FileSaver(Shell parent, CIShellContext context){ this.parent = parent; - this.ciContext = context; - this.logService = (LogService) ciContext.getService(LogService.class.getName()); this.guiBuilder = (GUIBuilderService)context.getService(GUIBuilderService.class.getName()); } + /** + * File exists, so make sure the user wants to overwrite + * @param file The file to possibly overwrite + * @return Whether or not the user decides to overwrite + */ private boolean confirmFileOverwrite(File file) { String message = "The file:\n" + file.getPath() + "\nalready exists. Are you sure you want to overwrite it?"; return guiBuilder.showConfirm("File Overwrite", message, ""); } + /** + * Checks for a valid file destination + * + * @param file to save to + * @return True on valid file save + */ private boolean isSaveFileValid(File file) { boolean valid = false; if (file.isDirectory()) { @@ -61,6 +75,13 @@ return valid; } + /** + * Given a converter, save the data + * + * @param converter Saves the data to a file + * @param data Data object to save + * @return Whether or not the save was successful + */ public boolean save(Converter converter, Data data) { ServiceReference[] serviceReferenceArray = converter.getConverterChain(); String outDataStr = (String)serviceReferenceArray[serviceReferenceArray.length-1] @@ -113,7 +134,9 @@ done = true; - logService.log(LogService.LOG_INFO, "Saved: " + selectedFile.getPath() + "\n"); + guiBuilder.showInformation("Data Saved", + "Data successfully saved to disk", + "Saved: " + selectedFile.getPath()); } else { done = true; return false; @@ -122,6 +145,13 @@ return true; } + /** + * Converter puts it into a temporary directory, this copies it over + * + * @param in The temp file to copy + * @param out Destination to copy to + * @return True on successful copy, false otherwise + */ private boolean copy(File in, File out) { try { FileInputStream fis = new FileInputStream(in); Modified: trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/save/Save.java =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/save/Save.java 2006-10-02 19:25:15 UTC (rev 242) +++ trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/save/Save.java 2006-10-03 19:20:18 UTC (rev 243) @@ -11,6 +11,11 @@ import org.eclipse.swt.widgets.Shell; import org.eclipse.ui.PlatformUI; +/** + * Save algorithm for persisting a data object + * + * @author bmarkine + */ public class Save implements Algorithm { Data[] data; Dictionary parameters; @@ -20,8 +25,14 @@ private GUIBuilderService guiBuilder; private DataConversionService conversionManager; - //private LogService logService; + /** + * Sets up default services for the algorithm + * + * @param data The data array to persist + * @param parameters Parameters for the algorithm + * @param context Provides services to CIShell services + */ public Save(Data[] data, Dictionary parameters, CIShellContext context) { this.data = data; this.parameters = parameters; @@ -32,16 +43,19 @@ this.conversionManager = (DataConversionService) context.getService( DataConversionService.class.getName()); - //this.logService = (LogService)context.getService(LogService.class.getName()); this.guiBuilder = (GUIBuilderService)context.getService(GUIBuilderService.class.getName()); } + /** + * Executes the algorithm + * + * @return Null for this algorithm + */ public Data[] execute() { //This only checks the first Data in the array final Converter[] converters = conversionManager.findConverters(data[0], "file-ext:*"); if (converters.length < 1) { - //logService.log(LogService.LOG_ERROR, "No valid converters found!"); guiBuilder.showError("No Converters", "No valid converters for data type: " + data[0].getData().getClass().getName(), @@ -51,7 +65,6 @@ if (!parentShell.isDisposed()) { parentShell.getDisplay().syncExec(new Runnable() { public void run() { - //Shell shell = new Shell(parentShell); SaveDataChooser sdc = new SaveDataChooser(data[0], parentShell, converters, "title", Modified: trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/save/SaveDataChooser.java =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/save/SaveDataChooser.java 2006-10-02 19:25:15 UTC (rev 242) +++ trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/save/SaveDataChooser.java 2006-10-03 19:20:18 UTC (rev 243) @@ -32,13 +32,12 @@ import org.cishell.reference.gui.common.AbstractDialog; /** - * SavePersisterChooser is a simple user interface to allow for selection + * SaveDataChooser is a simple user interface to allow for selection * among several Persisters that support the selected model, in the event * that more than one is found. * * @author Team IVC */ -//public class SaveDataChooser extends Shell { public class SaveDataChooser extends AbstractDialog { protected Data data; protected Converter[] converterArray; @@ -49,31 +48,33 @@ public static final Image QUESTION = Display.getCurrent().getSystemImage(SWT.ICON_QUESTION); /** - * Creates a new SavePersisterChooser object. + * Creates a new SaveChooser object. * - * @param title the desired Title of the SavePersisterChooser window - * @param model the model that this SavePersisterChooser is attempting to save - * @param window the IWorkbenchWindow that this SavePersisterChooser belongs to - * @param persisters the Persisters that can be used to save the given model + * @param data The data object to save + * @param parent The parent shell + * @param converterArray The array of converters to persist the data + * @param title Title of the Window + * @param brandPluginID The plugin that supplies the branding + * @param context The CIShellContext to retrieve available services */ - //public SaveDataChooser(String title, Data data, Shell parent, Data[] converterArray) { public SaveDataChooser(Data data, Shell parent, Converter[] converterArray, String title, String brandPluginID, CIShellContext context) { super(parent, title, QUESTION); this.data = data; - //this.parent = parent; this.converterArray = converterArray; this.context = context; } - /* - * Initialize the GUI for this SavePersisterChooser + /** + * Initialize the GUI for the chooser + * @param parent The parent window + * @return The new window containing the chooser */ private Composite initGUI(Composite parent) { Composite content = new Composite(parent, SWT.NONE); GridLayout layout = new GridLayout(); layout.numColumns = 2; - content.setLayout(layout); + content.setLayout(layout); //parent.setLayout(layout); Group converterGroup = new Group(content, SWT.NONE); @@ -97,7 +98,6 @@ }); Group detailsGroup = new Group(content, SWT.NONE); - //Group detailsGroup = new Group(parent, SWT.NONE); detailsGroup.setText("Details"); detailsGroup.setLayout(new FillLayout()); GridData detailsData = new GridData(GridData.FILL_BOTH); @@ -113,7 +113,7 @@ return content; } - /* + /** * Initialize the Listbox of Persisters using the stored Persister array */ private void initConverterList() { @@ -133,8 +133,10 @@ } } - /* - * Sets up the DetailPane where the details from the Persister PropertyMaps are displayed. + /** + * Sets up the DetailPane where the details from the Persister PropertyMaps are displayed. + * @param detailsGroup The detail pane to init + * @return A style of the text */ private StyledText initDetailPane(Group detailsGroup) { StyledText detailPane = new StyledText(detailsGroup, SWT.H_SCROLL | SWT.V_SCROLL); @@ -144,9 +146,10 @@ return detailPane; } - /* + /** * Changes the information displayed in the DetailsPane whenever a new Persister * is selected. + * @param converter A converter that contains the properties for the detail pane */ private void updateDetailPane(Converter converter) { Dictionary dict = converter.getProperties(); @@ -157,8 +160,6 @@ while (keysEnum.hasMoreElements()) { Object key = keysEnum.nextElement(); Object val = dict.get(key); - //if(property.getAcceptableClass().equals(String.class)){ - // String val = (String) dict.getPropertyValue(property); StyleRange styleRange = new StyleRange(); styleRange.start = detailPane.getText().length(); @@ -168,13 +169,13 @@ detailPane.setStyleRange(styleRange); detailPane.append(val + "\n"); - //} } } - /* + /** * When a Persister is chosen to Persist this model, this method handles the job * of opening the FileSaver and saving the model. + * @param selectedIndex The chosen converter */ protected void selectionMade(int selectedIndex) { getShell().setVisible(false); @@ -183,6 +184,12 @@ close(saver.save(converter, data)); } + /** + * Create the buttons for either cancelling or continuing with + * the save + * + * @param parent The GUI to place the buttons + */ public void createDialogButtons(Composite parent) { Button select = new Button(parent, SWT.PUSH); select.setText("Select"); @@ -205,6 +212,12 @@ }); } + /** + * Checks for the number of file savers. If there is one + * converter then it will save directly, otherwise intialize the chooser. + * + * @param parent The parent GUI for new dialog windows. + */ public Composite createContent(Composite parent) { if (converterArray.length == 1) { final FileSaver saver = new FileSaver((Shell)parent, context); Modified: trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/save/SaveFactory.java =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/save/SaveFactory.java 2006-10-02 19:25:15 UTC (rev 242) +++ trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/save/SaveFactory.java 2006-10-03 19:20:18 UTC (rev 243) @@ -13,23 +13,54 @@ import org.osgi.service.component.ComponentContext; import org.osgi.service.metatype.MetaTypeProvider; - +/** + * Create a Save object + * @author bmarkine + * + */ public class SaveFactory implements AlgorithmFactory, DataValidator { private CIShellContext context; + /** + * Create a local CIShell context + * @param ctxt The current CIShell context + */ protected void activate(ComponentContext ctxt) { context = new LocalCIShellContext(ctxt.getBundleContext()); } + + /** + * Deactivate the plugin + * @param ctxt Current CIShell context + */ protected void deactivate(ComponentContext ctxt) {} + /** + * Create a Save algorithm + * @param data The data objects to save + * @param parameters The parameters for the algorithm + * @param context Reference to services provided by CIShell + * @return An instance of the Save algorithm + */ public Algorithm createAlgorithm(Data[] data, Dictionary parameters, CIShellContext context) { this.context = context; return new Save(data, parameters, context); } + + /** + * Create parameters (this returns null only) + * data input data + * @return null; + */ public MetaTypeProvider createParameters(Data[] data) { return null; } + /** + * Validate the SaveFactory can handle the incoming file type + * @param data The data to save + * @return empty string on success + */ public String validate(Data[] data) { DataConversionService conversionManager = (DataConversionService) context.getService( DataConversionService.class.getName()); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hu...@us...> - 2006-10-02 15:54:48
|
Revision: 236 http://svn.sourceforge.net/cishell/?rev=236&view=rev Author: huangb Date: 2006-10-02 08:53:38 -0700 (Mon, 02 Oct 2006) Log Message: ----------- clean up the code a bit Modified Paths: -------------- trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/load/FileLoad.java Modified: trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/load/FileLoad.java =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/load/FileLoad.java 2006-10-02 15:06:00 UTC (rev 235) +++ trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/load/FileLoad.java 2006-10-02 15:53:38 UTC (rev 236) @@ -56,7 +56,6 @@ final IWorkbenchWindow[] windows = PlatformUI.getWorkbench().getWorkbenchWindows(); if (windows.length ==0){ -// System.out.println("windows[0] is null!!"); return null; } @@ -72,7 +71,6 @@ return returnDM; } else { -// logger.log(LogService.LOG_INFO, "Did not load any data..."); return null; } @@ -119,7 +117,6 @@ } String fileExtension = getFileExtension(file); - //System.out.println("fileExtension = "+fileExtension); String filter = "(&(type=converter)(in_data=file-ext:"+fileExtension+"))"; try { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bea...@us...> - 2006-10-02 15:06:11
|
Revision: 235 http://svn.sourceforge.net/cishell/?rev=235&view=rev Author: bearsfan Date: 2006-10-02 08:06:00 -0700 (Mon, 02 Oct 2006) Log Message: ----------- Using guiBuilder instead of logServices to display messages. Changed save.xml and SaveFactory to implement DataValidator (this not unit tested). Modified Paths: -------------- trunk/clients/gui/org.cishell.reference.gui.persistence/OSGI-INF/save.properties trunk/clients/gui/org.cishell.reference.gui.persistence/OSGI-INF/save.xml trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/save/FileSaver.java trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/save/Save.java trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/save/SaveFactory.java Removed Paths: ------------- trunk/clients/gui/org.cishell.reference.gui.persistence/OSGI-INF/l10n/ trunk/clients/gui/org.cishell.reference.gui.persistence/OSGI-INF/metatype/ Modified: trunk/clients/gui/org.cishell.reference.gui.persistence/OSGI-INF/save.properties =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.persistence/OSGI-INF/save.properties 2006-10-02 14:10:08 UTC (rev 234) +++ trunk/clients/gui/org.cishell.reference.gui.persistence/OSGI-INF/save.properties 2006-10-02 15:06:00 UTC (rev 235) @@ -2,6 +2,6 @@ label=Save... description=Saves data to disk in_data=java.lang.Object -out_data=file:* +out_data=null service.pid=org.cishell.reference.gui.persistence.save.Save remoteable=false Modified: trunk/clients/gui/org.cishell.reference.gui.persistence/OSGI-INF/save.xml =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.persistence/OSGI-INF/save.xml 2006-10-02 14:10:08 UTC (rev 234) +++ trunk/clients/gui/org.cishell.reference.gui.persistence/OSGI-INF/save.xml 2006-10-02 15:06:00 UTC (rev 235) @@ -8,5 +8,7 @@ <service> <provide interface= "org.cishell.framework.algorithm.AlgorithmFactory"/> + <provide interface= + "org.cishell.framework.algorithm.DataValidator"/> </service> </component> \ No newline at end of file Modified: trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/save/FileSaver.java =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/save/FileSaver.java 2006-10-02 14:10:08 UTC (rev 234) +++ trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/save/FileSaver.java 2006-10-02 15:06:00 UTC (rev 235) @@ -44,16 +44,15 @@ private boolean confirmFileOverwrite(File file) { String message = "The file:\n" + file.getPath() + "\nalready exists. Are you sure you want to overwrite it?"; - logService.log(LogService.LOG_INFO, "Confirm File Overwrite: " + message); - return true; - //return guiBuilder.showConfirm("File Overwrite", message, message); + return guiBuilder.showConfirm("File Overwrite", message, message); } private boolean isSaveFileValid(File file) { boolean valid = false; if (file.isDirectory()) { String message = "Destination cannot be a directory. Please choose a file"; - logService.log(LogService.LOG_ERROR, "Invalid Destination: " + message); + guiBuilder.showError("Invalid Destination", message, message); + //logService.log(LogService.LOG_ERROR, "Invalid Destination: " + message); valid = false; } else if (file.exists()) { valid = confirmFileOverwrite(file); @@ -112,17 +111,17 @@ done = true ; - //guiBuilder.showInformation("File Saved", - // "File successfully Saved", - // "File saved: " + selectedFile.getPath()); - logService.log(LogService.LOG_INFO, "File saved: " + selectedFile.getPath() + "\n"); + guiBuilder.showInformation("File Saved", + "File successfully Saved", + "File saved: " + selectedFile.getPath()); + //logService.log(LogService.LOG_INFO, "File saved: " + selectedFile.getPath() + "\n"); //DataManagerService dms = (DataManagerService)context.getService(DataManagerService.class.getName()); //dms.addData(data); } else { - //guiBuilder.showInformation("File Save Cancel", - // "File save has been cancelled", - // "File save has been cancelled"); - logService.log(LogService.LOG_INFO, "File save cancelled.\n"); + guiBuilder.showInformation("File Save Cancel", + "File save has been cancelled", + "File save has been cancelled"); + //logService.log(LogService.LOG_INFO, "File save cancelled.\n"); done = true; return false; } @@ -145,6 +144,7 @@ return true; } catch (IOException ioe) { + guiBuilder.showError("Copy Error", "IOException during copy", ioe.getMessage()); logService.log(LogService.LOG_ERROR, ioe.getMessage()); return false; } Modified: trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/save/Save.java =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/save/Save.java 2006-10-02 14:10:08 UTC (rev 234) +++ trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/save/Save.java 2006-10-02 15:06:00 UTC (rev 235) @@ -4,7 +4,6 @@ import org.cishell.framework.CIShellContext; import org.cishell.framework.algorithm.Algorithm; -import org.cishell.framework.algorithm.DataValidator; import org.cishell.framework.data.Data; import org.cishell.service.conversion.Converter; import org.cishell.service.conversion.DataConversionService; @@ -13,7 +12,7 @@ import org.eclipse.ui.PlatformUI; import org.osgi.service.log.LogService; -public class Save implements Algorithm, DataValidator { +public class Save implements Algorithm { Data[] data; Dictionary parameters; CIShellContext context; @@ -43,11 +42,11 @@ final Converter[] converters = conversionManager.findConverters(data[0], "file-ext:*"); if (converters.length < 1) { - logService.log(LogService.LOG_ERROR, "No valid converters found!"); - //guiBuilder.showError("No Converters", - // "No valid converters for data type: " + - // data[0].getData().getClass().getName(), - // "Please install a plugin that will save the data type to a file"); + //logService.log(LogService.LOG_ERROR, "No valid converters found!"); + guiBuilder.showError("No Converters", + "No valid converters for data type: " + + data[0].getData().getClass().getName(), + "Please install a plugin that will save the data type to a file"); } else { if (!parentShell.isDisposed()) { @@ -66,15 +65,4 @@ } return null; } - - public String validate(Data[] data) { - Converter[] converters = conversionManager.findConverters(data[0], "file-ext:*"); - if (converters.length == 0) { - return "No valid converters from " + - data[0].getData().getClass().getName() + " to any file extension"; - } - else { - return ""; - } - } } \ No newline at end of file Modified: trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/save/SaveFactory.java =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/save/SaveFactory.java 2006-10-02 14:10:08 UTC (rev 234) +++ trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/save/SaveFactory.java 2006-10-02 15:06:00 UTC (rev 235) @@ -5,20 +5,40 @@ import org.cishell.framework.CIShellContext; import org.cishell.framework.algorithm.Algorithm; import org.cishell.framework.algorithm.AlgorithmFactory; +import org.cishell.framework.algorithm.DataValidator; import org.cishell.framework.data.Data; +import org.cishell.service.conversion.Converter; +import org.cishell.service.conversion.DataConversionService; import org.osgi.service.component.ComponentContext; import org.osgi.service.metatype.MetaTypeProvider; -public class SaveFactory implements AlgorithmFactory { +public class SaveFactory implements AlgorithmFactory, DataValidator { + private CIShellContext context; protected void activate(ComponentContext ctxt) {} protected void deactivate(ComponentContext ctxt) {} public Algorithm createAlgorithm(Data[] data, Dictionary parameters, CIShellContext context) { + this.context = context; return new Save(data, parameters, context); } public MetaTypeProvider createParameters(Data[] data) { return null; } + + public String validate(Data[] data) { + DataConversionService conversionManager = (DataConversionService) context.getService( + DataConversionService.class.getName()); + + Converter[] converters = conversionManager.findConverters(data[0], "file-ext:*"); + if (converters.length == 0) { + return "No valid converters from " + + data[0].getData().getClass().getName() + " to any file extension"; + } + else { + return ""; + } + } + } \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bea...@us...> - 2006-09-30 17:45:00
|
Revision: 233 http://svn.sourceforge.net/cishell/?rev=233&view=rev Author: bearsfan Date: 2006-09-30 10:44:55 -0700 (Sat, 30 Sep 2006) Log Message: ----------- Close file after copy and added a default filename when saving. Modified Paths: -------------- trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/save/FileSaver.java trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/save/Save.java trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/save/SaveDataChooser.java Modified: trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/save/FileSaver.java =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/save/FileSaver.java 2006-09-30 16:21:53 UTC (rev 232) +++ trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/save/FileSaver.java 2006-09-30 17:44:55 UTC (rev 233) @@ -12,7 +12,9 @@ import org.cishell.framework.CIShellContext; import org.cishell.framework.algorithm.AlgorithmProperty; import org.cishell.framework.data.Data; +import org.cishell.framework.data.DataProperty; import org.cishell.service.conversion.Converter; +import org.cishell.service.guibuilder.GUIBuilderService; import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.FileDialog; import org.eclipse.swt.widgets.Shell; @@ -28,11 +30,15 @@ private Shell parent; private LogService logService; private CIShellContext ciContext; + + private GUIBuilderService guiBuilder; + public FileSaver(Shell parent, CIShellContext context){ this.parent = parent; this.ciContext = context; this.logService = (LogService) ciContext.getService(LogService.class.getName()); + this.guiBuilder = (GUIBuilderService)context.getService(GUIBuilderService.class.getName()); } private boolean confirmFileOverwrite(File file) { @@ -40,6 +46,7 @@ + "\nalready exists. Are you sure you want to overwrite it?"; logService.log(LogService.LOG_INFO, "Confirm File Overwrite: " + message); return true; + //return guiBuilder.showConfirm("File Overwrite", message, message); } private boolean isSaveFileValid(File file) { @@ -71,8 +78,15 @@ dialog.setFilterPath(currentDir.getPath()); dialog.setFilterExtensions(new String[]{"*" + ext}); - dialog.setText("Choose File"); - dialog.setFileName((String)data.getMetaData().get(AlgorithmProperty.LABEL)); + dialog.setText("Choose File"); + + String fileLabel = (String)data.getMetaData().get(DataProperty.LABEL); + if (fileLabel == null) { + dialog.setFileName("*" + ext); + } + else { + dialog.setFileName(fileLabel + '.' + ext); + } boolean done = false; @@ -97,11 +111,17 @@ } done = true ; - + + //guiBuilder.showInformation("File Saved", + // "File successfully Saved", + // "File saved: " + selectedFile.getPath()); logService.log(LogService.LOG_INFO, "File saved: " + selectedFile.getPath() + "\n"); //DataManagerService dms = (DataManagerService)context.getService(DataManagerService.class.getName()); //dms.addData(data); } else { + //guiBuilder.showInformation("File Save Cancel", + // "File save has been cancelled", + // "File save has been cancelled"); logService.log(LogService.LOG_INFO, "File save cancelled.\n"); done = true; return false; @@ -120,6 +140,8 @@ writableChannel.truncate(0); writableChannel.transferFrom(readableChannel, 0, readableChannel.size()); + fis.close(); + fos.close(); return true; } catch (IOException ioe) { Modified: trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/save/Save.java =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/save/Save.java 2006-09-30 16:21:53 UTC (rev 232) +++ trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/save/Save.java 2006-09-30 17:44:55 UTC (rev 233) @@ -4,48 +4,50 @@ import org.cishell.framework.CIShellContext; import org.cishell.framework.algorithm.Algorithm; +import org.cishell.framework.algorithm.DataValidator; import org.cishell.framework.data.Data; import org.cishell.service.conversion.Converter; import org.cishell.service.conversion.DataConversionService; +import org.cishell.service.guibuilder.GUIBuilderService; import org.eclipse.swt.widgets.Shell; import org.eclipse.ui.PlatformUI; import org.osgi.service.log.LogService; -public class Save implements Algorithm { +public class Save implements Algorithm, DataValidator { Data[] data; Dictionary parameters; CIShellContext context; final Shell parentShell; - DataConversionService conversionManager; - LogService logService; + private GUIBuilderService guiBuilder; + private DataConversionService conversionManager; + private LogService logService; public Save(Data[] data, Dictionary parameters, CIShellContext context) { this.data = data; this.parameters = parameters; this.context = context; - parentShell = PlatformUI.getWorkbench().getWorkbenchWindows()[0].getShell(); + this.parentShell = PlatformUI.getWorkbench().getWorkbenchWindows()[0].getShell(); - conversionManager = (DataConversionService) context.getService( + this.conversionManager = (DataConversionService) context.getService( DataConversionService.class.getName()); - logService = (LogService)context.getService(LogService.class.getName()); + this.logService = (LogService)context.getService(LogService.class.getName()); + this.guiBuilder = (GUIBuilderService)context.getService(GUIBuilderService.class.getName()); } public Data[] execute() { //This only checks the first Data in the array final Converter[] converters = conversionManager.findConverters(data[0], "file-ext:*"); - /* - for (int i = 0; i < converters.length; ++i) { - Dictionary dict = converters[i].getProperties(); - Object inDataObj = dict.get(AlgorithmProperty.IN_DATA); - Object outDataObj = dict.get(AlgorithmProperty.OUT_DATA); - } - */ + if (converters.length < 1) { logService.log(LogService.LOG_ERROR, "No valid converters found!"); + //guiBuilder.showError("No Converters", + // "No valid converters for data type: " + + // data[0].getData().getClass().getName(), + // "Please install a plugin that will save the data type to a file"); } else { if (!parentShell.isDisposed()) { @@ -64,4 +66,15 @@ } return null; } + + public String validate(Data[] data) { + Converter[] converters = conversionManager.findConverters(data[0], "file-ext:*"); + if (converters.length == 0) { + return "No valid converters from " + + data[0].getData().getClass().getName() + " to any file extension"; + } + else { + return ""; + } + } } \ No newline at end of file Modified: trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/save/SaveDataChooser.java =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/save/SaveDataChooser.java 2006-09-30 16:21:53 UTC (rev 232) +++ trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/save/SaveDataChooser.java 2006-09-30 17:44:55 UTC (rev 233) @@ -46,7 +46,6 @@ private StyledText detailPane; //private Shell parent; CIShellContext context; - //private LogService logService; public static final Image QUESTION = Display.getCurrent().getSystemImage(SWT.ICON_QUESTION); /** @@ -65,7 +64,6 @@ //this.parent = parent; this.converterArray = converterArray; this.context = context; - //this.logService = (LogService) context.getService(LogService.class.getName()); } /* This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bea...@us...> - 2006-09-30 16:21:58
|
Revision: 232 http://svn.sourceforge.net/cishell/?rev=232&view=rev Author: bearsfan Date: 2006-09-30 09:21:53 -0700 (Sat, 30 Sep 2006) Log Message: ----------- Removed a System.out.println on line 122. This printed out the current file extension. Modified Paths: -------------- trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/load/FileLoad.java Modified: trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/load/FileLoad.java =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/load/FileLoad.java 2006-09-29 21:31:43 UTC (rev 231) +++ trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/load/FileLoad.java 2006-09-30 16:21:53 UTC (rev 232) @@ -119,7 +119,7 @@ } String fileExtension = getFileExtension(file); - System.out.println("fileExtension = "+fileExtension); + //System.out.println("fileExtension = "+fileExtension); String filter = "(&(type=converter)(in_data=file-ext:"+fileExtension+"))"; try { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hu...@us...> - 2006-09-30 02:55:58
|
Revision: 226 http://svn.sourceforge.net/cishell/?rev=226&view=rev Author: huangb Date: 2006-09-29 13:35:29 -0700 (Fri, 29 Sep 2006) Log Message: ----------- fix a bug, instead of giving a fixed height, set canvasData.heightHint = image.getBounds().height; Modified Paths: -------------- trunk/clients/gui/org.cishell.reference.gui.workspace/src/org/cishell/reference/gui/common/AbstractDialog.java Modified: trunk/clients/gui/org.cishell.reference.gui.workspace/src/org/cishell/reference/gui/common/AbstractDialog.java =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.workspace/src/org/cishell/reference/gui/common/AbstractDialog.java 2006-09-29 20:16:35 UTC (rev 225) +++ trunk/clients/gui/org.cishell.reference.gui.workspace/src/org/cishell/reference/gui/common/AbstractDialog.java 2006-09-29 20:35:29 UTC (rev 226) @@ -236,7 +236,7 @@ }); } GridData canvasData = new GridData(); - canvasData.heightHint = 35; + canvasData.heightHint = image.getBounds().height; canvas.setLayoutData(canvasData); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |