Пример #1
0
  public ActionLink(String id, ItemAction action, ActionableItem actionableItem) {
    super(id, Model.of(action.getDisplayName(actionableItem)));
    this.action = action;
    this.actionableItem = actionableItem;

    // add css classes
    add(new CssClass("icon-link"));
    add(new CssClass(action.getCssClass()));

    // set href for link actions
    String actionURL = action.getActionLinkURL(actionableItem);
    if (StringUtils.isNotEmpty(actionURL)) {
      add(new AttributeModifier("onclick", "window.open(this.href); return false;"));
      add(new AttributeModifier("href", actionURL));
    }
  }
Пример #2
0
 @Override
 protected IAjaxCallDecorator getAjaxCallDecorator() {
   String message = action.getConfirmationMessage(actionableItem);
   return new AllowNewWindowDecorator(new ConfirmationAjaxCallDecorator(message));
 }
Пример #3
0
 @Override
 public void onClick(AjaxRequestTarget target) {
   action.actionPerformed(newEvent(target));
 }
Пример #4
0
 @Override
 public boolean isEnabled() {
   return action.isEnabled();
 }