예제 #1
0
 public static Hashtable<String, Object> getChoiceOfValues(
     EObject object, EStructuralFeature feature) {
   ExtendedPropertiesAdapter adapter =
       (ExtendedPropertiesAdapter) AdapterUtil.adapt(object, ExtendedPropertiesAdapter.class);
   if (adapter != null) return adapter.getFeatureDescriptor(feature).getChoiceOfValues(object);
   return null;
 }
예제 #2
0
  public static String getText(EObject object, EStructuralFeature feature) {
    if (feature == null) return getText(object);

    ExtendedPropertiesAdapter adapter =
        (ExtendedPropertiesAdapter) AdapterUtil.adapt(object, ExtendedPropertiesAdapter.class);
    if (adapter != null) return adapter.getFeatureDescriptor(feature).getText(object);
    return getDisplayName(object, feature);
  }
예제 #3
0
 public static String getLabel(EObject object, EStructuralFeature feature) {
   String label = "";
   ExtendedPropertiesAdapter adapter =
       (ExtendedPropertiesAdapter) AdapterUtil.adapt(object, ExtendedPropertiesAdapter.class);
   if (adapter != null) label = adapter.getFeatureDescriptor(feature).getLabel(object);
   else label = ModelUtil.toDisplayName(feature.getName());
   label = label.replaceAll(" Ref$", "");
   return label;
 }
예제 #4
0
 public static EObject createObject(EObject object, EStructuralFeature feature, EClass eclass) {
   ExtendedPropertiesAdapter adapter =
       (ExtendedPropertiesAdapter) AdapterUtil.adapt(object, ExtendedPropertiesAdapter.class);
   if (adapter != null) return adapter.getFeatureDescriptor(feature).createObject(object, eclass);
   return null;
 }
예제 #5
0
 public static boolean getIsMultiLine(EObject object, EStructuralFeature feature) {
   ExtendedPropertiesAdapter adapter =
       (ExtendedPropertiesAdapter) AdapterUtil.adapt(object, ExtendedPropertiesAdapter.class);
   if (adapter != null) return adapter.getFeatureDescriptor(feature).isMultiLine(object);
   return false;
 }