Пример #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;
 }