Package com.google.gdt.eclipse.designer.uibinder.model.widgets

Examples of com.google.gdt.eclipse.designer.uibinder.model.widgets.WidgetInfo


  @DisposeProjectAfter
  public void test_ClientBundle_changeCssFileExternally() throws Exception {
    prepare_ClientBundle_reloadCreate();
    // parse
    dontUseSharedGWTState();
    WidgetInfo panel =
        parse(
            "// filler filler filler filler filler",
            "// filler filler filler filler filler",
            "<ui:UiBinder>",
            "  <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"));
    // first change
    {
      // update CSS file
      setFileContentSrc(
          "test/client/MyResources.css",
          getSource(
              "/* filler filler filler filler filler */",
              "/* filler filler filler filler filler */",
              "/* filler filler filler filler filler */",
              ".one {",
              "  color: lime;",
              "}",
              ".two {}"));
      // refresh requested
      {
        EditorActivatedRequest request = new EditorActivatedRequest();
        panel.getBroadcast(EditorActivatedListener.class).invoke(request);
        assertFalse(request.isReparseRequested());
        assertTrue(request.isRefreshRequested());
        panel.refresh();
      }
      // has new value
      assertEquals("lime", getPropertyText(colorProperty));
      assertEquals("lime", getComputedStyleAttribute(panel, "color"));
    }
View Full Code Here


  //
  // Utils
  //
  ////////////////////////////////////////////////////////////////////////////
  private Property getStyleProperty(String styleName, String[] styleLines) throws Exception {
    WidgetInfo panel = parse(getStyleSourceLines(styleName, styleLines));
    refresh();
    return panel.getPropertyByTitle("styleName");
  }
View Full Code Here

        "<ui:UiBinder>",
        "  <g:FlowPanel>",
        "    <g:Button wbp:name='button'/>",
        "  </g:FlowPanel>",
        "</ui:UiBinder>");
    WidgetInfo button = getObjectByName("button");
    // "Class" is not generic property
    {
      IAction action = getExposeAction(button, "Class");
      assertNull(action);
    }
View Full Code Here

        "<ui:UiBinder>",
        "  <g:FlowPanel>",
        "    <t:MyButton wbp:name='button'/>",
        "  </g:FlowPanel>",
        "</ui:UiBinder>");
    WidgetInfo button = getObjectByName("button");
    // "myTextField" in not method property
    {
      IAction action = getExposeAction(button, "myTextField");
      assertNull(action);
    }
View Full Code Here

        "<ui:UiBinder>",
        "  <g:FlowPanel>",
        "    <g:Button wbp:name='button'/>",
        "  </g:FlowPanel>",
        "</ui:UiBinder>");
    WidgetInfo button = getObjectByName("button");
    // prepare action
    IAction action = getExposeAction(button, "enabled");
    // invalid identifier
    {
      String message = call_validate(action, "bad-name");
View Full Code Here

        "<ui:UiBinder>",
        "  <g:FlowPanel>",
        "    <g:Button wbp:name='button'/>",
        "  </g:FlowPanel>",
        "</ui:UiBinder>");
    WidgetInfo button = getObjectByName("button");
    //
    assertEquals(
        getSourceDQ(
            "...",
            "  public boolean getButtonEnabled() {",
View Full Code Here

        "<ui:UiBinder>",
        "  <g:FlowPanel>",
        "    <g:Button wbp:name='button'/>",
        "  </g:FlowPanel>",
        "</ui:UiBinder>");
    WidgetInfo button = getObjectByName("button");
    //
    assertEquals(
        getSourceDQ(
            "...",
            "  public boolean getButtonEnabled() {",
View Full Code Here

        "<ui:UiBinder>",
        "  <g:FlowPanel>",
        "    <g:Button wbp:name='button'/>",
        "  </g:FlowPanel>",
        "</ui:UiBinder>");
    WidgetInfo button = getObjectByName("button");
    //
    assertEquals(
        getSourceDQ(
            "...",
            "  public String getButtonText() {",
View Full Code Here

        "// filler filler filler filler filler",
        "// filler filler filler filler filler",
        "<g:FlowPanel>",
        "  <g:Button ui:field='button' text='AAA'>");
    refresh();
    WidgetInfo button = panel.getChildrenWidgets().get(0);
    // morph button
    MorphingTargetDescription morphingTarget = null;
    {
      for (MorphingTargetDescription target : button.getDescription().getMorphingTargets()) {
        if ("com.google.gwt.user.client.ui.Label".equals(target.getComponentClass().getName())) {
          morphingTarget = target;
          break;
        }
      }
View Full Code Here

        "<ui:UiBinder>",
        "  <g:FlowPanel>",
        "    <g:Button wbp:name='button'/>",
        "  </g:FlowPanel>",
        "</ui:UiBinder>");
    WidgetInfo button = getObjectByName("button");
    //
    assertEquals(
        getSourceDQ(
            "...",
            "  protected boolean getButtonEnabled() {",
View Full Code Here

TOP

Related Classes of com.google.gdt.eclipse.designer.uibinder.model.widgets.WidgetInfo

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.