Hi Paul! I think we could use the tool enablement to work this one out - I am thinking something like:
<actionTool categoryId="net.refractions.udig.tool.category.zoom" class="net.refractions.udig.tools.internal.ZoomExtent" commandHandler="net.refractions.udig.tools.internal.ZoomHandler" commandIds="net.refractions.udig.tool.default.zoom.all" icon="icons/etool16/zoom_extent_co.gif" id="net.refractions.udig.tools.ZoomExtent" menuPath="navigate/zoom.ext" name="%zoom.all.name" onToolbar="true" tooltip="%zoom.all.tooltip"> <enablement> <and> <adaptsTo target="net.refractions.udig.project.IMap"> </adaptsTo> <not> <property expectedValue="screen" propertyId="net.refractions.udig.ui.boundStragey"> </property> </not> </and> </enablement> </actionTool> The idea would be to define property "boundStrategy" and disable the ZoomExtent tool when it has the value "screen". I kind of thought that these properties were something defined by eclipse; but they seem to be done by udig. I found similar code for Actions for the "action filter" enablement stuff from eclipse; I wonder if we could add that into our enablement stuff for tools.exsd. -- Jody Garnett On Wednesday, 21 September 2011 at 12:11 PM, Paul Pfeiffer wrote: > I have run into a design issue: > - When the boundary selected is screen and I click zoom to extent... nothing > happens. > - When the boundary selected is all and the use boundary is ticked on the > Search View the results aren't different > Both situations are programmatically correct but would be confusing for > users. > > I have presented the situation to one of our staff here and he was happy with > the buttons being disabled if the functionality was not appropriate. > > At first look it seemed like I should provide methods in the strategies to > check whether a button/action should be disabled and then after a change in > the strategy enable or disable the relevant buttons. > > However after trying to implement this I was unable to find a way to access > the buttons and looking at other code it seems that setting up some kind of a > listener arrangement might be more appropriate. > > So in summary I am unsure which approach to take and I am unable to find > examples of either in the current code (although it is highly likely that I > simply missed it as I'm only starting to get the hang of finding my way > around the plugins and packages) > > Cheers > Paul > _______________________________________________ > 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
