use of com.google.gwt.user.client.ui.FlowPanel in project che by eclipse.
the class ActionButton method renderImage.
/** Redraw icon. */
private void renderImage() {
panel.clear();
if (presentation.getImageResource() != null) {
Image img = new Image(presentation.getImageResource());
img.setStyleName(toolbarResources.toolbar().iconButtonIcon());
panel.add(img);
} else if (presentation.getSVGResource() != null) {
SVGImage image = new SVGImage(presentation.getSVGResource());
image.getElement().setAttribute("class", toolbarResources.toolbar().iconButtonIcon());
panel.add(image);
} else if (presentation.getHTMLResource() != null) {
FlowPanel icon = new FlowPanel();
icon.setStyleName(toolbarResources.toolbar().iconButtonIcon());
FlowPanel inner = new FlowPanel();
inner.setStyleName(toolbarResources.toolbar().iconButtonIconInner());
inner.getElement().setInnerHTML(presentation.getHTMLResource());
icon.add(inner);
panel.add(inner);
}
}
use of com.google.gwt.user.client.ui.FlowPanel in project gwt-test-utils by gwt-test-utils.
the class ComplexPanelTest method remove.
@Test
public void remove() {
// Given
ComplexPanel panel = new FlowPanel();
Button b = new Button();
panel.add(b);
// Preconditions
assertThat(panel.getWidgetCount()).isEqualTo(1);
assertThat(b.getParent()).isEqualTo(panel);
// When
panel.remove(b);
// Then
assertThat(panel.getWidgetCount()).isEqualTo(0);
assertThat(b.getParent()).isNull();
}
use of com.google.gwt.user.client.ui.FlowPanel in project gwt-test-utils by gwt-test-utils.
the class ComplexPanelTest method remove_ByIndex.
@Test
public void remove_ByIndex() {
// Given
ComplexPanel panel = new FlowPanel();
Button b0 = new Button();
panel.add(b0);
Button b1 = new Button();
panel.add(b1);
// When
panel.remove(1);
// Then
assertThat(panel.getWidgetCount()).isEqualTo(1);
assertThat(panel.getWidget(0)).isEqualTo(b0);
assertThat(b0.getParent()).isEqualTo(panel);
assertThat(b1.getParent()).isNull();
}
use of com.google.gwt.user.client.ui.FlowPanel in project gwt-test-utils by gwt-test-utils.
the class ComplexPanelTest method add.
@Test
public void add() {
// Given
ComplexPanel panel = new FlowPanel();
RootPanel.get().add(panel);
assertThat(panel.isAttached()).isTrue();
assertThat(panel.getWidgetCount()).isEqualTo(0);
Button b1 = new Button();
assertThat(b1.isAttached()).isFalse();
assertThat(b1.getParent()).isNull();
// When
panel.add(b1);
// Then
assertThat(b1.isAttached()).isTrue();
assertThat(b1.getParent()).isEqualTo(panel);
assertThat(panel.getWidgetCount()).isEqualTo(1);
assertThat(panel.getWidget(0)).isEqualTo(b1);
assertThat(panel.getWidgetIndex(b1)).isEqualTo(0);
}
use of com.google.gwt.user.client.ui.FlowPanel in project gwt-test-utils by gwt-test-utils.
the class ComplexPanelTest method title.
@Test
public void title() {
// Given
ComplexPanel panel = new FlowPanel();
// When
panel.setTitle("title");
// Then
assertThat(panel.getTitle()).isEqualTo("title");
}
Aggregations