本文整理汇总了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);
}
}
示例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);
}
示例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);
}
示例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);
}
}
示例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);
}