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

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


    // prepare layout complex property
    {
      Property[] layoutProperties = getProperties();
      if (m_layoutComplexProperty == null) {
        String text = "(" + getTitle() + ")";
        m_layoutComplexProperty = new ComplexProperty("Layout", text) {
          @Override
          public boolean isModified() throws Exception {
            return true;
          }
View Full Code Here


      {
        Class<?> componentClass = getDescription().getComponentClass();
        text = "(" + componentClass.getName() + ")";
      }
      // prepare ComplexProperty
      m_complexProperty = new ComplexProperty("LayoutData", text) {
        @Override
        public boolean isModified() throws Exception {
          return true;
        }
View Full Code Here

    Constructor<?> constructor = getUiConstructor(object);
    if (constructor == null) {
      return null;
    }
    // prepare @UiConstructor complex property
    ComplexProperty constructorProperty = new ComplexProperty("UiConstructor", "(Properties)");
    constructorProperty.setCategory(PropertyCategory.system(3));
    constructorProperty.setModified(true);
    constructorProperty.setTooltip("Properties for @UiConstructor arguments.");
    // prepare sub-properties
    List<Property> subPropertiesList = Lists.newArrayList();
    String[] parameterNames = getConstructorParameterNames(constructor);
    Class<?>[] parameterTypes = constructor.getParameterTypes();
    for (int i = 0; i < parameterTypes.length; i++) {
      Property property = createProperty(object, parameterNames[i], parameterTypes[i]);
      if (property != null) {
        subPropertiesList.add(property);
      }
    }
    // set sub-properties
    if (!subPropertiesList.isEmpty()) {
      constructorProperty.setProperties(subPropertiesList);
      return constructorProperty;
    }
    return null;
  }
View Full Code Here

  /**
   * Collect bounds property from simple properties.
   */
  private static void collectBoundsProperty(FormItemInfo item, List<Property> properties) {
    final String key = "FormItem_Info.boundsProperty";
    ComplexProperty boundsProperty = (ComplexProperty) item.getArbitraryValue(key);
    if (boundsProperty == null) {
      boundsProperty = new ComplexProperty("Bounds", null);
      item.putArbitraryValue(key, boundsProperty);
    }
    // show bounds-property for absolute item layout
    boundsProperty.setCategory(item.getForm().isAbsoluteItemLayout()
        ? PropertyCategory.PREFERRED
        : PropertyCategory.ADVANCED);
    // move bounds items properties
    boundsProperty.setProperties(new Property[]{
        extractPropertyByTitle(properties, "left"),
        extractPropertyByTitle(properties, "top"),
        extractPropertyByTitle(properties, "width(int)"),
        extractPropertyByTitle(properties, "width(java.lang.String)"),
        extractPropertyByTitle(properties, "height(int)"),
        extractPropertyByTitle(properties, "height(java.lang.String)")});
    // apply current bounds
    Rectangle modelBounds = item.getModelBounds();
    if (modelBounds != null) {
      boundsProperty.setText("("
          + modelBounds.x
          + ", "
          + modelBounds.y
          + ", "
          + modelBounds.width
View Full Code Here

    // if no sub-properties, then no property
    if (subPropertiesList.isEmpty()) {
      return null;
    }
    // prepare @UiChild complex property
    ComplexProperty methodProperty = new ComplexProperty("UiChild", "(Properties)");
    methodProperty.setCategory(PropertyCategory.system(3));
    methodProperty.setModified(true);
    methodProperty.setTooltip("Properties for @UiChild arguments.");
    // set sub-properties
    methodProperty.setProperties(subPropertiesList);
    return methodProperty;
  }
View Full Code Here

  //
  // Bounds Property
  //
  ////////////////////////////////////////////////////////////////////////////
  private Property getBoundsProperty(CanvasInfo canvas) {
    ComplexProperty boundsProperty = (ComplexProperty) canvas.getArbitraryValue(this);
    if (boundsProperty == null) {
      boundsProperty = new ComplexProperty("Bounds", null);
      boundsProperty.setCategory(PropertyCategory.system(5));
      boundsProperty.setModified(true);
      canvas.putArbitraryValue(this, boundsProperty);
      // x
      BoundsProperty<?> xProperty = new BoundsProperty<CanvasInfo>(canvas, "x") {
        @Override
        public void setValue2(int value, Rectangle modelBounds) throws Exception {
          command_BOUNDS(m_component, new Point(value, modelBounds.y), null);
        }
      };
      // y
      BoundsProperty<?> yProperty = new BoundsProperty<CanvasInfo>(canvas, "y") {
        @Override
        public void setValue2(int value, Rectangle modelBounds) throws Exception {
          command_BOUNDS(m_component, new Point(modelBounds.x, value), null);
        }
      };
      // width
      BoundsProperty<?> widthProperty = new BoundsProperty<CanvasInfo>(canvas, "width") {
        @Override
        public void setValue2(int value, Rectangle modelBounds) throws Exception {
          command_BOUNDS(m_component, null, new Dimension(value, modelBounds.height));
        }
      };
      // height
      BoundsProperty<?> heightProperty = new BoundsProperty<CanvasInfo>(canvas, "height") {
        @Override
        public void setValue2(int value, Rectangle modelBounds) throws Exception {
          command_BOUNDS(m_component, null, new Dimension(modelBounds.width, value));
        }
      };
      boundsProperty.setProperties(new Property[]{
          xProperty,
          yProperty,
          widthProperty,
          heightProperty});
    }
    // apply current bounds
    Rectangle modelBounds = canvas.getModelBounds();
    if (modelBounds != null) {
      boundsProperty.setText("("
          + modelBounds.x
          + ", "
          + modelBounds.y
          + ", "
          + modelBounds.width
View Full Code Here

    {
      // check properties
      Property[] properties = cellBrowser.getProperties();
      assertTrue(properties.length > 0);
      {
        ComplexProperty constructorProperty =
            (ComplexProperty) cellBrowser.getPropertyByTitle("Constructor");
        assertNull(constructorProperty);
        // check if <tag name="property.no" value="true"/> removed
        //Property[] constructorProperties = constructorProperty.getProperties();
        //assertNotNull(constructorProperties[1].getTitle());
View Full Code Here

    {
      // check properties
      Property[] properties = cellTree.getProperties();
      assertTrue(properties.length > 0);
      {
        ComplexProperty constructorProperty =
            (ComplexProperty) cellTree.getPropertyByTitle("Constructor");
        assertNull(constructorProperty);
        // check if <tag name="property.no" value="true"/> removed
        //Property[] constructorProperties = constructorProperty.getProperties();
        //assertNotNull(constructorProperties[1].getTitle());
View Full Code Here

TOP

Related Classes of org.eclipse.wb.internal.core.model.property.ComplexProperty

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.