com.google.gwt.user.client.ui.AbstractImagePrototype Java Examples

The following examples show how to use com.google.gwt.user.client.ui.AbstractImagePrototype. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AbstractPaletteItemWidget.java    From appinventor-extensions with Apache License 2.0 6 votes vote down vote up
AbstractPaletteItemWidget(SimpleComponentDescriptor scd, ImageResource image) {
  this.scd = scd;

  AbstractImagePrototype.create(image).applyTo(this);
  this.addStyleName("ode-SimplePaletteItem-button");

  addClickHandler(new ClickHandler() {
    @Override
    public void onClick(ClickEvent event) {
      handleClick();
    }
  });
  addTouchStartHandler(new TouchStartHandler() {
    @Override
    public void onTouchStart(TouchStartEvent touchStartEvent) {
      // Otherwise captured by SimplePaletteItem
      touchStartEvent.stopPropagation();
    }
  });
  addTouchEndHandler(new TouchEndHandler() {
    @Override
    public void onTouchEnd(TouchEndEvent touchEndEvent) {
      handleClick();
    }
  });
}
 
Example #2
Source File: CellBrowser.java    From consulo with Apache License 2.0 6 votes vote down vote up
/**
 * Get the HTML representation of an image.
 *
 * @param res the {@link ImageResource} to render as HTML
 * @return the rendered HTML
 */
private SafeHtml getImageHtml(ImageResource res) {
  // Right-justify image if LTR, left-justify if RTL
  AbstractImagePrototype proto = AbstractImagePrototype.create(res);
  SafeHtml image = proto.getSafeHtml();

  SafeStylesBuilder cssBuilder = new SafeStylesBuilder();
  if (LocaleInfo.getCurrentLocale().isRTL()) {
    cssBuilder.appendTrustedString("left:0px;");
  } else {
    cssBuilder.appendTrustedString("right:0px;");
  }
  cssBuilder.appendTrustedString("width: " + res.getWidth() + "px;");
  cssBuilder.appendTrustedString("height: " + res.getHeight() + "px;");
  return template.imageWrapper(cssBuilder.toSafeStyles(), image);
}
 
Example #3
Source File: TableImages.java    From document-management-system with GNU General Public License v2.0 6 votes vote down vote up
@Override
public AbstractImagePrototype scrollTableFillWidth() {
	return new AbstractImagePrototype() {
		public void applyTo(Image image) {
			image.setUrl("img/fill_width.gif");
		}

		public Image createImage() {
			return new Image("img/fill_width.gif");
		}

		public String getHTML() {
			return "<img border=\"0\" src=\"img/fill_width.gif\"/>";
		}
	};
}
 
Example #4
Source File: TableImages.java    From document-management-system with GNU General Public License v2.0 6 votes vote down vote up
@Override
public AbstractImagePrototype scrollTableDescending() {
	return new AbstractImagePrototype() {
		public void applyTo(Image image) {
			image.setUrl("img/sort_desc.gif");
		}

		public Image createImage() {
			return new Image("img/sort_desc.gif");
		}

		public String getHTML() {
			return "<img border=\"0\" src=\"img/sort_desc.gif\"/>";
		}
	};
}
 
Example #5
Source File: TableImages.java    From document-management-system with GNU General Public License v2.0 6 votes vote down vote up
@Override
public AbstractImagePrototype scrollTableAscending() {
	return new AbstractImagePrototype() {
		public void applyTo(Image image) {
			image.setUrl("img/sort_asc.gif");
		}

		public Image createImage() {
			return new Image("img/sort_asc.gif");
		}

		public String getHTML() {
			return "<img border=\"0\" src=\"img/sort_asc.gif\"/>";
		}
	};
}
 
Example #6
Source File: TreeTable.java    From core with GNU Lesser General Public License v2.1 5 votes vote down vote up
public void setImage(AbstractImagePrototype image) {
  Element child = DOM.getFirstChild(this.image);
  if (child == null) {
    DOM.appendChild(this.image, image.createElement().<Element> cast());
  } else {
    image.applyTo(child.<AbstractImagePrototype.ImagePrototypeElement> cast());
  }
}
 
Example #7
Source File: SearchFilterField.java    From geofence with GNU General Public License v2.0 5 votes vote down vote up
public void setIcon(AbstractImagePrototype icon) {
    if (rendered) {
        El oldIcon = el().selectNode(style);
        if (oldIcon != null) {
            oldIcon.remove();
        }
        if (icon != null) {
            Element e = icon.createElement().cast();
            El.fly(e).addStyleName(style);
            el().insertChild(e, 0);
        }
    }
    this.icon = icon;
}
 
Example #8
Source File: Images.java    From reladomo with Apache License 2.0 4 votes vote down vote up
@Resource("image/button/refresh_on.gif")
public AbstractImagePrototype refreshOn();
 
Example #9
Source File: SearchFilterField.java    From geofence with GNU General Public License v2.0 4 votes vote down vote up
public AbstractImagePrototype getIcon() {
    return icon;
}
 
Example #10
Source File: Images.java    From reladomo with Apache License 2.0 4 votes vote down vote up
@Resource("image/button/sql_is_max_on_off.gif")
public AbstractImagePrototype sqlIsMaxOnOff();
 
Example #11
Source File: Images.java    From reladomo with Apache License 2.0 4 votes vote down vote up
@Resource("image/button/sql_is_max_on_on.gif")
public AbstractImagePrototype sqlIsMaxOnOn();
 
Example #12
Source File: Images.java    From reladomo with Apache License 2.0 4 votes vote down vote up
@Resource("image/button/sql_is_off_off.gif")
public AbstractImagePrototype sqlIsOffOff();
 
Example #13
Source File: Images.java    From reladomo with Apache License 2.0 4 votes vote down vote up
@Resource("image/button/sql_is_off_on.gif")
public AbstractImagePrototype sqlIsOffOn();
 
Example #14
Source File: Images.java    From reladomo with Apache License 2.0 4 votes vote down vote up
@Resource("image/button/sql_is_on_off.gif")
public AbstractImagePrototype sqlIsOnOff();
 
Example #15
Source File: Images.java    From reladomo with Apache License 2.0 4 votes vote down vote up
@Resource("image/button/filter_off.gif")
public AbstractImagePrototype filterOff();
 
Example #16
Source File: Images.java    From reladomo with Apache License 2.0 4 votes vote down vote up
@Resource("image/button/refresh_off.gif")
public AbstractImagePrototype refreshOff();
 
Example #17
Source File: Images.java    From reladomo with Apache License 2.0 4 votes vote down vote up
@Resource("image/button/force_gc_on.gif")
public AbstractImagePrototype forceGcOn();
 
Example #18
Source File: Images.java    From reladomo with Apache License 2.0 4 votes vote down vote up
@Resource("image/button/force_gc_off.gif")
public AbstractImagePrototype forceGcOff();
 
Example #19
Source File: Images.java    From reladomo with Apache License 2.0 4 votes vote down vote up
@Resource("image/button/clear_all_partially_cached_on.gif")
public AbstractImagePrototype clearAllPartiallyCachedOn();
 
Example #20
Source File: Images.java    From reladomo with Apache License 2.0 4 votes vote down vote up
@Resource("image/button/clear_all_partially_cached_off.gif")
public AbstractImagePrototype clearAllPartiallyCachedOff();
 
Example #21
Source File: Images.java    From reladomo with Apache License 2.0 4 votes vote down vote up
@Resource("image/button/clear_cache_off.gif")
public AbstractImagePrototype clearCacheOff();
 
Example #22
Source File: Images.java    From reladomo with Apache License 2.0 4 votes vote down vote up
@Resource("image/button/sql_is_on_on.gif")
public AbstractImagePrototype sqlIsOnOn();
 
Example #23
Source File: Images.java    From reladomo with Apache License 2.0 4 votes vote down vote up
@Resource("image/button/filter_on.gif")
public AbstractImagePrototype filterOn();
 
Example #24
Source File: Images.java    From reladomo with Apache License 2.0 4 votes vote down vote up
@Resource("image/button/reload_cache_off.gif")
public AbstractImagePrototype reloadCacheOff();
 
Example #25
Source File: Images.java    From reladomo with Apache License 2.0 4 votes vote down vote up
@Resource("image/button/reload_cache_on.gif")
public AbstractImagePrototype reloadCacheOn();
 
Example #26
Source File: Images.java    From reladomo with Apache License 2.0 4 votes vote down vote up
@Resource("image/button/clear_cache_on.gif")
public AbstractImagePrototype clearCacheOn();
 
Example #27
Source File: GeofenceIcons.java    From geofence with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Delete aoi.
 * 
 * @return the abstract image prototype
 */
@Resource("aoi_del.png")
AbstractImagePrototype deleteAOI();
 
Example #28
Source File: GeofenceIcons.java    From geofence with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Adds the.
 * 
 * @return the abstract image prototype
 */
@Resource("add.gif")
AbstractImagePrototype add();
 
Example #29
Source File: GeofenceIcons.java    From geofence with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Arrow down.
 * 
 * @return the abstract image prototype
 */
@Resource("arrow_down.png")
AbstractImagePrototype arrowDown();
 
Example #30
Source File: GeofenceIcons.java    From geofence with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Arrow up.
 * 
 * @return the abstract image prototype
 */
@Resource("arrow_up.png")
AbstractImagePrototype arrowUp();