Thanks for posting the code Larry. I've never seen the UndoableEditReceiver class used. This was a good example.
SS On Mon, Mar 30, 2009 at 6:36 AM, Larry Becker <becker.la...@gmail.com> wrote: > I made a local experimental addition to the Select Tool's double-click. It > opens View/Edit Attributes for the item double-clicked. One of our users > asked for it, but to me it doesn't seem very useful. I thought I would post > it here to see if anyone has any other ideas for double-click. It is also a > nice example of how you execute a PlugIn and create the context for it. The > UndoableEditReceiver was the tricky part. > > To see it work, make the change to SelectTool#mouseclicked(): > > public void mouseClicked(MouseEvent e) { > try { > super.mouseClicked(e); > setViewSource(e.getPoint()); > setViewDestination(e.getPoint()); > if (e.getClickCount() > 1) { > UndoableEditReceiver undoableEditReceiver = null; > try { > WorkbenchContext workbenchContext = > getWorkbench().getContext(); > undoableEditReceiver = workbenchContext > .getLayerManager() != null ? workbenchContext > .getLayerManager().getUndoableEditReceiver() : > null; > if (undoableEditReceiver != null) { > undoableEditReceiver.startReceiving(); > } > new > FeatureInfoPlugIn().execute(getWorkbench().getContext().createPlugInContext()); > } finally { > if (undoableEditReceiver != null) { > undoableEditReceiver.stopReceiving(); > } > } > return; > } > > fireGestureFinished(); > } catch (Throwable t) { > getPanel().getContext().handleThrowable(t); > } > } > > regards, > Larry > > -- > http://amusingprogrammer.blogspot.com/ > > ------------------------------------------------------------------------------ > > _______________________________________________ > Jump-pilot-devel mailing list > Jump-pilot-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel > > ------------------------------------------------------------------------------ _______________________________________________ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel