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

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


        "  </g:FlowPanel>",
        "</ui:UiBinder>");
    refresh();
    WidgetInfo button = getObjectByName("button");
    //
    Property property = PropertyUtils.getByPath(button, "Events/onClick");
    assertFalse(property.isModified());
    // do open
    openListener(property);
    // XML and Java updated
    assertXML(
        "// filler filler filler filler filler",
        "// filler filler filler filler filler",
        "<ui:UiBinder>",
        "  <g:FlowPanel>",
        "    <g:Button ui:field='existing'/>",
        "    <g:Button wbp:name='button' ui:field='button'/>",
        "  </g:FlowPanel>",
        "</ui:UiBinder>");
    assertJava(decorateTestClassLines(
        "  @UiField Button existing;",
        "  @UiField Button button;",
        "// filler filler filler filler filler",
        "// filler filler filler filler filler",
        "  @UiHandler('existing')",
        "  void onExistingClick(ClickEvent event) {",
        "  }",
        "  @UiHandler('button')",
        "  void onButtonClick(ClickEvent event) {",
        "  }"));
    assertTrue(property.isModified());
    assertEquals("onButtonClick", getPropertyText(property));
    // Java editor opened
    {
      IEditorPart activeEditor = DesignerPlugin.getActiveEditor();
      assertThat(activeEditor).isInstanceOf(CompilationUnitEditor.class);
View Full Code Here


        "  </g:FlowPanel>",
        "</ui:UiBinder>");
    refresh();
    WidgetInfo button = getObjectByName("button");
    //
    Property property = PropertyUtils.getByPath(button, "Events/onClick");
    assertFalse(property.isModified());
    // try to remove, nothing happens
    property.setValue(Property.UNKNOWN_VALUE);
  }
View Full Code Here

        "  </g:FlowPanel>",
        "</ui:UiBinder>");
    refresh();
    WidgetInfo button = getObjectByName("button");
    //
    final Property property = PropertyUtils.getByPath(button, "Events/onClick");
    assertTrue(property.isModified());
    assertEquals("someMethod", getPropertyText(property));
    // do remove
    new UiContext().executeAndCheck(new UIRunnable() {
      public void run(UiContext context) throws Exception {
        property.setValue(Property.UNKNOWN_VALUE);
      }
    }, new UIRunnable() {
      public void run(UiContext context) throws Exception {
        context.useShell("Confirm");
        context.clickButton("OK");
      }
    });
    // no handler now
    assertFalse(property.isModified());
    assertJava(decorateTestClassLines(
        "// filler filler filler filler filler",
        "// filler filler filler filler filler",
        "  @UiField Button button;"));
  }
View Full Code Here

      //
      if (m_autobind && m_parentBinding instanceof FormBindingInfo) {
        FormBindingInfo parentBinding = (FormBindingInfo) m_parentBinding;
        if (parentBinding.isAutobind() && !deleteAll) {
          WidgetObserveInfo field = (WidgetObserveInfo) m_target;
          Property property = field.getJavaInfo().getPropertyByTitle("name");
          if (property != null) {
            property.setValue(Property.UNKNOWN_VALUE);
          }
        }
      }
    }
  }
View Full Code Here

  //
  // getText()
  //
  ////////////////////////////////////////////////////////////////////////////
  public void test_getText_defaultValue() throws Exception {
    Property property = getStyleProperty(null, ArrayUtils.EMPTY_STRING_ARRAY);
    assertEquals("", getPropertyText(property));
  }
View Full Code Here

  ////////////////////////////////////////////////////////////////////////////
  /**
   * No style declaration, so no semantic sub-properties.
   */
  public void test_semantics_noStyle() throws Exception {
    Property styleProperty = getStyleProperty(null, ArrayUtils.EMPTY_STRING_ARRAY);
    assertThat(PropertyUtils.getChildren(styleProperty)).isEmpty();
  }
View Full Code Here

  /**
   * Test for {@link StyleSimpleValuePropertyEditor}.
   */
  public void test_semantics_simpleValue() throws Exception {
    // prepare property
    final Property property;
    {
      Property styleProperty =
          getStyleProperty("myPanel", new String[]{".myPanel {", "  color: red;", "}"});
      property = PropertyUtils.getByPath(styleProperty, "color");
    }
    // initial state
    assertEquals(true, property.isModified());
View Full Code Here

            "  <ui:with field='resources' type='test.client.MyResources'/>",
            "  <g:FlowPanel styleName='{resources.style.one}'/>",
            "</ui:UiBinder>");
    refresh();
    //
    Property styleProperty = panel.getPropertyByTitle("styleName");
    Property colorProperty = PropertyUtils.getByPath(styleProperty, "color");
    // initial state
    assertEquals("red", getPropertyText(colorProperty));
    assertEquals("red", getComputedStyleAttribute(panel, "color"));
    // set new value
    colorProperty.setValue("lime");
    assertEquals("lime", getPropertyText(colorProperty));
    assertEquals("lime", getComputedStyleAttribute(panel, "color"));
  }
View Full Code Here

        "  </g:TabPanel>",
        "</ui:UiBinder>");
    refresh();
    WidgetInfo button = getObjectByName("button");
    //
    Property property = button.getPropertyByTitle("TabText");
    assertNotNull(property);
    assertTrue(property.getCategory().isSystem());
    assertTrue(property.isModified());
    assertEquals("AAA", property.getValue());
    // set new value
    property.setValue("AA");
    assertXML(
        "// filler filler filler filler filler",
        "<ui:UiBinder>",
        "  <g:TabPanel>",
        "    <g:Tab text='AA'>",
        "      <g:Button wbp:name='button'/>",
        "    </g:Tab>",
        "  </g:TabPanel>",
        "</ui:UiBinder>");
    assertTrue(property.isModified());
    assertEquals("AA", property.getValue());
    // remove value, ignored
    property.setValue(Property.UNKNOWN_VALUE);
    assertXML(
        "// filler filler filler filler filler",
        "<ui:UiBinder>",
        "  <g:TabPanel>",
        "    <g:Tab text='AA'>",
        "      <g:Button wbp:name='button'/>",
        "    </g:Tab>",
        "  </g:TabPanel>",
        "</ui:UiBinder>");
    assertTrue(property.isModified());
    assertEquals("AA", property.getValue());
  }
View Full Code Here

            "  <ui:with field='resources' type='test.client.MyResources'/>",
            "  <g:FlowPanel styleName='{resources.style.one}'/>",
            "</ui:UiBinder>");
    refresh();
    //
    Property styleProperty = panel.getPropertyByTitle("styleName");
    Property colorProperty = PropertyUtils.getByPath(styleProperty, "color");
    // initial state
    assertEquals("red", getPropertyText(colorProperty));
    assertEquals("red", getComputedStyleAttribute(panel, "color"));
    // set new value
    colorProperty.setValue("lime");
    assertEquals("lime", getPropertyText(colorProperty));
    assertEquals("lime", getComputedStyleAttribute(panel, "color"));
  }
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.