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


Java Image.setAltText方法代码示例

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


在下文中一共展示了Image.setAltText方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
		}
	});
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:23,代码来源:WebTable.java

示例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;
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:21,代码来源:WebTable.java

示例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);
	}
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:20,代码来源:WebTable.java

示例4: toAnchor

import com.google.gwt.user.client.ui.Image; //导入方法依赖的package包/类
private static Anchor toAnchor(WebLinkInfoCommon info) {
  Anchor a = new Anchor();
  a.setHref(info.url);
  if (info.target != null && !info.target.isEmpty()) {
    a.setTarget(info.target);
  }
  if (info.imageUrl != null && !info.imageUrl.isEmpty()) {
    Image img = new Image();
    img.setAltText(info.name);
    img.setUrl(info.imageUrl);
    img.setTitle(info.name);
    a.getElement().appendChild(img.getElement());
  } else {
    a.setText("(" + info.name + ")");
  }
  return a;
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:18,代码来源:ProjectAccessEditor.java

示例5: toAnchor

import com.google.gwt.user.client.ui.Image; //导入方法依赖的package包/类
public final Anchor toAnchor() {
  Anchor a = new Anchor();
  a.setHref(url());
  if (target() != null && !target().isEmpty()) {
    a.setTarget(target());
  }
  if (imageUrl() != null && !imageUrl().isEmpty()) {
    Image img = new Image();
    img.setAltText(name());
    img.setUrl(imageUrl());
    img.setTitle(name());
    a.getElement().appendChild(img.getElement());
  } else {
    a.setText("(" + name() + ")");
  }
  return a;
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:18,代码来源:WebLinkInfo.java

示例6: onChannelMessage

import com.google.gwt.user.client.ui.Image; //导入方法依赖的package包/类
@Override
public void onChannelMessage(Object p_message)
{
  // redraw widget according to new presenceRoom
  PresenceRoom newPresenceRoom = (PresenceRoom)p_message;
  m_panel.clear();
  Set<String> pseudoList = new HashSet<String>();
  for( Presence presence : newPresenceRoom )
  {
    if( !pseudoList.contains( presence.getPseudo() ) )
    {
      pseudoList.add( presence.getPseudo() );
      Panel panel = new HorizontalPanel();
      Image image = new Image( presence.getAvatarUrl() );
      image.setPixelSize( 32, 32 );
      image.setAltText( presence.getPseudo() );
      image.setTitle( presence.getPseudo() );
      panel.add( image );
      panel.add( new Label(presence.getPseudo()) );
      m_panel.add( panel );
    }
  }
}
 
开发者ID:kroc702,项目名称:fullmetalgalaxy,代码行数:24,代码来源:MAppPresences.java

示例7: addImageWithLine

import com.google.gwt.user.client.ui.Image; //导入方法依赖的package包/类
/**
 * @param line
 */
public void addImageWithLine (String line) {
	if (line.length() > 0) {
		ConfigLine config = parseConfigLine(line);

		if (config.url != null && config.url.length() > 0) {
			Image image = new Image(config.url);

			if (config.name != null) {
				image.setTitle(config.name);
				image.setAltText(config.caption);
			}

			((HTMLPanel) this.getWidget()).add(image);

			if (config.caption != null) {
				((HTMLPanel) this.getWidget())
						.add(new HTMLPanel(SafeHtmlUtils.fromTrustedString(
								PostHelper.makeMarkup(config.caption))));
			}
		}
	}
}
 
开发者ID:billy1380,项目名称:blogwt,代码行数:26,代码来源:GalleryPart.java

示例8: onChannelMessage

import com.google.gwt.user.client.ui.Image; //导入方法依赖的package包/类
@Override
public void onChannelMessage(Object p_message)
{
  // redraw widget according to new presenceRoom
  PresenceRoom newPresenceRoom = (PresenceRoom)p_message;
  m_panel.clear();
  Set<String> pseudoList = new HashSet<String>();
  for( Presence presence : newPresenceRoom )
  {
    if( !pseudoList.contains( presence.getPseudo() ) )
    {
      pseudoList.add( presence.getPseudo() );
      Image image = new Image( presence.getAvatarUrl() );
      image.setPixelSize( 32, 32 );
      image.setAltText( presence.getPseudo() );
      image.setTitle( presence.getPseudo() );
      m_panel.add( image );
    }
  }
  if( pseudoList.size() <= 1 )
  {
    // user is alone: don't display anything
    m_panel.clear();
  }
  else
  {
    m_panel.add( m_btnChat );
  }
}
 
开发者ID:kroc702,项目名称:fullmetalgalaxy,代码行数:30,代码来源:MAppLittlePresences.java

示例9: addEditor

import com.google.gwt.user.client.ui.Image; //导入方法依赖的package包/类
private EditorView addEditor() {
  // Get the correct inner editor view to display, and add it.
  final EditorView view = innerEditor.createAndSetView();

  // We want the editor to use our view as the source of values.
  innerEditor.setView(this);
  views.add(view);

  insert(view, getWidgetIndex(errorMessage));

  // If this is not the first editor view, add a clickable image that, when
  // clicked, will remove this editor from the view, as well as the image
  // itself.
  if (views.size() > 1) {
    final Image remove = new Image(Resources.INSTANCE.removeParameter());
    remove.addClickHandler(new ClickHandler() {
      @Override
      public void onClick(ClickEvent event) {
        removeView(view);
        remove(remove);
      }
    });
    remove.setAltText("Remove this value");
    remove.addStyleName(Resources.INSTANCE.style().removeParameter());
    insert(remove, getWidgetIndex(errorMessage));
  } else {
    insert(addMore, getWidgetIndex(errorMessage));
  }

  return view;
}
 
开发者ID:showlowtech,项目名称:google-apis-explorer,代码行数:32,代码来源:RepeatedEditor.java

示例10: setResponseContent

import com.google.gwt.user.client.ui.Image; //导入方法依赖的package包/类
/**
 * Set the value of the panel reserved for the formatted response. There are a couple different
 * scenarios to tackle. If we can determine that the request returned an image, and the request is
 * repeatable, we will create an image tag with a source of the original request.
 *
 * If the response is a non-JSON text type, we just show it directly.
 *
 * In all other cases we try to process the text as JSON and if for some reason that fails, we
 * just hide it under an opaque tag that says as much information as we know about the response.
 *
 * @param request Request object with the API key replaced.
 * @param response Response from the server.
 * @param originalPath Path object before we replaced the API key.
 * @param linkFactory Which links factory should be used when generating links and navigation
 *        menus.
 */
private void setResponseContent(ApiRequest request, ApiResponse response, String originalPath,
    PrettifierLinkFactory linkFactory) {

  HeaderValue authorization = response.getHeaders().get(AUTH_HEADER);
  HeaderValue contentTypeHeader = response.getHeaders().get(CONTENT_TYPE_HEADER);
  GWT.log("Headers: " + response.getHeaders().entrySet());
  String contentType = contentTypeHeader == null ? "Unspecified" : contentTypeHeader.getValue();

  if (request.getHttpMethod() == HttpMethod.GET && contentType.startsWith(IMAGE_TYPE_PREFIX)
      && authorization == null) {

    // In the very special case that we performed a get and were given an
    // image, display it
    Image img = new Image();
    img.setUrl(Config.getBaseUrl() + originalPath);
    img.setAltText(Config.getBaseUrl() + request.getRequestPath());
    responseBodyDiv.add(img);
  } else if (contentType.startsWith(TEXT_TYPE_PREFIX)) {
    // We have non-JSON text, just show it.
    responseBodyDiv.add(new Label(response.getBodyAsString()));
  } else {
    // Treat the response as JSON, although we don't really know what it is
    try {
      JsonPrettifier.prettify(
          request.getService(), responseBodyDiv, response.getBodyAsString(), linkFactory);
    } catch (JsonFormatException e) {
      // If JSON processing fails, just say what we know about the data
      responseBodyDiv.add(new Label("[" + contentType + " data]"));
    }

    // Check if there was an error, and, if so, display it to the user.
    ErrorCase error = getErrorMessage(response);
    if (error != null) {
      setErrorMessage(error.getErrorLabel());
    }
  }
}
 
开发者ID:showlowtech,项目名称:google-apis-explorer,代码行数:54,代码来源:EmbeddedHistoryItemView.java

示例11: close

import com.google.gwt.user.client.ui.Image; //导入方法依赖的package包/类
public Image close() {
    final Image image = new Image(CommonImages.INSTANCE.close());
    image.setAltText(CommonConstants.INSTANCE.Close());
    return image;
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:6,代码来源:CommonAltedImages.java


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