本文整理汇总了Java中com.google.gwt.user.client.ui.Image.addClickHandler方法的典型用法代码示例。如果您正苦于以下问题:Java Image.addClickHandler方法的具体用法?Java Image.addClickHandler怎么用?Java Image.addClickHandler使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.user.client.ui.Image
的用法示例。
在下文中一共展示了Image.addClickHandler方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: IconCell
import com.google.gwt.user.client.ui.Image; //导入方法依赖的package包/类
public IconCell(ImageResource resource, final String title, String text) {
super(null);
iIcon = new Image(resource);
iIcon.setTitle(title);
iIcon.setAltText(title);
if (text != null && !text.isEmpty()) {
iLabel = new HTML(text, false);
iPanel = new HorizontalPanel();
iPanel.setStyleName("icon");
iPanel.add(iIcon);
iPanel.add(iLabel);
iIcon.getElement().getStyle().setPaddingRight(3, Unit.PX);
iPanel.setCellVerticalAlignment(iIcon, HasVerticalAlignment.ALIGN_MIDDLE);
}
iIcon.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
event.stopPropagation();
UniTimeConfirmationDialog.info(title);
}
});
}
示例2: add
import com.google.gwt.user.client.ui.Image; //导入方法依赖的package包/类
public IconsCell add(ImageResource resource, final String title) {
if (resource == null) return this;
Image icon = new Image(resource);
icon.setTitle(title);
icon.setAltText(title);
if (iPanel.getWidgetCount() > 0)
icon.getElement().getStyle().setPaddingLeft(3, Unit.PX);
iPanel.add(icon);
iPanel.setCellVerticalAlignment(icon, HasVerticalAlignment.ALIGN_MIDDLE);
if (title != null && !title.isEmpty()) {
icon.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
event.stopPropagation();
UniTimeConfirmationDialog.info(title);
}
});
}
return this;
}
示例3: NoteCell
import com.google.gwt.user.client.ui.Image; //导入方法依赖的package包/类
public NoteCell(String text, final String title) {
super(null);
if (Window.getClientWidth() <= 800 && title != null && !title.isEmpty()) {
iIcon = new Image(RESOURCES.note());
iIcon.setTitle(title);
iIcon.setAltText(title);
iIcon.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
event.stopPropagation();
UniTimeConfirmationDialog.info(title);
}
});
} else {
iNote = new P("unitime-Note");
iNote.setHTML(text);
if (title != null) iNote.setTitle(title);
}
}
示例4: PageLabelImpl
import com.google.gwt.user.client.ui.Image; //导入方法依赖的package包/类
public PageLabelImpl() {
iName = new P("text");
iHelp = new Image(RESOURCES.help());
iHelp.addStyleName("icon");
iHelp.setVisible(false);
add(iName);
add(iHelp);
iHelp.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
if (iUrl == null || iUrl.isEmpty()) return;
UniTimeFrameDialog.openDialog(MESSAGES.pageHelp(getText()), iUrl);
}
});
}
示例5: addLogo
import com.google.gwt.user.client.ui.Image; //导入方法依赖的package包/类
private void addLogo(HorizontalPanel panel) {
// Logo should be a link to App Inv homepage. Currently, after the user
// has logged in, the top level *is* ODE; so for now don't make it a link.
// Add timestamp to logo url to get around browsers that agressively cache
// the image! This same trick is used in StorageUtil.getFilePath().
Image logo = new Image(LOGO_IMAGE_URL + "?t=" + System.currentTimeMillis());
logo.setSize("40px", "40px");
logo.setStyleName("ode-Logo");
String logoUrl = ode.getSystemConfig().getLogoUrl();
if (!Strings.isNullOrEmpty(logoUrl)) {
logo.addClickHandler(new WindowOpenClickHandler(logoUrl));
}
panel.add(logo);
panel.setCellWidth(logo, "50px");
Label title = new Label("MIT App Inventor");
title.setStyleName("ode-LogoText");
VerticalPanel titleContainer = new VerticalPanel();
titleContainer.add(title);
panel.add(titleContainer);
panel.setCellWidth(titleContainer, "180px");
panel.setCellHorizontalAlignment(logo, HorizontalPanel.ALIGN_LEFT);
panel.setCellVerticalAlignment(logo, HorizontalPanel.ALIGN_MIDDLE);
}
示例6: setImage
import com.google.gwt.user.client.ui.Image; //导入方法依赖的package包/类
public void setImage(String image_url, String link_url) {
final String url = link_url;
Image image = new Image(image_url);
image.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
Window.open(url, "_blank", "scrollbars=1");
}
});
image.setTitle(" Click to Enlarge. Images will size with browser.");
grid.setWidget(plotRow, 0, image);
}
示例7: constructThumbnailImage
import com.google.gwt.user.client.ui.Image; //导入方法依赖的package包/类
/**
* Allows to create an image thumbnail for the given file descriptor
* @param fileDescriptors the list of file descriptors
* @param index the index of this file descriptor
* @return the image
*/
private Image constructThumbnailImage( final List<ShortUserFileDescriptor> fileDescriptors, final int index ){
final ShortUserFileDescriptor fileDescr = fileDescriptors.get( index );
Image image = new Image( ServerSideAccessManager.getProfileFileURL( fileDescr.ownerID, fileDescr, true ) );
image.setTitle( titlesI18N.userFileThumbnailManagementTip() );
image.addClickHandler( new ClickHandler(){
@Override
public void onClick(ClickEvent event) {
//Ensure lazy loading
( new SplitLoad( true ) {
@Override
public void execute() {
ViewTop10ProfileFilesDialogUI dialog = new ViewTop10ProfileFilesDialogUI( parentDialog, fileDescriptors, index );
dialog.show();
dialog.center();
}
}).loadAndExecute();
}
});
image.setStyleName( CommonResourcesContainer.USER_DIALOG_USER_IMAGE_STYLE );
return image;
}
示例8: makeLinkIcon
import com.google.gwt.user.client.ui.Image; //导入方法依赖的package包/类
public Widget makeLinkIcon(String iconUrl, String text, String tip, ClickHandler handler) {
HorizontalPanel hp = new HorizontalPanel();
Image image = new Image(iconUrl);
image.setHeight("16px");
makeIntoLinkButton(image);
hp.add(image);
if (!StringUtils.isEmpty(text)) {
Label label = new Label(text);
if (tip != null) {
label.setTitle(tip);
}
label.addClickHandler(handler);
makeIntoLinkButton(label);
hp.add(GwtUtil.getFiller(3, 1));
hp.add(label);
}
if (tip != null) {
image.setTitle(tip);
}
image.addClickHandler(handler);
return hp;
}
示例9: makeLabel
import com.google.gwt.user.client.ui.Image; //导入方法依赖的package包/类
protected Widget makeLabel() {
label = new HTML(getName(), false);
if (tooltips != null) {
label.setTitle(tooltips);
}
if (isRemovable) {
HorizontalPanel hp = new HorizontalPanel();
IconCreator ic= IconCreator.Creator.getInstance();
Image img= new Image(ic.getBlueDelete10x10());
DOM.setStyleAttribute(img.getElement(), "cursor", "pointer");
img.addClickHandler(new ClickHandler(){
public void onClick(ClickEvent event) {
tabPane.removeTab(getName());
tabPane.tabPanel.adjustTabWidth();
}
});
hp.add(label);
hp.add(GwtUtil.getFiller(5,1));
hp.add(img);
hp.addStyleName("removable");
return hp;
} else {
return label;
}
}
示例10: ProposedQueryReceivedUserInfoImage
import com.google.gwt.user.client.ui.Image; //导入方法依赖的package包/类
/**
* ProposedSubscriptionUserInfoImage
*/
public ProposedQueryReceivedUserInfoImage() {
image = new Image(OKMBundleResources.INSTANCE.shareQuery());
image.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
WorkspaceComunicator.changeSelectedTab(UIDockPanelConstants.DASHBOARD);
DashboardComunicator.showToolBoxExtension(MessagingToolBarBox.get().messagingToolBarBox);
MessagingToolBarBox.get().messageDashboard.messageStack.stackPanel.showWidget(MessageStack.STACK_QUERY_RECEIVED);
}
});
image.setTitle(GeneralComunicator.i18nExtension("messaging.user.info.new.proposed.query"));
image.setStyleName("okm-Hyperlink");
initWidget(image);
}
示例11: MessageReceivedUserInfoImage
import com.google.gwt.user.client.ui.Image; //导入方法依赖的package包/类
/**
* MessageReceivedUserInfoImage
*/
public MessageReceivedUserInfoImage() {
image = new Image(OKMBundleResources.INSTANCE.messageReceived());
image.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
WorkspaceComunicator.changeSelectedTab(UIDockPanelConstants.DASHBOARD);
DashboardComunicator.showToolBoxExtension(MessagingToolBarBox.get().messagingToolBarBox);
MessagingToolBarBox.get().messageDashboard.messageStack.stackPanel.showWidget(MessageStack.STACK_MESSAGES_RECEIVED);
}
});
image.setTitle(GeneralComunicator.i18nExtension("messaging.user.info.new.message.received"));
image.setStyleName("okm-Hyperlink");
initWidget(image);
}
示例12: ProposedSubscriptionReceivedUserInfoImage
import com.google.gwt.user.client.ui.Image; //导入方法依赖的package包/类
/**
* ProposedSubscriptionUserInfoImage
*/
public ProposedSubscriptionReceivedUserInfoImage() {
image = new Image(OKMBundleResources.INSTANCE.proposeSubscription());
image.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
WorkspaceComunicator.changeSelectedTab(UIDockPanelConstants.DASHBOARD);
DashboardComunicator.showToolBoxExtension(MessagingToolBarBox.get().messagingToolBarBox);
MessagingToolBarBox.get().messageDashboard.messageStack.stackPanel.showWidget(MessageStack.STACK_SUBSCRIPTION_RECEIVED);
}
});
image.setTitle(GeneralComunicator.i18nExtension("messaging.user.info.new.proposed.subscription"));
image.setStyleName("okm-Hyperlink");
initWidget(image);
}
开发者ID:openkm,项目名称:document-management-system,代码行数:18,代码来源:ProposedSubscriptionReceivedUserInfoImage.java
示例13: getLocaleSelectionPanel
import com.google.gwt.user.client.ui.Image; //导入方法依赖的package包/类
/**
* Allows to get the locale selection Panel
* @return
*/
public static HorizontalPanel getLocaleSelectionPanel() {
final HorizontalPanel localeSelectionPanel = new HorizontalPanel();
localeSelectionPanel.setVerticalAlignment( HasVerticalAlignment.ALIGN_MIDDLE );
localeSelectionPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
localeSelectionPanel.setStyleName( CommonResourcesContainer.LOCALE_PANEL_STYLE );
String[] localeNames = LocaleInfo.getAvailableLocaleNames();
for( String localeValue : localeNames ) {
if( !localeValue.equals( InterfaceUtils.DEFAULT_LOCALE_VALUE ) ) {
String nativeName = LocaleInfo.getLocaleNativeDisplayName( localeValue );
Image localeImage = new Image();
localeImage.addStyleName( CommonResourcesContainer.LOCALIZATION_IMAGE_STYLE );
localeImage.setUrl( ServerSideAccessManager.SITE_IMAGES_LOCATION + "locale_small_" + localeValue + ".png");
localeImage.setTitle( nativeName );
final String currLocaleValue = localeValue;
localeImage.addClickHandler( new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
reloadWebSitePages( currLocaleValue );
}
});
localeSelectionPanel.add( new HTML(" ") );
localeSelectionPanel.add( localeImage );
}
}
return localeSelectionPanel;
}
示例14: constructThumbnailImage
import com.google.gwt.user.client.ui.Image; //导入方法依赖的package包/类
/**
* Allows to create an image thumbnail for the given file descriptor
* @param fileDescriptors the list of file descriptors
* @param index the index of this file descriptor
* @return the image
*/
private Image constructThumbnailImage( final List<ShortFileDescriptor> fileDescriptors, final int index ){
final ShortFileDescriptor fileDescr = fileDescriptors.get( index );
Image image = new Image( ServerSideAccessManager.getProfileFileURL( userID, fileDescr, true ) );
image.setTitle( titlesI18N.userFileThumbnailManagementTip() );
image.addClickHandler( new ClickHandler(){
@Override
public void onClick(ClickEvent event) {
//First invert the list to have the desired order of files and the index
final List<ShortFileDescriptor> invertedFileSequence = new ArrayList<ShortFileDescriptor>();
final Iterator<ShortFileDescriptor> iter = fileDescriptors.iterator();
while( iter.hasNext() ) {
invertedFileSequence.add(0, iter.next());
}
final int inverted_index = ( fileDescriptors.size() - 1 ) - index;
//Ensure lazy loading
final SplitLoad executor = new SplitLoad( true ) {
@Override
public void execute() {
//Second open the dialog
ViewUserProfileFilesDialogUI dialog = new ViewUserProfileFilesDialogUI( parentDialog, invertedFileSequence,
inverted_index, userLoginName, userID);
dialog.show();
dialog.center();
}
};
executor.loadAndExecute();
}
});
image.setStyleName( CommonResourcesContainer.USER_DIALOG_USER_IMAGE_STYLE );
return image;
}
示例15: createWidget
import com.google.gwt.user.client.ui.Image; //导入方法依赖的package包/类
@Override
public Image createWidget() {
BlobImageRendererState state = getState();
Image image = GWT.create(Image.class);
image.addClickHandler(this);
if (state.width > -1) image.setWidth(state.width+"px");
if (state.height > -1) image.setWidth(state.height+"px");
return image;
}