Example usage for com.vaadin.ui Link TARGET_BORDER_DEFAULT

List of usage examples for com.vaadin.ui Link TARGET_BORDER_DEFAULT

Introduction

In this page you can find the example usage for com.vaadin.ui Link TARGET_BORDER_DEFAULT.

Prototype

BorderStyle TARGET_BORDER_DEFAULT

To view the source code for com.vaadin.ui Link TARGET_BORDER_DEFAULT.

Click Source Link

Usage

From source file:eu.lod2.Limes.java

License:Apache License

public Limes(LOD2DemoState st) {

    // The internal state and 
    state = st;/*from  w w  w  .  j  a  va2s .  co m*/

    VerticalLayout colanutspatiallayout = new VerticalLayout();

    initColanut = new LOD2DemoInitApp(st, "http://localhost/colanut");

    // Configuration form start
    // Set all properties at once for the moment.
    Form t2f = new Form();
    t2f.setDebugId(this.getClass().getSimpleName() + "_t2f");
    t2f.setCaption("Configuration");

    sourceGraph = new ExportSelector3(state, false, "Select graph with Source Limes data:");
    sourceGraph.setDebugId(this.getClass().getSimpleName() + "_sourceGraph");
    sourceGraph.graphSelector.setDebugId(this.getClass().getSimpleName() + "_graphSelector" + "_sourceGraph");
    t2f.getLayout().addComponent(sourceGraph);

    targetGraph = new ExportSelector3(state, false, "Select graph with Target Limes data:");
    targetGraph.setDebugId(this.getClass().getSimpleName() + "_targetGraph");
    targetGraph.graphSelector.setDebugId(this.getClass().getSimpleName() + "_graphSelector" + "_targetGraph");
    t2f.getLayout().addComponent(targetGraph);
    // initialize the footer area of the form
    HorizontalLayout t2ffooterlayout = new HorizontalLayout();
    t2f.setFooter(t2ffooterlayout);

    Button commitButton = new Button("Set configuration", new ClickListener() {
        public void buttonClick(ClickEvent event) {
            storeConfiguration(event);
        }
    });
    commitButton.setDebugId(this.getClass().getSimpleName() + "_commitButton");
    commitButton.setDescription("Commit the new configuration settings.");
    t2f.getFooter().addComponent(commitButton);

    colanutspatiallayout.addComponent(t2f);
    try {

        URL url = new URL(initColanut.service + "?se="
                + URLEncoder.encode("http://localhost:8890/sparql", "UTF-8") + "&te="
                + URLEncoder.encode("http://localhost:8890/sparql", "UTF-8") + "&sgp=source&tgp=target");
        colanutLink = new Link("Open ColaNut - the web interface for Limes", new ExternalResource(url));
        colanutLink.setTargetName("second");
        colanutLink.setTargetHeight(500);
        colanutLink.setTargetWidth(1000);
        colanutLink.setTargetBorder(Link.TARGET_BORDER_DEFAULT);
        colanutLink.setVisible(false);
        colanutspatiallayout.addComponent(colanutLink);

    } catch (UnsupportedEncodingException e) {
        e.printStackTrace();
    } catch (MalformedURLException e) {
        e.printStackTrace();
    }
    ;

    // Configuration form end
    /* do not use it as the visualisation is not so nice
            colanutbrowser = new Embedded();
            try { 
            
    URL url = new URL(state.getHostName() + "/colanut?se="+
                      URLEncoder.encode("http://localhost:8890/sparql", "UTF-8") + 
                      "&te=" + URLEncoder.encode("http://localhost:8890/sparql", "UTF-8") +
                      "&sgp=source&tgp=target");
    colanutbrowser = new Embedded("", new ExternalResource(url));
    colanutbrowser.setType(Embedded.TYPE_BROWSER);
    colanutspatiallayout.addComponent(colanutbrowser);
    colanutbrowser.setHeight(1000, Sizeable.UNITS_PIXELS);
    colanutbrowser.setWidth(1000, Sizeable.UNITS_PIXELS);
            } catch (UnsupportedEncodingException e) { 
    e.printStackTrace();
            } catch (MalformedURLException e) {
    e.printStackTrace();
            };
    */

    // The composition root MUST be set
    setCompositionRoot(colanutspatiallayout);
}