当前位置: 首页>>代码示例>>Java>>正文


Java Button.setVisible方法代码示例

本文整理汇总了Java中com.google.gwt.user.client.ui.Button.setVisible方法的典型用法代码示例。如果您正苦于以下问题:Java Button.setVisible方法的具体用法?Java Button.setVisible怎么用?Java Button.setVisible使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.gwt.user.client.ui.Button的用法示例。


在下文中一共展示了Button.setVisible方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createUI

import com.google.gwt.user.client.ui.Button; //导入方法依赖的package包/类
/**
 * The UI consists of a vertical panel that holds a drop-down list box,
 *   a Horizontal panel that holds the templates list (cell list) plus
 *   the selected template. This is inserted in the Wizard dialog.
 *
 * @param templates should never be null
 * @return the main panel for Wizard dialog.
 */
VerticalPanel createUI(final ArrayList<TemplateInfo> templates) {
  VerticalPanel panel = new VerticalPanel();
  panel.setStylePrimaryName("gwt-SimplePanel");
  panel.setVerticalAlignment(VerticalPanel.ALIGN_MIDDLE);
  panel.setHorizontalAlignment(VerticalPanel.ALIGN_CENTER);

  templatePanel = new HorizontalPanel();
  templatePanel.add(makeTemplateSelector(templates));
  if (templates.size() > 0)
    templatePanel.add(new TemplateWidget(templates.get(0), templateHostUrl));

  templatesMenu = makeTemplatesMenu();

  HorizontalPanel hPanel = new HorizontalPanel();
  hPanel.add(templatesMenu);
  removeButton = new Button("Remove this repository", new ClickHandler() {
      @Override
      public void onClick(ClickEvent arg0) {
        removeCurrentlySelectedRepository();
      }
    });
  removeButton.setVisible(false);
  hPanel.add(removeButton);
  panel.add(hPanel);
  panel.add(templatePanel);
  return panel;
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:36,代码来源:TemplateUploadWizard.java

示例2: 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

示例3: render

import com.google.gwt.user.client.ui.Button; //导入方法依赖的package包/类
@Override
public void render(final RendererCellReference cell, final String text, final Button button) {
    final boolean buttonEnable = isButtonEnable(cell.getElement().getClassName());
    if (text != null) {
        button.setHTML(text);
    }
    applystyles(button, buttonEnable);
    // this is to allow the button to disappear, if the text is null
    button.setVisible(text != null);
    button.getElement().setId(UIComponentIdProvider.ROLLOUT_ACTION_ID + "." + cell.getColumnIndex());
    button.setEnabled(buttonEnable);
}
 
开发者ID:eclipse,项目名称:hawkbit,代码行数:13,代码来源:HtmlButtonRenderer.java

示例4: render

import com.google.gwt.user.client.ui.Button; //导入方法依赖的package包/类
@Override
public void render(final RendererCellReference cell, final FontIconData iconMetadata, final Button button) {
    if (iconMetadata.getFontIconHtml() != null) {
        button.setHTML(iconMetadata.getFontIconHtml());
    }
    applyStyles(button, iconMetadata.isDisabled(), iconMetadata.getStyle());
    button.getElement().setId(iconMetadata.getId());
    button.getElement().setTitle(iconMetadata.getTitle());
    button.setEnabled(!iconMetadata.isDisabled());
    // this is to allow the button to disappear, if the text is null
    button.setVisible(iconMetadata.getFontIconHtml() != null);
}
 
开发者ID:eclipse,项目名称:hawkbit,代码行数:13,代码来源:GridButtonRenderer.java

示例5: a2b

import com.google.gwt.user.client.ui.Button; //导入方法依赖的package包/类
private static void a2b(NativeMap<ActionInfo> actions, String a, Button b) {
  if (actions.containsKey(a)) {
    b.setVisible(true);
    ActionInfo actionInfo = actions.get(a);
    b.setTitle(actionInfo.title());
    b.setEnabled(actionInfo.enabled());
  }
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:9,代码来源:Actions.java

示例6: setEnabled

import com.google.gwt.user.client.ui.Button; //导入方法依赖的package包/类
public void setEnabled(int button, boolean enabled) {
	Button b = (Button)iButtons.getWidget(button);
	b.setVisible(enabled); b.setEnabled(enabled);
	for (UniTimeHeaderPanel clone: iClones)
		clone.setEnabled(button, enabled);
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:7,代码来源:UniTimeHeaderPanel.java

示例7: initReportSection

import com.google.gwt.user.client.ui.Button; //导入方法依赖的package包/类
/**
 * Helper method called by constructor to initialize the report section
 */
private void initReportSection() {
  final HTML reportPrompt = new HTML();
  reportPrompt.setHTML(MESSAGES.galleryReportPrompt());
  reportPrompt.addStyleName("primary-prompt");
  final TextArea reportText = new TextArea();
  reportText.addStyleName("action-textarea");
  final Button submitReport = new Button(MESSAGES.galleryReportButton());
  submitReport.addStyleName("action-button");
  final Label descriptionError = new Label();
  descriptionError.setText("Description required");
  descriptionError.setStyleName("ode-ErrorMessage");
  descriptionError.setVisible(false);
  appReportPanel.add(reportPrompt);
  appReportPanel.add(descriptionError);
  appReportPanel.add(reportText);
  appReportPanel.add(submitReport);

  final OdeAsyncCallback<Boolean> isReportdByUserCallback = new OdeAsyncCallback<Boolean>(
      // failure message
      MESSAGES.galleryError()) {
        @Override
        public void onSuccess(Boolean isAlreadyReported) {
          if(isAlreadyReported) { //already reported, cannot report again
            reportPrompt.setHTML(MESSAGES.galleryAlreadyReportedPrompt());
            reportText.setVisible(false);
            submitReport.setVisible(false);
            submitReport.setEnabled(false);
          } else {
            submitReport.addClickHandler(new ClickHandler() {
              public void onClick(ClickEvent event) {
                final OdeAsyncCallback<Long> reportClickCallback = new OdeAsyncCallback<Long>(
                    // failure message
                    MESSAGES.galleryError()) {
                      @Override
                      public void onSuccess(Long id) {
                        reportPrompt.setHTML(MESSAGES.galleryReportCompletionPrompt());
                        reportText.setVisible(false);
                        submitReport.setVisible(false);
                        submitReport.setEnabled(false);
                      }
                  };
                if (!reportText.getText().trim().isEmpty()){
                  Ode.getInstance().getGalleryService().addAppReport(app, reportText.getText(),
                    reportClickCallback);
                  descriptionError.setVisible(false);
                } else {
                  descriptionError.setVisible(true);
                }
              }
            });
          }
        }
    };
  Ode.getInstance().getGalleryService().isReportedByUser(app.getGalleryAppId(),
      isReportdByUserCallback);
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:60,代码来源:GalleryPage.java


注:本文中的com.google.gwt.user.client.ui.Button.setVisible方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。