1 19 20 package org.netbeans.modules.java.bridge; 21 22 import org.openide.src.*; 23 24 29 class EditingRunnable implements ExceptionRunnable { 30 public static final int OP_MODIFIERS = 0; 31 public static final int OP_NAME = 1; 32 public static final int OP_SUPERCLASS = 2; 33 public static final int OP_SUPERINTERFACES = 3; 34 public static final int OP_EXCEPTIONS = 4; 35 public static final int OP_PARAMETERS = 5; 36 public static final int OP_RETURNTYPE = 6; 37 public static final int OP_CHANGE_FIELDS = 7; 38 public static final int OP_CHANGE_METHODS = 8; 39 public static final int OP_CHANGE_CONSTRUCTORS = 9; 40 public static final int OP_CHANGE_INITIALIZERS = 10; 41 public static final int OP_CHANGE_CLASSES = 11; 42 public static final int OP_BODY = 12; 43 public static final int OP_CLASSFLAG = 13; 44 public static final int OP_PACKAGE = 14; 45 public static final int OP_IMPORT = 15; 46 47 ElementImpl impl; 48 int op; 49 int mods; 50 Identifier name; 51 Element[] elems; 52 Identifier[] ids; 53 MethodParameter[] params; 54 Type rettype; 55 String str; 56 boolean flag; 57 Import imp; 58 59 public EditingRunnable(ElementImpl impl, boolean flag) { 60 this.impl = impl; 61 this.flag = flag; 62 this.op = OP_CLASSFLAG; 63 } 64 65 public EditingRunnable(ElementImpl impl, Import i) { 66 this.impl = impl; 67 this.imp = i; 68 this.op = OP_IMPORT; 69 } 70 71 public EditingRunnable(ElementImpl impl, int mods) { 72 this.impl = impl; 73 this.mods = mods; 74 this.op = OP_MODIFIERS; 75 } 76 77 public EditingRunnable(ElementImpl impl, int opcode, Element[] elems, int changeCode) { 78 this.impl = impl; 79 this.op = opcode; 80 this.elems = elems; 81 this.mods = changeCode; 82 } 83 84 public EditingRunnable(ElementImpl impl, MethodParameter[] params) { 85 this.impl = impl; 86 this.params = params; 87 this.op = OP_PARAMETERS; 88 } 89 90 public EditingRunnable(ElementImpl impl, Identifier[] ids, int operation) { 91 this.impl = impl; 92 this.op = OP_SUPERINTERFACES; 93 this.ids = ids; 94 this.mods = operation; 95 } 96 97 public EditingRunnable(ElementImpl impl, Identifier[] ids) { 98 this.impl = impl; 99 this.ids = ids; 100 this.op = OP_EXCEPTIONS; 101 } 102 103 public EditingRunnable(ElementImpl impl, int opcode, Identifier name) { 104 this.impl = impl; 105 this.name = name; 106 this.op = opcode; 107 } 108 109 public EditingRunnable(ElementImpl impl, Type rettype) { 110 this.impl = impl; 111 this.rettype = rettype; 112 this.op = OP_RETURNTYPE; 113 } 114 115 public EditingRunnable(ElementImpl impl, String str) { 116 this.impl = impl; 117 this.op = OP_BODY; 118 this.str = str; 119 } 120 121 public void run() throws SourceException { 122 switch (op) { 123 172 } 173 } 174 } 175 | Popular Tags |