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


Java ClickListener类代码示例

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


ClickListener类属于com.google.gwt.user.client.ui包,在下文中一共展示了ClickListener类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: upgradeWarnDialog

import com.google.gwt.user.client.ui.ClickListener; //导入依赖的package包/类
private static void upgradeWarnDialog(String aMessage) {
  final DialogBox dialogBox = new DialogBox(false, true);
  dialogBox.setStylePrimaryName("ode-DialogBox");
  dialogBox.setText(MESSAGES.warningDialogTitle());
  dialogBox.setGlassEnabled(true);
  dialogBox.setAnimationEnabled(true);
  final HTML message = new HTML(aMessage);
  message.setStyleName("DialogBox-message");
  VerticalPanel vPanel = new VerticalPanel();
  Button okButton = new Button("OK");
  okButton.addClickListener(new ClickListener() {
      @Override
      public void onClick(Widget sender) {
        dialogBox.hide();
      }
    });
  vPanel.add(message);
  vPanel.add(okButton);
  dialogBox.setWidget(vPanel);
  dialogBox.center();
  dialogBox.show();
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:23,代码来源:YoungAndroidFormUpgrader.java

示例2: ComponentHelpWidget

import com.google.gwt.user.client.ui.ClickListener; //导入依赖的package包/类
public ComponentHelpWidget(final SimpleComponentDescriptor scd) {
  if (imageResource == null) {
    Images images = Ode.getImageBundle();
    imageResource = images.help();
  }
  AbstractImagePrototype.create(imageResource).applyTo(this);
  addClickListener(new ClickListener() {
      @Override
      public void onClick(Widget sender) {
        final long MINIMUM_MS_BETWEEN_SHOWS = 250;  // .25 seconds

        if (System.currentTimeMillis() - lastClosureTime >=
            MINIMUM_MS_BETWEEN_SHOWS) {
          new ComponentHelpPopup(scd, sender);
        }
      }
    }
    );
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:20,代码来源:ComponentHelpWidget.java

示例3: ComponentRemoveWidget

import com.google.gwt.user.client.ui.ClickListener; //导入依赖的package包/类
public ComponentRemoveWidget(SimpleComponentDescriptor simpleComponentDescriptor) {
  if (imageResource == null) {
    Images images = Ode.getImageBundle();
    imageResource = images.deleteComponent();
  }
  this.scd = simpleComponentDescriptor;
  AbstractImagePrototype.create(imageResource).applyTo(this);
  addClickListener(new ClickListener() {

      @Override
      public void onClick(Widget widget) {
        if (Window.confirm(MESSAGES.reallyRemoveComponent())) {
          long projectId = ode.getCurrentYoungAndroidProjectId();
          YaProjectEditor projectEditor = (YaProjectEditor) ode.getEditorManager().getOpenProjectEditor(projectId);
          SimpleComponentDatabase componentDatabase = SimpleComponentDatabase.getInstance();
          componentDatabase.addComponentDatabaseListener(projectEditor);
          componentDatabase.removeComponent(scd.getName());
        }
      }
    });
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:22,代码来源:ComponentRemoveWidget.java

示例4: createLyricsDialog

import com.google.gwt.user.client.ui.ClickListener; //导入依赖的package包/类
private void createLyricsDialog()
{
	lyricsDialog = new DialogBox();
	VerticalPanel vPanel = new VerticalPanel();
	vPanel.setHeight( "100%" );
	vPanel.setHorizontalAlignment( VerticalPanel.ALIGN_CENTER );
	vPanel.setVerticalAlignment( VerticalPanel.ALIGN_MIDDLE );
	lyricsDialog.add( vPanel );
	
	lyrics = new HTML();
	ScrollPanel scrollPanel = new ScrollPanel();
	scrollPanel.setWidth( "300px" );
	scrollPanel.setHeight( "250px" );
	scrollPanel.add( lyrics );
	vPanel.add( scrollPanel );
	
	Button close = new NativeButton( "Close" );
	close.addClickListener( new ClickListener() {
		public void onClick( Widget arg0 ) {
			lyricsDialog.hide();
		}
	} );
	vPanel.add( close );
}
 
开发者ID:jolie,项目名称:jolie,代码行数:25,代码来源:Echoes.java

示例5: getWidget

import com.google.gwt.user.client.ui.ClickListener; //导入依赖的package包/类
public Widget getWidget(Object data) {
	if (!(data instanceof GWT_CiBean)) {
		return(new Label("getChildCount(Object data): Not a correct data object!"));
	}
	final GWT_CiBean bean = (GWT_CiBean)data;
	HorizontalPanel hpanel =  new HorizontalPanel();
	
	if (selectInstances() && (!bean.isTemplate())) {
		final CheckBox cb = new CheckBox();
		cb.setChecked(isChecked(bean));
		hpanel.add(cb);
		cb.addClickListener(new ClickListener() {

			public void onClick(Widget sender) {
				addChecked(bean, cb.isChecked());
			}

		});
	}
	hpanel.add(new Image(OneCMDBUtils.getIconForCI(bean)));
	Label label = new Label(bean.getDisplayName());
	hpanel.add(label);

	return(hpanel);
}
 
开发者ID:luox12,项目名称:onecmdb,代码行数:26,代码来源:SelectMultipleDataSourceControl.java

示例6: getWidget

import com.google.gwt.user.client.ui.ClickListener; //导入依赖的package包/类
/**
 * Override widget to add check box button.
 */
public Widget getWidget(Object data) {
	if (!(data instanceof GWT_CiBean)) {
		return(new Label("getChildCount(Object data): Not a correct data object!"));
	}
	final GWT_CiBean bean = (GWT_CiBean)data;
	HorizontalPanel hpanel =  new HorizontalPanel();
	hpanel.add(new Image(OneCMDBUtils.getIconForCI(bean)));
	Label label = new Label(bean.getDisplayName());
	hpanel.add(label);
	//final Image popup = new Image("images/select_me.gif");
	//hpanel.add(popup);
	label.addClickListener(new ClickListener() {
		public void onClick(Widget sender) {
			if (callback != null) {
				if (selectInstances != bean.isTemplate()) {
					return;
				}
				callback.onSelect(bean);
			}
		}
	});
	return(hpanel);
}
 
开发者ID:luox12,项目名称:onecmdb,代码行数:27,代码来源:SelectInheritanceDataSourceControl.java

示例7: setChildCount

import com.google.gwt.user.client.ui.ClickListener; //导入依赖的package包/类
public void setChildCount(int value) {
	if (value > 0) {
		final Image image = new Image("images/plus.gif");
		image.setStyleName("onecmdb-reverse-expand");
		image.addClickListener(new ClickListener() {

			public void onClick(Widget sender) {
				open = !open;
				if (open) {
					image.setUrl("images/minus.gif");
				} else {
					image.setUrl("images/plus.gif");
				}
				expandListener.onClick(WidgetItem.this);
			}
		});
		widgetPanel.add(image);
		widgetPanel.setCellVerticalAlignment(image, VerticalPanel.ALIGN_MIDDLE);
	}
}
 
开发者ID:luox12,项目名称:onecmdb,代码行数:21,代码来源:ReverseTreeTable.java

示例8: FooterScreen

import com.google.gwt.user.client.ui.ClickListener; //导入依赖的package包/类
public FooterScreen() {
	HorizontalPanel panel = new HorizontalPanel();
	HTML label = new HTML("OneCMDB 1.4.0 Beta &copy; Lokomo Systems <<a href='javascript:;'>about</a>>");
	label.setTitle("Show about screen");
	label.setStyleName("onecmdb-footer-label");
	panel.add(label);
	panel.setCellHorizontalAlignment(label, HorizontalPanel.ALIGN_RIGHT);
	panel.setStyleName("onecmdb-footer");
	label.addClickListener(new ClickListener() {

		public void onClick(Widget sender) {
			getBaseEntryScreen().showScreen(OneCMDBApplication.SHOW_STATIC_CONTENT, 
					"about.html", 
					new Long(0));
		}
		
	});
	initWidget(panel);
}
 
开发者ID:luox12,项目名称:onecmdb,代码行数:20,代码来源:FooterScreen.java

示例9: ButtonValueWidget

import com.google.gwt.user.client.ui.ClickListener; //导入依赖的package包/类
public ButtonValueWidget(final String actionName, String label, final Widget left) {
	HorizontalPanel panel = new HorizontalPanel();
	Button b = new Button(label);
	b.addClickListener(new ClickListener() {

		public void onClick(Widget sender) {
			if (actionCallback != null) {
				actionCallback.onAction(actionName, left);
			}
		}
		
	});
	panel.add(b);
	panel.add(left);
	initWidget(panel);
}
 
开发者ID:luox12,项目名称:onecmdb,代码行数:17,代码来源:ButtonValueWidget.java

示例10: load

import com.google.gwt.user.client.ui.ClickListener; //导入依赖的package包/类
public void load() {
	if (this.currentTemplate == null) {
		setErrorText("No Template to show!");
		return;
	}
	setErrorText("");
	setTitleText("Attributes for ");
	setTitleWidget(new CIIconDisplayNameWidget(this.currentTemplate));
	vPanel.clear();
	
	HTML add = new HTML("[<a href='javascript:;'>new</a>]");
	add.setTitle("Add a new attribute to this template");
	add.addClickListener(new ClickListener() {
		public void onClick(Widget sender) {
			OneCMDBModelCreator.get().showScreen(OneCMDBModelCreator.ADD_ATTRIBUTE_SCREEN, currentTemplate.getAlias(), new Long(0));
		}
		
	});
	HorizontalPanel hPanel = new HorizontalPanel();
	hPanel.add(add);
	hPanel.setCellHorizontalAlignment(add, HorizontalPanel.ALIGN_RIGHT);
	hPanel.setWidth("100%");
	vPanel.add(hPanel);
	vPanel.add(getAttributeTable());
	
}
 
开发者ID:luox12,项目名称:onecmdb,代码行数:27,代码来源:ListAttributeScreen.java

示例11: showEndGame

import com.google.gwt.user.client.ui.ClickListener; //导入依赖的package包/类
public void showEndGame(final Runnable runnable) {
  final DialogBox box = new DialogBox();
  box.setAnimationEnabled(true);
  box.setText("Thanks for playing Higher or Lower! *ding*ding*ding*ding*");
  Button b = new Button("Thanks for having me!");
  b.addStyleName("centered");
  b.addClickListener(new ClickListener() {
    public void onClick(Widget sender) {
      runnable.run();
      box.hide();
    }
  });
  box.setWidget(b);
  box.center();
  box.show();
}
 
开发者ID:google-code-export,项目名称:google-gin,代码行数:17,代码来源:DefaultGameDialogs.java

示例12: ResponseItem

import com.google.gwt.user.client.ui.ClickListener; //导入依赖的package包/类
public ResponseItem(final MethodNode method, final TreeItem methodTreeItem) {
  HorizontalPanel containerPanel = new HorizontalPanel();    
  HTML response = new HTML(SyntaxHighlighter.highlight("<" + WadlXml.responseNode + ">"));
  containerPanel.add(response);    
  
  // remove response hyperlink
  Hyperlink removeResponseLink = new Hyperlink(GuiFactory.strings.remove(), true, "");
  removeResponseLink.addClickListener(new ClickListener() {
    public void onClick(Widget sender) {        
      method.removeResponse(method.getResponse());         
      listResponse(method, methodTreeItem);
    }
  });      
  containerPanel.add(removeResponseLink);
  
  initWidget(containerPanel);
}
 
开发者ID:tomayac,项目名称:rest-describe-and-compile,代码行数:18,代码来源:ResponseItem.java

示例13: listIncludes

import com.google.gwt.user.client.ui.ClickListener; //导入依赖的package包/类
public static void listIncludes(final GrammarsNode grammars, final VerticalPanel includePanel) {
  includePanel.clear();
  Vector allIncludes = grammars.getAllIncludes();
  Iterator includeIterator = allIncludes.iterator();
  VerticalPanel includeItems = new VerticalPanel();
  while (includeIterator.hasNext()) {      
    IncludeItem includeItem = new IncludeItem((String) includeIterator.next(), grammars, includePanel);
    includeItems.add(includeItem);     
  }
  includePanel.add(includeItems);
  
  // add include button        
  Button addIncludeButton = new Button(GuiFactory.strings.addInclude());
  addIncludeButton.addClickListener(new ClickListener() {
    public void onClick(Widget sender) {
      grammars.addInclude(GuiFactory.strings.newInclude());
      IncludeItem.listIncludes(grammars, includePanel);
    }
  });
  includePanel.add(addIncludeButton);    

}
 
开发者ID:tomayac,项目名称:rest-describe-and-compile,代码行数:23,代码来源:IncludeItem.java

示例14: RequestItem

import com.google.gwt.user.client.ui.ClickListener; //导入依赖的package包/类
public RequestItem(final MethodNode method, final TreeItem methodTreeItem) {
  HorizontalPanel containerPanel = new HorizontalPanel();    
  HTML request = new HTML(SyntaxHighlighter.highlight("<" + WadlXml.requestNode + ">"));
  containerPanel.add(request);
  
  // remove request hyperlink
  Hyperlink removeRequestLink = new Hyperlink(GuiFactory.strings.remove(), true, "");
  removeRequestLink.addClickListener(new ClickListener() {
    public void onClick(Widget sender) {        
      method.removeRequest(method.getRequest());         
      listRequest(method, methodTreeItem);
    }
  });      
  containerPanel.add(removeRequestLink);
  
  initWidget(containerPanel);
}
 
开发者ID:tomayac,项目名称:rest-describe-and-compile,代码行数:18,代码来源:RequestItem.java

示例15: listUsedClassNames

import com.google.gwt.user.client.ui.ClickListener; //导入依赖的package包/类
/**
 * 
 */
private static void listUsedClassNames() {
  Iterator classNameIterator = CodeGenerator.usedClassNames.iterator();
  requestClassesPanel.clear();
  while(classNameIterator.hasNext()) {      
    final String className = (String) classNameIterator.next();
    Hyperlink hyperlink = new Hyperlink("<nobr><img align=\"absmiddle\" src=\"./images/details.png\" />" + className + "</nobr>", true, "");
    hyperlink.addClickListener(new ClickListener() {
      public void onClick(Widget sender) {
        int pos = codeTextArea.getText().indexOf(className);
        codeTextArea.setCursorPos(pos);          
        codeTextArea.setSelectionRange(pos, className.length());
      }        
    });
    requestClassesPanel.add(hyperlink);      
  }    
}
 
开发者ID:tomayac,项目名称:rest-describe-and-compile,代码行数:20,代码来源:RestCompilePanel.java


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