本文整理汇总了Java中com.google.gwt.user.client.ui.Label.setHorizontalAlignment方法的典型用法代码示例。如果您正苦于以下问题:Java Label.setHorizontalAlignment方法的具体用法?Java Label.setHorizontalAlignment怎么用?Java Label.setHorizontalAlignment使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.user.client.ui.Label
的用法示例。
在下文中一共展示了Label.setHorizontalAlignment方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: TitleBar
import com.google.gwt.user.client.ui.Label; //导入方法依赖的package包/类
TitleBar() {
title = new Label();
title.setStylePrimaryName("ode-SimpleMockFormTitle");
title.setHorizontalAlignment(Label.ALIGN_LEFT);
bar = new AbsolutePanel();
bar.add(title, 12, 4);
initWidget(bar);
setStylePrimaryName("ode-SimpleMockFormTitleBar");
setSize("100%", HEIGHT + "px");
}
示例2: SimplePaletteItem
import com.google.gwt.user.client.ui.Label; //导入方法依赖的package包/类
/**
* Creates a new palette item.
*
* @param scd component descriptor for palette item
* @param dropTargetProvider provider of targets that palette items can be dropped on
*/
public SimplePaletteItem(SimpleComponentDescriptor scd, DropTargetProvider dropTargetProvider) {
this.dropTargetProvider = dropTargetProvider;
this.scd = scd;
componentPrototype = null;
// Initialize palette item UI
HorizontalPanel panel = new HorizontalPanel();
panel.setStylePrimaryName("ode-SimplePaletteItem");
Image image = scd.getImage();
image.setStylePrimaryName("ode-SimplePaletteItem-icon");
panel.add(image);
panel.setCellHorizontalAlignment(image, HorizontalPanel.ALIGN_LEFT);
panel.setCellWidth(image, "30px");
Label label = new Label(ComponentsTranslation.getComponentName(scd.getName()));
label.setHorizontalAlignment(Label.ALIGN_LEFT);
label.addStyleName("ode-SimplePaletteItem-caption");
panel.add(label);
HorizontalPanel optPanel = new HorizontalPanel();
ComponentHelpWidget helpImage = new ComponentHelpWidget(scd);
helpImage.addStyleName("ode-SimplePalleteItem-button");
optPanel.add(helpImage);
optPanel.setCellHorizontalAlignment(helpImage, HorizontalPanel.ALIGN_LEFT);
if (scd.getExternal()) {
ComponentRemoveWidget deleteImage = new ComponentRemoveWidget(scd);
deleteImage.addStyleName("ode-SimplePalleteItem-button");
optPanel.add(deleteImage);
optPanel.setCellHorizontalAlignment(deleteImage, HorizontalPanel.ALIGN_RIGHT);
}
panel.add(optPanel);
panel.setCellHorizontalAlignment(optPanel, HorizontalPanel.ALIGN_RIGHT);
panel.setWidth("100%");
add(panel);
setWidth("100%");
addHandlers();
}