Package org.apache.wicket

Examples of org.apache.wicket.AttributeModifier


                } else if(property == TYPE) {
                    if(layer != null) {
                        ResourceReference icon = icons.getSpecificLayerIcon(layer);
                        Fragment f = new Fragment(id, "iconFragment", ImportSummaryPage.this);
                        Image image = new Image("icon", icon);
                        image.add(new AttributeModifier("title", true, new Model(getTypeTooltip(layer))));
            f.add(image);
                        return f;
                    } else {
                        return new Label(id, "");
                    }
View Full Code Here


        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

        add(new Label("project", importer.getProject()));
        add(info = new WebMarkupContainer("info"));
        info.setOutputMarkupId(true);
        info.add(bar = new Label("bar", "0"));
        widthModel = new Model("width: 0%;");
        bar.add(new AttributeModifier("style", widthModel));
        info.add(percentage = new Label("percentage", "0"));
        info.add(currentFile = new Label("currentFile", ""));
        info.add(new AjaxLink("cancel") {

            @Override
View Full Code Here

                item.add(new Label("category.header", new StringResourceModel(category.getNameKey(), (Component) null, null)));
                item.add(new ListView("category.links", links.get(category)){
                    public void populateItem(ListItem item){
                        MenuPageInfo info = (MenuPageInfo)item.getModelObject();
                        BookmarkablePageLink link = new BookmarkablePageLink("link", info.getComponentClass());
                        link.add(new AttributeModifier("title", true, new StringResourceModel(info.getDescriptionKey(), (Component) null, null)));
                        link.add(new Label("link.label", new StringResourceModel(info.getTitleKey(), (Component) null, null)));
                        Image image;
                        if(info.getIcon() != null) {
                            image = new Image("link.icon", new ResourceReference(info.getComponentClass(), info.getIcon()));
                        } else {
                            image = new Image("link.icon", new ResourceReference(GeoServerBasePage.class, "img/icons/silk/wrench.png"));
                        }
                        image.add(new AttributeModifier("alt", true, new ParamResourceModel(info.getTitleKey(), null)));
                        link.add(image);
                        item.add(link);
                    }
                });
            }
        });

        add(new ListView("standalone", standalone){
                    public void populateItem(ListItem item){
                        MenuPageInfo info = (MenuPageInfo)item.getModelObject();
                        BookmarkablePageLink link = new BookmarkablePageLink("link", info.getComponentClass());
                        link.add(new AttributeModifier("title", true, new StringResourceModel(info.getDescriptionKey(), (Component) null, null)));
                        link.add(new Label("link.label", new StringResourceModel(info.getTitleKey(), (Component) null, null)));
                        item.add(link);
                       
                    }
                }
View Full Code Here

                + "REQUEST=GetLegendGraphic&VERSION=1.0.0&FORMAT=image/png&WIDTH=20&HEIGHT=20&STRICT=false&style=";
        StyleInfo styleInfo = (StyleInfo) styleInfoModel.getObject();
        if (styleInfo != null) {
            String style = styleInfo.getName();
            url += style;
            image.add(new AttributeModifier("src", new Model(url)));
            if (target != null) {
                target.addComponent(image);
            }
        }
    }
View Full Code Here

        for (int i = 0; i < wmsOutputFormats.size(); i++) {
            String wmsOutputFormat = wmsOutputFormats.get(i);
            String label = translateFormat("format.wms.", wmsOutputFormat);
            // build option with text and value
            Label format = new Label(i + "", label);
            format.add(new AttributeModifier("value", true, new Model(wmsOutputFormat)));
            wmsFormats.add(format);
        }
        menu.add(wmsFormats);
       
        // the vector ones, it depends, we might have to hide them
        boolean vector = layer.groupInfo == null && layer.layerInfo.getType() != LayerInfo.Type.RASTER;
        WebMarkupContainer wfsFormatsGroup = new WebMarkupContainer("wfs");
        RepeatingView wfsFormats = new RepeatingView("wfsFormats");
        if(vector) {
            for (int i = 0; i < wfsOutputFormats.size(); i++) {
                String wfsOutputFormat = wfsOutputFormats.get(i);
                String label = translateFormat("format.wfs.", wfsOutputFormat);
                // build option with text and value
                Label format = new Label(i + "", label);
                format.add(new AttributeModifier("value", true, new Model(wfsOutputFormat)));
                wfsFormats.add(format);
            }
        }
        wfsFormatsGroup.add(wfsFormats);
        menu.add(wfsFormatsGroup);
View Full Code Here

                link.add(new Label("resourcelabel", dataStoreFactoryName));
                item.add(link);
                item.add(new Label("resourceDescription", description));
                Image icon = new Image("storeIcon", icons.getStoreIcon(factory.getClass()));
                // TODO: icons could provide a description too to be used in alt=...
                icon.add(new AttributeModifier("alt", true, new Model("")));
                item.add(icon);
            }
        };

        final List<String> sortedCoverageNames = new ArrayList<String>();
        sortedCoverageNames.addAll(getAvailableCoverageStores().keySet());
        Collections.sort(sortedCoverageNames);

        final ListView coverageLinks = new ListView("rasterResources", sortedCoverageNames) {
            @Override
            protected void populateItem(ListItem item) {
                final String coverageFactoryName = item.getModelObjectAsString();
                final Map<String, Format> coverages = getAvailableCoverageStores();
                Format format = coverages.get(coverageFactoryName);
                final String description = format.getDescription();
                SubmitLink link;
                link = new SubmitLink("resourcelink") {
                    @Override
                    public void onSubmit() {
                        setResponsePage(new CoverageStoreNewPage(coverageFactoryName));
                    }
                };
                link.setEnabled(thereAreWorkspaces);
                link.add(new Label("resourcelabel", coverageFactoryName));
                item.add(link);
                item.add(new Label("resourceDescription", description));
                Image icon = new Image("storeIcon", icons.getStoreIcon(format.getClass()));
                // TODO: icons could provide a description too to be used in alt=...
                icon.add(new AttributeModifier("alt", true, new Model("")));
                item.add(icon);
            }
        };

        storeForm.add(dataStoreLinks);
View Full Code Here

  /** Tests simple behavior */
  @Test
  public void simple()
  {
    MyPage page = new MyPage();
    page.getContainer().add(new AttributeModifier("class", "border"));
    tester.startPage(page);

    assertTrue(tester.getLastResponseAsString().contains("class=\"border\""));
  }
View Full Code Here

   * Tests the fact that url-behavior indexes do not change even if behaviors are removed/added
   */
  @Test
  public void urlIndexRendering()
  {
    Behavior border = new AttributeModifier("class", "border");
    Behavior border2 = new AttributeModifier("class2", "border");
    Behavior auto = new AttributeModifier("autocomplete", "off");
    Behavior auto2 = new AttributeModifier("autocomplete2", "off");
    Behavior link = new LinkBehavior("href");
    Behavior link2 = new LinkBehavior("onclick");

    MyPage page = new MyPage();

View Full Code Here

   * Tests that removal of behaviors properly cleans up the data array
   */
  @Test
  public void behaviorDataArrayCleanup()
  {
    Behavior border = new AttributeModifier("class", "border");
    Behavior border2 = new AttributeModifier("class2", "border");
    Behavior auto = new AttributeModifier("autocomplete", "off");
    Behavior auto2 = new AttributeModifier("autocomplete2", "off");
    Behavior link = new LinkBehavior("href");
    Behavior link2 = new LinkBehavior("onclick");

    MyPage page = new MyPage();
    page.getContainer().add(border, auto, link, border2, link2, auto2);
View Full Code Here

TOP

Related Classes of org.apache.wicket.AttributeModifier

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.