public boolean hasContext(IUndoContext context) { if (context == null) return false; for (int i = 0; i< fContexts.size(); i++) { IUndoContext otherContext = (IUndoContext)fContexts.get(i); // have to check both ways because one context may be more general in // its matching rules than another. if (context.matches(otherContext) || otherContext.matches(context)) return true; } return false; }
@Override public boolean hasContext(IUndoContext context) { if (context == null) return false; for (int i = 0; i< fContexts.size(); i++) { IUndoContext otherContext = fContexts.get(i); // have to check both ways because one context may be more general in // its matching rules than another. if (context.matches(otherContext) || otherContext.matches(context)) return true; } return false; }
@Override public boolean hasContext(IUndoContext context) { if (context == null) return false; for (int i = 0; i< fContexts.size(); i++) { IUndoContext otherContext = fContexts.get(i); // have to check both ways because one context may be more general in // its matching rules than another. if (context.matches(otherContext) || otherContext.matches(context)) return true; } return false; }
@Override public final boolean hasContext(IUndoContext context) { Assert.isNotNull(context); for (int i = 0; i < contexts.size(); i++) { IUndoContext otherContext = contexts.get(i); // have to check both ways because one context may be more general // in // its matching rules than another. if (context.matches(otherContext) || otherContext.matches(context)) { return true; } } return false; }
@Override public final boolean hasContext(IUndoContext context) { Assert.isNotNull(context); for (int i = 0; i < contexts.size(); i++) { IUndoContext otherContext = contexts.get(i); // have to check both ways because one context may be more general // in // its matching rules than another. if (context.matches(otherContext) || otherContext.matches(context)) { return true; } } return false; }
@Override public final boolean hasContext(IUndoContext context) { Assert.isNotNull(context); for (int i = 0; i < contexts.size(); i++) { IUndoContext otherContext = contexts.get(i); // have to check both ways because one context may be more general // in // its matching rules than another. if (context.matches(otherContext) || otherContext.matches(context)) { return true; } } return false; }
@Override public boolean matches(IUndoContext context) { if (this == context) return true; IUndoContext workspaceContext= ResourcesPlugin.getWorkspace().getAdapter(IUndoContext.class); if (workspaceContext == null) return false; return workspaceContext.matches(context); } }
@Override public boolean matches(IUndoContext context) { if (this == context) return true; IUndoContext workspaceContext= ResourcesPlugin.getWorkspace().getAdapter(IUndoContext.class); if (workspaceContext == null) return false; return workspaceContext.matches(context); } }
public boolean matches(IUndoContext context) { if (this == context) return true; IUndoContext workspaceContext= (IUndoContext)ResourcesPlugin.getWorkspace().getAdapter(IUndoContext.class); if (workspaceContext == null) return false; return workspaceContext.matches(context); } }
private boolean requiresApproval(IUndoableOperation operation, IAdaptable uiInfo) { // no approval is required if the operation doesn't have our undo // context if (!(operation.hasContext(context))) { return false; } // no approval is required if the operation only has our context if (operation.getContexts().length == 1) { return false; } // no approval is required if we can ascertain that the operation did // not originate // in our context. if (uiInfo != null) { IUndoContext originatingContext = Adapters.adapt(uiInfo, IUndoContext.class); if (originatingContext != null && !(originatingContext.matches(context))) { return false; } } return true; }
if (undoContext.matches(context)) { operation.removeContext(undoContext);
if (contexts[j].matches(context)) { operation.removeContext(contexts[j]);
if (contexts[j].matches(context)) { operation.removeContext(contexts[j]);
if (contexts[j].matches(context)) { operation.removeContext(contexts[j]);
if (undoContext.matches(context)) { operation.removeContext(undoContext);
if (contexts[j].matches(context)) { operation.removeContext(contexts[j]);