Reusing the table import dialog

7 views
Skip to first unread message

Martin Cerny

unread,
Jun 10, 2016, 9:55:18 AM6/10/16
to cytoscap...@googlegroups.com
Hi all,
for loading data series into a plugin, I would like to reuse/tweak the "Import Columns From Table"  dialog (under File -> Import -> Table -> File..). Looking at the code, I fear, this is not possible, but I wanted to ask, if anyone new of a workaround.

In particular, I am interested in reusing the ImportTablePanel, but it is heavily entrenched in the non-public code, so I guess there is no way.

On a more general note - is there some guideline on how to share GUI code across plugins?

Thanks
Martin Cerny

srikanth bezawada

unread,
Jun 10, 2016, 11:21:07 AM6/10/16
to cytoscap...@googlegroups.com
Hi Martin Cerny,

I am not sure but you can try these. 
- Create a class ImportTableFromAppAction extends AbstractCyAction
- In the constructor , use setPreferredMenu("File.Import.Table") and use this code  for reference

For GUI, if you are using netbeans, you can automate using drag and drop.



Thanks,
Srikanth.B.


--
You received this message because you are subscribed to the Google Groups "cytoscape-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cytoscape-disc...@googlegroups.com.
To post to this group, send email to cytoscap...@googlegroups.com.
Visit this group at https://groups.google.com/group/cytoscape-discuss.
For more options, visit https://groups.google.com/d/optout.

Tim Hull

unread,
Jun 10, 2016, 12:58:08 PM6/10/16
to cytoscap...@googlegroups.com
If you want to use the Table UI from table import, there isn't a way as that isn't exposed in the API. If you want to share code across plugins, you can register the classes in question as an OSGi service with registerService and then use getService to get it. Though to do that, you will need to declare a dependency in the Maven dependency section of the pom.xml of the app using the dependency (on the app providing the dependency), as well as this in the <instructions> section:

<Cytoscape-App-Dependencies>My App Name;1.2.3</Cytoscape-App-Dependencies>

Substitute your app name and version number (of the app providing the dependency) for My App Name and 1.2.3.

Hope this helps..

Tim

--
Reply all
Reply to author
Forward
0 new messages