1 11 12 package org.eclipse.core.commands.contexts; 13 14 import org.eclipse.core.commands.common.AbstractNamedHandleEvent; 15 16 26 public final class ContextEvent extends AbstractNamedHandleEvent { 27 28 31 private static final int CHANGED_PARENT_ID = LAST_USED_BIT << 1; 32 33 36 private final Context context; 37 38 53 public ContextEvent(final Context context, final boolean definedChanged, 54 final boolean nameChanged, final boolean descriptionChanged, 55 final boolean parentIdChanged) { 56 super(definedChanged, descriptionChanged, nameChanged); 57 58 if (context == null) { 59 throw new NullPointerException (); 60 } 61 this.context = context; 62 63 if (parentIdChanged) { 64 changedValues |= CHANGED_PARENT_ID; 65 } 66 } 67 68 74 public final Context getContext() { 75 return context; 76 } 77 78 83 public final boolean isParentIdChanged() { 84 return ((changedValues & CHANGED_PARENT_ID) != 0); 85 } 86 } 87 | Popular Tags |