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

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


        "      rootPanel.add(widget);",
        "    }",
        "  }",
        "}");
    refresh();
    WidgetInfo widget = getJavaInfoByName("widget");
    // decorations
    assertEquals(new Insets(2), widget.getMargins());
    assertEquals(new Insets(3), widget.getBorders());
    assertEquals(new Insets(4), widget.getPaddings());
    // set new size, tweak to take decorations into account
    widget.getSizeSupport().setSize(100, 50);
    assertEquals(new Dimension(100, 50), widget.getBounds().getSize());
    // source
    int clientWidth = 100 - (2 + 0 + 0) * 2;
    int clientHeight = 50 - (2 + 0 + 0) * 2;
    assertEditor(
        "public class Test implements EntryPoint {",
View Full Code Here


        "      rootPanel.add(widget);",
        "    }",
        "  }",
        "}");
    refresh();
    WidgetInfo widget = getJavaInfoByName("widget");
    // decorations
    assertEquals(new Insets(0), widget.getMargins());
    assertEquals(new Insets(3), widget.getBorders());
    assertEquals(new Insets(1, 8, 1, 8), widget.getPaddings());
    // set new size, tweak to take decorations into account
    widget.getSizeSupport().setSize(100, 50);
    assertEquals(new Dimension(100, 50), widget.getBounds().getSize());
    // source
    int clientWidth = 100 - (0 + 0 + 0) * 2;
    int clientHeight = 50 - (0 + 0 + 0) * 2;
    assertEditor(
        "public class Test implements EntryPoint {",
View Full Code Here

            "    RootPanel rootPanel = RootPanel.get();",
            "  }",
            "}");
    refresh();
    //
    final WidgetInfo widget = createJavaInfo("com.google.gwt.user.client.ui.TextBox");
    ExecutionUtils.run(frame, new RunnableEx() {
      public void run() throws Exception {
        flowContainer_CREATE(frame, widget, null);
        widget.getSizeSupport().setSize(100, 50);
      }
    });
    assertEditor(
        "public class Test implements EntryPoint {",
        "  public void onModuleLoad() {",
        "    RootPanel rootPanel = RootPanel.get();",
        "    {",
        "      TextBox textBox = new TextBox();",
        "      rootPanel.add(textBox);",
        "      textBox.setSize('100px', '50px');",
        "    }",
        "  }",
        "}");
    // no tweaks for decorations, so (bounds, in contrast to client) size is bigger than asked
    {
      int margin = 0;
      int border = 2;
      int padding = 1;
      assertEquals(100 + (margin + border + padding) * 2, widget.getBounds().width);
      assertEquals(50 + (margin + border + padding) * 2, widget.getBounds().height);
    }
  }
View Full Code Here

   * @return the "Size" property for standard RootPanel/Button test case.
   */
  private Property getSizeProperty(String sizeString) throws Exception {
    parseSource("test.client", "Test.java", getSizeSource(sizeString));
    refresh();
    WidgetInfo button = getJavaInfoByName("button");
    return button.getPropertyByTitle("Size");
  }
View Full Code Here

            "  protected Widget createWidget() {",
            "    return new Button();",
            "  }",
            "}");
    panel.refresh();
    WidgetInfo button = panel.getWidget();
    //
    button.getSizeSupport().setSize("200px", "100px");
    assertEditor(
        "public class Test extends LazyPanel {",
        "  public Test() {",
        "  }",
        "  protected Widget createWidget() {",
View Full Code Here

        "    DateLabel dateLabel = new DateLabel();",
        "    add(dateLabel);",
        "  }",
        "}");
    refresh();
    WidgetInfo dateLabel = getJavaInfoByName("dateLabel");
    // has some date in text
    assertEquals("12/31/2010", getValueLabelText(dateLabel));
  }
View Full Code Here

            "      add(button_2, 'ABCABC', false);",
            "    }",
            "  }",
            "}");
    panel.refresh();
    WidgetInfo button_1 = getJavaInfoByName("button_1");
    WidgetInfo button_2 = getJavaInfoByName("button_2");
    //
    List<WidgetHandle> handles = panel.getWidgetHandles();
    assertThat(handles).hasSize(2);
    WidgetHandle handle_1 = handles.get(0);
    WidgetHandle handle_2 = handles.get(1);
View Full Code Here

            "      add(button_2, 'ABCABC', false);",
            "    }",
            "  }",
            "}");
    panel.refresh();
    WidgetInfo button_1 = getJavaInfoByName("button_1");
    WidgetInfo button_2 = getJavaInfoByName("button_2");
    assertTrue(isVisible(panel, button_1));
    assertFalse(isVisible(panel, button_2));
    //
    panel.getWidgetHandles().get(1).show();
    assertFalse(isVisible(panel, button_1));
View Full Code Here

            "      add(button, 'My widget', false);",
            "    }",
            "  }",
            "}");
    panel.refresh();
    WidgetInfo button = getJavaInfoByName("button");
    //
    Property property = button.getPropertyByTitle("TabText");
    assertNotNull(property);
    assertTrue(property.getCategory().isSystem());
    assertEquals("My widget", property.getValue());
    // test that "TabText" is not considered as "text" property of "button"
    assertEquals("button", ObjectsLabelProvider.INSTANCE.getText(button));
View Full Code Here

            "    super(1.5, Unit.EM);",
            "  }",
            "}");
    panel.refresh();
    //
    WidgetInfo newButton = createButton();
    panel.command_CREATE2(newButton, null);
    assertEditor(
        "public class Test extends TabLayoutPanel {",
        "  public Test() {",
        "    super(1.5, Unit.EM);",
View Full Code Here

TOP

Related Classes of com.google.gdt.eclipse.designer.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.