Example usage for com.vaadin.ui Link TARGET_BORDER_NONE

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

Introduction

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

Prototype

BorderStyle TARGET_BORDER_NONE

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

Click Source Link

Usage

From source file:eu.lod2.AuthoringTab.java

License:Apache License

public AuthoringTab(LOD2DemoState st) {

    // The internal state and 
    state = st;//from   w w w . ja va2 s .  c  o  m

    VerticalLayout authoringTab = new VerticalLayout();

    // Activate a graph in Virtuoso be editable in OntoWiki.
    // Remark: the accessrightsnull in Virtuoso have be set correct [check this]
    Form activateform = new Form();
    activateform.setDebugId(this.getClass().getSimpleName() + "_activateform");
    activateform.setCaption("Activate graph in OntoWiki");

    // the localhost ip-address
    activategraph = new TextField("graphname:", state.getCurrentGraph());
    activategraph.setColumns(50);
    activateform.getLayout().addComponent(activategraph);

    Button activateButton = new Button("Activate graph", new ClickListener() {
        public void buttonClick(ClickEvent event) {
            activateGraph(event);
        }
    });
    activateButton.setDebugId(this.getClass().getSimpleName() + "_activateButton");
    activateButton.setDescription("Activate the graph in Virtuoso to become editable in OntoWiki.");
    activateform.getFooter().addComponent(activateButton);

    authoringTab.addComponent(activateform);

    // add a form widget to edit with OntoWiki (or other editor) a specific resource
    Form t2f = new Form();
    t2f.setCaption("Edit resource content");

    TextField resToEdit = new TextField("Resource:");
    resToEdit.setDebugId(this.getClass().getSimpleName() + "_resToEdit");
    resToEdit.setImmediate(false);
    resToEdit.addListener(this);
    resToEdit.setColumns(50);
    t2f.getLayout().addComponent(resToEdit);

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

    ontowikil = new Link("Edit with Ontowiki",
            new ExternalResource(state.getHostName() + "/ontowiki/view/?r=&m=http://mytest.com"));
    ontowikil.setTargetName("_blank");
    ontowikil.setTargetBorder(Link.TARGET_BORDER_NONE);
    ThemeResource ontoWikiIconl = new ThemeResource("app_images/OntoWiki.logo.png");
    ontowikil.setIcon(ontoWikiIconl);
    ontowikil.setEnabled(false);

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

    authoringTab.addComponent(t2f);

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

    VerticalLayout panelContent = new VerticalLayout();

    Link l = new Link("Ontowiki",
            new ExternalResource(state.getHostName() + "/ontowiki/view/?r=&m=http://mytest.com"));
    l.setTargetName("_blank");
    l.setTargetBorder(Link.TARGET_BORDER_NONE);
    ThemeResource ontoWikiIcon = new ThemeResource("app_images/OntoWiki.logo.png");
    l.setIcon(ontoWikiIcon);
    panelContent.addComponent(l);

    panel.setContent(panelContent);
    authoringTab.addComponent(panel);

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

From source file:eu.lod2.EnrichmentTab.java

License:Apache License

public EnrichmentTab(LOD2DemoState st) {

    // The internal state and 
    state = st;/*from   ww  w  .  j av  a2 s  .  c  o  m*/

    VerticalLayout enrichmentTab = new VerticalLayout();

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

    VerticalLayout panelContent = new VerticalLayout();

    Link l1 = new Link("SILK", new ExternalResource(state.getHostName() + "/silk"));
    l1.setTargetName("_blank");
    l1.setTargetBorder(Link.TARGET_BORDER_NONE);
    panelContent.addComponent(l1);

    Link l = new Link("ORE", new ExternalResource("http://web.ore-tool.net"));
    l.setTargetName("_blank");
    l.setTargetBorder(Link.TARGET_BORDER_NONE);
    panelContent.addComponent(l);

    panel.setContent(panelContent);
    enrichmentTab.addComponent(panel);

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

From source file:eu.lod2.OnlineToolsTab.java

License:Apache License

public OnlineToolsTab(String g, LOD2DemoState st) {

    // The internal state and 
    state = st;//w w  w.  j a  va 2s.  co  m
    storeInGraph = g;

    //************************************************************************
    // OnlineToolsTab
    VerticalLayout onlineToolsTab = new VerticalLayout();

    TextField sid = new TextField("search sameAs id's for:");
    sid.setDebugId(this.getClass().getSimpleName() + "_sid");
    final Label sidenc = new Label("");
    // configure & add to layout
    sid.setImmediate(true);
    sid.setColumns(30);
    sid.addListener(new TextChangeListener() {
        public void textChange(TextChangeEvent event) {
            sameasid = event.getText();
        }
    });

    Button sidbutton = new Button("convert", new ClickListener() {
        public void buttonClick(ClickEvent event) {
            try {
                URI encoded = new URI(sameasid);
                sidenc.setValue("http://sameAs.org/rdf?uri=" + encoded.toASCIIString());
            } catch (Exception e) {
                e.printStackTrace();
            }
            ;
            try {
                //   java.net.URL sameAsData = new java.net.URL("http://sameAs.org/rdf?uri=http%3A%2F%2Fdbpedia.org%2Fresource%2FGermany");

                URI sidencoded = new URI(sameasid);
                java.net.URL sameAsData = new java.net.URL(
                        "http://sameAs.org/rdf?uri=" + sidencoded.toASCIIString());
                String baseURI = "http://sameAs.org#";

                RepositoryConnection con = state.getRdfStore().getConnection();
                Resource contextURI = con.getValueFactory().createURI(storeInGraph);
                Resource[] contexts = new Resource[] { contextURI };
                con.add(sameAsData, baseURI, RDFFormat.RDFXML, contexts);

            } catch (RepositoryException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            } catch (MalformedURLException e) {
                e.printStackTrace();
            } catch (IOException e) {
                e.printStackTrace();
            } catch (RDFParseException e) {
                e.printStackTrace();
            } catch (URISyntaxException e) {
                e.printStackTrace();
            }
            ;
        };
    });

    onlineToolsTab.addComponent(sid);
    onlineToolsTab.addComponent(sidenc);
    onlineToolsTab.addComponent(sidbutton);

    /* Sigma EE is temporarily deprecated
    try { 
       URL url2 = new URL(state.getHostName() + "/lod2.sigma.html");
       Embedded browser2 = new Embedded("", new ExternalResource(url2));
       browser2.setType(Embedded.TYPE_BROWSER);
       browser2.setWidth("100%");
       browser2.setHeight(500);
       onlineToolsTab.addComponent(browser2);   
    } catch (MalformedURLException e) {
       e.printStackTrace();
    };
    */

    /* The online resources link page */
    final Panel panel = new Panel("LOD2 online components");

    VerticalLayout panelContent = new VerticalLayout();

    Link l = new Link("SameAs Inference", new ExternalResource("http://sameAs.org/"));
    l.setTargetName("_blank");
    l.setTargetBorder(Link.TARGET_BORDER_NONE);
    panelContent.addComponent(l);

    Link l2 = new Link("Sig.ma", new ExternalResource("http://sig.ma/"));
    l2.setTargetName("_blank");
    l2.setTargetBorder(Link.TARGET_BORDER_NONE);
    //panelContent.addComponent(l2);

    Link l3 = new Link("LOD cloud", new ExternalResource("http://lod.openlinksw.com/"));
    l3.setTargetName("_blank");
    l3.setTargetBorder(Link.TARGET_BORDER_NONE);
    panelContent.addComponent(l3);

    panel.setContent(panelContent);
    onlineToolsTab.addComponent(panel);

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

From source file:eu.lod2.QueryingTab.java

License:Apache License

public QueryingTab(LOD2DemoState st) {

    // The internal state and 
    state = st;/*  w  w  w . j av  a2s  .co 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);
}