Hi,
When i run the following code it stops File>Properties --> Resource Information tab from working.
I have commented out the code up until the offending line in red. If i comment this line out then the resource tab starts to work as expected.
Finally, if i put all code back in place ... i don't actually see an issue with what the code tries to achieve, it correctly get the property information and enables/disables the button however the resource information dialogue stops working ??
public void onFileEvent(VueEvent e) {
try
{
Messages.debugMsg("onFileEvent() - Event Fired: " + e.getEventName());
switch (e.getEvent()) {
case VueEvent.ONSETFILE:
//***
try
{
Messages.debugMsg("Checking AllowNew property");
//Check if we need to disable the button
Property mProp = getPerformer().getMarkupProperty(false, false);
/*
if(mProp != null)
{
Messages.debugMsg("Retrieved markup options");
Property pGUI = mProp.getFirstChildWithName(Property.PROP_GUI);
if(pGUI != null)
{
Messages.debugMsg("Retrieved GUI options");
Property pGUIDisplayOptions = pGUI.getFirstChildWithName("DisplayOptions");
if(pGUIDisplayOptions != null)
{
Messages.debugMsg("Retrieved DisplayOptions");
Property pNew = pGUIDisplayOptions.getFirstChildWithName("AllowNew");
if(pNew != null)
{
Messages.debugMsg("Retrieved AllowedNew: " + pNew.getValueString());
String canCreateNew = pNew.getValueString();
if(canCreateNew.equalsIgnoreCase("false"))
{
Messages.debugMsg("Checking for markups before disabling the button");
//We would normally just disable the button but in theory there might be markups to open so check
Property[] pMarkups = mProp.getChildrenWithName("Markup");
if(pMarkups == null || (pMarkups != null && pMarkups.length == 0))
{
Messages.debugMsg("Disabling Show All button");
setEnabled(false);
}
else
{
Messages.debugMsg("Enabling Show All button");
setEnabled(true);
}
}
else
{
setEnabled(true);
}
}
}
}
}
*/
}
catch(Exception ex)
{
Messages.error("There was an error checking if the Show All Markup button should be enabled.", ex);
}
break;
}
}
catch(Exception ex)
{
Messages.error("Error: " + ex.getMessage(), ex);
}
}