Sorry Paul I am having a bit of jet lagged induced fun. 

Here is an outline of a property ....

public class BoundryTypePropertyValue extends AbstractPropertyValue implements 
PropertyValue {

 public BoundryTypePropertyValue() {
 // TODO Auto-generated constructor stub
 }

 @Override
 public boolean isTrue( Object object, String value ) {
 IWorkbench workbench = (IWorkbench) object;

 BoundaryService service = (BoundaryService) workbench.getService(String.class);
String type = service.getStragey().getType();

 return type.equals( value );
 }

 @Override
 public boolean canCacheResult() {
 return false;
 }

 @Override
 public boolean isBlocking() {
 return false;
 }

}

Where you can smash that into udig.ui plugin.xml with something like:




<extension
id="net.refractions.udig.ui.properties"
name="uDig UI Properties"
point="net.refractions.udig.ui.objectProperty">
<object
targetClass="org.eclipse.ui.IWorkbench">
<property
class="net.refractions.udig.ui.internal.BoundryTypePropertyValue"
id="net.refractions.udig.ui.boundaryType">
</property>
</object>
</extension>


Before we get too excited we need to check with Jesse if the object property 
thing can pass us in a workbench or not? If not we could ask it to pass us in 
an IMap as a temporary measure.

Can you let me know if that works; if not I will try and teach the object 
property stuff how to look up the current workbench.-- 
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

Reply via email to