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-09-30 02:55:57
|
Revision: 225 http://svn.sourceforge.net/cishell/?rev=225&view=rev Author: huangb Date: 2006-09-29 13:16:35 -0700 (Fri, 29 Sep 2006) Log Message: ----------- modify the filter setup in the findConverters method Modified Paths: -------------- trunk/core/org.cishell.reference/src/org/cishell/reference/service/conversion/DataConversionServiceImpl.java Modified: trunk/core/org.cishell.reference/src/org/cishell/reference/service/conversion/DataConversionServiceImpl.java =================================================================== --- trunk/core/org.cishell.reference/src/org/cishell/reference/service/conversion/DataConversionServiceImpl.java 2006-09-29 19:02:45 UTC (rev 224) +++ trunk/core/org.cishell.reference/src/org/cishell/reference/service/conversion/DataConversionServiceImpl.java 2006-09-29 20:16:35 UTC (rev 225) @@ -48,7 +48,8 @@ */ public Converter[] findConverters(String inFormat, String outFormat) { try { - String filter = "(&("+IN_DATA+"="+inFormat+") " + + String filter = "(&("+ALGORITHM_TYPE+"="+TYPE_CONVERTER+")" + + "("+IN_DATA+"="+inFormat+") " + "("+OUT_DATA+"="+outFormat+")" + "(!("+REMOTE+"=*)))"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hu...@us...> - 2006-09-29 21:12:08
|
Revision: 230 http://svn.sourceforge.net/cishell/?rev=230&view=rev Author: huangb Date: 2006-09-29 14:12:03 -0700 (Fri, 29 Sep 2006) Log Message: ----------- change the message shown in the GUIBuilder window 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-09-29 21:08:30 UTC (rev 229) +++ trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/load/FileLoad.java 2006-09-29 21:12:03 UTC (rev 230) @@ -134,8 +134,8 @@ // no converters found means the file format is not supported if (serviceRefList == null || serviceRefList.length == 0){ - guiBuilder.showError("Unsupported File Format", "Sorry, the file format: *"+fileExtension+" is not supported so far.", - "Sorry, the file format: *"+fileExtension+" is not supported so far. \n"+ + guiBuilder.showError("Unsupported File Format", "Sorry, the file format: *."+fileExtension+" is not supported so far.", + "Sorry, the file format: *."+fileExtension+" is not supported so far. \n"+ "Please send your requests to cis...@li.... \n" +"Thank you."); return; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
Revision: 229 http://svn.sourceforge.net/cishell/?rev=229&view=rev Author: huangb Date: 2006-09-29 14:08:30 -0700 (Fri, 29 Sep 2006) Log Message: ----------- clean up the debugging messages Modified Paths: -------------- trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/load/LoadPersisterChooser.java Modified: trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/load/LoadPersisterChooser.java =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/load/LoadPersisterChooser.java 2006-09-29 21:07:34 UTC (rev 228) +++ trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/load/LoadPersisterChooser.java 2006-09-29 21:08:30 UTC (rev 229) @@ -145,7 +145,6 @@ private void updateDetailPane(ServiceReference persister) { detailPane.setText(""); - System.out.println("length="+details_prop_names.length); for (int i=0; i<details_prop_names.length; i++){ String val = (String) persister.getProperty(details_prop_names[i]); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hu...@us...> - 2006-09-29 21:07:38
|
Revision: 228 http://svn.sourceforge.net/cishell/?rev=228&view=rev Author: huangb Date: 2006-09-29 14:07:34 -0700 (Fri, 29 Sep 2006) Log Message: ----------- use swt GUIBuilder pop-up window to display the error message instead of logging the error messages in the console view 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:04:41 UTC (rev 227) +++ trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/load/FileLoad.java 2006-09-29 21:07:34 UTC (rev 228) @@ -21,6 +21,7 @@ import org.cishell.framework.algorithm.Algorithm; import org.cishell.framework.data.Data; import org.cishell.framework.data.BasicData; +import org.cishell.service.guibuilder.GUIBuilderService; /* * @author Weixia(Bonnie) Huang (hu...@in...) @@ -28,14 +29,19 @@ public class FileLoad implements Algorithm{ private static File currentDir; + private final LogService logger; - private final BundleContext bContext; + private final GUIBuilderService guiBuilder; + + private BundleContext bContext; private CIShellContext ciContext; public FileLoad(CIShellContext ciContext, BundleContext bContext) { this.ciContext = ciContext; this.bContext = bContext; - logger = (LogService) ciContext.getService(LogService.class.getName()); + logger = (LogService) ciContext.getService(LogService.class.getName()); + guiBuilder = (GUIBuilderService)ciContext.getService(GUIBuilderService.class.getName()); + } public void selectionChanged(IAction action, ISelection selection) { @@ -47,9 +53,10 @@ // System.out.println("counter is "+counter); // ?? why getActiveWorkbenchWindow() didn't work?? Data[] returnDM; + final IWorkbenchWindow[] windows = PlatformUI.getWorkbench().getWorkbenchWindows(); if (windows.length ==0){ - System.out.println("windows[0] is null!!"); +// System.out.println("windows[0] is null!!"); return null; } @@ -75,7 +82,7 @@ String fileName = theFile.getName() ; String extension ; if (fileName.lastIndexOf(".") != -1) - extension = fileName.substring(fileName.lastIndexOf(".")) ; + extension = fileName.substring(fileName.lastIndexOf(".")+1) ; else extension = "" ; return extension ; @@ -93,7 +100,8 @@ FileDialog dialog = new FileDialog(window.getShell(), SWT.OPEN); if (currentDir == null) { - currentDir = new File(System.getProperty("user.dir") + File.separator + "sampledata" + File.separator + "anything"); + currentDir = new File(System.getProperty("user.dir") + File.separator + "sampledata"); +// currentDir = new File(System.getProperty("user.dir") + File.separator + "sampledata" + File.separator + "anything"); } dialog.setFilterPath(currentDir.getPath()); dialog.setText("Select a File"); @@ -109,8 +117,6 @@ } else { currentDir = new File(file.getPath()); } -// FileResourceDescriptor frd = new BasicFileResourceDescriptor(file); -// String fileExtension = frd.getFileExtension(); String fileExtension = getFileExtension(file); System.out.println("fileExtension = "+fileExtension); @@ -122,15 +128,16 @@ // to nocompression by default. // get all the service references of converters that can load this type of file. -// ServiceReference[] serviceRefList = bContext.getServiceReferences(null, filter); ServiceReference[] serviceRefList = bContext.getAllServiceReferences( AlgorithmFactory.class.getName(), filter); // no converters found means the file format is not supported if (serviceRefList == null || serviceRefList.length == 0){ - //log "The file format is not supported" - logger.log(LogService.LOG_INFO, "Sorry, the file format: *"+fileExtension+" is not supported so far."); + guiBuilder.showError("Unsupported File Format", "Sorry, the file format: *"+fileExtension+" is not supported so far.", + "Sorry, the file format: *"+fileExtension+" is not supported so far. \n"+ + "Please send your requests to cis...@li.... \n" + +"Thank you."); return; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hu...@us...> - 2006-09-29 21:05:33
|
Revision: 227 http://svn.sourceforge.net/cishell/?rev=227&view=rev Author: huangb Date: 2006-09-29 14:04:41 -0700 (Fri, 29 Sep 2006) Log Message: ----------- add org.cishell.service.guibuilder to the Import-Package section. Modified Paths: -------------- trunk/clients/gui/org.cishell.reference.gui.persistence/META-INF/MANIFEST.MF 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-09-29 20:35:29 UTC (rev 226) +++ trunk/clients/gui/org.cishell.reference.gui.persistence/META-INF/MANIFEST.MF 2006-09-29 21:04:41 UTC (rev 227) @@ -11,6 +11,7 @@ org.cishell.framework.data, org.cishell.reference.gui.common, org.cishell.service.conversion, + org.cishell.service.guibuilder, org.osgi.framework;version="1.3.0", org.osgi.service.component;version="1.0.0", org.osgi.service.log;version="1.3.0", This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bea...@us...> - 2006-09-28 19:34:59
|
Revision: 217 http://svn.sourceforge.net/cishell/?rev=217&view=rev Author: bearsfan Date: 2006-09-28 12:34:50 -0700 (Thu, 28 Sep 2006) Log Message: ----------- When a new data object is added to the viewer, it will be highlighted. Modified Paths: -------------- trunk/clients/gui/org.cishell.reference.gui.datamanager/src/org/cishell/reference/gui/datamanager/AbstractDataManagerView.java Modified: trunk/clients/gui/org.cishell.reference.gui.datamanager/src/org/cishell/reference/gui/datamanager/AbstractDataManagerView.java =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.datamanager/src/org/cishell/reference/gui/datamanager/AbstractDataManagerView.java 2006-09-28 19:14:41 UTC (rev 216) +++ trunk/clients/gui/org.cishell.reference.gui.datamanager/src/org/cishell/reference/gui/datamanager/AbstractDataManagerView.java 2006-09-28 19:34:50 UTC (rev 217) @@ -189,9 +189,8 @@ dataToDataGUIItemMap.put(data, item); // update the ModelManager with the new selection - Set selection = new HashSet(); + final Set selection = new HashSet(); selection.add(data); - manager.setSelectedData((Data[]) selection.toArray(new Data[0])); Display.getDefault().syncExec(new Runnable() { public void run() { if (!tree.isDisposed()) { @@ -202,27 +201,12 @@ updateContextMenu(data); // update the global selection viewer.expandToLevel(item, 0); - selectItem(item, tree.getItems()); - getSite().getSelectionProvider().setSelection( - new StructuredSelection(new Data[] { data })); - setFocus(); + manager.setSelectedData((Data[]) selection.toArray(new Data[0])); } } }); } - private void selectItem(DataGUIItem item, TreeItem[] items) { - for (int i = 0; i < items.length; i++) { - TreeItem treeItem = items[i]; - if (treeItem.getData() == item) { - manager.setSelectedData(new Data[] { item.getModel() }); - treeItem.getParent().setSelection(new TreeItem[] { treeItem }); - return; - } - selectItem(item, treeItem.getItems()); - } - } - public void dataLabelChanged(Data data, String label) { if (data != null && label != null) { TreeItem[] treeItems = tree.getItems(); @@ -246,11 +230,11 @@ public void dataSelected(final Data[] data) { if (data != null) { + //setFocus(); Display.getDefault().syncExec(new Runnable() { public void run() { Set itemSet = new HashSet(); for (int i = 0; i < data.length; ++i) { - TreeItem[] treeItems = tree.getItems(); for (int j = 0; j < treeItems.length; ++j) { if (treeItems[i].getData() == data[i]) { @@ -261,6 +245,8 @@ } tree.setSelection((TreeItem[]) itemSet .toArray(new TreeItem[0])); + getSite().getSelectionProvider().setSelection( + new StructuredSelection(data)); } }); } @@ -298,8 +284,6 @@ } manager.setSelectedData(modelArray); - getSite().getSelectionProvider().setSelection( - new StructuredSelection(modelArray)); } } @@ -440,10 +424,10 @@ */ private class TreeItemEditorListener extends MouseAdapter implements KeyListener { - // private TreeEditor editor; + private TreeEditor editor; public TreeItemEditorListener(TreeEditor editor) { - // this.editor = editor; + this.editor = editor; } public void keyReleased(KeyEvent e) { @@ -458,8 +442,12 @@ public void keyPressed(KeyEvent e) { } + + public void mouseDown(MouseEvent e) { + } } + private class DataModelSelectionProvider implements ISelectionProvider { private Set listeners = new HashSet(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hu...@us...> - 2006-09-28 19:14:46
|
Revision: 216 http://svn.sourceforge.net/cishell/?rev=216&view=rev Author: huangb Date: 2006-09-28 12:14:41 -0700 (Thu, 28 Sep 2006) Log Message: ----------- wrong place Removed Paths: ------------- https:/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hu...@us...> - 2006-09-28 19:11:54
|
Revision: 215 http://svn.sourceforge.net/cishell/?rev=215&view=rev Author: huangb Date: 2006-09-28 12:11:20 -0700 (Thu, 28 Sep 2006) Log Message: ----------- initial version Added Paths: ----------- trunk/clients/gui/org.cishell.reference.gui.persistence/.classpath trunk/clients/gui/org.cishell.reference.gui.persistence/.project trunk/clients/gui/org.cishell.reference.gui.persistence/.settings/ trunk/clients/gui/org.cishell.reference.gui.persistence/.settings/org.eclipse.pde.core.prefs trunk/clients/gui/org.cishell.reference.gui.persistence/META-INF/ trunk/clients/gui/org.cishell.reference.gui.persistence/META-INF/MANIFEST.MF trunk/clients/gui/org.cishell.reference.gui.persistence/OSGI-INF/ trunk/clients/gui/org.cishell.reference.gui.persistence/OSGI-INF/l10n/ trunk/clients/gui/org.cishell.reference.gui.persistence/OSGI-INF/l10n/bundle_en.properties trunk/clients/gui/org.cishell.reference.gui.persistence/OSGI-INF/load.properties trunk/clients/gui/org.cishell.reference.gui.persistence/OSGI-INF/load.xml trunk/clients/gui/org.cishell.reference.gui.persistence/OSGI-INF/metatype/ trunk/clients/gui/org.cishell.reference.gui.persistence/OSGI-INF/metatype/METADATA.XML 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/build.properties trunk/clients/gui/org.cishell.reference.gui.persistence/src/ trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/ trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/ trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/ trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/ trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/ trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/load/ 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/FileLoadFactory.java trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/load/LoadPersisterChooser.java trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/save/ 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 Added: trunk/clients/gui/org.cishell.reference.gui.persistence/.classpath =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.persistence/.classpath (rev 0) +++ trunk/clients/gui/org.cishell.reference.gui.persistence/.classpath 2006-09-28 19:11:20 UTC (rev 215) @@ -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.persistence/.project =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.persistence/.project (rev 0) +++ trunk/clients/gui/org.cishell.reference.gui.persistence/.project 2006-09-28 19:11:20 UTC (rev 215) @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>org.cishell.reference.gui.persistence</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.persistence/.settings/org.eclipse.pde.core.prefs =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.persistence/.settings/org.eclipse.pde.core.prefs (rev 0) +++ trunk/clients/gui/org.cishell.reference.gui.persistence/.settings/org.eclipse.pde.core.prefs 2006-09-28 19:11:20 UTC (rev 215) @@ -0,0 +1,3 @@ +#Wed Sep 27 14:27:31 EDT 2006 +eclipse.preferences.version=1 +pluginProject.extensions=false Added: trunk/clients/gui/org.cishell.reference.gui.persistence/META-INF/MANIFEST.MF =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.persistence/META-INF/MANIFEST.MF (rev 0) +++ trunk/clients/gui/org.cishell.reference.gui.persistence/META-INF/MANIFEST.MF 2006-09-28 19:11:20 UTC (rev 215) @@ -0,0 +1,23 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Persistence Plug-in +Bundle-SymbolicName: org.cishell.reference.gui.persistence +Bundle-Version: 0.0.1 +Bundle-ClassPath: . +Bundle-Localization: plugin +Import-Package: org.cishell.app.service.datamanager, + org.cishell.framework, + org.cishell.framework.algorithm, + org.cishell.framework.data, + org.cishell.reference.gui.common, + org.cishell.service.conversion, + org.osgi.framework;version="1.3.0", + org.osgi.service.component;version="1.0.0", + org.osgi.service.log;version="1.3.0", + org.osgi.service.metatype;version="1.1.0", + org.osgi.service.prefs;version="1.1.0" +X-AutoStart: true +Service-Component: OSGI-INF/load.xml, OSGI-INF/save.xml +Require-Bundle: org.eclipse.swt, + org.eclipse.ui + Added: trunk/clients/gui/org.cishell.reference.gui.persistence/OSGI-INF/l10n/bundle_en.properties =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.persistence/OSGI-INF/l10n/bundle_en.properties (rev 0) +++ trunk/clients/gui/org.cishell.reference.gui.persistence/OSGI-INF/l10n/bundle_en.properties 2006-09-28 19:11:20 UTC (rev 215) @@ -0,0 +1,7 @@ +#Localization variables for OSGI-INF/metatatype/METADATA.XML +# +#Samples: +#input=Input +#desc=Enter an integer (that will be converted to a string) +#name=Input->String +#name_desc=Converts inputted integer to string Added: trunk/clients/gui/org.cishell.reference.gui.persistence/OSGI-INF/load.properties =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.persistence/OSGI-INF/load.properties (rev 0) +++ trunk/clients/gui/org.cishell.reference.gui.persistence/OSGI-INF/load.properties 2006-09-28 19:11:20 UTC (rev 215) @@ -0,0 +1,7 @@ +menu_path=file/additions/ +label=Load... +description=This converter allows users to select file from the file system and load it to Data Model window +in_data=null +out_data=java.lang.Object +service.pid=org.cishell.reference.gui.persistence.load.FileLoad +remoteable=true Added: trunk/clients/gui/org.cishell.reference.gui.persistence/OSGI-INF/load.xml =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.persistence/OSGI-INF/load.xml (rev 0) +++ trunk/clients/gui/org.cishell.reference.gui.persistence/OSGI-INF/load.xml 2006-09-28 19:11:20 UTC (rev 215) @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?> +<component name="org.cishell.reference.gui.persistence.load.FileLoad.component" immediate="false"> + <implementation class="org.cishell.reference.gui.persistence.load.FileLoadFactory"/> + <properties entry="OSGI-INF/load.properties"/> + <reference name="LOG" interface="org.osgi.service.log.LogService"/> + <reference name="MTS" interface="org.osgi.service.metatype.MetaTypeService"/> + + <service> + <provide interface= + "org.cishell.framework.algorithm.AlgorithmFactory"/> + </service> +</component> \ No newline at end of file Added: trunk/clients/gui/org.cishell.reference.gui.persistence/OSGI-INF/metatype/METADATA.XML =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.persistence/OSGI-INF/metatype/METADATA.XML (rev 0) +++ trunk/clients/gui/org.cishell.reference.gui.persistence/OSGI-INF/metatype/METADATA.XML 2006-09-28 19:11:20 UTC (rev 215) @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<metatype:MetaData xmlns:metatype="http://www.osgi.org/xmlns/metatype/v1.0.0"> + <OCD name="File Load Converter" id="org.cishell.reference.gui.load.FileLoad.OCD" + description=""> + </OCD> + <Designate pid="org.cishell.reference.gui.load.FileLoad"> + <Object ocdref="org.cishell.reference.gui.load.FileLoad.OCD" /> + </Designate> +</metatype:MetaData> Added: trunk/clients/gui/org.cishell.reference.gui.persistence/OSGI-INF/save.properties =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.persistence/OSGI-INF/save.properties (rev 0) +++ trunk/clients/gui/org.cishell.reference.gui.persistence/OSGI-INF/save.properties 2006-09-28 19:11:20 UTC (rev 215) @@ -0,0 +1,7 @@ +menu_path=File/Save +label=Save... +description=Saves data to disk +in_data=java.lang.Object +out_data=file:* +service.pid=org.cishell.reference.gui.persistence.save.Save +remoteable=false Added: trunk/clients/gui/org.cishell.reference.gui.persistence/OSGI-INF/save.xml =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.persistence/OSGI-INF/save.xml (rev 0) +++ trunk/clients/gui/org.cishell.reference.gui.persistence/OSGI-INF/save.xml 2006-09-28 19:11:20 UTC (rev 215) @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?> +<component name="org.cishell.reference.gui.persistence.save.Save.component" immediate="false"> + <implementation class="org.cishell.reference.gui.persistence.save.SaveFactory"/> + <properties entry="OSGI-INF/save.properties"/> + <reference name="LOG" interface="org.osgi.service.log.LogService"/> + <reference name="MTS" interface="org.osgi.service.metatype.MetaTypeService"/> + + <service> + <provide interface= + "org.cishell.framework.algorithm.AlgorithmFactory"/> + </service> +</component> \ No newline at end of file Added: trunk/clients/gui/org.cishell.reference.gui.persistence/build.properties =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.persistence/build.properties (rev 0) +++ trunk/clients/gui/org.cishell.reference.gui.persistence/build.properties 2006-09-28 19:11:20 UTC (rev 215) @@ -0,0 +1,4 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + . Added: 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 (rev 0) +++ trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/load/FileLoad.java 2006-09-28 19:11:20 UTC (rev 215) @@ -0,0 +1,163 @@ +package org.cishell.reference.gui.persistence.load; + +import java.io.File; +import java.util.ArrayList; + +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.PlatformUI; +import org.eclipse.swt.SWT; +import org.eclipse.swt.widgets.FileDialog; +import org.eclipse.swt.widgets.Display; +import org.eclipse.jface.action.IAction; +import org.eclipse.jface.viewers.ISelection; + + +import org.osgi.framework.BundleContext; +import org.osgi.framework.ServiceReference; +import org.osgi.service.log.LogService; + +import org.cishell.framework.CIShellContext; +import org.cishell.framework.algorithm.AlgorithmFactory; +import org.cishell.framework.algorithm.Algorithm; +import org.cishell.framework.data.Data; +import org.cishell.framework.data.BasicData; + +/* + * @author Weixia(Bonnie) Huang (hu...@in...) + */ +public class FileLoad implements Algorithm{ + + private static File currentDir; + private final LogService logger; + private final BundleContext bContext; + private CIShellContext ciContext; + + public FileLoad(CIShellContext ciContext, BundleContext bContext) { + this.ciContext = ciContext; + this.bContext = bContext; + logger = (LogService) ciContext.getService(LogService.class.getName()); + } + + public void selectionChanged(IAction action, ISelection selection) { + + } + + public Data[] execute() { +// int counter = PlatformUI.getWorkbench().getWorkbenchWindowCount(); +// System.out.println("counter is "+counter); +// ?? why getActiveWorkbenchWindow() didn't work?? + Data[] returnDM; + final IWorkbenchWindow[] windows = PlatformUI.getWorkbench().getWorkbenchWindows(); + if (windows.length ==0){ + System.out.println("windows[0] is null!!"); + return null; + } + + Display display = PlatformUI.getWorkbench().getDisplay(); + DataUpdater dataUpdater = new DataUpdater (windows[0]); + display.syncExec(dataUpdater); + if (!dataUpdater.returnList.isEmpty()){ + int size = dataUpdater.returnList.size(); + returnDM = new Data[size]; + for(int index=0; index<size; index++){ + returnDM[index]=(Data)dataUpdater.returnList.get(index); + } + return returnDM; + } + else { +// logger.log(LogService.LOG_INFO, "Did not load any data..."); + return null; + } + + } + + public static String getFileExtension(File theFile) { + String fileName = theFile.getName() ; + String extension ; + if (fileName.lastIndexOf(".") != -1) + extension = fileName.substring(fileName.lastIndexOf(".")) ; + else + extension = "" ; + return extension ; + } + + final class DataUpdater implements Runnable{ + IWorkbenchWindow window; + ArrayList returnList = new ArrayList(); + + DataUpdater (IWorkbenchWindow window){ + this.window = window; + } + + public void run (){ + + FileDialog dialog = new FileDialog(window.getShell(), SWT.OPEN); + if (currentDir == null) { + currentDir = new File(System.getProperty("user.dir") + File.separator + "sampledata" + File.separator + "anything"); + } + dialog.setFilterPath(currentDir.getPath()); + dialog.setText("Select a File"); + String fileName = dialog.open(); + if (fileName == null) { + return; + } + + File file = new File(fileName); + + if (file.isDirectory()) { + currentDir = file; + } else { + currentDir = new File(file.getPath()); + } +// FileResourceDescriptor frd = new BasicFileResourceDescriptor(file); +// String fileExtension = frd.getFileExtension(); + + String fileExtension = getFileExtension(file); + System.out.println("fileExtension = "+fileExtension); + String filter = "(&(type=converter)(in_data=file-ext:"+fileExtension+"))"; + try { + + // set the properties for the resource descriptor. + // note that this relies on the fact that the compression is set + // to nocompression by default. + + // get all the service references of converters that can load this type of file. +// ServiceReference[] serviceRefList = bContext.getServiceReferences(null, filter); + ServiceReference[] serviceRefList = bContext.getAllServiceReferences( + AlgorithmFactory.class.getName(), filter); + + + // no converters found means the file format is not supported + if (serviceRefList == null || serviceRefList.length == 0){ + //log "The file format is not supported" + logger.log(LogService.LOG_INFO, "Sorry, the file format: *"+fileExtension+" is not supported so far."); + return; + } + + //<filename>[.<data model type>][.<index>] + // only one persister found, so load the model + if (serviceRefList.length == 1){ + logger.log(LogService.LOG_INFO, "Loaded: "+file.getPath()); + AlgorithmFactory persister = (AlgorithmFactory)bContext.getService(serviceRefList[0]); + Data[] dm = new Data[]{new BasicData(file.getPath(), String.class.getName()) }; + dm = persister.createAlgorithm(dm, null, ciContext).execute(); + for (int i=0; i<dm.length; i++) + returnList.add(dm[i]); + return; + + } + + // lots of persisters found, return the chooser + new LoadPersisterChooser("Load", file, window.getShell(), + ciContext, bContext, serviceRefList, returnList).open(); + + + }catch (Exception e){ + e.printStackTrace(); + } + + }//end run() + } //end class + + +} \ No newline at end of file Added: trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/load/FileLoadFactory.java =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/load/FileLoadFactory.java (rev 0) +++ trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/load/FileLoadFactory.java 2006-09-28 19:11:20 UTC (rev 215) @@ -0,0 +1,35 @@ +package org.cishell.reference.gui.persistence.load; + +//standard java +import java.util.Dictionary; + +//osgi +import org.osgi.framework.BundleContext; +import org.osgi.service.component.ComponentContext; +import org.osgi.service.metatype.MetaTypeProvider; + +//cishell +import org.cishell.framework.CIShellContext; +import org.cishell.framework.algorithm.Algorithm; +import org.cishell.framework.algorithm.AlgorithmFactory; +import org.cishell.framework.data.Data; + +/* + * @author Weixia(Bonnie) Huang (hu...@in...) + */ +public class FileLoadFactory implements AlgorithmFactory { + private BundleContext bcontext; + + protected void activate(ComponentContext ctxt) { + bcontext = ctxt.getBundleContext(); + } + protected void deactivate(ComponentContext ctxt) {} + + public Algorithm createAlgorithm(Data[] data, Dictionary parameters, CIShellContext context) { + return new FileLoad(context, bcontext); + } + public MetaTypeProvider createParameters(Data[] data) { + return null; + } + +} \ No newline at end of file Added: trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/load/LoadPersisterChooser.java =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/load/LoadPersisterChooser.java (rev 0) +++ trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/load/LoadPersisterChooser.java 2006-09-28 19:11:20 UTC (rev 215) @@ -0,0 +1,201 @@ +/* + * InfoVis CyberInfrastructure: A Data-Code-Compute Resource for Research + * and Education in Information Visualization (http://iv.slis.indiana.edu/). + * + * Created on Jan 24, 2005 at Indiana University. + */ +package org.cishell.reference.gui.persistence.load; + +import java.util.ArrayList; +import java.io.File; + +import org.eclipse.swt.SWT; +import org.eclipse.swt.custom.StyleRange; +import org.eclipse.swt.custom.StyledText; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.layout.FillLayout; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Group; +import org.eclipse.swt.widgets.List; +import org.eclipse.swt.widgets.Shell; + +import org.osgi.framework.BundleContext; +import org.osgi.framework.ServiceReference; +import org.osgi.service.log.LogService; + +import org.cishell.framework.CIShellContext; +import org.cishell.framework.algorithm.AlgorithmFactory; +import org.cishell.framework.data.BasicData; +import org.cishell.framework.data.Data; + +import org.cishell.reference.gui.common.AbstractDialog; + +/** + * + * @author Team IVC (Weixia Huang, James Ellis) + */ +public class LoadPersisterChooser extends AbstractDialog { + private File theFile; + private LogService logger; + + private ServiceReference[] persisterArray; + private List persisterList; + private StyledText detailPane; + private CIShellContext ciContext; + private BundleContext bContext; + private ArrayList returnList; + + private static final String[] details_prop_names = + {"format_name", "supported_file_extension", "format_description", + "restorable_model_name", "restorable_model_description" }; + private static final String[] details_prop_name_descriptions = + {"Format name", "Supported file extension", "Format description", + "Restorable model name", "Restorable model description" }; + + public LoadPersisterChooser(String title, File theFile, + Shell parent, CIShellContext ciContext, BundleContext bContext, + ServiceReference[] persisterArray, ArrayList returnList){ + super(parent, title, AbstractDialog.QUESTION); + this.ciContext = ciContext; + this.bContext = bContext; + this.persisterArray = persisterArray; + this.returnList = returnList; + + this.theFile = theFile; + + this.logger = (LogService) ciContext.getService(LogService.class.getName()); +//shall this part be moved out of the code? + setDescription("The file you have selected can be loaded" + + " using the following formats.\n" + + "Please select one of them."); + setDetails("This dialog allows the user to choose among all available " + + "formats for loading the selected data model. Choose any of the formats " + + "to continue loading the dataset."); + } + + private Composite initGUI(Composite parent) { + Composite content = new Composite(parent, SWT.NONE); + + GridLayout layout = new GridLayout(); + layout.numColumns = 2; + content.setLayout(layout); + + Group persisterGroup = new Group(content, SWT.NONE); +//shall this label be moved out of the code? + persisterGroup.setText("Loaded by"); + persisterGroup.setLayout(new FillLayout()); + GridData persisterListGridData = new GridData(GridData.FILL_BOTH); + persisterListGridData.widthHint = 200; + persisterGroup.setLayoutData(persisterListGridData); + + persisterList = new List(persisterGroup, SWT.H_SCROLL |SWT.V_SCROLL | SWT.SINGLE); +// initPersisterArray(); + initPersisterList(); + persisterList.addSelectionListener(new SelectionAdapter(){ + public void widgetSelected(SelectionEvent e) { + List list = (List)e.getSource(); + int selection = list.getSelectionIndex(); + if(selection != -1){ + updateDetailPane(persisterArray[selection]); + } + } + }); + + Group detailsGroup = new Group(content, SWT.NONE); +// shall this label be moved out of the code? + detailsGroup.setText("Details"); + detailsGroup.setLayout(new FillLayout()); + GridData detailsGridData = new GridData(GridData.FILL_BOTH); + detailsGridData.widthHint = 200; + detailsGroup.setLayoutData(detailsGridData); + + detailPane = initDetailPane(detailsGroup); + + persisterList.setSelection(0); + updateDetailPane(persisterArray[0]); + + return content; + } + + private void initPersisterList(){ + for (int i = 0; i < persisterArray.length; ++i) { + + String name = (String)persisterArray[i].getProperty("converter_name"); + + // if someone was sloppy enough to not provide a name, then use the + // name of the class instead. + if (name == null || name.length() == 0) + name = persisterArray[i].getClass().getName(); + persisterList.add(name); + } + } + + + private StyledText initDetailPane(Group detailsGroup) { + StyledText detailPane = new StyledText(detailsGroup, SWT.H_SCROLL | SWT.V_SCROLL); + detailPane.setEditable(false); + detailPane.getCaret().setVisible(false); + return detailPane; + } + + private void updateDetailPane(ServiceReference persister) { + + detailPane.setText(""); + System.out.println("length="+details_prop_names.length); + for (int i=0; i<details_prop_names.length; i++){ + String val = (String) persister.getProperty(details_prop_names[i]); + + StyleRange styleRange = new StyleRange(); + styleRange.start = detailPane.getText().length(); + detailPane.append(details_prop_name_descriptions[i] + ":\n"); + styleRange.length = details_prop_names[i].length() + 1; + styleRange.fontStyle = SWT.BOLD; + detailPane.setStyleRange(styleRange); + + detailPane.append(val + "\n"); + + } + + } + + private void selectionMade(int selectedIndex) { + + logger.log(LogService.LOG_INFO, "Loaded: "+theFile.getPath()); + AlgorithmFactory persister =(AlgorithmFactory) bContext.getService(persisterArray[selectedIndex]); + Data[] dm = new Data[]{new BasicData(theFile.getPath(),String.class.getName())}; + dm = persister.createAlgorithm(dm, null, ciContext).execute(); + for(int i = 0; i<dm.length; i++){ + returnList.add(dm[i]); + } + close(true); + } + + public void createDialogButtons(Composite parent) { + Button select = new Button(parent, SWT.PUSH); + select.setText("Select"); + select.addSelectionListener(new SelectionAdapter(){ + public void widgetSelected(SelectionEvent e) { + int index = persisterList.getSelectionIndex(); + if(index != -1){ + selectionMade(index); + } + } + }); + + Button cancel = new Button(parent, SWT.NONE); + cancel.setText("Cancel"); + cancel.addSelectionListener(new SelectionAdapter(){ + public void widgetSelected(SelectionEvent e) { + close(false); + } + }); + } + + public Composite createContent(Composite parent) { + return initGUI(parent); + } +} Added: 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 (rev 0) +++ trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/save/FileSaver.java 2006-09-28 19:11:20 UTC (rev 215) @@ -0,0 +1,130 @@ +/* + * Created on Aug 19, 2004 + */ +package org.cishell.reference.gui.persistence.save; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.nio.channels.FileChannel; + +import org.cishell.framework.CIShellContext; +import org.cishell.framework.algorithm.AlgorithmProperty; +import org.cishell.framework.data.Data; +import org.cishell.service.conversion.Converter; +import org.eclipse.swt.SWT; +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 + */ +public class FileSaver { + private static File currentDir; + + private Shell parent; + private LogService logService; + private CIShellContext ciContext; + + public FileSaver(Shell parent, CIShellContext context){ + this.parent = parent; + this.ciContext = context; + this.logService = (LogService) ciContext.getService(LogService.class.getName()); + } + + 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; + } + + 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); + valid = false; + } else if (file.exists()) { + valid = confirmFileOverwrite(file); + } + else + valid = true ; + return valid; + } + + public boolean save(Converter converter, Data data) { + ServiceReference[] serviceReferenceArray = converter.getConverterChain(); + String outDataStr = (String)serviceReferenceArray[serviceReferenceArray.length-1] + .getProperty(AlgorithmProperty.OUT_DATA); + + String ext = outDataStr.substring(outDataStr.indexOf(':')+1); + + FileDialog dialog = new FileDialog(parent, SWT.SAVE); + + if (currentDir == null) { + currentDir = new File(System.getProperty("user.home")); + } + dialog.setFilterPath(currentDir.getPath()); + + dialog.setFilterExtensions(new String[]{"*" + ext}); + dialog.setText("Choose File"); + dialog.setFileName((String)data.getMetaData().get(AlgorithmProperty.LABEL)); + + boolean done = false; + + while (!done) { + String fileName = dialog.open(); + if (fileName != null) { + File selectedFile = new File(fileName); + if (!isSaveFileValid(selectedFile)) + continue; + if (ext != null && ext.length() != 0) + if (!selectedFile.getPath().endsWith(ext)) + selectedFile = new File(selectedFile.getPath() + ext) ; + + Data newData = converter.convert(data); + + copy((File)newData.getData(), selectedFile); + + if (selectedFile.isDirectory()) { + currentDir = selectedFile; + } else { + currentDir = new File(selectedFile.getParent()); + } + + done = true ; + + logService.log(LogService.LOG_INFO, "File saved: " + selectedFile.getPath() + "\n"); + //DataManagerService dms = (DataManagerService)context.getService(DataManagerService.class.getName()); + //dms.addData(data); + } else { + logService.log(LogService.LOG_INFO, "File save cancelled.\n"); + done = true; + return false; + } + } + return true; + } + + private boolean copy(File in, File out) { + try { + FileInputStream fis = new FileInputStream(in); + FileOutputStream fos = new FileOutputStream(out); + + FileChannel readableChannel = fis.getChannel(); + FileChannel writableChannel = fos.getChannel(); + + writableChannel.truncate(0); + writableChannel.transferFrom(readableChannel, 0, readableChannel.size()); + return true; + } + catch (IOException ioe) { + logService.log(LogService.LOG_ERROR, ioe.getMessage()); + return false; + } + } +} \ No newline at end of file Added: 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 (rev 0) +++ trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/save/Save.java 2006-09-28 19:11:20 UTC (rev 215) @@ -0,0 +1,67 @@ +package org.cishell.reference.gui.persistence.save; + +import java.util.Dictionary; + +import org.cishell.framework.CIShellContext; +import org.cishell.framework.algorithm.Algorithm; +import org.cishell.framework.data.Data; +import org.cishell.service.conversion.Converter; +import org.cishell.service.conversion.DataConversionService; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.ui.PlatformUI; +import org.osgi.service.log.LogService; + +public class Save implements Algorithm { + Data[] data; + Dictionary parameters; + CIShellContext context; + + final Shell parentShell; + + DataConversionService conversionManager; + 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(); + + conversionManager = (DataConversionService) context.getService( + DataConversionService.class.getName()); + + logService = (LogService)context.getService(LogService.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!"); + } + else { + 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", + Save.class.getName(), + context); + sdc.createContent(parentShell); + sdc.open(); + }}); + } + } + return null; + } +} \ No newline at end of file Added: 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 (rev 0) +++ trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/save/SaveDataChooser.java 2006-09-28 19:11:20 UTC (rev 215) @@ -0,0 +1,220 @@ +/* + * InfoVis CyberInfrastructure: A Data-Code-Compute Resource for Research + * and Education in Information Visualization (http://iv.slis.indiana.edu/). + * + * Created on Jan 28, 2005 at Indiana University. + */ +package org.cishell.reference.gui.persistence.save; + +import java.util.Dictionary; +import java.util.Enumeration; + +import org.cishell.framework.CIShellContext; +import org.cishell.framework.algorithm.AlgorithmProperty; +import org.cishell.framework.data.Data; +import org.cishell.service.conversion.Converter; +import org.eclipse.swt.SWT; +import org.eclipse.swt.custom.StyleRange; +import org.eclipse.swt.custom.StyledText; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.graphics.Image; +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.Group; +import org.eclipse.swt.widgets.List; +import org.eclipse.swt.widgets.Shell; + +import org.cishell.reference.gui.common.AbstractDialog; + +/** + * SavePersisterChooser 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; + private List converterList; + private StyledText detailPane; + //private Shell parent; + CIShellContext context; + //private LogService logService; + public static final Image QUESTION = Display.getCurrent().getSystemImage(SWT.ICON_QUESTION); + + /** + * Creates a new SavePersisterChooser 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 + */ + //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; + //this.logService = (LogService) context.getService(LogService.class.getName()); + } + + /* + * Initialize the GUI for this SavePersisterChooser + */ + private Composite initGUI(Composite parent) { + Composite content = new Composite(parent, SWT.NONE); + GridLayout layout = new GridLayout(); + layout.numColumns = 2; + content.setLayout(layout); + //parent.setLayout(layout); + + Group converterGroup = new Group(content, SWT.NONE); + converterGroup.setText("Pick the Output Data Type"); + converterGroup.setLayout(new FillLayout()); + GridData persisterData = new GridData(GridData.FILL_BOTH); + persisterData.widthHint = 200; + converterGroup.setLayoutData(persisterData); + + converterList = new List(converterGroup, SWT.H_SCROLL | SWT.V_SCROLL | SWT.SINGLE); + initConverterList(); + converterList.addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) { + List list = (List) e.getSource(); + int selection = list.getSelectionIndex(); + + if (selection != -1) { + updateDetailPane(converterArray[selection]); + } + } + }); + + 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); + detailsData.widthHint = 200; + detailsGroup.setLayoutData(detailsData); + + detailPane = initDetailPane(detailsGroup); + + //select the first item by default + converterList.setSelection(0); + updateDetailPane(converterArray[0]); + + return content; + } + + /* + * Initialize the Listbox of Persisters using the stored Persister array + */ + private void initConverterList() { + for (int i = 0; i < converterArray.length; ++i) { + Dictionary dict = converterArray[i].getProperties(); + + // get the name of the persister from the property map + String outData = (String) dict.get(AlgorithmProperty.LABEL); + + // if someone was sloppy enough to not provide a name, then use the + // name of the class instead. + if ((outData == null) || (outData.length() == 0)) { + outData = converterArray[i].getClass().getName(); + } + + converterList.add(outData); + } + } + + /* + * Sets up the DetailPane where the details from the Persister PropertyMaps are displayed. + */ + private StyledText initDetailPane(Group detailsGroup) { + StyledText detailPane = new StyledText(detailsGroup, SWT.H_SCROLL | SWT.V_SCROLL); + detailPane.setEditable(false); + detailPane.getCaret().setVisible(false); + + return detailPane; + } + + /* + * Changes the information displayed in the DetailsPane whenever a new Persister + * is selected. + */ + private void updateDetailPane(Converter converter) { + Dictionary dict = converter.getProperties(); + Enumeration keysEnum = dict.keys(); + + detailPane.setText(""); + + 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(); + detailPane.append(key + ":\n"); + styleRange.length = key.toString().length() + 1; + styleRange.fontStyle = SWT.BOLD; + 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. + */ + protected void selectionMade(int selectedIndex) { + getShell().setVisible(false); + final Converter converter = converterArray[selectedIndex]; + final FileSaver saver = new FileSaver(getShell(), context); + close(saver.save(converter, data)); + } + + public void createDialogButtons(Composite parent) { + Button select = new Button(parent, SWT.PUSH); + select.setText("Select"); + select.addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) { + int index = converterList.getSelectionIndex(); + + if (index != -1) { + selectionMade(index); + } + } + }); + + Button cancel = new Button(parent, SWT.NONE); + cancel.setText("Cancel"); + cancel.addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) { + close(false); + } + }); + } + + public Composite createContent(Composite parent) { + if (converterArray.length == 1) { + final FileSaver saver = new FileSaver((Shell)parent, context); + close(saver.save(converterArray[0], data)); + return parent; + } + else { + return initGUI(parent); + } + } +} Added: 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 (rev 0) +++ trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/save/SaveFactory.java 2006-09-28 19:11:20 UTC (rev 215) @@ -0,0 +1,24 @@ +package org.cishell.reference.gui.persistence.save; + +import java.util.Dictionary; + +import org.cishell.framework.CIShellContext; +import org.cishell.framework.algorithm.Algorithm; +import org.cishell.framework.algorithm.AlgorithmFactory; +import org.cishell.framework.data.Data; +import org.osgi.service.component.ComponentContext; +import org.osgi.service.metatype.MetaTypeProvider; + + +public class SaveFactory implements AlgorithmFactory { + + protected void activate(ComponentContext ctxt) {} + protected void deactivate(ComponentContext ctxt) {} + + public Algorithm createAlgorithm(Data[] data, Dictionary parameters, CIShellContext context) { + return new Save(data, parameters, context); + } + public MetaTypeProvider createParameters(Data[] data) { + return null; + } +} \ 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: <hu...@us...> - 2006-09-28 19:10:56
|
Revision: 213 http://svn.sourceforge.net/cishell/?rev=213&view=rev Author: huangb Date: 2006-09-28 12:07:53 -0700 (Thu, 28 Sep 2006) Log Message: ----------- Initial import. Added Paths: ----------- https:/svn.sourceforge.net/svnroot/cishell/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hu...@us...> - 2006-09-28 19:10:26
|
Revision: 214 http://svn.sourceforge.net/cishell/?rev=214&view=rev Author: huangb Date: 2006-09-28 12:10:18 -0700 (Thu, 28 Sep 2006) Log Message: ----------- Initial import. Added Paths: ----------- trunk/clients/gui/org.cishell.reference.gui.persistence/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hu...@us...> - 2006-09-28 19:09:00
|
Revision: 211 http://svn.sourceforge.net/cishell/?rev=211&view=rev Author: huangb Date: 2006-09-28 12:07:42 -0700 (Thu, 28 Sep 2006) Log Message: ----------- Initial import. Added Paths: ----------- https:/svn.sourceforge.net/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hu...@us...> - 2006-09-28 19:07:56
|
Revision: 212 http://svn.sourceforge.net/cishell/?rev=212&view=rev Author: huangb Date: 2006-09-28 12:07:47 -0700 (Thu, 28 Sep 2006) Log Message: ----------- Initial import. Added Paths: ----------- https:/svn.sourceforge.net/svnroot/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hu...@us...> - 2006-09-28 19:05:46
|
Revision: 210 http://svn.sourceforge.net/cishell/?rev=210&view=rev Author: huangb Date: 2006-09-28 12:05:40 -0700 (Thu, 28 Sep 2006) Log Message: ----------- Initial import. Added Paths: ----------- https:/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hu...@us...> - 2006-09-28 15:27:35
|
Revision: 209 http://svn.sourceforge.net/cishell/?rev=209&view=rev Author: huangb Date: 2006-09-28 08:17:54 -0700 (Thu, 28 Sep 2006) Log Message: ----------- initial version Added Paths: ----------- trunk/clients/gui/org.cishell.reference.gui.workspace/src/org/cishell/reference/gui/common/ trunk/clients/gui/org.cishell.reference.gui.workspace/src/org/cishell/reference/gui/common/AbstractDialog.java Added: 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 (rev 0) +++ trunk/clients/gui/org.cishell.reference.gui.workspace/src/org/cishell/reference/gui/common/AbstractDialog.java 2006-09-28 15:17:54 UTC (rev 209) @@ -0,0 +1,465 @@ +/* + * 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.common; + +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.PaintEvent; +import org.eclipse.swt.events.PaintListener; +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.Canvas; +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 { + public static final Image INFORMATION = Display.getCurrent().getSystemImage(SWT.ICON_INFORMATION); + public static final Image WARNING = Display.getCurrent().getSystemImage(SWT.ICON_WARNING); + public static final Image ERROR = Display.getCurrent().getSystemImage(SWT.ICON_ERROR); + public static final Image QUESTION = Display.getCurrent().getSystemImage(SWT.ICON_QUESTION); + public static final Image WORKING = Display.getCurrent().getSystemImage(SWT.ICON_WORKING); + +// private static final Image ivcIcon = IVCImageLoader.createImage("ivc.gif"); + + //constants used in resizing of shell when details are shown/hidden + private static final int DETAILS_HEIGHT = 75; + private static final int SCROLLBAR_BUFFER = 47; + + + 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); + shell.setText(getText()); +// shell.setImage(ivcIcon); + 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() { + success = true; + + setupHeader(); + setupContent(); + setupButtons(); + + shell.pack(); + setLocation(); + shell.open(); + shell.addShellListener(new ShellAdapter(){ + public void shellClosed(ShellEvent e) { + success = false; + } + }); + Display display = getParent().getDisplay(); + + while (!shell.isDisposed()) { + if (!display.readAndDispatch()) { + display.sleep(); + } + } + + return success; + } + + /* + * 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); + + Canvas canvas = new Canvas(header, SWT.NONE); + if (image != null) { + canvas.addPaintListener(new PaintListener() { + public void paintControl(PaintEvent e) { + e.gc.drawImage(image, 0, 0); + } + }); + } + GridData canvasData = new GridData(); + canvasData.heightHint = 35; + 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 + Button details = new Button(buttons, SWT.PUSH); + details.setText("Details >>"); + details.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); + details.addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) { + if ((detailsText == null) || detailsText.isDisposed()) { + //show details section + setupDetails(); + shell.pack(); + } else { + //remove details section + detailsText.dispose(); + shell.pack(); + } + } + }); + details.setEnabled((detailsString != null) && + !detailsString.equals("")); + } + + /* + * creates the details text box when the "Details >>" button is toggled + */ + private void setupDetails() { + int width = shell.getSize().x; + 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(); + data.grabExcessHorizontalSpace = false; + data.grabExcessVerticalSpace = false; + data.widthHint = width - SCROLLBAR_BUFFER; + data.heightHint = DETAILS_HEIGHT; + detailsText.setLayoutData(data); + if(detailsString != null) + detailsText.setText(detailsString); + } + + /** + * 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(); + } +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bh...@us...> - 2006-09-26 19:09:32
|
Revision: 208 http://svn.sourceforge.net/cishell/?rev=208&view=rev Author: bh2 Date: 2006-09-26 12:09:27 -0700 (Tue, 26 Sep 2006) Log Message: ----------- Fixed bug with log view to fix some nasty NPEs Modified Paths: -------------- trunk/clients/gui/org.cishell.reference.gui.log/src/org/cishell/reference/gui/log/LogView.java Modified: trunk/clients/gui/org.cishell.reference.gui.log/src/org/cishell/reference/gui/log/LogView.java =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.log/src/org/cishell/reference/gui/log/LogView.java 2006-09-26 18:43:44 UTC (rev 207) +++ trunk/clients/gui/org.cishell.reference.gui.log/src/org/cishell/reference/gui/log/LogView.java 2006-09-26 19:09:27 UTC (rev 208) @@ -307,7 +307,7 @@ Integer offset = offsets[i]; String url = (String) offsetToUrlMap.get(offset); - if ((position >= offset.intValue()) && + if (offset != null && url != null && (position >= offset.intValue()) && (position <= (offset.intValue() + url.length()))) { overURL = true; @@ -358,7 +358,7 @@ Integer offset = offsets[i]; String url = (String) offsetToUrlMap.get(offset); - if ((clicked >= offset.intValue()) && + if (url != null && (clicked >= offset.intValue()) && (clicked <= (offset.intValue() + url.length()))) { try { Program.launch(url); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bh...@us...> - 2006-09-26 18:43:52
|
Revision: 207 http://svn.sourceforge.net/cishell/?rev=207&view=rev Author: bh2 Date: 2006-09-26 11:43:44 -0700 (Tue, 26 Sep 2006) Log Message: ----------- Fixed bug in MenuManager that tried to run an algorithm even when it was cancelled from the gui before use. 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-09-22 17:11:22 UTC (rev 206) +++ trunk/clients/gui/org.cishell.reference.gui.menumanager/src/org/cishell/reference/gui/menumanager/menu/AlgorithmAction.java 2006-09-26 18:43:44 UTC (rev 207) @@ -88,7 +88,9 @@ params = builder.createGUIandWait(pid, provider); } - scheduler.schedule(new AlgorithmWrapper(ref, bContext, ciContext, data, converters, params), ref); + if (params != null) { + scheduler.schedule(new AlgorithmWrapper(ref, bContext, ciContext, data, converters, params), ref); + } } catch (Throwable e) { e.printStackTrace(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bh...@us...> - 2006-09-22 17:11:29
|
Revision: 206 http://svn.sourceforge.net/cishell/?rev=206&view=rev Author: bh2 Date: 2006-09-22 10:11:22 -0700 (Fri, 22 Sep 2006) Log Message: ----------- Fixed two bugs with static executable runner: * tokenized the command string so that we can eliminate spurious quotation marks * output files are correctly linked to now Modified Paths: -------------- trunk/templates/org.cishell.templates/src/org/cishell/templates/staticexecutable/StaticExecutableRunner.java Modified: trunk/templates/org.cishell.templates/src/org/cishell/templates/staticexecutable/StaticExecutableRunner.java =================================================================== --- trunk/templates/org.cishell.templates/src/org/cishell/templates/staticexecutable/StaticExecutableRunner.java 2006-09-21 13:58:29 UTC (rev 205) +++ trunk/templates/org.cishell.templates/src/org/cishell/templates/staticexecutable/StaticExecutableRunner.java 2006-09-22 17:11:22 UTC (rev 206) @@ -70,7 +70,7 @@ String algDir = tempDir + File.separator + props.getProperty("Algorithm-Directory") + File.separator; chmod(algDir); - File[] output = execute(algDir + getTemplate(), algDir); + File[] output = execute(getTemplate(algDir), algDir); return toData(output); } catch (Exception e) { @@ -137,11 +137,11 @@ } } - protected File[] execute(String execString, String baseDir) throws Exception { + protected File[] execute(String[] cmdarray, String baseDir) throws Exception { File dir = new File(baseDir); String[] beforeFiles = dir.list(); - Process process = Runtime.getRuntime().exec(execString, null, new File(baseDir)); + Process process = Runtime.getRuntime().exec(cmdarray, null, new File(baseDir)); logStream(LogService.LOG_INFO, process.getInputStream()); logStream(LogService.LOG_ERROR, process.getErrorStream()); @@ -154,7 +154,6 @@ Arrays.sort(afterFiles); List outputs = new ArrayList(); - String tempDir = this.tempDir + File.separator; int beforeIndex = 0; int afterIndex = 0; @@ -164,14 +163,14 @@ beforeIndex++; afterIndex++; } else { - outputs.add(new File(tempDir + afterFiles[afterIndex])); + outputs.add(new File(baseDir + afterFiles[afterIndex])); afterIndex++; } - } + } //get any remaining new files while (afterIndex < afterFiles.length) { - outputs.add(new File(tempDir + afterFiles[afterIndex])); + outputs.add(new File(baseDir + afterFiles[afterIndex])); afterIndex++; } @@ -196,14 +195,24 @@ } } - protected String getTemplate() { - String template = props.getProperty("template"); + protected String[] getTemplate(String algDir) { + String template = "" + props.getProperty("template"); + String[] cmdarray = template.split("\\s"); - template = template.replaceAll("\\$\\{executable\\}", props.getProperty("executable")); + for (int i=0; i < cmdarray.length; i++) { + cmdarray[i] = substiteVars(cmdarray[i]); + } + cmdarray[0] = algDir + cmdarray[0]; + return cmdarray; + } + + protected String substiteVars(String str) { + str = str.replaceAll("\\$\\{executable\\}", props.getProperty("executable")); + for (int i=0; i < data.length; i++) { String file = ((File) data[i].getData()).getAbsolutePath(); - template = template.replaceAll("\\$\\{inFile\\["+i+"\\]\\}", "\""+file+"\""); + str = str.replaceAll("\\$\\{inFile\\["+i+"\\]\\}", file); } for (Enumeration i=parameters.keys(); i.hasMoreElements(); ) { @@ -212,10 +221,10 @@ if (value == null) value = ""; - template = template.replaceAll("\\$\\{"+key+"\\}", value.toString()); + str = str.replaceAll("\\$\\{"+key+"\\}", value.toString()); } - return template; + return str; } public File getTempDirectory() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bh...@us...> - 2006-09-21 13:58:34
|
Revision: 205 http://svn.sourceforge.net/cishell/?rev=205&view=rev Author: bh2 Date: 2006-09-21 06:58:29 -0700 (Thu, 21 Sep 2006) Log Message: ----------- updated the update site with a new build of the GUI Modified Paths: -------------- trunk/deployment/org.cishell.update/site.xml Modified: trunk/deployment/org.cishell.update/site.xml =================================================================== --- trunk/deployment/org.cishell.update/site.xml 2006-09-19 21:46:24 UTC (rev 204) +++ trunk/deployment/org.cishell.update/site.xml 2006-09-21 13:58:29 UTC (rev 205) @@ -6,7 +6,7 @@ <feature url="features/org.cishell.feature_0.0.1.200609131643.jar" id="org.cishell.feature" version="0.0.1.200609131643"> <category name="Core Features"/> </feature> - <feature url="features/org.cishell.reference.gui.feature_0.0.1.200609131643.jar" id="org.cishell.reference.gui.feature" version="0.0.1.200609131643"> + <feature url="features/org.cishell.reference.gui.feature_0.0.1.200609210951.jar" id="org.cishell.reference.gui.feature" version="0.0.1.200609210951"> <category name="Applications"/> </feature> <feature url="features/org.cishell.environment.equinox.feature_0.0.1.jar" id="org.cishell.environment.equinox.feature" version="0.0.1"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bh...@us...> - 2006-09-19 21:46:28
|
Revision: 204 http://svn.sourceforge.net/cishell/?rev=204&view=rev Author: bh2 Date: 2006-09-19 14:46:24 -0700 (Tue, 19 Sep 2006) Log Message: ----------- got rid of old resourced linked in data manager gui's build.properties file Modified Paths: -------------- trunk/clients/gui/org.cishell.reference.gui.datamanager/build.properties Modified: trunk/clients/gui/org.cishell.reference.gui.datamanager/build.properties =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.datamanager/build.properties 2006-09-19 17:51:54 UTC (rev 203) +++ trunk/clients/gui/org.cishell.reference.gui.datamanager/build.properties 2006-09-19 21:46:24 UTC (rev 204) @@ -1,6 +1,4 @@ source.. = src/ output.. = bin/ bin.includes = META-INF/,\ - .,\ - icons/,\ - plugin.xml + . \ 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-19 17:52:04
|
Revision: 203 http://svn.sourceforge.net/cishell/?rev=203&view=rev Author: bearsfan Date: 2006-09-19 10:51:54 -0700 (Tue, 19 Sep 2006) Log Message: ----------- Set up a brand for the data manager view Modified Paths: -------------- trunk/clients/gui/org.cishell.reference.gui.brand.cishell/META-INF/MANIFEST.MF trunk/clients/gui/org.cishell.reference.gui.brand.cishell/plugin.xml Added Paths: ----------- trunk/clients/gui/org.cishell.reference.gui.brand.cishell/icons/datamanager_icon.gif trunk/clients/gui/org.cishell.reference.gui.brand.cishell/icons/network.png trunk/clients/gui/org.cishell.reference.gui.brand.cishell/icons/table.png trunk/clients/gui/org.cishell.reference.gui.brand.cishell/icons/tree.png trunk/clients/gui/org.cishell.reference.gui.brand.cishell/icons/unknown.png trunk/clients/gui/org.cishell.reference.gui.brand.cishell/src/org/cishell/reference/gui/brand/cishell/DataManagerView.java Modified: trunk/clients/gui/org.cishell.reference.gui.brand.cishell/META-INF/MANIFEST.MF =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.brand.cishell/META-INF/MANIFEST.MF 2006-09-19 17:48:09 UTC (rev 202) +++ trunk/clients/gui/org.cishell.reference.gui.brand.cishell/META-INF/MANIFEST.MF 2006-09-19 17:51:54 UTC (rev 203) @@ -12,3 +12,4 @@ org.cishell.reference.gui.workspace, org.cishell.reference.gui.menumanager Eclipse-LazyStart: true +Import-Package: org.cishell.app.service.datamanager Copied: trunk/clients/gui/org.cishell.reference.gui.brand.cishell/icons/datamanager_icon.gif (from rev 173, trunk/clients/gui/org.cishell.reference.gui.datamanager/icons/datamanager_icon.gif) =================================================================== (Binary files differ) Property changes on: trunk/clients/gui/org.cishell.reference.gui.brand.cishell/icons/datamanager_icon.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/clients/gui/org.cishell.reference.gui.brand.cishell/icons/network.png =================================================================== (Binary files differ) Property changes on: trunk/clients/gui/org.cishell.reference.gui.brand.cishell/icons/network.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/clients/gui/org.cishell.reference.gui.brand.cishell/icons/table.png =================================================================== (Binary files differ) Property changes on: trunk/clients/gui/org.cishell.reference.gui.brand.cishell/icons/table.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/clients/gui/org.cishell.reference.gui.brand.cishell/icons/tree.png =================================================================== (Binary files differ) Property changes on: trunk/clients/gui/org.cishell.reference.gui.brand.cishell/icons/tree.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/clients/gui/org.cishell.reference.gui.brand.cishell/icons/unknown.png =================================================================== (Binary files differ) Property changes on: trunk/clients/gui/org.cishell.reference.gui.brand.cishell/icons/unknown.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: trunk/clients/gui/org.cishell.reference.gui.brand.cishell/plugin.xml =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.brand.cishell/plugin.xml 2006-09-19 17:48:09 UTC (rev 202) +++ trunk/clients/gui/org.cishell.reference.gui.brand.cishell/plugin.xml 2006-09-19 17:51:54 UTC (rev 203) @@ -19,6 +19,17 @@ value="0,163,500,10"/> </product> </extension> + + <extension + point="org.eclipse.ui.views"> + <view + allowMultiple="false" + class="org.cishell.reference.gui.brand.cishell.DataManagerView" + icon="icons/datamanager_icon.gif" + id="org.cishell.reference.gui.datamanager.DataManagerView" + name="Data Manager"/> + </extension> + <extension point="org.eclipse.ui.perspectiveExtensions"> <perspectiveExtension targetID="org.cishell.reference.gui.workspace.Perspective"> Added: trunk/clients/gui/org.cishell.reference.gui.brand.cishell/src/org/cishell/reference/gui/brand/cishell/DataManagerView.java =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.brand.cishell/src/org/cishell/reference/gui/brand/cishell/DataManagerView.java (rev 0) +++ trunk/clients/gui/org.cishell.reference.gui.brand.cishell/src/org/cishell/reference/gui/brand/cishell/DataManagerView.java 2006-09-19 17:51:54 UTC (rev 203) @@ -0,0 +1,9 @@ +package org.cishell.reference.gui.brand.cishell; + +import org.cishell.reference.gui.datamanager.AbstractDataManagerView; + +public class DataManagerView extends AbstractDataManagerView { + public DataManagerView() { + super("org.cishell.reference.gui.brand.cishell"); + } +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bea...@us...> - 2006-09-19 17:48:15
|
Revision: 202 http://svn.sourceforge.net/cishell/?rev=202&view=rev Author: bearsfan Date: 2006-09-19 10:48:09 -0700 (Tue, 19 Sep 2006) Log Message: ----------- Direct conversion of the previous version of the data manager viewer required some external helper classes. Modified Paths: -------------- trunk/clients/gui/org.cishell.reference.gui.datamanager/META-INF/MANIFEST.MF trunk/clients/gui/org.cishell.reference.gui.datamanager/src/org/cishell/reference/gui/datamanager/Activator.java Removed Paths: ------------- trunk/clients/gui/org.cishell.reference.gui.datamanager/icons/ trunk/clients/gui/org.cishell.reference.gui.datamanager/plugin.xml trunk/clients/gui/org.cishell.reference.gui.datamanager/src/org/cishell/reference/gui/datamanager/DataManagerView.java Modified: trunk/clients/gui/org.cishell.reference.gui.datamanager/META-INF/MANIFEST.MF =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.datamanager/META-INF/MANIFEST.MF 2006-09-19 14:02:36 UTC (rev 201) +++ trunk/clients/gui/org.cishell.reference.gui.datamanager/META-INF/MANIFEST.MF 2006-09-19 17:48:09 UTC (rev 202) @@ -8,3 +8,8 @@ Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime Eclipse-LazyStart: true +Import-Package: org.cishell.app.service.datamanager, + org.cishell.framework, + org.cishell.framework.data, + org.osgi.service.log;version="1.3.0" +Export-Package: org.cishell.reference.gui.datamanager Deleted: trunk/clients/gui/org.cishell.reference.gui.datamanager/plugin.xml =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.datamanager/plugin.xml 2006-09-19 14:02:36 UTC (rev 201) +++ trunk/clients/gui/org.cishell.reference.gui.datamanager/plugin.xml 2006-09-19 17:48:09 UTC (rev 202) @@ -1,13 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<?eclipse version="3.2"?> -<plugin> - <extension - point="org.eclipse.ui.views"> - <view - allowMultiple="false" - class="org.cishell.reference.gui.datamanager.DataManagerView" - icon="icons/datamanager_icon.gif" - id="org.cishell.reference.gui.datamanager.DataManagerView" - name="Data Manager"/> - </extension> -</plugin> Modified: trunk/clients/gui/org.cishell.reference.gui.datamanager/src/org/cishell/reference/gui/datamanager/Activator.java =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.datamanager/src/org/cishell/reference/gui/datamanager/Activator.java 2006-09-19 14:02:36 UTC (rev 201) +++ trunk/clients/gui/org.cishell.reference.gui.datamanager/src/org/cishell/reference/gui/datamanager/Activator.java 2006-09-19 17:48:09 UTC (rev 202) @@ -1,7 +1,9 @@ package org.cishell.reference.gui.datamanager; +import org.cishell.app.service.datamanager.DataManagerService; import org.eclipse.ui.plugin.AbstractUIPlugin; import org.osgi.framework.BundleContext; +import org.osgi.service.log.LogService; /** * The activator class controls the plug-in life cycle @@ -10,6 +12,7 @@ // The plug-in ID public static final String PLUGIN_ID = "org.cishell.reference.gui.datamanager"; + private static BundleContext context; // The shared instance private static Activator plugin; @@ -27,6 +30,8 @@ */ public void start(BundleContext context) throws Exception { super.start(context); + + Activator.context = context; } /* @@ -46,5 +51,18 @@ public static Activator getDefault() { return plugin; } - + + protected static DataManagerService getDataManagerService() { + DataManagerService manager = (DataManagerService) context.getService( + context.getServiceReference(DataManagerService.class.getName())); + + return manager; + } + + protected static LogService getLogService() { + LogService log = (LogService) context.getService( + context.getServiceReference(LogService.class.getName())); + + return log; + } } Deleted: trunk/clients/gui/org.cishell.reference.gui.datamanager/src/org/cishell/reference/gui/datamanager/DataManagerView.java =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.datamanager/src/org/cishell/reference/gui/datamanager/DataManagerView.java 2006-09-19 14:02:36 UTC (rev 201) +++ trunk/clients/gui/org.cishell.reference.gui.datamanager/src/org/cishell/reference/gui/datamanager/DataManagerView.java 2006-09-19 17:48:09 UTC (rev 202) @@ -1,41 +0,0 @@ -/* **************************************************************************** - * 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 Aug 21, 2006 at Indiana University. - * - * Contributors: - * Indiana University - - * ***************************************************************************/ -package org.cishell.reference.gui.datamanager; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Label; -import org.eclipse.ui.part.ViewPart; - -/** - * - * @author Bruce Herr (bh...@bh...) - */ -public class DataManagerView extends ViewPart { - - public DataManagerView() {} - - /** - * @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite) - */ - public void createPartControl(Composite parent) { - Label label = new Label(parent, SWT.NONE); - label.setText("Data Manager"); - } - - /** - * @see org.eclipse.ui.part.WorkbenchPart#setFocus() - */ - public void setFocus() {} -} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bea...@us...> - 2006-09-19 14:02:42
|
Revision: 201 http://svn.sourceforge.net/cishell/?rev=201&view=rev Author: bearsfan Date: 2006-09-19 07:02:36 -0700 (Tue, 19 Sep 2006) Log Message: ----------- Direct conversion of the previous version of the data manager viewer required some external helper classes. Added Paths: ----------- trunk/clients/gui/org.cishell.reference.gui.datamanager/src/org/cishell/reference/gui/datamanager/DataGUIItem.java trunk/clients/gui/org.cishell.reference.gui.datamanager/src/org/cishell/reference/gui/datamanager/DataTreeContentProvider.java trunk/clients/gui/org.cishell.reference.gui.datamanager/src/org/cishell/reference/gui/datamanager/DataTreeLabelProvider.java Added: trunk/clients/gui/org.cishell.reference.gui.datamanager/src/org/cishell/reference/gui/datamanager/DataGUIItem.java =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.datamanager/src/org/cishell/reference/gui/datamanager/DataGUIItem.java (rev 0) +++ trunk/clients/gui/org.cishell.reference.gui.datamanager/src/org/cishell/reference/gui/datamanager/DataGUIItem.java 2006-09-19 14:02:36 UTC (rev 201) @@ -0,0 +1,145 @@ +/* + * InfoVis CyberInfrastructure: A Data-Code-Compute Resource for Research + * and Education in Information Visualization (http://iv.slis.indiana.edu/). + * + * Created on Feb 19, 2005 at Indiana University. + */ +package org.cishell.reference.gui.datamanager; + +import java.io.File; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.cishell.framework.data.Data; +import org.cishell.framework.data.DataProperty; +import org.eclipse.core.runtime.Platform; +import org.eclipse.swt.graphics.Image; +import org.eclipse.ui.plugin.AbstractUIPlugin; + + +/** + * DataModelGUIItem is a wrapper of a DataModel which is used by the + * DataModelTreeView to hold the items in the TreeView. It adds to the + * DataModel the notion of having parent and children DataModelTreeItems + * and keeps track of this information for usage by the TreeView. + * + * @author Team IVC + */ +public class DataGUIItem { + + private String brandPluginID; + + //images for the defined types + private Image matrixIcon; + private Image treeIcon; + private Image networkIcon; + private Image unknownIcon; + + private Map typeToImageMapping; + + private List children; + private Data data; + private DataGUIItem parent; + + + /** + * Creates a new DataModelGUIItem object. + * + * @param model the DataModel this DataModelGUIItem is using + * @param parent the parent DataModelGUIItem of this DataModelGUIItem + */ + public DataGUIItem(Data data, DataGUIItem parent, String brandPluginID) { + this.data = data; + this.parent = parent; + children = new ArrayList(); + + this.brandPluginID = brandPluginID; + matrixIcon = createImage("table.png", this.brandPluginID); + treeIcon = createImage("tree.png", this.brandPluginID); + networkIcon = createImage("network.png", this.brandPluginID); + unknownIcon = createImage("unknown.png", this.brandPluginID); + + typeToImageMapping = new HashMap(); + registerImage(DataProperty.OTHER_TYPE, unknownIcon); + registerImage(DataProperty.MATRIX_TYPE, matrixIcon); + registerImage(DataProperty.NETWORK_TYPE, networkIcon); + registerImage(DataProperty.TREE_TYPE, treeIcon); + } + + /** + * Returns the DataModel used by this DataModelGUIItem + * + * @return the DataModel used by this DataModelGUIItem + */ + public Data getModel() { + return data; + } + + /** + * Returns the parent DataModelGUIItem of this DataModelGUIItem, or + * null if this is the root item. + * + * @return the parent DataModelGUIItem of this DataModelGUIItem, or + * null if this is the root item + */ + public DataGUIItem getParent() { + return parent; + } + + /** + * Adds the given DataModelGUIItem as a child of this DataModelGUIItem + * + * @param item the new child of this DataModelGUIItem + */ + public void addChild(DataGUIItem item) { + children.add(item); + } + + /** + * Returns an array of all of the children of this DataModelGUIItem + * + * @return an array of all of the children of this DataModelGUIItem + */ + public Object[] getChildren() { + return children.toArray(); + } + + /** + * Removes the given DataModelGUIItem from the collection of children + * of this DataModelGUIItem. + * + * @param item the child of this DataModelGUIItem to remove + */ + public void removeChild(DataGUIItem item) { + children.remove(item); + } + + /** + * Returns the icon associated with this DataModel for display in IVC. + * + * @return the icon associated with this DataModel for display in IVC + */ + public Image getIcon(){ + Image icon = (Image)typeToImageMapping.get(data.getMetaData().get(DataProperty.TYPE)); + if(icon == null) icon = unknownIcon; + return icon; + } + + public void registerImage(String type, Image image){ + typeToImageMapping.put(type, image); + } + + public static Image createImage(String name, String brandPluginID){ + if(Platform.isRunning()){ + return AbstractUIPlugin. + imageDescriptorFromPlugin(brandPluginID, + File.separator + "icons" + File.separator + name). + createImage(); + } + else { + return null; + } + } +} Added: trunk/clients/gui/org.cishell.reference.gui.datamanager/src/org/cishell/reference/gui/datamanager/DataTreeContentProvider.java =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.datamanager/src/org/cishell/reference/gui/datamanager/DataTreeContentProvider.java (rev 0) +++ trunk/clients/gui/org.cishell.reference.gui.datamanager/src/org/cishell/reference/gui/datamanager/DataTreeContentProvider.java 2006-09-19 14:02:36 UTC (rev 201) @@ -0,0 +1,95 @@ +/* + * InfoVis CyberInfrastructure: A Data-Code-Compute Resource for Research + * and Education in Information Visualization (http://iv.slis.indiana.edu/). + * + * Created on Feb 19, 2005 at Indiana University. + */ +package org.cishell.reference.gui.datamanager; + +import org.eclipse.jface.viewers.ITreeContentProvider; +import org.eclipse.jface.viewers.Viewer; + + +/** + * ContentProvider for the DataModel TreeView. This class is used to form + * the structure of the tree that is displayed based on the relationships between + * the DataModelTreeItems within it. + * + * @author Team IVC + */ +public class DataTreeContentProvider implements ITreeContentProvider { + private static final Object[] EMPTY_ARRAY = new Object[0]; + + /** + * Returns the children of the given TreeView element. This parentElement + * should be a DataModelGUIItem + * + * @param parentElement the TreeView element to find the children of + * + * @return Returns the children of the given TreeView element + */ + public Object[] getChildren(Object parentElement) { + if (parentElement instanceof DataGUIItem) { + return ((DataGUIItem) parentElement).getChildren(); + } + + return EMPTY_ARRAY; + } + + /** + * Gets the parent of the given TreeView element. This element should be + * a DataModelGUIItem + * + * @param element the element to find the parent of + * + * @return the parent of the given TreeView element + */ + public Object getParent(Object element) { + if (element instanceof DataGUIItem) { + return ((DataGUIItem) element).getParent(); + } + + return null; + } + + /** + * Determines whether or not the given TreeView element has any children. + * + * @param element the TreeView element to find the children for. + * + * @return true if the given element has children, false if not. + */ + public boolean hasChildren(Object element) { + return getChildren(element).length > 0; + } + + /** + * Returns an array of the elements to display in the TreeViewer + * + * @param inputElement the root element of the TreeViewer + * + * @return an array of the elements to display in the TreeViewer + */ + public Object[] getElements(Object inputElement) { + return getChildren(inputElement); + } + + /** + * Does nothing. + */ + public void dispose() {} + + /** + * Does nothing. + * + * This method could be used to notify this content provider that + * the given viewer's input has been switched to a different element. + * + * @param viewer the viewer + * @param oldInput the old input element, or <code>null</code> if the viewer + * did not previously have an input + * @param newInput the new input element, or <code>null</code> if the viewer + * does not have an input + */ + public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {} +} Added: trunk/clients/gui/org.cishell.reference.gui.datamanager/src/org/cishell/reference/gui/datamanager/DataTreeLabelProvider.java =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.datamanager/src/org/cishell/reference/gui/datamanager/DataTreeLabelProvider.java (rev 0) +++ trunk/clients/gui/org.cishell.reference.gui.datamanager/src/org/cishell/reference/gui/datamanager/DataTreeLabelProvider.java 2006-09-19 14:02:36 UTC (rev 201) @@ -0,0 +1,63 @@ +/* + * InfoVis CyberInfrastructure: A Data-Code-Compute Resource for Research + * and Education in Information Visualization (http://iv.slis.indiana.edu/). + * + * Created on Feb 19, 2005 at Indiana University. + */ +package org.cishell.reference.gui.datamanager; + +import org.cishell.framework.data.Data; +import org.cishell.framework.data.DataProperty; +import org.eclipse.jface.viewers.LabelProvider; +import org.eclipse.swt.graphics.Image; + + +/** + * LabelProvider for the DataModelTreeView used to represent DataModels in IVC. + * + * @author Team IVC + */ +public class DataTreeLabelProvider extends LabelProvider { + + /** + * Returns the Image associated with the given element that should be + * displayed in the Tree. + * + * @param element the element in the DataModelTreeView for which to + * return the associated Image. + * + * @return the Image associated with the given element that should be + * displayed in the Tree + */ + public Image getImage(Object element) { + if (element instanceof DataGUIItem) { + return ((DataGUIItem) element).getIcon(); + } + + return null; + } + + /** + * Returns the text to display for the given DataModelTreeView element. This + * is the label of the DataModel which the element represents. + * + * @param element the element in the DataModelTreeView to find the text + * to display. + * + * @return the text to display for the given DataModelTreeView element + */ + public String getText(Object element) { + if (element instanceof DataGUIItem) { + Data model = ((DataGUIItem) element).getModel(); + String label = (String) model.getMetaData().get(DataProperty.LABEL); + Boolean modified = (Boolean)model.getMetaData().get(DataProperty.MODIFIED); + if(modified != null && modified.booleanValue()){ + label = ">" + label; + } + + return label; + } + + return null; + } +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bea...@us...> - 2006-09-19 14:00:45
|
Revision: 200 http://svn.sourceforge.net/cishell/?rev=200&view=rev Author: bearsfan Date: 2006-09-19 07:00:20 -0700 (Tue, 19 Sep 2006) Log Message: ----------- Ported the previous version of the datamodel view to support the CISHell infrastructure. Just have the basic functionality working including 'rename' and 'discard'. Save is yet to be implemented. Added Paths: ----------- trunk/clients/gui/org.cishell.reference.gui.datamanager/src/org/cishell/reference/gui/datamanager/AbstractDataManagerView.java Copied: trunk/clients/gui/org.cishell.reference.gui.datamanager/src/org/cishell/reference/gui/datamanager/AbstractDataManagerView.java (from rev 173, trunk/clients/gui/org.cishell.reference.gui.datamanager/src/org/cishell/reference/gui/datamanager/DataManagerView.java) =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.datamanager/src/org/cishell/reference/gui/datamanager/AbstractDataManagerView.java (rev 0) +++ trunk/clients/gui/org.cishell.reference.gui.datamanager/src/org/cishell/reference/gui/datamanager/AbstractDataManagerView.java 2006-09-19 14:00:20 UTC (rev 200) @@ -0,0 +1,546 @@ +/* **************************************************************************** + * 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 Aug 21, 2006 at Indiana University. + * + * Contributors: + * Indiana University - + * ***************************************************************************/ +package org.cishell.reference.gui.datamanager; + +import java.util.Dictionary; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Map; +import java.util.Set; +import java.util.StringTokenizer; + +import org.cishell.app.service.datamanager.DataManagerListener; +import org.cishell.app.service.datamanager.DataManagerService; +import org.cishell.framework.data.Data; +import org.cishell.framework.data.DataProperty; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.ISelectionChangedListener; +import org.eclipse.jface.viewers.ISelectionProvider; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.jface.viewers.SelectionChangedEvent; +import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.jface.viewers.TreeViewer; +import org.eclipse.swt.SWT; +import org.eclipse.swt.custom.TreeEditor; +import org.eclipse.swt.events.FocusAdapter; +import org.eclipse.swt.events.FocusEvent; +import org.eclipse.swt.events.KeyAdapter; +import org.eclipse.swt.events.KeyEvent; +import org.eclipse.swt.events.KeyListener; +import org.eclipse.swt.events.MouseAdapter; +import org.eclipse.swt.events.MouseEvent; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.graphics.Point; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Event; +import org.eclipse.swt.widgets.Listener; +import org.eclipse.swt.widgets.Menu; +import org.eclipse.swt.widgets.MenuItem; +import org.eclipse.swt.widgets.Text; +import org.eclipse.swt.widgets.Tree; +import org.eclipse.swt.widgets.TreeItem; +import org.eclipse.ui.part.ViewPart; +import org.osgi.service.log.LogService; + +/** + * + * @author Bruce Herr (bh...@bh...) + */ +public abstract class AbstractDataManagerView extends ViewPart implements + DataManagerListener { + private String brandPluginID; + + private DataManagerService manager; + + private TreeViewer viewer; + + private TreeEditor editor; + + private Text newEditor; + + private DataGUIItem rootItem; + + // flag to notify if a tree item is currently being updated so there + // isnt a conflict among various listeners + private boolean updatingTreeItem; + + private Tree tree; + + private Menu menu; + + private Map dataToDataGUIItemMap; + + private DiscardListener discardListener; + + public AbstractDataManagerView(String brandPluginID) { + manager = Activator.getDataManagerService(); + this.brandPluginID = brandPluginID; + dataToDataGUIItemMap = new HashMap(); + + if (manager == null) { + Activator.getLogService().log(LogService.LOG_ERROR, + "Data Manager Service unavailable!"); + } + } + + /** + * @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite) + */ + public void createPartControl(Composite parent) { + + // Label label = new Label(parent, SWT.NONE); + // label.setText("Data Manager"); + viewer = new TreeViewer(parent); + viewer.setContentProvider(new DataTreeContentProvider()); + viewer.setLabelProvider(new DataTreeLabelProvider()); + + rootItem = new DataGUIItem(null, null, this.brandPluginID); + viewer.setInput(rootItem); + viewer.expandAll(); + + // grab the tree and add the appropriate listeners + tree = viewer.getTree(); + tree.addSelectionListener(new DatamodelSelectionListener()); + tree.addMouseListener(new ContextMenuListener()); + + // setup the context menu for the tree + menu = new Menu(tree); + menu.setVisible(false); + + MenuItem saveItem = new MenuItem(menu, SWT.PUSH); + saveItem.setText("Save"); + saveItem.setEnabled(false); + + MenuItem renameItem = new MenuItem(menu, SWT.PUSH); + renameItem.setText("Rename"); + renameItem.addListener(SWT.Selection, new Listener() { + public void handleEvent(Event event) { + handleInput(); + } + }); + + MenuItem discardItem = new MenuItem(menu, SWT.PUSH); + discardItem.setText("Discard"); + discardListener = new DiscardListener(); + discardItem.addListener(SWT.Selection, discardListener); + tree.setMenu(menu); + + // allow cells to be edited on double click or when pressing enter on + // them + editor = new TreeEditor(tree); + editor.horizontalAlignment = SWT.LEFT; + editor.grabHorizontal = true; + editor.minimumWidth = 50; + TreeItemEditorListener editorListener = new TreeItemEditorListener( + editor); + tree.addMouseListener(editorListener); + tree.addKeyListener(editorListener); + + // listen to IVC for models being added by plugins + manager.addDataManagerListener(this); + + getSite().setSelectionProvider(new DataModelSelectionProvider()); + } + + /** + * @see org.eclipse.ui.part.WorkbenchPart#setFocus() + */ + public void setFocus() { + viewer.getControl().setFocus(); + } + + public void dataAdded(final Data data, String label) { + // get the data from the model needed to setup the DataModelGUIItem + Dictionary modelDictionary = data.getMetaData(); + + Data parent = (Data) modelDictionary.get(DataProperty.PARENT); + DataGUIItem parentItem; + if (parent == null) { + // if it has no parent, it is a child of the root + parentItem = rootItem; + } else { + // otherwise find the associated DataModelGUIItem for the parent + parentItem = (DataGUIItem) dataToDataGUIItemMap.get(parent); + } + + // create the new DataModelGUIItem + final DataGUIItem item = new DataGUIItem(data, parentItem, + this.brandPluginID); + // notify the parent DataModelGUIItem of its new child + parentItem.addChild(item); + // keep a reference to the new model in the model->TreeItem mapping so + // that + // it can be used in the future if it has a child + dataToDataGUIItemMap.put(data, item); + + // update the ModelManager with the new selection + Set selection = new HashSet(); + selection.add(data); + manager.setSelectedData((Data[]) selection.toArray(new Data[0])); + Display.getDefault().syncExec(new Runnable() { + public void run() { + if (!tree.isDisposed()) { + // update the TreeView + viewer.refresh(); + // context menu may need to have options enabled/disabled + // based on the new selection + updateContextMenu(data); + // update the global selection + viewer.expandToLevel(item, 0); + selectItem(item, tree.getItems()); + getSite().getSelectionProvider().setSelection( + new StructuredSelection(new Data[] { data })); + setFocus(); + } + } + }); + } + + private void selectItem(DataGUIItem item, TreeItem[] items) { + for (int i = 0; i < items.length; i++) { + TreeItem treeItem = items[i]; + if (treeItem.getData() == item) { + manager.setSelectedData(new Data[] { item.getModel() }); + treeItem.getParent().setSelection(new TreeItem[] { treeItem }); + return; + } + selectItem(item, treeItem.getItems()); + } + } + + public void dataLabelChanged(Data data, String label) { + if (data != null && label != null) { + TreeItem[] treeItems = tree.getItems(); + for (int i = 0; i < treeItems.length; ++i) { + if (((DataGUIItem)treeItems[i].getData()).getModel() == data) { + updateText(label, treeItems[i]); + break; + } + } + } + } + + public void dataRemoved(Data data) { + TreeItem[] treeItems = tree.getItems(); + for (int i = 0; i < treeItems.length; ++i) { + if (((DataGUIItem)treeItems[i].getData()).getModel() == data) { + tree.clear(tree.indexOf(treeItems[i]), false); + } + } + } + + public void dataSelected(final Data[] data) { + if (data != null) { + Display.getDefault().syncExec(new Runnable() { + public void run() { + Set itemSet = new HashSet(); + for (int i = 0; i < data.length; ++i) { + + TreeItem[] treeItems = tree.getItems(); + for (int j = 0; j < treeItems.length; ++j) { + if (treeItems[i].getData() == data[i]) { + itemSet.add(treeItems[i]); + break; + } + } + } + tree.setSelection((TreeItem[]) itemSet + .toArray(new TreeItem[0])); + } + }); + } + } + + /* + * enables/disables save item in the context menu based on whether or not + * their is an available Persister for the given model + */ + private void updateContextMenu(Data model) { + // reset the enablement of the save context menu appropriately + // boolean saveEnabled = (model.getData() != null) && + // !(IVC.getInstance().getPersistenceRegistry() + // .getSupportingPersisters(model.getData()).isEmpty()); + boolean saveEnabled = false; + menu.getItem(0).setEnabled(saveEnabled); + } + + /* + * Listens for selection in the GUI of data models by selecting their item + * in the tree and updates the ModelManager appropriately + */ + private class DatamodelSelectionListener extends SelectionAdapter { + public void widgetSelected(SelectionEvent e) { + Tree tree = (Tree) e.getSource(); + TreeItem[] selection = tree.getSelection(); + Set models = new HashSet(); + Data[] modelArray = new Data[selection.length]; + + for (int i = 0; i < selection.length; i++) { + Data model = ((DataGUIItem) selection[i].getData()).getModel(); + updateContextMenu(model); + models.add(model); + modelArray[i] = model; + } + + manager.setSelectedData(modelArray); + getSite().getSelectionProvider().setSelection( + new StructuredSelection(modelArray)); + } + } + + /* + * allows for direct text editing of the label of a DataModelGUIItem by + * using a Text control associated with a TreeEditor. This allows for + * renaming of data models without a pop-up dialog or anything + */ + private void handleInput() { + // Clean up any previous editor control + Control oldEditor = editor.getEditor(); + + if (oldEditor != null) { + oldEditor.dispose(); + } + + // Identify the selected row, only allow input if there is a single + // selected row + TreeItem[] selection = tree.getSelection(); + + if (selection.length != 1) { + return; + } + + final TreeItem item = selection[0]; + + if (item == null) { + return; + } + + // The control that will be the editor must be a child of the Table + newEditor = new Text(tree, SWT.NONE); + newEditor.setText(item.getText()); + newEditor.addFocusListener(new FocusAdapter() { + public void focusLost(FocusEvent e) { + if (!updatingTreeItem) { + //updateText(newEditor.getText(), item); + manager.setLabel(((DataGUIItem)item.getData()).getModel(), newEditor.getText()); + } + } + }); + + // ENTER ESC + newEditor.addKeyListener(new KeyAdapter() { + public void keyReleased(KeyEvent e) { + if ((e.character == SWT.CR) && !updatingTreeItem) { + updateText(newEditor.getText(), item); + } else if (e.keyCode == SWT.ESC) { + newEditor.dispose(); + } + } + }); + newEditor.selectAll(); + newEditor.setFocus(); + editor.setEditor(newEditor, item); + } + + /* + * updates the actual Label property of the DataModel that is being edited + * by the TreeEditor for renaming - only if the new name is valid though + */ + private void updateText(String newLabel, TreeItem item) { + updatingTreeItem = true; + + if (newLabel.startsWith(">")) + newLabel = newLabel.substring(1); + + if (isValid(newLabel)) { + editor.getItem().setText(newLabel); + + DataGUIItem treeItem = (DataGUIItem) item.getData(); + Data model = treeItem.getModel(); + model.getMetaData().put(DataProperty.LABEL, newLabel); + viewer.refresh(); + newEditor.dispose(); + } else { + String message = "Invalid data model name. The following characters" + + " are not allowed:\n\n" + + "`~!@#$%^&*()+=[{]}\\|;:'\",<>/?"; + Activator.getLogService().log(LogService.LOG_WARNING, message); + handleInput(); + } + + updatingTreeItem = false; + } + + // not valid chars: `~!@#$%^&*()+=[{]}\|;:'",<>/? + private boolean isValid(String label) { + StringTokenizer st = new StringTokenizer(" " + label + " ", + "`~!@#$%^&*()+=[{]}\\|;:'\",<>/?"); + + return st.countTokens() == 1; + } + + /* + * Listens for right-clicks on TreeItems and opens the context menu when + * needed. + */ + private class ContextMenuListener extends MouseAdapter { + public void mouseUp(MouseEvent event) { + if (event.button == 3) { + TreeItem item = tree.getItem(new Point(event.x, event.y)); + + if (item != null) { + tree.getMenu().setVisible(true); + } else { + tree.getMenu().setVisible(false); + } + } + } + } + + private class DiscardListener implements Listener { + public void handleEvent(Event event) { + TreeItem[] selection = AbstractDataManagerView.this.tree + .getSelection(); + + for (int i = 0; i < selection.length; i++) { + DataGUIItem item = (DataGUIItem) selection[i].getData(); + DataGUIItem parent = item.getParent(); + + if (parent != null) { + parent.removeChild(item); + } + + dataToDataGUIItemMap.remove(item.getModel()); + manager.removeData(item.getModel()); + } + + manager.setSelectedData(new Data[0]); + viewer.refresh(); + } + } + + /* + * Listens for double clicks or Enter presses on a TreeItem to cause that + * item to become editable to rename it. + */ + private class TreeItemEditorListener extends MouseAdapter implements + KeyListener { + // private TreeEditor editor; + + public TreeItemEditorListener(TreeEditor editor) { + // this.editor = editor; + } + + public void keyReleased(KeyEvent e) { + if ((e.keyCode == SWT.CR) && !updatingTreeItem) { + handleInput(); + } + } + + public void mouseDoubleClick(MouseEvent e) { + handleInput(); + } + + public void keyPressed(KeyEvent e) { + } + } + + private class DataModelSelectionProvider implements ISelectionProvider { + + private Set listeners = new HashSet(); + + private ISelection selection; + + public void addSelectionChangedListener( + ISelectionChangedListener listener) { + listeners.add(listener); + } + + public ISelection getSelection() { + return selection; + } + + public void removeSelectionChangedListener( + ISelectionChangedListener listener) { + listeners.remove(listener); + } + + private TreeItem getTreeItem(Data model, TreeItem[] items) { + TreeItem result = null; + int i = 0; + while (i < items.length && result == null) { + DataGUIItem data = ((DataGUIItem) items[i].getData()); + if (data != null) { // not sure why this happens.. + Data item = data.getModel(); + + if (item == model) + result = items[i]; + else { + // check the children recursively + result = getTreeItem(model, items[i].getItems()); + } + } else { + // check the children recursively + result = getTreeItem(model, items[i].getItems()); + } + + i++; + } + + return result; + } + + public void setSelection(ISelection selection) { + if (selection != this.selection) { + this.selection = selection; + viewer.refresh(true); + + if (selection != null + && selection instanceof IStructuredSelection) { + IStructuredSelection ss = (IStructuredSelection) selection; + Iterator iterator = ss.iterator(); + TreeItem[] newTreeSelection = new TreeItem[ss.size()]; + int i = 0; + while (iterator.hasNext()) { + Object next = iterator.next(); + if (next instanceof Data) { + TreeItem result = getTreeItem((Data) next, tree + .getItems()); + newTreeSelection[i] = result; + viewer.expandToLevel( + dataToDataGUIItemMap.get(next), 0); + } + i++; + } + + tree.setSelection(newTreeSelection); + } + + Iterator listenerIterator = listeners.iterator(); + while (listenerIterator.hasNext()) { + ISelectionChangedListener listener = (ISelectionChangedListener) listenerIterator + .next(); + SelectionChangedEvent event = new SelectionChangedEvent( + this, selection); + listener.selectionChanged(event); + } + } + } + + } +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bh...@us...> - 2006-09-18 21:32:12
|
Revision: 199 http://svn.sourceforge.net/cishell/?rev=199&view=rev Author: bh2 Date: 2006-09-18 14:31:50 -0700 (Mon, 18 Sep 2006) Log Message: ----------- fixed a bug with the java-based templates that didn't generate parameter descriptions that were entered Modified Paths: -------------- trunk/deployment/org.cishell.update/site.xml Modified: trunk/deployment/org.cishell.update/site.xml =================================================================== --- trunk/deployment/org.cishell.update/site.xml 2006-09-18 21:15:52 UTC (rev 198) +++ trunk/deployment/org.cishell.update/site.xml 2006-09-18 21:31:50 UTC (rev 199) @@ -18,7 +18,7 @@ <feature url="features/org.cishell.algorithm.examples.feature_0.0.1.200609131643.jar" id="org.cishell.algorithm.examples.feature" version="0.0.1.200609131643"> <category name="Development"/> </feature> - <feature url="features/org.cishell.development.feature_0.0.1.200609131643.jar" id="org.cishell.development.feature" version="0.0.1.200609131643"> + <feature url="features/org.cishell.development.feature_0.0.1.200609181727.jar" id="org.cishell.development.feature" version="0.0.1.200609181727"> <category name="Development"/> </feature> <category-def name="Development" label="Development"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bh...@us...> - 2006-09-18 21:16:04
|
Revision: 198 http://svn.sourceforge.net/cishell/?rev=198&view=rev Author: bh2 Date: 2006-09-18 14:15:52 -0700 (Mon, 18 Sep 2006) Log Message: ----------- fixed a bug with the java-based templates that didn't generate parameter descriptions that were entered Modified Paths: -------------- trunk/templates/org.cishell.templates.wizards/META-INF/MANIFEST.MF trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pages/ParameterListBuilderPage.java Modified: trunk/templates/org.cishell.templates.wizards/META-INF/MANIFEST.MF =================================================================== --- trunk/templates/org.cishell.templates.wizards/META-INF/MANIFEST.MF 2006-09-15 15:42:51 UTC (rev 197) +++ trunk/templates/org.cishell.templates.wizards/META-INF/MANIFEST.MF 2006-09-18 21:15:52 UTC (rev 198) @@ -2,7 +2,7 @@ Bundle-ManifestVersion: 2 Bundle-Name: CIShell Integration Wizards Bundle-SymbolicName: org.cishell.templates.wizards;singleton:=true -Bundle-Version: 0.0.1 +Bundle-Version: 0.0.1.qualifier Bundle-Activator: org.cishell.templates.wizards.Activator Bundle-Localization: plugin Require-Bundle: org.eclipse.ui;bundle-version="3.2.0", Modified: trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pages/ParameterListBuilderPage.java =================================================================== --- trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pages/ParameterListBuilderPage.java 2006-09-15 15:42:51 UTC (rev 197) +++ trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pages/ParameterListBuilderPage.java 2006-09-18 21:15:52 UTC (rev 198) @@ -57,6 +57,7 @@ output += "\t\t<AD name=\""+attrs[i].getName()+"\" "+ "id=\""+attrs[i].getID()+"\" "+ "type=\""+getTypeString(attrs[i])+"\" "+ + "description=\""+attrs[i].getDescription()+"\" "+ "default=\""+attrs[i].getDefaultValue()[0]+"\"/>\n"; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |