Example usage for com.vaadin.ui Link setTargetBorder

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

Introduction

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

Prototype

public void setTargetBorder(BorderStyle targetBorder) 

Source Link

Document

Sets the border of the target window.

Usage

From source file:eu.lod2.QueryingTab.java

License:Apache License

public QueryingTab(LOD2DemoState st) {

    // The internal state and 
    state = st;/*  w w w. jav  a2 s. c o  m*/

    VerticalLayout queryingTab = new VerticalLayout();

    Form t2f = new Form();
    t2f.setDebugId(this.getClass().getSimpleName() + "_t2f");
    t2f.setCaption("Information Source Querying");

    graphname = new TextField("repository graph name:");
    graphname.setDebugId(this.getClass().getSimpleName() + "_graphname");
    /*      if (state == null | state.getCurrentGraph() == null | state.getCurrentGraph().equals("")) {
             graphname.setValue("");
          } else {
             graphname.setValue(state.getCurrentGraph());
          };
          */

    // configure & add to layout
    graphname.setImmediate(true);
    graphname.addListener(this);
    graphname.setColumns(30);
    graphname.setRequired(true);
    graphname.setRequiredError("Name of the graph is missing. No query will be issued.");
    t2f.getLayout().addComponent(graphname);

    // initialize the footer area of the form
    HorizontalLayout t2ffooterlayout = new HorizontalLayout();
    t2f.setFooter(t2ffooterlayout);

    Button okbutton = new Button("List graph content", new ClickListener() {
        public void buttonClick(ClickEvent event) {
            extractionQuery(event);
        }
    });
    okbutton.setDebugId(this.getClass().getSimpleName() + "_okbutton");
    okbutton.setDescription(
            "View the result from the SPARQL query: 'select * from <graphname> where {?s ?p ?o.} LIMIT 100'");
    //                        okbutton.addListener(this); // react to tclicks

    ExternalResource ontowikiquery = new ExternalResource(
            state.getHostName() + "/ontowiki/queries/editor/?query=&m=http://mytest.com");

    ontowikiquerylink = new Link("Query via Ontowiki", ontowikiquery);
    ontowikiquerylink.setTargetName("_blank");
    ontowikiquerylink.setTargetBorder(Link.TARGET_BORDER_NONE);
    ontowikiquerylink.setEnabled(false);
    ThemeResource ontoWikiIcon = new ThemeResource("app_images/OntoWiki.logo.png");
    ontowikiquerylink.setIcon(ontoWikiIcon);

    t2f.getFooter().addComponent(okbutton);
    t2ffooterlayout.setComponentAlignment(okbutton, Alignment.TOP_RIGHT);
    t2f.getFooter().addComponent(ontowikiquerylink);
    t2ffooterlayout.setComponentAlignment(ontowikiquerylink, Alignment.TOP_RIGHT);

    queryingTab.addComponent(t2f);
    queryingTab.addComponent(sparqlResult);

    final Panel t2components = new Panel("LOD2 components interfaces");

    VerticalLayout t2ComponentsContent = new VerticalLayout();

    // dummy request
    ExternalResource ontowikiquery2 = new ExternalResource(
            state.getHostName() + "/ontowiki/queries/editor/?query=&m=");
    Link ontowikiquerylink2 = new Link("Ontowiki", ontowikiquery2);
    ontowikiquerylink2.setTargetName("_blank");
    ontowikiquerylink2.setTargetBorder(Link.TARGET_BORDER_NONE);
    ThemeResource ontoWikiIcon2 = new ThemeResource("app_images/OntoWiki.logo.png");
    ontowikiquerylink2.setIcon(ontoWikiIcon2);
    t2ComponentsContent.addComponent(ontowikiquerylink2);

    t2components.setContent(t2ComponentsContent);
    queryingTab.addComponent(t2components);

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