if (aFunctionName.equals("Editable"))
{
if (!editable)
{
NoSupportException nse = new NoSupportException(
aFunctionName + " is not editable " );
throw new InvocationTargetException(
"Scripting framework error editing script", null, nse );
}
XScriptContext ctxt = provider.getScriptingContext();
ScriptMetaData data = null;
try
{
data = (ScriptMetaData)parent.getByName( name );
}
catch ( NoSuchElementException nse )
{
throw new com.sun.star.lang.IllegalArgumentException(
name + " does not exist or can't be found " );
}
catch ( com.sun.star.lang.WrappedTargetException wte )
{
// rethrow
throw new InvocationTargetException(
"Scripting framework editing script ",
null, wte.TargetException );
}
provider.getScriptEditor().edit(ctxt, data);
}
else if (aFunctionName.equals("Deletable"))
{
if (!deletable)
{
NoSupportException nse = new NoSupportException(
aFunctionName + " is not supported for this node" );
throw new InvocationTargetException(
"Scripting framework error deleting script", null, nse );
}
try
{
parent.removeByName( name );
result = new Any(new Type(Boolean.class), Boolean.TRUE);
}
catch ( NoSuchElementException nse )
{
throw new com.sun.star.lang.IllegalArgumentException(
name + " does not exist or can't be found " );
}
catch ( WrappedTargetException wte )
{
// rethrow
throw new InvocationTargetException(
"Scripting framework deleting script ",
null, wte.TargetException );
}
}
else if (aFunctionName.equals("Renamable"))
{
result = new Any(new Type(XBrowseNode.class), new XBrowseNode[0]);
if (!renamable)
{
NoSupportException nse = new NoSupportException(
aFunctionName + " is not supported for this node" );
throw new InvocationTargetException(
"Scripting framework error renaming script", null, nse );
}