1 11 package org.eclipse.core.internal.events; 12 13 import org.eclipse.core.resources.IResource; 14 15 20 public class LifecycleEvent { 21 public static final int PRE_PROJECT_CLOSE = 0x01; 23 public static final int PRE_PROJECT_CHANGE = 0x02; 24 public static final int PRE_PROJECT_COPY = 0x04; 25 public static final int PRE_PROJECT_CREATE = 0x08; 26 27 public static final int PRE_PROJECT_DELETE = 0x10; 28 public static final int PRE_PROJECT_OPEN = 0x20; 29 public static final int PRE_PROJECT_MOVE = 0x40; 30 31 public static final int PRE_LINK_COPY = 0x100; 32 public static final int PRE_LINK_CREATE = 0x200; 33 public static final int PRE_LINK_DELETE = 0x400; 34 public static final int PRE_LINK_MOVE = 0x800; 35 36 39 public int kind; 40 46 public IResource resource; 47 51 public IResource newResource; 52 53 56 public int updateFlags; 57 58 private static final LifecycleEvent instance = new LifecycleEvent(); 59 60 private LifecycleEvent() { 61 super(); 62 } 63 64 public static LifecycleEvent newEvent(int kind, IResource resource) { 65 instance.kind = kind; 66 instance.resource = resource; 67 instance.newResource = null; 68 instance.updateFlags = 0; 69 return instance; 70 } 71 72 public static LifecycleEvent newEvent(int kind, IResource oldResource, IResource newResource, int updateFlags) { 73 instance.kind = kind; 74 instance.resource = oldResource; 75 instance.newResource = newResource; 76 instance.updateFlags = updateFlags; 77 return instance; 78 } 79 } 80 | Popular Tags |