Package org.eclipse.wb.internal.core.xml.model.property

Examples of org.eclipse.wb.internal.core.xml.model.property.GenericPropertyImpl


          ExpressionAccessor expressionAccessor = new CellExpressionAccessor(namespace, "width");
          GenericPropertyDescription propertyDescription =
              new GenericPropertyDescription(null, "width", String.class, expressionAccessor);
          propertyDescription.setEditor(StringPropertyEditor.INSTANCE);
          propertyDescription.setConverter(StringConverter.INSTANCE);
          widthProperty = new GenericPropertyImpl(widget, propertyDescription);
        }
        // "height"
        Property heightProperty;
        {
          ExpressionAccessor expressionAccessor = new CellExpressionAccessor(namespace, "height");
          GenericPropertyDescription propertyDescription =
              new GenericPropertyDescription(null, "height", String.class, expressionAccessor);
          propertyDescription.setEditor(StringPropertyEditor.INSTANCE);
          propertyDescription.setConverter(StringConverter.INSTANCE);
          heightProperty = new GenericPropertyImpl(widget, propertyDescription);
        }
        // "horizontalAlignment"
        Property horizontalAlignmentProperty;
        {
          StaticFieldPropertyEditor propertyEditor = new StaticFieldPropertyEditor();
          Class<?> hasHorizontalAlignmentClass =
              editorLoader.loadClass("com.google.gwt.user.client.ui.HasHorizontalAlignment");
          propertyEditor.configure(hasHorizontalAlignmentClass, new String[]{
              "ALIGN_LEFT",
              "ALIGN_CENTER",
              "ALIGN_RIGHT"});
          Object defaultValue =
              ReflectionUtils.getFieldObject(hasHorizontalAlignmentClass, "ALIGN_LEFT");
          // create property
          ExpressionAccessor expressionAccessor =
              new CellExpressionAccessor(namespace, "horizontalAlignment");
          GenericPropertyDescription propertyDescription =
              new GenericPropertyDescription(null,
                  "horizontalAlignment",
                  String.class,
                  expressionAccessor);
          propertyDescription.setEditor(propertyEditor);
          propertyDescription.setDefaultValue(defaultValue);
          horizontalAlignmentProperty = new GenericPropertyImpl(widget, propertyDescription);
        }
        // "verticalAlignment"
        Property verticalAlignmentProperty;
        {
          StaticFieldPropertyEditor propertyEditor = new StaticFieldPropertyEditor();
          Class<?> hasVerticalAlignmentClass =
              editorLoader.loadClass("com.google.gwt.user.client.ui.HasVerticalAlignment");
          propertyEditor.configure(hasVerticalAlignmentClass, new String[]{
              "ALIGN_TOP",
              "ALIGN_MIDDLE",
              "ALIGN_BOTTOM"});
          Object defaultValue =
              ReflectionUtils.getFieldObject(hasVerticalAlignmentClass, "ALIGN_TOP");
          // create property
          ExpressionAccessor expressionAccessor =
              new CellExpressionAccessor(namespace, "verticalAlignment");
          GenericPropertyDescription propertyDescription =
              new GenericPropertyDescription(null,
                  "verticalAlignment",
                  String.class,
                  expressionAccessor);
          propertyDescription.setEditor(propertyEditor);
          propertyDescription.setDefaultValue(defaultValue);
          verticalAlignmentProperty = new GenericPropertyImpl(widget, propertyDescription);
        }
        // create complex "Cell" property
        ComplexProperty cellProperty = new ComplexProperty("Cell", "(cell properties)");
        cellProperty.setCategory(PropertyCategory.system(7));
        cellProperty.setProperties(new Property[]{
View Full Code Here


  // IPropertiesMenuContributor
  //
  ////////////////////////////////////////////////////////////////////////////
  public void contributeMenu(IMenuManager manager, Property property) throws Exception {
    if (property instanceof GenericPropertyImpl) {
      GenericPropertyImpl genericProperty = (GenericPropertyImpl) property;
      if (genericProperty.getObject() instanceof UIObjectInfo) {
        UIObjectInfo object = (UIObjectInfo) genericProperty.getObject();
        MethodExpressionAccessor accessor = getMethodAccessor(genericProperty);
        if (accessor != null) {
          manager.insertAfter(GROUP_EDIT, new ExposePropertyAction(genericProperty,
              object,
              accessor));
View Full Code Here

    };
    GenericPropertyDescription description =
        new GenericPropertyDescription(name, name, type, accessor);
    description.setConverter(converter);
    description.setEditor(editor);
    return new GenericPropertyImpl(object, description);
  }
View Full Code Here

    };
    GenericPropertyDescription description =
        new GenericPropertyDescription(name, name, type, accessor);
    description.setConverter(converter);
    description.setEditor(editor);
    return new GenericPropertyImpl(object, description);
  }
View Full Code Here

TOP

Related Classes of org.eclipse.wb.internal.core.xml.model.property.GenericPropertyImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.