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

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


  private void contributeTabTextProperty() {
    addBroadcastListener(new XmlObjectAddProperties() {
      public void invoke(XmlObjectInfo object, List<Property> properties) throws Exception {
        if (object instanceof WidgetInfo && getChildren().contains(object)) {
          WidgetInfo widget = (WidgetInfo) object;
          Property textProperty = getTabTextProperty(widget);
          if (textProperty != null) {
            properties.add(textProperty);
          }
        }
      }
View Full Code Here


  /**
   * @return the existing or new "TabText" property.
   */
  private Property getTabTextProperty(final XmlObjectInfo widget) throws Exception {
    Property property = (Property) widget.getArbitraryValue(this);
    if (property == null) {
      final DocumentElement headerElement = getHeaderElement(widget);
      if (headerElement.getTagLocal().equals("header")) {
        property = new XmlProperty(widget, "TabText", StringPropertyEditor.INSTANCE) {
          @Override
          public boolean isModified() throws Exception {
            return getValue() != UNKNOWN_VALUE;
          }

          @Override
          public Object getValue() throws Exception {
            return headerElement.getTextNode().getText();
          }

          @Override
          protected void setValueEx(Object value) throws Exception {
            if (value instanceof String) {
              headerElement.setText((String) value, false);
            }
          }
        };
        property.setCategory(PropertyCategory.system(7));
      }
    }
    return property;
  }
View Full Code Here

            "}");
    frame.refresh();
    WidgetInfo hyperlink = frame.getChildrenWidgets().get(0);
    // check "text" property
    {
      Property textProperty = hyperlink.getPropertyByTitle("text");
      assertTrue(textProperty.isModified());
      assertEquals("text", textProperty.getValue());
    }
    // check "targetHistoryToken" property
    {
      Property tokenProperty = hyperlink.getPropertyByTitle("targetHistoryToken");
      assertTrue(tokenProperty.isModified());
      assertEquals("token", tokenProperty.getValue());
    }
  }
View Full Code Here

            "}");
    frame.refresh();
    WidgetInfo hyperlink = frame.getChildrenWidgets().get(0);
    // check "text" property
    {
      Property textProperty = hyperlink.getPropertyByTitle("text");
      assertTrue(textProperty.isModified());
      assertEquals("text", textProperty.getValue());
    }
    // check "targetHistoryToken" property
    {
      Property tokenProperty = hyperlink.getPropertyByTitle("targetHistoryToken");
      assertTrue(tokenProperty.isModified());
      assertEquals("token", tokenProperty.getValue());
    }
  }
View Full Code Here

            "}");
    frame.refresh();
    StackPanelInfo panel = (StackPanelInfo) frame.getChildrenWidgets().get(0);
    WidgetInfo button = panel.getChildrenWidgets().get(0);
    //
    Property textProperty = button.getPropertyByTitle("StackText");
    assertNotNull(textProperty);
    assertTrue(textProperty.getCategory().isSystem());
    assertEquals("Some text", textProperty.getValue());
    textProperty.setValue("New text");
    assertEditor(
        "public class Test implements EntryPoint {",
        "  public void onModuleLoad() {",
        "    RootPanel rootPanel = RootPanel.get();",
        "    StackPanel panel = new StackPanel();",
View Full Code Here

  /**
   * @return <code>true</code> if widget fill cell horizontally.
   */
  private boolean hasWidthFill() throws Exception {
    Property widthProperty = PropertyUtils.getByPath(m_component, "Size/width");
    Object width = widthProperty.getValue();
    return "100%".equals(width);
  }
View Full Code Here

  /**
   * @return <code>true</code> if widget fill cell vertically.
   */
  private boolean hasHeightFill() throws Exception {
    Property heightProperty = PropertyUtils.getByPath(m_component, "Size/height");
    Object height = heightProperty.getValue();
    return "100%".equals(height);
  }
View Full Code Here

  private void ensureTitleForChildPanels() {
    addBroadcastListener(new JavaEventListener() {
      @Override
      public void addAfter(JavaInfo parent, JavaInfo child) throws Exception {
        if (isActiveOnContainer(parent)) {
          Property titleProperty = child.getPropertyByTitle("title");
          if (titleProperty != null && !titleProperty.isModified()) {
            titleProperty.setValue("New Panel");
          }
        }
      }
    });
  }
View Full Code Here

      ClassLoader classLoader = JavaInfoUtils.getClassLoader(this);
      Class<?> regionClass = classLoader.loadClass("com.gwtext.client.core.RegionPosition");
      region = ReflectionUtils.invokeMethod(regionClass, "getPosition(java.lang.String)", position);
    }
    // set "region" value
    Property property = PropertyUtils.getByPath(this, "region");
    property.setValue(region);
  }
View Full Code Here

  public void setHeight(double height) throws Exception {
    setSizePropertyValue("height", height);
  }

  private void setSizePropertyValue(String name, double value) throws Exception {
    Property property = getPropertyByTitle(name);
    if (value == -1) {
      property.setValue(Property.UNKNOWN_VALUE);
    } else {
      property.setValue(value);
    }
  }
View Full Code Here

TOP

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

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.