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


Java Label.setText方法代码示例

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


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

示例1: GalleryAppBox

import com.google.gwt.user.client.ui.Label; //导入方法依赖的package包/类
/**
 * Creates new Gallery app box.
 */
private GalleryAppBox() {
  gContainer = new FlowPanel();
  final HorizontalPanel container = new HorizontalPanel();
  container.setWidth("100%");
  container.setSpacing(0);
  container.setHorizontalAlignment(HorizontalPanel.ALIGN_CENTER);
  HorizontalPanel panel = new HorizontalPanel();
  Image image = new Image();
  image.setResource(Ode.getImageBundle().waitingIcon());
  panel.add(image);
  Label label = new Label();
  label.setText(Ode.getMessages().defaultRpcMessage());
  panel.add(label);
  gContainer.add(panel);
  this.add(gContainer);
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:20,代码来源:GalleryAppBox.java

示例2: addProperty

import com.google.gwt.user.client.ui.Label; //导入方法依赖的package包/类
public void addProperty(Property p, int row) {
	grid.setWidget(row, 0, new Label(p.getName()));

	Label box = new Label();
	box.setText(p.getValue());
	grid.setWidget(row, 1, box);
	box.setStyleName("propetybox");
	properties.put(p, box);
}
 
开发者ID:ICT-BDA,项目名称:EasyML,代码行数:10,代码来源:PropertyTable.java

示例3: deleteRow

import com.google.gwt.user.client.ui.Label; //导入方法依赖的package包/类
public void deleteRow(int row){
	this.removeRow(row);
	for( int i = row; i < this.getRowCount() - 1; ++ i ){
		Label label = (Label)this.getWidget(i,0);
		label.setText(name + " " + i);
	}
	active();
}
 
开发者ID:ICT-BDA,项目名称:EasyML,代码行数:9,代码来源:SqlScriptFileConfigTable.java

示例4: addGalleryAppTab

import com.google.gwt.user.client.ui.Label; //导入方法依赖的package包/类
/**
 * Creates the GUI components for a regular app tab.
 * This method resides here because it needs access to global variables.
 * @param container: the FlowPanel that this app tab will reside.
 * @param content: the sub-panel that contains the actual app content.
 */
private void addGalleryAppTab(FlowPanel container, FlowPanel content, final String incomingUserId) {
  // Search specific
  generalTotalResultsLabel = new Label();
  container.add(generalTotalResultsLabel);

  final OdeAsyncCallback<GalleryAppListResult> byAuthorCallback = new OdeAsyncCallback<GalleryAppListResult>(
    // failure message
    MESSAGES.galleryError()) {
    @Override
    public void onSuccess(GalleryAppListResult appsResult) {
      refreshApps(appsResult,false);
    }
  };
  Ode.getInstance().getGalleryService().getDeveloperApps(userId,appCatalogCounter ,NUMAPPSTOSHOW, byAuthorCallback);
  container.add(content);

  buttonNext = new Label();
  buttonNext.setText(MESSAGES.galleryMoreApps());
  buttonNext.addStyleName("active");

  FlowPanel next = new FlowPanel();
  next.add(buttonNext);
  next.addStyleName("gallery-nav-next");
  container.add(next);
  buttonNext.addClickHandler(new ClickHandler() {
    //  @Override
    public void onClick(ClickEvent event) {
       if (!appCatalogExhausted) {
            // If the next page still has apps to retrieve, do it
            appCatalogCounter += NUMAPPSTOSHOW;
            Ode.getInstance().getGalleryService().getDeveloperApps(userId,appCatalogCounter ,NUMAPPSTOSHOW, byAuthorCallback);
          }
    }
  });
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:42,代码来源:ProfilePage.java

示例5: createEmailCollapse

import com.google.gwt.user.client.ui.Label; //导入方法依赖的package包/类
/**
 * Help method for Email Collapse Function
 * When the button(see more) is clicked, it will retrieve the whole email from database.
 * @param parent the parent container
 * @param emailId email id
 * @param preview email preview
 */
void createEmailCollapse(final FlowPanel parent, final long emailId, final String preview){
  final Label emailContent = new Label();
  emailContent.setText(preview);
  emailContent.addStyleName("inline-label");
  parent.add(emailContent);
  final Label actionButton = new Label();
  actionButton.setText(MESSAGES.seeMoreLink());
  actionButton.addStyleName("seemore-link");
  parent.add(actionButton);
  if(preview.length() <= MAX_EMAIL_PREVIEW_LENGTH){
    actionButton.setVisible(false);
  }
  actionButton.addClickHandler(new ClickHandler() {
    boolean ifPreview = true;
    @Override
    public void onClick(ClickEvent event) {
      if(ifPreview == true){
        OdeAsyncCallback<Email> callback = new OdeAsyncCallback<Email>(
            // failure message
            MESSAGES.serverUnavailable()) {
              @Override
              public void onSuccess(final Email email) {
                emailContent.setText(email.getBody());
                emailContent.addStyleName("inline");
                actionButton.setText(MESSAGES.hideLink());
                ifPreview = false;
              }
            };
        Ode.getInstance().getGalleryService().getEmail(emailId, callback);
      }else{
        emailContent.setText(preview);
        actionButton.setText(MESSAGES.seeMoreLink());
        ifPreview = true;
      }
    }
  });
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:45,代码来源:ReportList.java

示例6: initReportSection

import com.google.gwt.user.client.ui.Label; //导入方法依赖的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

示例7: createLoadingWidget

import com.google.gwt.user.client.ui.Label; //导入方法依赖的package包/类
private Widget createLoadingWidget(final int pending) {
  final HorizontalPanel container = new HorizontalPanel();
  container.setWidth("100%");
  container.setSpacing(0);
  container.setHorizontalAlignment(HorizontalPanel.ALIGN_CENTER);
  HorizontalPanel panel = new HorizontalPanel();
  Image image = new Image();
  image.setResource(IMAGES.waitingIcon());
  panel.add(image);
  Label label = new Label();
  label.setText(MESSAGES.defaultRpcMessage());
  panel.add(label);
  container.add(panel);
  GalleryClient.getInstance().addListener(new GalleryRequestListener() {
    volatile int count = pending;
    private void hideLoadingWidget() {
      if (container.getParent() != null) {
        container.clear();
        container.removeFromParent();
      }
    }
    @Override
    public boolean onAppListRequestCompleted(GalleryAppListResult appsResult, int requestID, boolean refreshable) {
      if ((--count) <= 0) {
        hideLoadingWidget();
        return true;
      }
      return false;
    }
    @Override
    public boolean onCommentsRequestCompleted(List<GalleryComment> comments) {
      if ((--count) <= 0) {
        hideLoadingWidget();
        return true;
      }
      return false;
    }
    @Override
    public boolean onSourceLoadCompleted(UserProject projectInfo) {
      if ((--count) <= 0) {
        hideLoadingWidget();
        return true;
      }
      return false;
    }
  });
  return container;
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:49,代码来源:Ode.java


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