On 03/02/2010 02:46, Stian Soiland-Reyes wrote:
> On Tue, Feb 2, 2010 at 23:33, David Withers
> <[email protected]> wrote:
>> I have a custom implementation of ActivityOutputPort for the SADI
>> activity (so I can add contextual menus for the ports) but this doesn't
>> work with the workflow explorer.
> 
> You should not need to make your own implementation for this.
> 
> As the port does not know its parent I know it would be a bit tedious,
> but you can always do in the ContextualMenuComponent.isEnabled() that
> does something like:
> 
> if (contextualSelection == null || !
> (contextualSelection.getSelection() instanceof ActivityOutputPort)) {
>   return false;
> }
> ActivityOutputPort activityOut = (ActivityOutputPort)
> contextualSelection.getSelection();
> Processor proc = Tools.getFirstProcessorWithActivityOutputPort(activityOut);
> for (Activity activity : proc.getActivities()) {
>     if (activity instanceof SADIActivity) {
>         return true;
>     }
> }
> return false;

That certainly is tedious. I prefer:
  return getContextualSelection().getSelection() instanceof
SADIActivityPort;

Another reason for not using ActivityOutputPortImpl is that I want to
provide a contextual view for SADI ports; I don't want the 'No details
available.' message from OutputPortContextualView.

David.

-- 
David Withers
School of Computer Science, University of Manchester,
Oxford Road, Manchester, M13 9PL, UK.
+44 (0)161 275 0683

------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
taverna-hackers mailing list
[email protected]
Web site: http://www.taverna.org.uk
Mailing lists: http://www.taverna.org.uk/taverna-mailing-lists/
Developers Guide: http://www.mygrid.org.uk/tools/developer-information

Reply via email to