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

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


      }

      private Property getCellComplexProperty(WidgetInfo component) throws Exception {
        ClassLoader editorLoader = JavaInfoUtils.getClassLoader(panel);
        // "width"
        GenericPropertyImpl widthProperty;
        {
          ExpressionAccessor expressionAccessor =
              new CellExpressionAccessor(panel, "setCellWidth", "java.lang.String");
          widthProperty =
              new GenericPropertyImpl(component,
                  "width",
                  new ExpressionAccessor[]{expressionAccessor},
                  "",
                  StringConverter.INSTANCE,
                  StringPropertyEditor.INSTANCE);
        }
        // "height"
        GenericPropertyImpl heightProperty;
        {
          ExpressionAccessor expressionAccessor =
              new CellExpressionAccessor(panel, "setCellHeight", "java.lang.String");
          heightProperty =
              new GenericPropertyImpl(component,
                  "height",
                  new ExpressionAccessor[]{expressionAccessor},
                  "",
                  StringConverter.INSTANCE,
                  StringPropertyEditor.INSTANCE);
        }
        // "horizontalAlignment"
        GenericPropertyImpl horizontalAlignmentProperty;
        {
          StaticFieldPropertyEditor propertyEditor = new StaticFieldPropertyEditor();
          Class<?> hasHorizontalAlignmentClass =
              editorLoader.loadClass("com.google.gwt.user.client.ui.HasHorizontalAlignment");
          ExpressionAccessor expressionAccessor =
              new CellExpressionAccessor(panel,
                  "setCellHorizontalAlignment",
                  "com.google.gwt.user.client.ui.HasHorizontalAlignment.HorizontalAlignmentConstant");
          propertyEditor.configure(hasHorizontalAlignmentClass, new String[]{
              "ALIGN_LEFT",
              "ALIGN_CENTER",
              "ALIGN_RIGHT",
              "ALIGN_DEFAULT"});
          Object defaultValue =
              ReflectionUtils.getFieldObject(hasHorizontalAlignmentClass, "ALIGN_DEFAULT");
          horizontalAlignmentProperty =
              new GenericPropertyImpl(component,
                  "horizontalAlignment",
                  new ExpressionAccessor[]{expressionAccessor},
                  defaultValue,
                  null,
                  propertyEditor);
        }
        // "verticalAlignment"
        GenericPropertyImpl 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"});
          ExpressionAccessor expressionAccessor =
              new CellExpressionAccessor(panel,
                  "setCellVerticalAlignment",
                  "com.google.gwt.user.client.ui.HasVerticalAlignment.VerticalAlignmentConstant");
          Object defaultValue =
              ReflectionUtils.getFieldObject(hasVerticalAlignmentClass, "ALIGN_TOP");
          verticalAlignmentProperty =
              new GenericPropertyImpl(component,
                  "verticalAlignment",
                  new ExpressionAccessor[]{expressionAccessor},
                  defaultValue,
                  null,
                  propertyEditor);
View Full Code Here


      public void invoke(JavaInfo javaInfo, List<Property> properties) throws Exception {
        WidgetInfo header = getHeader(javaInfo);
        if (header != null) {
          for (Property property : header.getProperties()) {
            if (isTextProperty(property)) {
              GenericPropertyImpl genericProperty = (GenericPropertyImpl) property;
              Property copy = new GenericPropertyImpl(genericProperty, "HeaderText");
              copy.setCategory(PropertyCategory.system(7));
              properties.add(copy);
              return;
            }
          }
        }
      }

      private WidgetInfo getHeader(JavaInfo javaInfo) {
        if (javaInfo instanceof WidgetInfo && javaInfo.getParent() == StackLayoutPanelInfo.this) {
          WidgetInfo widget = (WidgetInfo) javaInfo;
          for (WidgetInfo header : widget.getChildren(WidgetInfo.class)) {
            if (header.getAssociation() instanceof InvocationSecondaryAssociation) {
              return header;
            }
          }
        }
        return null;
      }

      private boolean isTextProperty(Property property) {
        if (property instanceof GenericPropertyImpl) {
          GenericPropertyImpl genericProperty = (GenericPropertyImpl) property;
          GenericPropertyDescription description = genericProperty.getDescription();
          return description != null && description.hasTrueTag("isText");
        }
        return false;
      }
    });
View Full Code Here

      }
    });
  }

  private Property createCellComplexProperty(final WidgetInfo widget) throws Exception {
    GenericPropertyImpl widthProperty = createStringProperty(widget, "setWidth", "width");
    GenericPropertyImpl heightProperty = createStringProperty(widget, "setHeight", "height");
    GenericPropertyImpl styleNameProperty =
        createStyleProperty(widget, "setStyleName", "styleName");
    GenericPropertyImpl stylePrimaryNameProperty =
        createStyleProperty(widget, "setStylePrimaryName", "stylePrimaryName");
    GenericPropertyImpl visibleProperty =
        createBooleanProperty(widget, "setVisible", "visible", true);
    GenericPropertyImpl wordWrapProperty =
        createBooleanProperty(widget, "setWordWrap", "wordWrap", false);
    // "horizontalAlignment"
    Property horizontalAlignmentProperty;
    {
      horizontalAlignmentProperty =
View Full Code Here

      Object defaultValue,
      ExpressionConverter converter,
      PropertyEditor propertyEditor) {
    ExpressionAccessor expressionAccessor =
        new CellFormatterExpressionAccessor(methodName, typeName);
    return new GenericPropertyImpl(widget,
        title,
        new ExpressionAccessor[]{expressionAccessor},
        defaultValue,
        converter,
        propertyEditor);
View Full Code Here

TOP

Related Classes of org.eclipse.wb.internal.core.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.