229230231232233234235236237238239
"// filler filler filler", "public class Test extends Composite {", " public Test() {", " }", "}"); composite.refresh(); assertThat(composite.getProperties()).isEmpty(); } /** * If Composite has Widget, we show properties.
247248249250251252253254255256257
" Button button = new Button();", " initWidget(button);", " }", " }", "}"); composite.refresh(); // prepare properties Property[] properties = composite.getProperties(); assertThat(properties).isNotEmpty(); // usual properties {
274275276277278279280281282283284
" Button button = new Button();", " initWidget(button);", " }", " }", "}"); composite.refresh(); // add setWidth() composite.addMethodInvocation( "setWidth(java.lang.String)", StringConverter.INSTANCE.toJavaSource(null, "150px")); assertEditor(
290291292293294295296297298299300
" }", " setWidth('150px');", " }", "}"); // refresh composite.refresh(); assertNoErrors(composite); } /** * New method invocations should be added at the end of constructor.
441442443444445446447448449450451
" initWidget(button);", " button.setSize('200px', '100px');", " }", " }", "}"); composite.refresh(); // check Composite bounds Rectangle bounds = composite.getBounds(); assertEquals(new Rectangle(0, 0, 200, 100), bounds); }
461462463464465466467468469470471
" Button button = new Button();", " initWidget(button);", " }", " }", "}"); composite.refresh(); // set external size composite.getTopBoundsSupport().setSize(300, 150); composite.refresh(); // check Composite bounds Rectangle bounds = composite.getBounds();
464465466467468469470471472473474
" }", "}"); composite.refresh(); // set external size composite.getTopBoundsSupport().setSize(300, 150); composite.refresh(); // check Composite bounds Rectangle bounds = composite.getBounds(); assertEquals(new Rectangle(0, 0, 300, 150), bounds); }
492493494495496497498499500501502
" }", " }", " setSize('400px', '0px');", " }", "}"); composite.refresh(); assertNoErrors(composite); // check Composite bounds Rectangle bounds = composite.getBounds(); assertEquals(new Rectangle(0, 0, 400, 0), bounds); }
145146147148149150151152153154155
// check hierarchy assertHierarchy( "{this: com.google.gwt.user.client.ui.Composite} {this} {/initWidget(grid)/}", " {new: com.gwtext.client.widgets.grid.GridPanel} {local-unique: grid} {/new GridPanel()/ /initWidget(grid)/ /grid.setSize('300px', '200px')/}"); // refresh() composite.refresh(); assertNoErrors(composite); // check bounds { Rectangle compositeBounds = composite.getBounds(); assertThat(compositeBounds.width).isEqualTo(300);
180181182183184185186187188189190
" GridPanel grid = new GridPanel();", " flexTable.setWidget(0, 0, grid);", " }", " }", "}"); composite.refresh(); assertNoErrors(composite); } public void test_liveImage() throws Exception { RootPanelInfo frame =