Hi Marco, sorry to be a bit quick, but it might be that you find it here: http://jgrasstechtips.blogspot.it/2008/01/how-to-open-view-from-action-and.html
I hope your question was about how to open a view through its id :) Ciao, Andrea On Thu, Jun 21, 2012 at 12:03 PM, Marco Foi <[email protected]> wrote: > With the explicit intent of both informing the dev community and asking for > help, I am reporting my activities within the GSoC project. > > I decided to add an operation to the eu.udig.tools.merge to allow for > merging features selected with the core selection tools (suggested by Jody > https://jira.codehaus.org/browse/UDIG-1921 ). > > The workflow is: > - the users adds a layer > - the users selects a number of features of his interest using "Box > selection" or "Feature selection" core tools > - the users right-clicks on the layer -> operation -> "Merge selected" (the > newly added operation!) > - the selected features are "passed" to the MergeView (available in the > eu.merge.tools.merge.internal.view): the view that ultimately calls the > methods to process geometries. > > The workflow (should) proceed as before, using the MergeView features to > eventually remove features and select text attributes of the output merged > feature. > > > THE PROBLEM > > How can a ViewPart be opened in uDig by code? (MergeView extends ViewPart) > I can retrieve selected features but I found no way to open the view (to use > its addSourceFeatures() method) > It seems that since the operation I created is not in the UI-therad (or > something like that), a pretty basic code line such: > > MergeView view = (MergeView) ApplicationGIS.getView(true, MergeView.ID); > > fails with a NullPointerException, caused by a Display.getCurrent() > returning null in a private method down inside ApplicationGIS. > > Any hint? > > Marco > > > _______________________________________________ > User-friendly Desktop Internet GIS (uDig) > http://udig.refractions.net > http://lists.refractions.net/mailman/listinfo/udig-devel > _______________________________________________ User-friendly Desktop Internet GIS (uDig) http://udig.refractions.net http://lists.refractions.net/mailman/listinfo/udig-devel
