1 11 12 package org.eclipse.ui.internal.menus; 13 14 34 public final class SReference { 35 36 40 public static final int TYPE_UNSPECIFIED = 0; 41 42 45 public static final int TYPE_MENU = 1; 46 47 50 public static final int TYPE_GROUP = 2; 51 52 55 public static final int TYPE_ITEM = 3; 56 57 60 public static final int TYPE_WIDGET = 4; 61 62 66 private final int type; 67 68 72 private final String id; 73 74 86 public SReference(final int type, final String id) { 87 if ((type < TYPE_UNSPECIFIED) || (type > TYPE_WIDGET)) { 88 throw new IllegalArgumentException ( 89 "The type of reference is not understood"); } 91 if (id == null) { 92 throw new NullPointerException ( 93 "The identifier of the menu element must be null"); } 95 96 this.type = type; 97 this.id = id; 98 } 99 100 105 public final String getId() { 106 return id; 107 } 108 109 115 public final int getType() { 116 return type; 117 } 118 } 119 | Popular Tags |