Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/taglib/workspace/WorkspaceContextExtender.java18
1 files changed, 16 insertions, 2 deletions
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/taglib/workspace/WorkspaceContextExtender.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/taglib/workspace/WorkspaceContextExtender.java
index 2d8a591..bef92ad 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/taglib/workspace/WorkspaceContextExtender.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/taglib/workspace/WorkspaceContextExtender.java
@@ -234,7 +234,7 @@ public final class WorkspaceContextExtender
protected boolean isActionRequired(JET2Context context, IWorkspaceAction action)
{
- final IResource resource = action.getResource();
+ final IResource resource = getActionResource(action);
if(resource != null && !(resource instanceof IFile)) {
// For non-files, action is required only if resource does not exist
return !resource.exists();
@@ -262,6 +262,20 @@ public final class WorkspaceContextExtender
return ActionsUtil.finalizeAndTestForChange(file, ext.getContentWriter(), existingContents);
}
+ private IResource getActionResource(IWorkspaceAction action)
+ {
+ IResource resource;
+ try
+ {
+ resource = action.getResource();
+ }
+ catch (JET2TagException e)
+ {
+ resource = null;
+ }
+ return resource;
+ }
+
/**
* @param context
* @param action
@@ -299,7 +313,7 @@ public final class WorkspaceContextExtender
*/
protected void doActionCommitted(final JET2Context context, final IWorkspaceAction action) throws JET2TagException
{
- final IResource resource = action.getResource();
+ final IResource resource = getActionResource(action);
if(action instanceof IWorkspaceActionExtension) {
ActionsUtil.contentCommitted(((IWorkspaceActionExtension)action).getContentWriter(), resource);
}

Back to the top