本文整理汇总了Java中com.google.gwt.user.client.ui.Label.setWidth方法的典型用法代码示例。如果您正苦于以下问题:Java Label.setWidth方法的具体用法?Java Label.setWidth怎么用?Java Label.setWidth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.user.client.ui.Label
的用法示例。
在下文中一共展示了Label.setWidth方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initGridHead
import com.google.gwt.user.client.ui.Label; //导入方法依赖的package包/类
protected void initGridHead(int size){
this.setSpacing(3);
paramsGrid = new Grid(size, 3);
paramsGrid.setStyleName("gridstyle");
paramsGrid.setBorderWidth(1);
paramsGrid.setWidth("250px");
Label nameLabel = new Label(Constants.studioUIMsg.parameter());
nameLabel.setWidth("65px");
paramsGrid.setWidget(0, 0, nameLabel);
Label typeLabel = new Label(Constants.studioUIMsg.type());
typeLabel.setWidth("40px");
paramsGrid.setWidget(0, 1, typeLabel);
Label valueLabel = new Label(Constants.studioUIMsg.value());
paramsGrid.setWidget(0, 2, valueLabel);
paramsGrid.setVisible(false);
}
示例2: ReportWidgets
import com.google.gwt.user.client.ui.Label; //导入方法依赖的package包/类
/**
* Constructor of ReportWidgets
* @param report GalleryAppReport
*/
private ReportWidgets(final GalleryAppReport report) {
reportTextLabel = new Label(report.getReportText());
reportTextLabel.addStyleName("ode-ProjectNameLabel");
reportTextLabel.setWordWrap(true);
reportTextLabel.setWidth("200px");
appLabel = new Label(report.getApp().getTitle());
appLabel.addStyleName("primary-link");
DateTimeFormat dateTimeFormat = DateTimeFormat.getMediumDateTimeFormat();
Date dateCreated = new Date(report.getTimeStamp());
dateCreatedLabel = new Label(dateTimeFormat.format(dateCreated));
appAuthorlabel = new Label(report.getOffender().getUserName());
appAuthorlabel.addStyleName("primary-link");
reporterLabel = new Label(report.getReporter().getUserName());
reporterLabel.addStyleName("primary-link");
sendEmailButton = new Button(MESSAGES.buttonSendEmail());
deactiveAppButton = new Button(MESSAGES.labelDeactivateApp());
markAsResolvedButton = new Button(MESSAGES.labelmarkAsResolved());
seeAllActions = new Button(MESSAGES.labelSeeAllActions());
}
示例3: createNoProjectsDialog
import com.google.gwt.user.client.ui.Label; //导入方法依赖的package包/类
/**
* Creates, visually centers, and optionally displays the dialog box
* that informs the user how to start learning about using App Inventor
* or create a new project.
* @param showDialog Convenience variable to show the created DialogBox.
* @return The created and optionally displayed Dialog box.
*/
public DialogBox createNoProjectsDialog(boolean showDialog) {
// Create the UI elements of the DialogBox
final DialogBox dialogBox = new DialogBox(true, false); //DialogBox(autohide, modal)
dialogBox.setStylePrimaryName("ode-DialogBox");
dialogBox.setText(MESSAGES.createNoProjectsDialogText());
Grid mainGrid = new Grid(2, 2);
mainGrid.getCellFormatter().setAlignment(0,
0,
HasHorizontalAlignment.ALIGN_CENTER,
HasVerticalAlignment.ALIGN_MIDDLE);
mainGrid.getCellFormatter().setAlignment(0,
1,
HasHorizontalAlignment.ALIGN_CENTER,
HasVerticalAlignment.ALIGN_MIDDLE);
mainGrid.getCellFormatter().setAlignment(1,
1,
HasHorizontalAlignment.ALIGN_RIGHT,
HasVerticalAlignment.ALIGN_MIDDLE);
Image dialogImage = new Image(Ode.getImageBundle().androidGreenSmall());
Grid messageGrid = new Grid(2, 1);
messageGrid.getCellFormatter().setAlignment(0,
0,
HasHorizontalAlignment.ALIGN_JUSTIFY,
HasVerticalAlignment.ALIGN_MIDDLE);
messageGrid.getCellFormatter().setAlignment(1,
0,
HasHorizontalAlignment.ALIGN_LEFT,
HasVerticalAlignment.ALIGN_MIDDLE);
Label messageChunk1 = new HTML(MESSAGES.createNoProjectsDialogMessage1());
messageChunk1.setWidth("23em");
Label messageChunk2 = new Label(MESSAGES.createNoprojectsDialogMessage2());
// Add the elements to the grids and DialogBox.
messageGrid.setWidget(0, 0, messageChunk1);
messageGrid.setWidget(1, 0, messageChunk2);
mainGrid.setWidget(0, 0, dialogImage);
mainGrid.setWidget(0, 1, messageGrid);
dialogBox.setWidget(mainGrid);
dialogBox.center();
if (showDialog) {
dialogBox.show();
}
return dialogBox;
}