Package org.apache.wicket.markup.html.link

Examples of org.apache.wicket.markup.html.link.Link


   *            {@link #setSelectedTab(int)}.
   * @return created link component
   */
  protected WebMarkupContainer newLink(String linkId, final int index)
  {
    return new Link(linkId)
    {
      private static final long serialVersionUID = 1L;

      public void onClick()
      {
View Full Code Here


    add(new Image("logo"));
    add(new Image("beer"));

    // Add a couple of links to be able to play around with the session
    // locale
    add(new Link("goCanadian")
    {
      private static final long serialVersionUID = 1L;

      public void onClick()
      {
        getSession().setLocale(Locale.CANADA);
      }
    });
    add(new Link("goUS")
    {
      private static final long serialVersionUID = 1L;

      public void onClick()
      {
        getSession().setLocale(Locale.US);
      }
    });
    add(new Link("goDutch")
    {
      private static final long serialVersionUID = 1L;

      public void onClick()
      {
        getSession().setLocale(new Locale("nl", "NL"));
      }
    });
    add(new Link("goGerman")
    {
      private static final long serialVersionUID = 1L;

      public void onClick()
      {
        getSession().setLocale(new Locale("de", "DE"));
      }
    });
    add(new Link("goChinese")
    {
      private static final long serialVersionUID = 1L;

      public void onClick()
      {
        getSession().setLocale(new Locale("zh", "CN"));
      }
    });
    add(new Link("goDanish")
    {
      private static final long serialVersionUID = 1L;

      public void onClick()
      {
View Full Code Here

  /**
   * Constructor
   */
  public EnclosurePage_6()
  {
    add(new Link("link")
    {
      private static final long serialVersionUID = 1L;

      public void onClick()
      {
View Full Code Here

  {
    // Get the index of page this link shall point to
    final int pageIndex = getStartIndex() + loopItem.getIteration();

    // Add a page link pointing to the page
    final Link link = newPagingNavigationLink("pageLink", pageable, pageIndex);
    loopItem.add(link);

    // Add a page number label to the list which is enclosed by the link
    String label = "";
    if (labelProvider != null)
    {
      label = labelProvider.getPageLabel(pageIndex);
    }
    else
    {
      label = String.valueOf(pageIndex + 1);
    }
    link.add(new Label("pageNumber", label));
  }
View Full Code Here

        add(new Label("jai.memory.threshold", new MapModel(values, KEY_JAI_MEM_THRESHOLD)));
        add(new Label("jai.tile.threads", new MapModel(values, KEY_JAI_TILE_THREADS)));
        add(new Label("jai.tile.priority", new MapModel(values, KEY_JAI_TILE_THREAD_PRIORITY)));
        add(new Label("updateSequence", new MapModel(values, KEY_UPDATE_SEQUENCE)));

        add(new Link("free.locks") {
            private static final long serialVersionUID = 1L;

            public void onClick() {
                // TODO: see GEOS-2130
                updateModel();
            }
        });
        add(new Link("free.memory") {
            private static final long serialVersionUID = 1L;

            public void onClick() {
                System.gc();
                System.runFinalization();
                updateModel();
            }
        });
       
        add(new Link("free.memory.jai") {
            private static final long serialVersionUID = 1L;

            public void onClick() {
                SunTileCache jaiCache = getGeoServer().getGlobal().getJAI().getTileCache();
                final long capacityBefore = jaiCache.getMemoryCapacity();
View Full Code Here

            }
        };
    }
   
    private Link cancelLink() {
        return new Link("cancel") {

            @Override
            public void onClick() {
                onCancel();               
            }
View Full Code Here

        localeInput.setOutputMarkupId(true);
        newTranslationForm.add(localeInput);
    }

    private Link cancelLink() {
        return new Link("cancel") {
            private static final long serialVersionUID = -765151069378795644L;

            @Override
            public void onClick() {
                setResponsePage(TranslationPage.class);
View Full Code Here

                final CatalogIconFactory icons = CatalogIconFactory.get();
                LayerInfo layer = layerSummary.getLayer();
        if(property == LAYER) {
                    Fragment f = new Fragment(id, "edit", ImportSummaryPage.this);
                   
                    Link editLink = editLink(layerSummary);
                    editLink.setEnabled(layer != null);
                    f.add(editLink);
                   
                    return f;
                } else if(property == STATUS) {
                    ResourceReference icon = layerSummary.getStatus().successful() ?
View Full Code Here

            }
        });
    }
   
    Link editLink(final LayerSummary layerSummary) {
        Link link = new Link("edit") {

            @Override
            public void onClick() {
                Page p = new ResourceConfigurationPage(layerSummary.getLayer(), true) {
                    @Override
                    protected void onSuccessfulSave() {
                        setResponsePage(ImportSummaryPage.this);
                        layerSummary.setStatus(ImportStatus.SUCCESS);
                    }
                   
                    @Override
                    protected void onCancel() {
                        setResponsePage(ImportSummaryPage.this);
                    }
                };
                setResponsePage(p);
            }
           
        };
       
        // keep the last modified name if possible
        String name;
        if(layerSummary.getLayer() != null)
            name = layerSummary.getLayer().getName();
        else
            name =  layerSummary.getLayerName();
        link.add(new Label("name", name));
       
        // also set a tooltip explaining what this action does
        link.add(new AttributeModifier("title", true, new ParamResourceModel("edit", this, name)));
       
        return link;
    }
View Full Code Here

        return navigation;
    }
   
    @Override
    protected Link newPagingNavigationLink(String id, IPageable pageable, int pageNumber) {
        Link link = super.newPagingNavigationLink(id, pageable, pageNumber);
        // we turn the id into the css class
        link.add(new SimpleAttributeModifier("class", id));
        return link;
    }
View Full Code Here

TOP

Related Classes of org.apache.wicket.markup.html.link.Link

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.