Java Code Examples for com.google.gwt.resources.client.ImageResource

The following examples show how to use com.google.gwt.resources.client.ImageResource. These examples are extracted from open source projects. 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
@Override
  public void render(Context context, TemplateInfo template, SafeHtmlBuilder sb) {
  if (template == null)
    return;
  sb.appendHtmlConstant("<table style='margin: 4pt 0;'>");

  // Add the thumbnail image, if available, or a default image.
  sb.appendHtmlConstant("<tr><td rowspan='3' width=\"32px\">");
  if ( !template.thumbStr.equals("") )   {
    String src = hostUrl + TEMPLATES_ROOT_DIRECTORY +   template.name + "/" + template.thumbStr;
    sb.appendHtmlConstant("<img style='width:32px' src='" + src + "'>");
  } else {
    ImageResource imgResource = Ode.getImageBundle().appInventorLogo();
    Image img = new Image(imgResource);
    String url = img.getUrl();
    sb.appendHtmlConstant("<img style='width:32px' src='" + url + "'>");
  }
  sb.appendHtmlConstant("</td>");

  // Add the name and description.
  sb.appendHtmlConstant("<td style='font-size:95%;'><b>");
  sb.appendEscaped(template.name);
  sb.appendHtmlConstant("</b></td></tr><tr><td>");
  sb.appendEscaped(template.subtitle);
  sb.appendHtmlConstant("</td></tr></table>");
}
 
Example 2
Source Project: appinventor-extensions   Source File: MockTextBoxBase.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Creates a new MockTextBox component.
 *
 * @param editor  editor of source file the component belongs to
 */
MockTextBoxBase(SimpleEditor editor, String type, ImageResource icon) {
  super(editor, type, icon);

  // Initialize mock textbox UI
  textBoxWidget = new TextBox();
  initWrapper(textBoxWidget);
}
 
Example 3
Source Project: appinventor-extensions   Source File: MockMapFeatureBase.java    License: Apache License 2.0 5 votes vote down vote up
MockMapFeatureBase(SimpleEditor editor, String type, ImageResource icon) {
  super(editor, type, icon);
  panel = new SimplePanel();
  panel.setStylePrimaryName("ode-SimpleMockComponent");
  initComponent(panel);
  this.unsinkEvents(Event.MOUSEEVENTS);
}
 
Example 4
Source Project: appinventor-extensions   Source File: Ode.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Helper method to create push buttons.
 *
 * @param img  image to shown on face of push button
 * @param tip  text to show in tooltip
 * @return  newly created push button
 */
public static PushButton createPushButton(ImageResource img, String tip,
                                          ClickHandler handler) {
  PushButton pb = new PushButton(new Image(img));
  pb.addClickHandler(handler);
  pb.setTitle(tip);
  return pb;
}
 
Example 5
Source Project: EasyML   Source File: Resources.java    License: Apache License 2.0 4 votes vote down vote up
@Source("dir_close.png")
ImageResource getTreeClosed();
 
Example 6
Source Project: EasyML   Source File: Resources.java    License: Apache License 2.0 4 votes vote down vote up
@Source("dir_close.png")
ImageResource getTreeLeaf();
 
Example 7
Source Project: EasyML   Source File: TreeImageResources.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public ImageResource treeClosed() {
	return Resources.instance.getTreeClosed();
}
 
Example 8
Source Project: EasyML   Source File: TreeImageResources.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public ImageResource treeLeaf() {
	return Resources.instance.getTreeLeaf();
}
 
Example 9
Source Project: EasyML   Source File: TreeImageResources.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public ImageResource treeOpen() {
	return Resources.instance.getTreeOpen();
}
 
Example 10
Source Project: appinventor-extensions   Source File: GalleryImages.java    License: Apache License 2.0 4 votes vote down vote up
@Source("androidIcon.png")
ImageResource androidIcon();
 
Example 11
Source Project: appinventor-extensions   Source File: MockToggleBase.java    License: Apache License 2.0 4 votes vote down vote up
public MockToggleBase(SimpleEditor editor, String type, ImageResource icon) {
  super(editor, type, icon);
}
 
Example 12
Source Project: appinventor-extensions   Source File: MockPolygonBase.java    License: Apache License 2.0 4 votes vote down vote up
public MockPolygonBase(SimpleEditor editor, String type, ImageResource image) {
  super(editor, type, image);
}
 
Example 13
Source Project: appinventor-extensions   Source File: Images.java    License: Apache License 2.0 4 votes vote down vote up
/**
 * Designer item: WebViewer component in designer
 */
// The image here is public domain and comes from
// www.pdclipart.org/displayimage.php/?pid=1047
@Source("com/google/appinventor/images/webviewerbig.png")
ImageResource webviewerbig();
 
Example 14
Source Project: appinventor-extensions   Source File: Images.java    License: Apache License 2.0 2 votes vote down vote up
/**
 * Built in drawer item: procedures
 */
@Source("com/google/appinventor/images/procedures.png")
ImageResource procedures();
 
Example 15
Source Project: appinventor-extensions   Source File: Images.java    License: Apache License 2.0 2 votes vote down vote up
/**
 * Built in drawer item: logic
 */
@Source("com/google/appinventor/images/logic.png")
ImageResource logic();
 
Example 16
Source Project: appinventor-extensions   Source File: Images.java    License: Apache License 2.0 2 votes vote down vote up
/**
 * Designer palette item: Map
 */
@Source("com/google/appinventor/images/map.png")
ImageResource map();
 
Example 17
Source Project: appinventor-extensions   Source File: Images.java    License: Apache License 2.0 2 votes vote down vote up
/**
 * Designer palette item: Lego Mindstorms NXT components
 */
@Source("com/google/appinventor/images/legoMindstormsNxt.png")
ImageResource legoMindstormsNxt();
 
Example 18
/**
 * Creates a new instance of a visible component.
 *
 * @param editor  editor of source file the component belongs to
 */
MockVisibleComponent(SimpleEditor editor, String type, ImageResource icon) {
  super(editor, type, new Image(icon));
}
 
Example 19
Source Project: appinventor-extensions   Source File: Images.java    License: Apache License 2.0 2 votes vote down vote up
/**
 * Built in drawer item: variables
 */
@Source("com/google/appinventor/images/variables.png")
ImageResource variables();
 
Example 20
Source Project: appinventor-extensions   Source File: Images.java    License: Apache License 2.0 2 votes vote down vote up
/**
 * Designer palette item: Rectangle
 */
@Source("com/google/appinventor/images/rectangle.png")
ImageResource rectangle();
 
Example 21
Source Project: appinventor-extensions   Source File: Images.java    License: Apache License 2.0 2 votes vote down vote up
/**
 * Designer pallete item: PhoneStatus Component
 */
@Source("com/google/appinventor/images/phoneip.png")
ImageResource phonestatusComponent();
 
Example 22
Source Project: appinventor-extensions   Source File: Images.java    License: Apache License 2.0 2 votes vote down vote up
/**
 * App Inventor Logo
 * {@link Ode#createWelcomeDialog(boolean)}
 */
@Source("com/google/appinventor/images/appinvlogo-32.png")
ImageResource appInventorLogo();
 
Example 23
Source Project: appinventor-extensions   Source File: Images.java    License: Apache License 2.0 2 votes vote down vote up
/**
 * Close button image for the box widget
 */
@Source("com/google/appinventor/images/boxClose.png")
ImageResource boxClose();
 
Example 24
Source Project: appinventor-extensions   Source File: Images.java    License: Apache License 2.0 2 votes vote down vote up
/**
 * Designer palette item: cloudDB component
 */
@Source("com/google/appinventor/images/cloudDB.png")
ImageResource cloudDB();
 
Example 25
Source Project: appinventor-extensions   Source File: Images.java    License: Apache License 2.0 2 votes vote down vote up
/**
 * Minimize button image for the box widget
 */
@Source("com/google/appinventor/images/boxMinimize.png")
ImageResource boxMinimize();
 
Example 26
Source Project: appinventor-extensions   Source File: Images.java    License: Apache License 2.0 2 votes vote down vote up
/**
 * Restore button image for the box widget
 */
@Source("com/google/appinventor/images/boxRestore.png")
ImageResource boxRestore();
 
Example 27
Source Project: appinventor-extensions   Source File: Images.java    License: Apache License 2.0 2 votes vote down vote up
/**
 * Close button image for the tab widget
 */
@Source("com/google/appinventor/images/close.png")
ImageResource close();
 
Example 28
Source Project: appinventor-extensions   Source File: Images.java    License: Apache License 2.0 2 votes vote down vote up
/**
 * Phone status bar shown above the form in the visual designer
 */
@Source("com/google/appinventor/images/phonebar.png")
ImageResource phonebar();
 
Example 29
Source Project: appinventor-extensions   Source File: Images.java    License: Apache License 2.0 2 votes vote down vote up
/**
 * Designer palette item: GyroscopeSensor component
 */
@Source("com/google/appinventor/images/gyroscopesensor.png")
ImageResource gyroscopesensor();
 
Example 30
Source Project: appinventor-extensions   Source File: Images.java    License: Apache License 2.0 2 votes vote down vote up
/**
 * Designer palette item: Lego Mindstorms EV3 components
 */
@Source("com/google/appinventor/images/legoMindstormsEv3.png")
ImageResource legoMindstormsEv3();