Example usage for com.vaadin.server ExternalResource getURL

List of usage examples for com.vaadin.server ExternalResource getURL

Introduction

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

Prototype

public String getURL() 

Source Link

Document

Gets the URL of the external resource.

Usage

From source file:cb_server.LogInWindow.java

License:Open Source License

private LogInWindow() {

    super("Get API Key"); // Set window caption

    this.setWidth(50, Unit.PERCENTAGE);
    this.setHeight(80, Unit.PERCENTAGE);

    center();//from  www  . j a  va 2 s . c o  m

    URL url;
    try {

        String oAuthUrl = CB_Api.getGcAuthUrl();

        url = new URL(oAuthUrl);

        ExternalResource extRes = new ExternalResource(url);

        extRes.getURL();

        BrowserFrame browser = new BrowserFrame("", extRes);

        browser.setWidth(100, Unit.PERCENTAGE);
        browser.setHeight(100, Unit.PERCENTAGE);

        content = new VerticalLayout();
        content.setWidth(100, Unit.PERCENTAGE);
        content.setHeight(100, Unit.PERCENTAGE);
        setContent(content);

        //         browser.addListener(eventType, target, method);

        content.addComponent(browser);
    } catch (MalformedURLException e) {

        e.printStackTrace();
    }
}

From source file:de.uni_tuebingen.qbic.qbicmainportlet.ButtonLink.java

License:Open Source License

public void setResource(ExternalResource externalResource) {
    buildHTMLCode(externalResource.getURL());
    super.setContentMode(ContentMode.HTML);
}

From source file:org.opencms.ui.components.CmsToolBar.java

License:Open Source License

/**
 * Creates the button HTML for the given icon resource.<p>
 *
 * @param icon the icon//from www.j  a v  a2s.  c om
 *
 * @return the HTML
 */
static String getDropDownButtonHtml(ExternalResource icon) {

    return "<div tabindex=\"0\" role=\"button\" class=\"v-button v-widget borderless v-button-borderless "
            + OpenCmsTheme.TOOLBAR_BUTTON + " v-button-" + OpenCmsTheme.TOOLBAR_BUTTON
            + "\"><span class=\"v-button-wrap\"><img class=\"v-icon\" src=\"" + icon.getURL()
            + "\" /></span></div>";
}