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

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


      submitForm(submitLink.getForm().getPageRelativePath());
    }
    // if the link is a normal link (or ResourceLink)
    else if (linkComponent instanceof AbstractLink)
    {
      AbstractLink link = (AbstractLink)linkComponent;

      /*
       * If the link is a bookmarkable link, then we need to transfer the parameters to the
       * next request.
       */
 
View Full Code Here


      submitForm(submitLink.getForm().getPageRelativePath());
    }
    // if the link is a normal link (or ResourceLink)
    else if (linkComponent instanceof AbstractLink)
    {
      AbstractLink link = (AbstractLink)linkComponent;

      /*
       * If the link is a bookmarkable link, then we need to transfer the parameters to the
       * next request.
       */
 
View Full Code Here

      submitForm(submitLink.getForm().getPageRelativePath());
    }
    // if the link is a normal link (or ResourceLink)
    else if (linkComponent instanceof AbstractLink)
    {
      AbstractLink link = (AbstractLink)linkComponent;

      /*
       * If the link is a bookmarkable link, then we need to transfer the parameters to the
       * next request.
       */
 
View Full Code Here

     *
     * @param label The button label
     * @return The new button instance
     */
    private AbstractLink createButton(final String label) {
        AbstractLink button = new BookmarkablePageLink<Void>(ButtonList.getButtonMarkupId(), ComponentsPage.class).setBody(Model.of(label));
        button.add(new ButtonBehavior());

        return button;
    }
View Full Code Here

*/
public class ButtonBehaviorTest extends WicketApplicationTest {

    @Test
    public void fixDisabledButtonMarkup() {
        AbstractLink link = newLink(id());
        link.setEnabled(false);
        link.add(new ButtonBehavior());

        TagTester tagTester = startComponentInPage(link, "<a wicket:id='"+id()+"'>text</a>");
        assertCssClass(tagTester, "btn-disabled");
        String disabledAttr = tagTester.getAttribute("disabled");
        assertEquals("disabled", disabledAttr);
View Full Code Here

    }


    @Override
    protected void populateItem(ListItem<AbstractLink> item) {
        final AbstractLink link = item.getModelObject();

        Args.isTrue(getButtonMarkupId().equals(link.getId()), "component id is invalid, please use ButtonList.getButtonMarkupId()");

        item.add(link);
    }
View Full Code Here

      submitForm(submitLink.getForm().getPageRelativePath());
    }
    // if the link is a normal link (or ResourceLink)
    else if (linkComponent instanceof AbstractLink)
    {
      AbstractLink link = (AbstractLink)linkComponent;

      /*
       * If the link is a bookmarkable link, then we need to transfer the parameters to the
       * next request.
       */
 
View Full Code Here

                } else {
                    clearBookmarkLink.setEnabled(true);
                }
                item.add(clearBookmarkLink);
               
                final AbstractLink link = Links.newBookmarkablePageLink(ID_BOOKMARKED_PAGE_LINK, pageParameters, pageClass);

                final RootOid oid = BookmarkedPagesModel.oidFrom(pageParameters);
                ObjectSpecification objectSpec = null;
                if(oid != null) {
                    ObjectSpecId objectSpecId = oid.getObjectSpecId();
                    objectSpec = getSpecificationLoader().lookupBySpecId(objectSpecId);
                }
                final ResourceReference imageResource = imageCache.resourceReferenceForSpec(objectSpec);
                final Image image = new Image(ID_BOOKMARKED_PAGE_ICON, imageResource) {
                    private static final long serialVersionUID = 1L;
                    @Override
                    protected boolean shouldAddAntiCacheParameter() {
                        return false;
                    }
                };
                link.addOrReplace(image);

                String title = BookmarkedPagesModel.titleFrom(pageParameters);
                final Label label = new Label(ID_BOOKMARKED_PAGE_TITLE, title);
                link.add(label);
                item.add(link);
                if(bookmarkedPagesModel.isCurrent(pageParameters)) {
                    item.add(new CssClassAppender("currentBookmark"));
                }
                item.add(new CssClassAppender("bookmarkDepth" + node.getDepth()));
View Full Code Here

                protected void populateItem(ListItem<ComponentFactory> item) {
                   
                    final int underlyingViewNum = item.getIndex();
                   
                    final ComponentFactory componentFactory = item.getModelObject();
                    final AbstractLink link = new AjaxLink<Void>(ID_VIEW_LINK) {
                        private static final long serialVersionUID = 1L;
                        @Override
                        public void onClick(AjaxRequestTarget target) {
                           
                            for(int i=0; i<MAX_NUM_UNDERLYING_VIEWS; i++) {
                                final Component component = underlyingViews[i];
                                T dummyModel = dummyOf(model);
                               
                                if(component != null) {
                                    final boolean isSelected = i == underlyingViewNum;
                                    applyCssVisibility(component, isSelected);
                                    component.setDefaultModel(isSelected? model: dummyModel);
                                }
                            }
                            selectorPanel.selectedComponentFactory = componentFactory;
                            target.add(selectorPanel, views);
                        }
                    };
                    String name = nameFor(componentFactory);
                    Label viewTitleLabel = new Label(ID_VIEW_TITLE, name);
                    viewTitleLabel.add(new CssClassAppender(StringExtensions.asLowerDashed(name)));
                    link.add(viewTitleLabel);
                    item.add(link);
                   
                    link.setEnabled(componentFactory != selectorPanel.selectedComponentFactory);
                }

                private String nameFor(final ComponentFactory componentFactory) {
                    return componentFactory instanceof CollectionContentsAsUnresolvedPanelFactory ? "hide" : componentFactory.getName();
                }
View Full Code Here

            @Override
            protected void populateItem(ListItem<LinkAndLabel> item) {
                final LinkAndLabel linkAndLabel = item.getModelObject();
               
                final AbstractLink link = linkAndLabel.getLink();

                Label viewTitleLabel = new Label(ID_ADDITIONAL_LINK_TITLE, linkAndLabel.getLabel());
                String disabledReasonIfAny = linkAndLabel.getDisabledReasonIfAny();
                if(disabledReasonIfAny != null) {
                    viewTitleLabel.add(new AttributeAppender("title", disabledReasonIfAny));
                }
                if(linkAndLabel.isBlobOrClob()) {
                    link.add(new CssClassAppender("noVeil"));
                }
                if(linkAndLabel.isPrototype()) {
                    link.add(new CssClassAppender("prototype"));
                }
                link.add(new CssClassAppender(linkAndLabel.getActionIdentifier()));
                String cssClass = linkAndLabel.getCssClass();
                if(cssClass != null) {
                    item.add(new CssClassAppender(cssClass));
                }
                viewTitleLabel.add(new CssClassAppender(StringExtensions.asLowerDashed(linkAndLabel.getLabel())));
                link.addOrReplace(viewTitleLabel);
                item.addOrReplace(link);
            }
        };
        container.addOrReplace(listView);
    }
View Full Code Here

TOP

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

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.