本文整理汇总了Java中com.google.gwt.user.client.ui.Button.setWidth方法的典型用法代码示例。如果您正苦于以下问题:Java Button.setWidth方法的具体用法?Java Button.setWidth怎么用?Java Button.setWidth使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.user.client.ui.Button
的用法示例。
在下文中一共展示了Button.setWidth方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setButtonsForUrls
import com.google.gwt.user.client.ui.Button; //导入方法依赖的package包/类
public void setButtonsForUrls() {
urlButtonPanel.clear();
urlAndShortcutMap = presenter.batchDTO.getUrlAndShortcutMap();
urlAndTitleMap = presenter.batchDTO.getUrlAndTitleMap();
if (null != urlAndShortcutMap && !urlAndShortcutMap.isEmpty()) {
Set<String> urlList = urlAndShortcutMap.keySet();
for (final String url : urlList) {
if (urlAndShortcutMap.get(url) != null && !urlAndShortcutMap.get(url).isEmpty()) {
String buttonName = LocaleDictionary.get().getConstantValue(urlAndApplicationMap.get(url));
Button button = new Button(buttonName, new ClickHandler() {
@Override
public void onClick(ClickEvent arg0) {
presenter.showExternalAppForHtmlPattern(urlAndShortcutMap.get(url), urlAndTitleMap.get(url));
}
});
button.setWidth("55px");
button.setVisible(true);
String title = url.substring(url.indexOf('('), url.length());
button.setTitle(title);
urlButtonPanel.setSpacing(5);
urlButtonPanel.add(button);
}
}
}
}
示例2: alertWidget
import com.google.gwt.user.client.ui.Button; //导入方法依赖的package包/类
public static DialogBox alertWidget(final String header, final String content) {
final DialogBox dialogBox = new DialogBox();
final VerticalPanel verticalPanel = new VerticalPanel();
final Label emptyLabel = new Label("");
emptyLabel.setSize("auto", "25px");
dialogBox.setText(header);
verticalPanel.add(emptyLabel);
verticalPanel.add(new Label(content));
verticalPanel.add(emptyLabel);
final Button buttonClose = new Button("Close", new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
dialogBox.hide();
}
});
buttonClose.setWidth("100px");
verticalPanel.add(buttonClose);
verticalPanel.setCellHorizontalAlignment(buttonClose, HasAlignment.ALIGN_CENTER);
dialogBox.add(verticalPanel);
dialogBox.setWidth("400px");
return dialogBox;
}
示例3: alertWidget
import com.google.gwt.user.client.ui.Button; //导入方法依赖的package包/类
/**
* Creates a DialogBox object with the specified header and content and
* returns it to be displayed.
*
* @param header
* Title for the alert dialog
* @param content
* Inner message content to display
* @return A DialogBox object configured with the specified strings
*/
public static DialogBox alertWidget(final String header,
final String content) {
final DialogBox dialogBox = new DialogBox();
final VerticalPanel verticalPanel = new VerticalPanel();
final Label emptyLabel = new Label("");
emptyLabel.setSize("auto", "25px");
dialogBox.setText(header);
verticalPanel.add(emptyLabel);
verticalPanel.add(new Label(content));
verticalPanel.add(emptyLabel);
final Button buttonClose = new Button("Close", new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
dialogBox.hide();
}
});
buttonClose.setWidth("100px");
verticalPanel.add(buttonClose);
verticalPanel.setCellHorizontalAlignment(buttonClose,
HasAlignment.ALIGN_CENTER);
dialogBox.add(verticalPanel);
return dialogBox;
}