Ejemplo n.º 1
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;
  }
  private CompositeWidget createWidget() {
    CompositeWidget newWidget = UiFactory.eINSTANCE.createCompositeWidget();

    for (Map.Entry<String, String> entry : getNamespaces().entrySet()) {
      ValueAttribute attribute = UiFactory.eINSTANCE.createValueAttribute();
      attribute.setName(entry.getKey());
      attribute.setValue(entry.getValue());
      newWidget.getAttributes().add(attribute);
    }

    newWidget.setWidgetType(ConfigurationManager.instance.getDefaultCompositeType());

    Layout layout = UiFactory.eINSTANCE.createLayout();
    layout.setLayoutType(ConfigurationManager.instance.getDefaultLayoutType());
    newWidget.setLayout(layout);

    return newWidget;
  }
Ejemplo n.º 3
0
  @Override
  protected CompositeWidget layoutCategorizedEditors(
      Category category, List<PropertyEditor> editors) {
    if (((TypeCategory) category).isDatatype) {
      CompositeWidgetType compositeType = ConfigurationManager.instance.getDefaultCompositeType();

      CompositeWidget container = UiFactory.eINSTANCE.createCompositeWidget();
      container.setWidgetType(compositeType);

      Layout layout = createLayout(category.getNumColumns());
      container.setLayout(layout);

      for (PropertyEditor editor : editors) {
        CompositeWidget group = createDataTypeGroup(editor.getProperty());

        PropertyEditor viewEditor = UiFactory.eINSTANCE.createPropertyEditor();
        viewEditor.setWidgetType(getViewEditor());
        viewEditor.setProperty(editor.getProperty());

        ValueAttribute view = UiFactory.eINSTANCE.createValueAttribute();
        view.setName("view");
        view.setValue(getViewName(editor.getProperty()));
        viewEditor.getAttributes().add(view);

        group.getWidgets().add(viewEditor);
        container.getWidgets().add(group);
      }

      return container;
    }

    return super.layoutCategorizedEditors(category, editors);
  }
Ejemplo n.º 4
0
 /**
  *
  * <!-- begin-user-doc -->
  * <!-- end-user-doc -->
  *
  * @generated
  */
 @Override
 public CompositeWidget getWidget() {
   if (widget != null && widget.eIsProxy()) {
     InternalEObject oldWidget = (InternalEObject) widget;
     widget = (CompositeWidget) eResolveProxy(oldWidget);
     if (widget != oldWidget) {
       if (eNotificationRequired()) {
         eNotify(
             new ENotificationImpl(
                 this, Notification.RESOLVE, ContextsPackage.SECTION__WIDGET, oldWidget, widget));
       }
     }
   }
   return widget;
 }