當前位置: 首頁>>代碼示例>>Java>>正文


Java Button.setWidth方法代碼示例

本文整理匯總了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);
			}
		}

	}
}
 
開發者ID:kuzavas,項目名稱:ephesoft,代碼行數:30,代碼來源:ReviewValidatePanel.java

示例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;
}
 
開發者ID:palantir,項目名稱:gerrit-ci,代碼行數:29,代碼來源:ProjectConfigurationScreen.java

示例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;
}
 
開發者ID:palantir,項目名稱:gerrit-ci,代碼行數:40,代碼來源:ConfigurationScreen.java


注:本文中的com.google.gwt.user.client.ui.Button.setWidth方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。