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


Java Label.addClickHandler方法代码示例

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


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

示例1: SqlScriptFileConfigTable

import com.google.gwt.user.client.ui.Label; //导入方法依赖的package包/类
public SqlScriptFileConfigTable(SqlProgramWidget widget, String name){
	this.widget = widget;
	this.name = name;
	this.insertRow(0);
	Label add = new Label();
	add.addStyleName("admin-user-edit");
	this.setWidget(0, 0, new Label(name));
	this.setWidget(0, 1, new Label());
	this.setWidget(0, 2, add);
	this.setWidget(0, 3, new Label());
	add.addClickHandler(new ClickHandler(){

		@Override
		public void onClick(ClickEvent event) {
			int i = 0;
			while( i < SqlScriptFileConfigTable.this.getRowCount() 
					&& SqlScriptFileConfigTable.this.getWidget(i, 2 ) != event.getSource() ) i ++ ;

			if( i < SqlScriptFileConfigTable.this.getRowCount() ){
				addRow( i, "");
			}

		}

	});
}
 
开发者ID:ICT-BDA,项目名称:EasyML,代码行数:27,代码来源:SqlScriptFileConfigTable.java

示例2: initActionTabs

import com.google.gwt.user.client.ui.Label; //导入方法依赖的package包/类
/**
 * Helper method called by constructor to initialize the app action tabs
 */
private void initActionTabs() {
  // Add a bunch of tabs for executable actions regarding the app
  appSecondaryWrapper.addStyleName("clearfix");
  appSecondaryWrapper.add(appActionTabs);
  appActionTabs.addStyleName("app-actions");
  appActionTabs.add(appDescPanel, "Description");
  appActionTabs.add(appSharePanel, "Share");
  appActionTabs.add(appReportPanel, "Report");
  appActionTabs.selectTab(0);
  appActionTabs.addStyleName("app-actions-tabs");
  appDetails.add(appSecondaryWrapper);
  // Return to Gallery link
  Label returnLabel = new Label("Back to Gallery");
  returnLabel.addClickHandler(new ClickHandler() {
    @Override
    public void onClick(ClickEvent clickEvent) {
      ode.switchToGalleryView();
    }
  });
  returnToGallery.add(returnLabel);
  returnToGallery.addStyleName("gallery-nav-return");
  returnToGallery.addStyleName("primary-link");
  appSecondaryWrapper.add(returnToGallery); //
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:28,代码来源:GalleryPage.java

示例3: initSalvageSection

import com.google.gwt.user.client.ui.Label; //导入方法依赖的package包/类
/**
 * Helper method called by constructor to initialize the salvage section
 * @param container   The container that salvage label reside
 */
private void initSalvageSection(Panel container) { //TODO: Update the location of this button
  if (!canSalvage()) {                              // Permitted to salvage?
    return;
  }

  final Label salvagePrompt = new Label("salvage");
  salvagePrompt.addStyleName("primary-link");
  container.add(salvagePrompt);

  salvagePrompt.addClickHandler(new ClickHandler() {
    public void onClick(ClickEvent event) {
      final OdeAsyncCallback<Void> callback = new OdeAsyncCallback<Void>(
          // failure message
          MESSAGES.galleryError()) {
            @Override
            public void onSuccess(Void bool) {
              salvagePrompt.setText("done");
            }
        };
      Ode.getInstance().getGalleryService().salvageGalleryApp(app.getGalleryAppId(), callback);
    }
  });
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:28,代码来源:GalleryPage.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


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