public class BasicLabelSamplePane extends Composite implements SamplePanel {
public BasicLabelSamplePane() {
VerticalPanel labels = new VerticalPanel();
BasicLabel label = createLabel("Simple", null);
labels.add(label);
labels.setCellHeight(label, "30px");
addGap(labels, "10px");
label = createLabel("Click Me", null);
label.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
DefaultNotifier.getInstance().showInfo("Click", "You see, you can even register click listeners on a BasicLabel", new SimpleCallback() {
public void handle() {
}
});
}
});
labels.add(label);
labels.setCellHeight(label, "30px");
addGap(labels, "10px");
label = createLabel("Icon Label", WidgetImages.Instance.get().icon_Printer().createImage());
labels.add(label);
labels.setCellHeight(label, "30px");
addGap(labels, "10px");
label = createLabel("Label Custom Width", WidgetImages.Instance.get().icon_Printer().createImage());
label.setWidth("250px");
labels.add(label);
labels.setCellHeight(label, "30px");
addGap(labels, "10px");
label = createLabel("Align Center", WidgetImages.Instance.get().icon_CubeGreen().createImage());
label.setWidth("250px");
label.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
labels.add(label);
labels.setCellHeight(label, "30px");
addGap(labels, "10px");
label = createLabel("Align Right", WidgetImages.Instance.get().icon_CubeGreen().createImage());
label.setWidth("250px");
label.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
labels.add(label);
labels.setCellHeight(label, "30px");
VerticalPanel main = new VerticalPanel();