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-10-04 01:43:34
|
Revision: 238 http://svn.sourceforge.net/cishell/?rev=238&view=rev Author: bh2 Date: 2006-10-02 09:15:00 -0700 (Mon, 02 Oct 2006) Log Message: ----------- Added DataValidator checking for Algorithms on the menu Modified Paths: -------------- trunk/clients/gui/org.cishell.reference.gui.menumanager/src/org/cishell/reference/gui/menumanager/menu/AlgorithmAction.java Modified: trunk/clients/gui/org.cishell.reference.gui.menumanager/src/org/cishell/reference/gui/menumanager/menu/AlgorithmAction.java =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.menumanager/src/org/cishell/reference/gui/menumanager/menu/AlgorithmAction.java 2006-10-02 16:14:28 UTC (rev 237) +++ trunk/clients/gui/org.cishell.reference.gui.menumanager/src/org/cishell/reference/gui/menumanager/menu/AlgorithmAction.java 2006-10-02 16:15:00 UTC (rev 238) @@ -25,6 +25,7 @@ import org.cishell.framework.CIShellContext; import org.cishell.framework.algorithm.AlgorithmFactory; import org.cishell.framework.algorithm.AlgorithmProperty; +import org.cishell.framework.algorithm.DataValidator; import org.cishell.framework.data.Data; import org.cishell.service.conversion.Converter; import org.cishell.service.conversion.DataConversionService; @@ -141,9 +142,34 @@ } } } - setEnabled(data != null); + setEnabled(data != null && isValid()); } + private boolean isValid() { + String valid = null; + String[] classes = (String[]) ref.getProperty(Constants.OBJECTCLASS); + + if (classes != null && data != null) { + for (int i=0; i < classes.length; i++) { + if (classes[i].equals(DataValidator.class.getName())) { + DataValidator validator = (DataValidator) bContext.getService(ref); + + synchronized(this) { + for (int j=0; j < data.length; j++) { + if (converters[j] != null && converters[j].length > 0) { + data[j] = converters[j][0].convert(data[j]); + } + } + + valid = validator.validate(data); + } + } + } + } + + return valid == null || valid.length() == 0; + } + private boolean isAsignableFrom(String type, Data datum) { Object data = datum.getData(); boolean assignable = false; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bh...@us...> - 2006-10-13 23:23:17
|
Revision: 278 http://svn.sourceforge.net/cishell/?rev=278&view=rev Author: bh2 Date: 2006-10-13 16:23:12 -0700 (Fri, 13 Oct 2006) Log Message: ----------- fixed a thread locking problem (though it may cause other problems later) Modified Paths: -------------- trunk/clients/gui/org.cishell.reference.gui.menumanager/src/org/cishell/reference/gui/menumanager/menu/AlgorithmAction.java Modified: trunk/clients/gui/org.cishell.reference.gui.menumanager/src/org/cishell/reference/gui/menumanager/menu/AlgorithmAction.java =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.menumanager/src/org/cishell/reference/gui/menumanager/menu/AlgorithmAction.java 2006-10-13 23:22:22 UTC (rev 277) +++ trunk/clients/gui/org.cishell.reference.gui.menumanager/src/org/cishell/reference/gui/menumanager/menu/AlgorithmAction.java 2006-10-13 23:23:12 UTC (rev 278) @@ -153,17 +153,16 @@ for (int i=0; i < classes.length; i++) { if (classes[i].equals(DataValidator.class.getName())) { DataValidator validator = (DataValidator) bContext.getService(ref); - - synchronized(this) { - for (int j=0; j < data.length; j++) { - if (converters[j] != null && converters[j].length > 0) { - data[j] = converters[j][0].convert(data[j]); - converters[j] = null; - } + + //FIXME: Could cause concurrency problems... + for (int j=0; j < data.length; j++) { + if (converters[j] != null && converters[j].length > 0) { + data[j] = converters[j][0].convert(data[j]); + converters[j] = null; } - - valid = validator.validate(data); } + + valid = validator.validate(data); } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bh...@us...> - 2006-10-24 17:22:51
|
Revision: 314 http://svn.sourceforge.net/cishell/?rev=314&view=rev Author: bh2 Date: 2006-10-24 10:22:45 -0700 (Tue, 24 Oct 2006) Log Message: ----------- disabled DataValidator usage until we find a better fix Modified Paths: -------------- trunk/clients/gui/org.cishell.reference.gui.menumanager/src/org/cishell/reference/gui/menumanager/menu/AlgorithmAction.java Modified: trunk/clients/gui/org.cishell.reference.gui.menumanager/src/org/cishell/reference/gui/menumanager/menu/AlgorithmAction.java =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.menumanager/src/org/cishell/reference/gui/menumanager/menu/AlgorithmAction.java 2006-10-24 14:35:20 UTC (rev 313) +++ trunk/clients/gui/org.cishell.reference.gui.menumanager/src/org/cishell/reference/gui/menumanager/menu/AlgorithmAction.java 2006-10-24 17:22:45 UTC (rev 314) @@ -149,10 +149,13 @@ } else { originalData = null; } + - setEnabled(data != null && isValid()); + setEnabled(data != null); //&& isValid()); } + //This method will be disabled until we can find a better solution + //for extra validation beyond input/output checking private boolean isValid() { String valid = null; String[] classes = (String[]) ref.getProperty(Constants.OBJECTCLASS); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hu...@us...> - 2006-10-25 16:53:14
|
Revision: 316 http://svn.sourceforge.net/cishell/?rev=316&view=rev Author: huangb Date: 2006-10-25 09:52:56 -0700 (Wed, 25 Oct 2006) Log Message: ----------- printout the acknowledgement metadata on the console. Modified Paths: -------------- trunk/clients/gui/org.cishell.reference.gui.menumanager/src/org/cishell/reference/gui/menumanager/menu/AlgorithmAction.java Modified: trunk/clients/gui/org.cishell.reference.gui.menumanager/src/org/cishell/reference/gui/menumanager/menu/AlgorithmAction.java =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.menumanager/src/org/cishell/reference/gui/menumanager/menu/AlgorithmAction.java 2006-10-25 04:56:16 UTC (rev 315) +++ trunk/clients/gui/org.cishell.reference.gui.menumanager/src/org/cishell/reference/gui/menumanager/menu/AlgorithmAction.java 2006-10-25 16:52:56 UTC (rev 316) @@ -34,6 +34,7 @@ import org.osgi.framework.BundleContext; import org.osgi.framework.Constants; import org.osgi.framework.ServiceReference; +import org.osgi.service.log.LogService; import org.osgi.service.metatype.MetaTypeProvider; @@ -75,6 +76,36 @@ Data[] data = this.data; Converter[][] converters = this.converters; + //Print out acknowledge info. Not sure this is the right place. + //But it seems working fine. + + LogService logger = (LogService) ciContext.getService(LogService.class.getName()); + + String label = (String)ref.getProperty("label"); + if (label != null) + logger.log(LogService.LOG_INFO, label+" was selected."); + + String authors = (String)ref.getProperty("authors"); + if (authors != null) + logger.log(LogService.LOG_INFO, "Author(s): "+authors); + String implementers = (String)ref.getProperty("implementers"); + if (implementers != null) + logger.log(LogService.LOG_INFO, "Implementer(s): "+implementers); + String integrators = (String)ref.getProperty("integrators"); + if (integrators != null) + logger.log(LogService.LOG_INFO, "Integrator(s): "+integrators); + String reference = (String)ref.getProperty("reference"); + String reference_url = (String)ref.getProperty("reference_url"); + if (reference != null && reference_url != null ) + logger.log(LogService.LOG_INFO, "Reference: "+reference+ + " ( "+reference_url+" )"); + else if (reference != null && reference_url == null ) + logger.log(LogService.LOG_INFO, "Reference: "+reference); + String docu = (String)ref.getProperty("docu"); + if (docu != null) + logger.log(LogService.LOG_INFO, "Docu: "+docu); +/////////////////////////// + SchedulerService scheduler = (SchedulerService) bContext.getService(bContext.getServiceReference( SchedulerService.class.getName())); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hu...@us...> - 2006-11-21 16:16:08
|
Revision: 333 http://svn.sourceforge.net/cishell/?rev=333&view=rev Author: huangb Date: 2006-11-21 08:15:45 -0800 (Tue, 21 Nov 2006) Log Message: ----------- minus change of the format when logging the reference url Modified Paths: -------------- trunk/clients/gui/org.cishell.reference.gui.menumanager/src/org/cishell/reference/gui/menumanager/menu/AlgorithmAction.java Modified: trunk/clients/gui/org.cishell.reference.gui.menumanager/src/org/cishell/reference/gui/menumanager/menu/AlgorithmAction.java =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.menumanager/src/org/cishell/reference/gui/menumanager/menu/AlgorithmAction.java 2006-10-30 17:02:41 UTC (rev 332) +++ trunk/clients/gui/org.cishell.reference.gui.menumanager/src/org/cishell/reference/gui/menumanager/menu/AlgorithmAction.java 2006-11-21 16:15:45 UTC (rev 333) @@ -122,7 +122,7 @@ String reference_url = (String)ref.getProperty("reference_url"); if (reference != null && reference_url != null ) logger.log(LogService.LOG_INFO, "Reference: "+reference+ - " ( "+reference_url+" )"); + " ("+reference_url+")"); else if (reference != null && reference_url == null ) logger.log(LogService.LOG_INFO, "Reference: "+reference); String docu = (String)ref.getProperty("docu"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hu...@us...> - 2007-03-15 21:32:38
|
Revision: 379 http://svn.sourceforge.net/cishell/?rev=379&view=rev Author: huangb Date: 2007-03-15 14:32:35 -0700 (Thu, 15 Mar 2007) Log Message: ----------- modify printAlgorithmInformation method --adjust to log the whole acknowledgement in one block 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 2007-03-15 21:30:57 UTC (rev 378) +++ trunk/clients/gui/org.cishell.reference.gui.menumanager/src/org/cishell/reference/gui/menumanager/menu/AlgorithmAction.java 2007-03-15 21:32:35 UTC (rev 379) @@ -93,32 +93,34 @@ } private void printAlgorithmInformation() { + //adjust to log the whole acknowledgement in one block LogService logger = (LogService) ciContext.getService(LogService.class.getName()); - + StringBuffer acknowledgement = new StringBuffer(); String label = (String)ref.getProperty("label"); if (label != null){ - logger.log(LogService.LOG_INFO, ".........."); - logger.log(LogService.LOG_INFO, label+" was selected."); + acknowledgement.append("..........\n"+ + label+" was selected.\n\n"); } String authors = (String)ref.getProperty("authors"); if (authors != null) - logger.log(LogService.LOG_INFO, "Author(s): "+authors); + acknowledgement.append("Author(s): "+authors+"\n"); String implementers = (String)ref.getProperty("implementers"); if (implementers != null) - logger.log(LogService.LOG_INFO, "Implementer(s): "+implementers); + acknowledgement.append("Implementer(s): "+implementers+"\n"); String integrators = (String)ref.getProperty("integrators"); if (integrators != null) - logger.log(LogService.LOG_INFO, "Integrator(s): "+integrators); + acknowledgement.append("Integrator(s): "+integrators+"\n"); String reference = (String)ref.getProperty("reference"); - String reference_url = (String)ref.getProperty("reference_url"); + String reference_url = (String)ref.getProperty("reference_url"); if (reference != null && reference_url != null ) - logger.log(LogService.LOG_INFO, "Reference: "+reference+ - " ("+reference_url+")"); + acknowledgement.append("Reference: "+reference+ + " ("+reference_url+")\n"); else if (reference != null && reference_url == null ) - logger.log(LogService.LOG_INFO, "Reference: "+reference); + acknowledgement.append("Reference: "+reference+"\n"); String docu = (String)ref.getProperty("docu"); if (docu != null) - logger.log(LogService.LOG_INFO, "Docu: "+docu); + acknowledgement.append("Docu: "+docu); + logger.log(LogService.LOG_INFO, acknowledgement.toString()); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hu...@us...> - 2007-04-26 04:53:40
|
Revision: 385 http://svn.sourceforge.net/cishell/?rev=385&view=rev Author: huangb Date: 2007-04-25 21:53:38 -0700 (Wed, 25 Apr 2007) Log Message: ----------- Add a new constructor which allow to input the label/text of an AlgorithmAction 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 2007-04-26 04:50:11 UTC (rev 384) +++ trunk/clients/gui/org.cishell.reference.gui.menumanager/src/org/cishell/reference/gui/menumanager/menu/AlgorithmAction.java 2007-04-26 04:53:38 UTC (rev 385) @@ -55,8 +55,27 @@ dataManager.addDataManagerListener(this); dataSelected(dataManager.getSelectedData()); + } + public AlgorithmAction(String label, ServiceReference ref, BundleContext bContext, CIShellContext ciContext) { + this.ref = ref; + this.ciContext = ciContext; + this.bContext = bContext; + + setText(label); + setToolTipText((String)ref.getProperty(AlgorithmProperty.DESCRIPTION)); + + DataManagerService dataManager = (DataManagerService) + bContext.getService(bContext.getServiceReference( + DataManagerService.class.getName())); + + dataManager.addDataManagerListener(this); + dataSelected(dataManager.getSelectedData()); + } + + + public void run() { //hmm... should probably change this.. maybe use the scheduler... new Thread("Menu Item Runner") { @@ -225,4 +244,8 @@ public void dataAdded(Data data, String label) {} public void dataLabelChanged(Data data, String label) {} public void dataRemoved(Data data) {} + + public ServiceReference getServiceReference(){ + return ref; + } } \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |