/** * Helper methods that both checks whether the link is enabled and whether the action ENABLE is * allowed. * * @return whether the link should be rendered as enabled */ protected final boolean isLinkEnabled() { return isEnabled() && isEnableAllowed(); }
/** * @see org.apache.wicket.Component#isEnabled() */ @Override public boolean isEnabled() { // If we're auto-enabling if (getAutoEnable()) { // the link is enabled if this link doesn't link to the current page return !linksTo(getPage()); } return super.isEnabled(); }
/** * @see org.apache.wicket.Component#isEnabled() */ public boolean isEnabled() { // If we're auto-enabling if (getAutoEnable()) { // the link is enabled if this link doesn't link to the current page return !linksTo(getPage()); } return super.isEnabled(); }
/** * @see org.apache.wicket.Component#isEnabled() */ @Override public boolean isEnabled() { // If we're auto-enabling if (getAutoEnable()) { // the link is enabled if this link doesn't link to the current page return !linksTo(getPage()); } return super.isEnabled(); }
/** * @see org.apache.wicket.Component#isEnabled() */ @Override public boolean isEnabled() { // If we're auto-enabling if (getAutoEnable()) { // the link is enabled if this link doesn't link to the current page return !linksTo(getPage()); } return super.isEnabled(); }
/** * Enable/disable a button * * @param button the button * @param enabled enabled state */ protected static void enable(AbstractLink button, boolean enabled) { if (enabled != button.isEnabled()) { button.setEnabled(enabled); if (enabled) { button.remove(DISABLED_BEHAVIOR); } else { button.add(DISABLED_BEHAVIOR); } } }
@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); link.configure(); if (!link.isEnabled()) { item.add(new CssClassNameAppender("disabled")); } } }
@Override protected void populateItem(LoopItem item) { final int index = item.getIndex(); final IMenuLink menuItem = MenuPanel.this.menuItems.get(index); final AbstractLink link; final Component linkLabel = menuItem.getDisplayComponent("menuLinkLabel"); if (linkLabel instanceof Image) { item.add(new WebMarkupContainer("menuLink1").setVisible(false)); link = menuItem.getLink("menuLink2"); } else { link = menuItem.getLink("menuLink1"); item.add(new WebMarkupContainer("menuLink2").setVisible(false)); } link.setOutputMarkupId(true); linkLabel.setOutputMarkupId(true); link.add(linkLabel); item.add(link); if (!link.isEnabled()) { item.add(disabledMenuItem); } if (!link.isVisible()) { item.setVisible(false); } item.setOutputMarkupId(true); }
if (!link.isEnabled()) { item.add(disabledMenuItem);