private static List<Context> findContexts(EObject source) {
    List<Context> contexts = new LinkedList<Context>();

    Context rootContext = null;
    if (source.eResource() != null) {
      for (Resource resource : source.eResource().getResourceSet().getResources()) {
        if (!resource.getContents().isEmpty() && resource.getContents().get(0) instanceof Context) {
          rootContext = (Context) resource.getContents().get(0);
          contexts.add(rootContext);
          break;
        }
      }
    }

    return PropertiesUtil.getDependencies(rootContext);
  }
Esempio n. 2
0
  protected CompositeWidget createDataTypeGroup(Property property) {
    CompositeWidgetType groupType = getGroupComposite();
    CompositeWidget group = UiFactory.eINSTANCE.createCompositeWidget();
    group.setWidgetType(groupType);

    ValueAttribute text = UiFactory.eINSTANCE.createValueAttribute();
    text.setName("text");
    text.setValue(PropertiesUtil.getLabel(property));

    group.getAttributes().add(text);

    Layout layout = createLayout(1);
    group.setLayout(layout);

    return group;
  }