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


Java Image.addClickListener方法代碼示例

本文整理匯總了Java中com.google.gwt.user.client.ui.Image.addClickListener方法的典型用法代碼示例。如果您正苦於以下問題:Java Image.addClickListener方法的具體用法?Java Image.addClickListener怎麽用?Java Image.addClickListener使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.google.gwt.user.client.ui.Image的用法示例。


在下文中一共展示了Image.addClickListener方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: setChildCount

import com.google.gwt.user.client.ui.Image; //導入方法依賴的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

示例2: load

import com.google.gwt.user.client.ui.Image; //導入方法依賴的package包/類
public void load() {
	VerticalPanel panel = new VerticalPanel();
	HorizontalPanel header = new HorizontalPanel();
	header.setStyleName("one-select-popup-header");
	header.setWidth("100%");
	Label headerLabel = new Label(title);
	Image close = new Image("images/eclipse/close.gif");
	header.add(headerLabel);
	header.add(close);
	
	header.setCellHorizontalAlignment(headerLabel, HorizontalPanel.ALIGN_LEFT);
	header.setCellHorizontalAlignment(close, HorizontalPanel.ALIGN_RIGHT);
	header.setCellVerticalAlignment(close, HorizontalPanel.ALIGN_MIDDLE);
	
	// Add drag control.
	new DragControl(this, headerLabel);
	
	close.addClickListener(new ClickListener() {
		public void onClick(Widget sender) {
			hide();	
		}
	});
	panel.add(header);
	panel.add(content);
	
	panel.setCellVerticalAlignment(header, VerticalPanel.ALIGN_TOP);
	panel.setCellVerticalAlignment(content, VerticalPanel.ALIGN_TOP);
	panel.setCellHeight(content, "100%");
	setWidget(panel);
}
 
開發者ID:luox12,項目名稱:onecmdb,代碼行數:31,代碼來源:DragablePopup.java

示例3: addAttributeRow

import com.google.gwt.user.client.ui.Image; //導入方法依賴的package包/類
private void addAttributeRow(HoverGridWidget widget, int row, final GWT_AttributeBean aBean) {
	widget.setText(row, NAME_COL, aBean.getDisplayName());
	widget.setText(row, ALIAS_COL, aBean.getAlias());
	widget.setWidget(row, TYPE_COL, new Hyperlink(aBean.getType(), null));
	widget.setText(row, REF_TYPE_COL, aBean.getRefType());
	widget.setText(row, DERIVED_COL, aBean.isDerived() ? "*" : " ");
	widget.setText(row, MIN_COL, aBean.getMinOccurs());
	widget.setText(row, MAX_COL, aBean.getMaxOccurs());
	List values = currentTemplate.fetchAttributeValueBeans(aBean.getAlias());
	if (values != null && values.size() > 0) {
		GWT_ValueBean value = (GWT_ValueBean) values.get(0);
		widget.setText(row, DEFAULT_VALUE_COL, value.getValue());
	} else {
		widget.setText(row, DEFAULT_VALUE_COL, "");
	}
	if (!aBean.isDerived()) {
		Image delete = new Image("images/trashcan16.gif");
		delete.setTitle("Delete attribute " + aBean.getDisplayName());
		delete.addClickListener(new ClickListener() {

			public void onClick(Widget sender) {
				delete(aBean);
			}
			
		});
		widget.setWidget(row, DEFAULT_VALUE_COL+1, delete);
	}
	
	rowMap.put(new Integer(row), aBean);
}
 
開發者ID:luox12,項目名稱:onecmdb,代碼行數:31,代碼來源:ListAttributeScreen.java

示例4: addValue

import com.google.gwt.user.client.ui.Image; //導入方法依賴的package包/類
public void addValue(final Widget widget) {
	// need to get the base widget...
	if (widget instanceof IBaseField) {
		final HorizontalPanel hPanel = new HorizontalPanel();
		hPanel.add(((IBaseField)widget).getBaseField());
		
		
		valuePanel.add(hPanel);
		if (mValue.getCtrl().isReadonly()) {
			((IBaseField)widget).getBaseField().setStyleName("multi-value-input-readonly");
		} else {
			Image delete = new Image("images/delete-value.gif");
			delete.setTitle("Remove this value");
			delete.addClickListener(new ClickListener() {

				public void onClick(Widget sender) {
					List values = mValue.getAttributeValues();
					List remainingValues = new ArrayList();
					for (Iterator iter = values.iterator(); iter.hasNext();) {
						AttributeValue aValue = (AttributeValue) iter.next();
						if (widget.equals(aValue.getWidget())) {
							// Remove this, 
							mValue.removeAttributeValue(aValue);
							valuePanel.remove(hPanel);
							break;
						}
					}
				}
				
			});

			hPanel.add(delete);
			hPanel.setCellWidth(((IBaseField)widget).getBaseField(), "100%");
			//((IBaseField)widget).getBaseField().setStyleName("multi-value-input");
			((IBaseField)widget).getBaseField().setStyleName("multi-value-input-inside");
			hPanel.setStyleName("multi-value-input");
		}
		baseFields.add(widget);
		
	}
}
 
開發者ID:luox12,項目名稱:onecmdb,代碼行數:42,代碼來源:CIMultiValueWidget.java

示例5: getWidget

import com.google.gwt.user.client.ui.Image; //導入方法依賴的package包/類
public Widget getWidget(final Object data) {
	HorizontalPanel hpanel = (HorizontalPanel) super.getWidget(data);
	if (data instanceof GWT_CiBean) {
		final GWT_CiBean bean = (GWT_CiBean)data;
	
		final Image popup = new Image("images/eclipse/tree_menu2.gif");
		hpanel.add(popup);
		hpanel.setCellVerticalAlignment(popup, VerticalPanel.ALIGN_MIDDLE);
		popup.addClickListener(new ClickListener() {

			public void onClick(Widget sender) {
				System.out.println("Menu popup...");
				final PopupPanel p = new PopupPanel(true);
				//p.setStyleName("popup-menu");
				Command newInstance = new Command() {
					public void execute() {
						p.hide();
						OneCMDBModelCreator.get().showScreen(OneCMDBModelCreator.NEW_INSTANCE_SCREEN, bean.getAlias(), new Long(0));
					}
				};
				Command newTemplate = new Command() {
					public void execute() {
						p.hide();
						OneCMDBModelCreator.get().showScreen(OneCMDBModelCreator.NEW_TEMPLATE_SCREEN, bean.getAlias(), new Long(0));
					}
				};
				Command delete = new Command() {
					public void execute() {
						p.hide();
						delete(bean);
					}
				};

				// Make some sub-menus that we will cascade from the top menu.
				MenuBar fooMenu = new MenuBar(true);
				if (bean.isTemplate()) {
					fooMenu.addItem("New Instance", newInstance);
					fooMenu.addItem("New Template", newTemplate);
				}
				fooMenu.addItem("Delete", delete);


				p.setPopupPosition(popup.getAbsoluteLeft(), popup.getAbsoluteTop());
				p.setWidget(fooMenu);
				p.show();
			}

		});
	}
	return(hpanel);
}
 
開發者ID:luox12,項目名稱:onecmdb,代碼行數:52,代碼來源:ModelInheritanceTreeControl.java


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