本文整理汇总了Java中com.google.gwt.user.client.ui.Image.addStyleName方法的典型用法代码示例。如果您正苦于以下问题:Java Image.addStyleName方法的具体用法?Java Image.addStyleName怎么用?Java Image.addStyleName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.user.client.ui.Image
的用法示例。
在下文中一共展示了Image.addStyleName方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: SolverStatus
import com.google.gwt.user.client.ui.Image; //导入方法依赖的package包/类
public SolverStatus() {
super("unitime-SolverStatus");
iStatus = new P("status-label");
iIcon = new Image(RESOURCES.helpIcon()); iIcon.addStyleName("status-icon");
iIcon.setVisible(false);
add(iStatus); add(iIcon);
RPC.execute(new PageNameRpcRequest("Solver Status"), new AsyncCallback<PageNameInterface>() {
@Override
public void onFailure(Throwable caught) {}
@Override
public void onSuccess(final PageNameInterface result) {
iIcon.setTitle(MESSAGES.pageHelp(result.getName()));
iIcon.setVisible(true);
iIcon.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
if (result.getHelpUrl() == null || result.getHelpUrl().isEmpty()) return;
UniTimeFrameDialog.openDialog(MESSAGES.pageHelp(result.getName()), result.getHelpUrl());
}
});
}
});
}
示例2: 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);
}
});
}
示例3: makeImage
import com.google.gwt.user.client.ui.Image; //导入方法依赖的package包/类
private Widget makeImage(final TablePanel.View v) {
Image img = new Image(v.getIcon());
img.setSize("24px", "24px");
if (v.getName().equals(selView)) {
img.addStyleName("selected-view");
return img;
} else {
Widget w = GwtUtil.makeImageButton(img, v.getShortDesc(), new ClickHandler() {
public void onClick(ClickEvent event) {
selView = v.getName();
TablePanel table = hub.getActiveTable();
table.switchView(selView);
layout();
}
});
w.addStyleName("selectable-view");
return w;
}
}
示例4: addImage
import com.google.gwt.user.client.ui.Image; //导入方法依赖的package包/类
private Image addImage()
{
AbstractImagePrototype imageprototype = AbstractImagePrototype.create( Icons.s_instance
.strategy_padlock() );
if( GameEngine.model().getZoomDisplayed().getValue() == EnuZoom.Medium )
{
imageprototype = AbstractImagePrototype.create( Icons.s_instance.tactic_padlock() );
}
Image image = null;
if( !m_unusedImages.isEmpty() )
{
image = m_unusedImages.iterator().next();
imageprototype.applyTo( image );
image.setVisible( true );
m_unusedImages.remove( image );
}
else
{
image = imageprototype.createImage();
add( image );
DOM.setStyleAttribute( image.getElement(), "zIndex", "1000" );
image.addStyleName( "transparent50" );
}
m_usedImages.add( image );
return image;
}
示例5: show
import com.google.gwt.user.client.ui.Image; //导入方法依赖的package包/类
private void show (Resource resource, boolean withImage) {
if (resource != null) {
txtName.setValue(resource.name);
txtData.setValue(resource.data);
txtDescription.setValue(resource.description);
txtProperties.setValue(resource.properties);
txtType.setValue(
resource.type == null ? "" : resource.type.toString());
uplDragAndDrop.setVisible(false);
if (withImage) {
Image image = new Image("upload?blob-key="
+ resource.data.replace("gs://", ""));
image.addStyleName("img-rounded");
image.addStyleName("img-responsive");
image.addStyleName("center-block");
pnlResourcePreview.add(image);
}
}
}
示例6: createUserItem
import com.google.gwt.user.client.ui.Image; //导入方法依赖的package包/类
private ListGroupItem createUserItem(final SocialUser socialUser,
final boolean follow) {
final ListGroupItem user = new ListGroupItem();
final Image userImage = imageProvider.getImageForSocialUser(socialUser,
ImageSize.SMALL);
userImage.addStyleName("img-circle");
userImage.addStyleName(Styles.PULL_LEFT);
user.getWidget(0).getElement().getStyle().setPaddingLeft(10,
Style.Unit.PX);
user.add(userImage);
user.setText(socialUser.getName());
if (socialUser.getUserName().equals(socialLoggedUser.getUserName()) == false) {
user.add(createFollowButton(socialUser,
follow));
}
return user;
}
示例7: Check
import com.google.gwt.user.client.ui.Image; //导入方法依赖的package包/类
Check(boolean value, String onMessage, String offMessage) {
Image image = new Image(value ? RESOURCES.on() : RESOURCES.off());
image.addStyleName("image");
add(image);
InlineHTML text = new InlineHTML(value ? onMessage : offMessage);
text.addStyleName("message");
add(text);
if (value)
addStyleName("check-enabled");
else
addStyleName("check-disabled");
}
示例8: updateAppImage
import com.google.gwt.user.client.ui.Image; //导入方法依赖的package包/类
/**
* Helper method to update the app image
* @param url The URL of the image to show
* @param container The container that image widget resides
*/
private void updateAppImage(String url, final Panel container) {
image = new Image();
image.addStyleName("app-image");
image.setUrl(url);
// if the user has provided a gallery app image, we'll load it. But if not
// the error will occur and we'll load default image
image.addErrorHandler(new ErrorHandler() {
public void onError(ErrorEvent event) {
image.setUrl(GalleryApp.DEFAULTGALLERYIMAGE);
}
});
container.add(image);
if(gallery.getSystemEnvironment() != null &&
gallery.getSystemEnvironment().toString().equals("Development")){
final OdeAsyncCallback<String> callback = new OdeAsyncCallback<String>(
// failure message
MESSAGES.galleryError()) {
@Override
public void onSuccess(String newUrl) {
image.setUrl(newUrl + "?" + System.currentTimeMillis());
}
};
Ode.getInstance().getGalleryService().getBlobServingUrl(url, callback);
}
}
示例9: updateUserImage
import com.google.gwt.user.client.ui.Image; //导入方法依赖的package包/类
/**
* Helper method to update the user's image
* @param url The URL of the image to show
* @param container The container that image widget resides
*/
private void updateUserImage(final String url, Panel container) {
userAvatar = new Image();
//setUrl if the new URL is the same one as it was before; an easy workaround is
//to make the URL unique so it forces the browser to reload
userAvatar.setUrl(url + "?" + System.currentTimeMillis());
userAvatar.addStyleName("app-image");
if (profileStatus == PRIVATE) {
//userAvatar.addStyleName("status-updating");
}
// if the user has provided a gallery app image, we'll load it. But if not
// the error will occur and we'll load default image
userAvatar.addErrorHandler(new ErrorHandler() {
public void onError(ErrorEvent event) {
userAvatar.setUrl(GalleryApp.DEFAULTUSERIMAGE);
}
});
container.add(userAvatar);
if(gallery.getSystemEnvironment() != null &&
gallery.getSystemEnvironment().toString().equals("Development")){
final OdeAsyncCallback<String> callback = new OdeAsyncCallback<String>(
// failure message
MESSAGES.galleryError()) {
@Override
public void onSuccess(String newUrl) {
userAvatar.setUrl(newUrl + "?" + System.currentTimeMillis());
}
};
Ode.getInstance().getGalleryService().getBlobServingUrl(url, callback);
}
}
示例10: LatLonWidget
import com.google.gwt.user.client.ui.Image; //导入方法依赖的package包/类
/**
* Constructs an empty widget.
*/
public LatLonWidget() {
panel = new Grid(1,3);
middle = new VerticalPanel();
rose = new Image(GWT.getModuleBaseURL()+"../images/compass_rose.png");
rose.addStyleName("OL_MAP-middle");
southLat = new TextBox();
northLat = new TextBox();
southLat.setWidth(boxWidth);
northLat.setWidth(boxWidth);
eastLon = new TextBox();
westLon = new TextBox();
eastLon.setWidth(boxWidth);
westLon.setWidth(boxWidth);
panel.setWidget(0, 0, westLon);
middle.add(northLat);
middle.add(rose);
middle.add(southLat);
panel.setWidget(0, 1, middle);
panel.setWidget(0, 2, eastLon);
// panel.getFlexCellFormatter().setColSpan(2, 0, 2);
initWidget(panel);
}
示例11: 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;
}
示例12: ImageButton
import com.google.gwt.user.client.ui.Image; //导入方法依赖的package包/类
public ImageButton(Image image, String tip, ClickHandler handler) {
fp = new FocusPanel();
this.image = image;
image.setTitle(tip);
image.addStyleName("imageTypeButton");
fp.setWidget(image);
if (handler != null) fp.addClickHandler(handler);
initWidget(fp);
}
示例13: drawTransparentImage
import com.google.gwt.user.client.ui.Image; //导入方法依赖的package包/类
private void drawTransparentImage(AbstractImagePrototype p_image, AnBoardPosition p_position)
{
Image image = m_images.getNextImage();
p_image.applyTo( image );
DOM.setStyleAttribute( image.getElement(), "zIndex", "1000" );
image.addStyleName( "transparent50" );
setWidgetHexPosition( image, p_position );
}
示例14: 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;
}