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

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


   */
  private void addLayoutProperties(List<Property> properties) throws Exception {
    // prepare layout complex property
    if (m_complexProperty == null) {
      String text = "(" + getTitle() + ")";
      m_complexProperty = 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

      WidgetInfo widget,
      boolean horizontal,
      String locationTitle) {
    Location location = getLocation(widget, horizontal);
    //
    ComplexProperty complexProperty;
    {
      @SuppressWarnings("unchecked")
      Map<String, ComplexProperty> complexProperties =
          (Map<String, ComplexProperty>) widget.getArbitraryValue(this);
      if (complexProperties == null) {
        complexProperties = Maps.newTreeMap();
        widget.putArbitraryValue(this, complexProperties);
      }
      complexProperty = complexProperties.get(locationTitle);
      if (complexProperty == null) {
        complexProperty = new ComplexProperty(locationTitle, "<properties>");
        complexProperty.setCategory(PropertyCategory.system(10));
        complexProperties.put(locationTitle, complexProperty);
      }
      properties.add(complexProperty);
    }
    // prepare sub-properties
    List<Property> subProperties = Lists.newArrayList();
    if (location.leading != null) {
      String title = location.leading.attribute;
      subProperties.add(new LocationValue_Property(title, location.leading));
      subProperties.add(new LocationUnit_Property(title + " unit", location.leading));
    }
    if (location.trailing != null) {
      String title = location.trailing.attribute;
      subProperties.add(new LocationValue_Property(title, location.trailing));
      subProperties.add(new LocationUnit_Property(title + " unit", location.trailing));
    }
    if (location.size != null) {
      String title = location.size.attribute;
      subProperties.add(new LocationValue_Property(title, location.size));
      subProperties.add(new LocationUnit_Property(title + " unit", location.size));
    }
    complexProperty.setProperties(subProperties);
  }
View Full Code Here

                  defaultValue,
                  null,
                  propertyEditor);
        }
        // create complex "Cell" property
        ComplexProperty cellProperty = new ComplexProperty("Cell", "(cell properties)");
        cellProperty.setCategory(PropertyCategory.system(7));
        cellProperty.setProperties(new Property[]{
            widthProperty,
            heightProperty,
            horizontalAlignmentProperty,
            verticalAlignmentProperty});
        return cellProperty;
View Full Code Here

  private void addFace(String faceName) throws Exception {
    final JavaInfo face = JavaInfoUtils.addChildExposedByMethod(this, "get" + faceName);
    m_faces.add(face);
    // create ComplexProperty for each face
    {
      ComplexProperty faceProperty = new ComplexProperty(faceName, "(Face properties)") {
        @Override
        public void setValue(Object value) throws Exception {
          if (value == Property.UNKNOWN_VALUE) {
            face.delete();
          }
        }
      };
      faceProperty.setProperties(face.getProperties());
      faceProperty.setCategory(PropertyCategory.system(100 + m_faces.size()));
      m_faceProperties.add(faceProperty);
    }
    // when any face property is about to set, reset other properties
    face.addBroadcastListener(new GenericPropertySetValue() {
      public void invoke(GenericPropertyImpl property, Object[] value, boolean[] shouldSetValue)
View Full Code Here

    // optional FlexTable properties
    if (m_panel instanceof FlexTableInfo) {
      addSpanProperties(widget, properties);
    }
    // create complex "Cell" property
    ComplexProperty cellProperty = new ComplexProperty("Cell", "(cell properties)");
    cellProperty.setCategory(PropertyCategory.system(7));
    cellProperty.setProperties(properties);
    return cellProperty;
  }
View Full Code Here

    if (invocation == null) {
      return;
    }
    String signature = AstNodeUtils.getMethodSignature(invocation);
    //
    ComplexProperty complexProperty;
    {
      @SuppressWarnings("unchecked")
      Map<String, ComplexProperty> complexProperties =
          (Map<String, ComplexProperty>) widget.getArbitraryValue(this);
      if (complexProperties == null) {
        complexProperties = Maps.newTreeMap();
        widget.putArbitraryValue(this, complexProperties);
      }
      complexProperty = complexProperties.get(title);
      if (complexProperty == null) {
        complexProperty = new ComplexProperty(title, "<properties>");
        complexProperty.setCategory(PropertyCategory.system(10));
        complexProperties.put(signature, complexProperty);
      }
      properties.add(complexProperty);
    }
    // update sub-properties
    String[] propertyTitles = getLocationPropertyTitles(signature);
    String title_1 = propertyTitles[0];
    String title_3 = propertyTitles[1];
    Property property_1 = new LocationValue_Property(title_1, invocation, 1);
    Property property_1u = new LocationUnit_Property(title_1 + " unit", invocation, 2, horizontal);
    Property property_3 = new LocationValue_Property(title_3, invocation, 3);
    Property property_3u = new LocationUnit_Property(title_3 + " unit", invocation, 4, horizontal);
    Property[] subProperties = new Property[]{property_1, property_1u, property_3, property_3u};
    complexProperty.setProperties(subProperties);
  }
View Full Code Here

          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[]{
            widthProperty,
            heightProperty,
            horizontalAlignmentProperty,
            verticalAlignmentProperty});
        return cellProperty;
View Full Code Here

              propertiesToMove.add(property);
            }
          }
          properties.removeAll(propertiesToMove);
          // add to "canvas" property
          ComplexProperty canvasProperty = getCanvasProperty();
          canvasProperty.setProperties(propertiesToMove);
          canvasProperty.setText(getVariableSupport().getTitle());
          properties.add(canvasProperty);
          // add underlying widget properties
          Property[] widgetProperties = getWidget().getProperties();
          properties.addAll(Lists.newArrayList(widgetProperties));
        }
View Full Code Here

    });
  }

  private ComplexProperty getCanvasProperty() {
    final String CANVAS_PROPERTY = "CANVAS_PROPERTY";
    ComplexProperty canvasProperty = (ComplexProperty) getArbitraryValue(CANVAS_PROPERTY);
    if (canvasProperty == null) {
      canvasProperty = new ComplexProperty("Canvas", null);
      canvasProperty.setCategory(PropertyCategory.system(5));
      canvasProperty.setModified(true);
      putArbitraryValue(CANVAS_PROPERTY, canvasProperty);
    }
    return canvasProperty;
  }
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.