Example usage for com.vaadin.server ThemeResource ThemeResource

List of usage examples for com.vaadin.server ThemeResource ThemeResource

Introduction

In this page you can find the example usage for com.vaadin.server ThemeResource ThemeResource.

Prototype

public ThemeResource(String resourceId) 

Source Link

Document

Creates a resource.

Usage

From source file:org.hip.vif.skin.dflt.Skin.java

License:Open Source License

@Override
public Component getHeader(final String inAppName) {
    final HorizontalLayout outLayout = new HorizontalLayout();
    outLayout.setStyleName("vif-head");
    outLayout.setMargin(false);/*w ww.  j  a va  2 s.  c  o  m*/
    outLayout.setWidth("100%");
    outLayout.setHeight(80, Unit.PIXELS);

    final Embedded lImage = new Embedded();
    lImage.setSource(new ThemeResource("images/vifLogo.gif"));
    outLayout.addComponent(lImage);
    outLayout.setComponentAlignment(lImage, Alignment.TOP_LEFT);
    outLayout.setExpandRatio(lImage, 0.42f);

    final Label lTitle = LabelHelper.createLabel("VIF Forum", "vif-head-title");
    lTitle.setSizeUndefined();
    outLayout.addComponent(lTitle);
    outLayout.setComponentAlignment(lTitle, Alignment.MIDDLE_LEFT);
    outLayout.setExpandRatio(lTitle, 0.58f);

    return outLayout;
}

From source file:org.hip.vif.skin.green.Skin.java

License:Open Source License

@Override
public Component getHeader(final String inAppName) {
    final HorizontalLayout outLayout = new HorizontalLayout();
    outLayout.setWidth("100%");
    outLayout.setHeight(115, Unit.PIXELS);
    outLayout.setStyleName("vif-green-head");

    final Embedded lImage = new Embedded();
    lImage.setSource(new ThemeResource("images/head.jpg"));
    outLayout.addComponent(lImage);//ww w  . j  a va 2  s . c  om
    outLayout.setComponentAlignment(lImage, Alignment.TOP_LEFT);

    final Label lTitle = new Label("VIF - Virtual Discussion Forum");
    lTitle.setStyleName("vif-head-title");
    lTitle.setWidth(700, Unit.PIXELS);
    outLayout.addComponent(lTitle);

    return outLayout;
}

From source file:org.hip.vif.web.util.RatingValue.java

License:Open Source License

/** @return {@link Component} the rating value as embedded gif. */
public Component render() {
    final Embedded out = new Embedded(null, new ThemeResource(String.format(TMPL_IMG, img)));
    out.setStyleName("vif-rating-value"); //$NON-NLS-1$
    out.setDescription(messages.getMessage(msgKey));
    return out;/*w w  w.j  a v a2 s . com*/
}

From source file:org.jdal.vaadin.ui.form.CancelAction.java

License:Apache License

public CancelAction() {
    setIcon(new ThemeResource(DEFAULT_ICON));
}

From source file:org.jdal.vaadin.ui.form.ViewSaveAction.java

License:Apache License

/**
 * @param persistentService//  w  ww .jav a 2  s  .  c o  m
 * @param view
 */
public ViewSaveAction(VaadinView view, Dao persistentService) {
    this.persistentService = persistentService;
    setView(view);
    setIcon(new ThemeResource(DEFAULT_ICON));
}

From source file:org.jdal.vaadin.ui.FormUtils.java

License:Apache License

/**
 * Gets resource from url using the following prefix
 * <ul>/*from w w w  . j  a  va 2  s. c  o m*/
 * <li> classpath: for searching the classpath.</li>
 * <li> theme: for searching in current theme </li>
 * <li> url: to use a url </li>
 * </ul>
 * @param url resource url
 * @return the resource.
 */
public static Resource getResource(String url) {
    Resource resource;

    if (url.startsWith(CLASSPATH_PREFIX))
        resource = new ClassResource(StringUtils.substringAfter(url, CLASSPATH_PREFIX));
    else if (url.startsWith(THEME_PREFIX))
        resource = new ThemeResource(StringUtils.substringAfter(url, THEME_PREFIX));
    else if (url.startsWith(URL_PREFIX))
        resource = new ExternalResource(StringUtils.substringAfter(url, URL_PREFIX));
    else if (url.contains(":"))
        resource = new ExternalResource(url);
    else
        resource = new ThemeResource(url);

    return resource;
}

From source file:org.jdal.vaadin.ui.table.AddAction.java

License:Apache License

public AddAction() {
    setIcon(new ThemeResource("images/table/filenew.png"));
}

From source file:org.jdal.vaadin.ui.table.ClearFilterAction.java

License:Apache License

public ClearFilterAction() {
    setIcon(new ThemeResource("images/table/edit-clear.png"));
}

From source file:org.jdal.vaadin.ui.table.FindAction.java

License:Apache License

public FindAction() {
    setIcon(new ThemeResource("images/table/edit-find.png"));
}

From source file:org.jdal.vaadin.ui.table.RefreshAction.java

License:Apache License

public RefreshAction() {
    setIcon(new ThemeResource("images/table/reload.png"));
}