Example usage for org.apache.wicket AttributeModifier remove

List of usage examples for org.apache.wicket AttributeModifier remove

Introduction

In this page you can find the example usage for org.apache.wicket AttributeModifier remove.

Prototype

public static AttributeModifier remove(String attributeName) 

Source Link

Document

Creates a attribute modifier that removes an attribute with the specified name

Usage

From source file:kz.supershiny.web.wicket.components.AjaxPagingPanel.java

public AjaxPagingPanel(String id, final SearchCriteria criteria) {
    super(id);//from  w  w  w. j  ava2 s .c o  m

    globalContainer = new WebMarkupContainer("globalContainer");
    add(globalContainer.setOutputMarkupId(true));

    next = new AjaxLink("next") {
        @Override
        public void onClick(AjaxRequestTarget art) {
            criteria.next();
            refreshPaging(art, criteria);
        }

        @Override
        public boolean isEnabled() {
            return !criteria.isLastPage();
        }
    };
    globalContainer.add(next.setOutputMarkupId(true));

    prev = new AjaxLink("prev") {
        @Override
        public void onClick(AjaxRequestTarget art) {
            criteria.prev();
            refreshPaging(art, criteria);
        }

        @Override
        public boolean isEnabled() {
            return !criteria.isFirstPage();
        }
    };
    globalContainer.add(prev.setOutputMarkupId(true));

    snext = new AjaxLink("snext") {
        @Override
        public void onClick(AjaxRequestTarget art) {
            criteria.snext();
            refreshPaging(art, criteria);
        }

        @Override
        public boolean isEnabled() {
            return !criteria.isLastPage();
        }
    };
    globalContainer.add(snext.setOutputMarkupId(true));

    sprev = new AjaxLink("sprev") {
        @Override
        public void onClick(AjaxRequestTarget art) {
            criteria.sprev();
            refreshPaging(art, criteria);
        }

        @Override
        public boolean isEnabled() {
            return !criteria.isFirstPage();
        }
    };
    globalContainer.add(sprev.setOutputMarkupId(true));

    numbers = new ListView("numbers", criteria.getNumbers()) {

        @Override
        protected void populateItem(ListItem li) {
            final long pageNum = (Long) li.getModelObject();
            final Label number = new Label("number", pageNum + "");
            final AjaxLink numberLink = new AjaxLink("numberLink") {
                @Override
                public void onClick(AjaxRequestTarget art) {
                    criteria.toPage(pageNum);
                    refreshPaging(art, criteria);
                }
            };
            if (pageNum != criteria.getCurrent()) {
                numberLink.setEnabled(true);
                li.add(AttributeModifier.remove("class"));
            } else {
                numberLink.setEnabled(false);
                li.add(AttributeModifier.append("class", "active"));
            }
            numberLink.add(number);
            li.add(numberLink);
        }
    };
    globalContainer.add(numbers.setOutputMarkupId(true));
}

From source file:org.apache.karaf.webconsole.osgi.core.bundle.install.InstallBundlePanel.java

License:Apache License

protected void onChecked() {
    file.add(AttributeModifier.remove("disabled"));
}

From source file:org.devgateway.eudevfin.projects.module.components.panels.TransactionTableListPanel.java

@Override
protected void populateTable() {
    final ModalWindow modal = AddModalWindow(null);
    //        refreshItems();
    this.itemsListView = new ListView<FinancialTransaction>("projectTransactionsList", items) {

        private static final long serialVersionUID = -8758662617501215830L;

        @Override//from   www . j  a v  a2s  . co  m
        protected void populateItem(ListItem<FinancialTransaction> listItem) {
            final FinancialTransaction transaction = listItem.getModelObject();

            AjaxLink linkToEdit = new AjaxLink("linkToEditTransaction") {
                @Override
                public void onClick(AjaxRequestTarget target) {
                    PageParameters parameters = new PageParameters()
                            .add(TransactionsTableModal.PARAM_TRANSACTION_ID, transaction.getId());
                    setParameters(parameters);
                    AddModalWindow(parameters);
                    modal.show(target);
                }
            };
            linkToEdit.setBody(Model.of(transaction.getShortDescription()));
            String CRSId = transaction.getCrsIdentificationNumber() == null ? ""
                    : transaction.getCrsIdentificationNumber();
            Label CRSIdLabel = new Label("CRSId", CRSId);
            String geographicName = transaction.getRecipient() == null ? ""
                    : transaction.getRecipient().getName();
            Label geographicFocusLabel = new Label("geographicFocus", geographicName);
            String agencyName = transaction.getExtendingAgency() == null ? ""
                    : transaction.getExtendingAgency().getName();
            Label financingInstitutionLabel = new Label("financingInstitution", agencyName);
            Label reportingYearLabel = new Label("reportingYear", transaction.getReportingYear().getYear());

            final CustomFinancialTransaction ctx = (CustomFinancialTransaction) transaction;
            Label amountUSD = new Label("amountUSD",
                    RateUtil.moneyToString(rateUtil.exchange(transaction.getAmountsExtended(), CurrencyUnit.USD,
                            ctx.getFixedRate(), RateUtil.getStartOfMonth(ctx.getCommitmentDate()))));
            Label amountRON = new Label("amountRON", transaction.getAmountsExtended().getAmount().toString());
            Label amountEUR = new Label("amountEUR",
                    RateUtil.moneyToString(rateUtil.exchange(transaction.getAmountsExtended(), CurrencyUnit.EUR,
                            ctx.getFixedRate(), RateUtil.getStartOfMonth(ctx.getCommitmentDate()))));

            BootstrapDeleteButton delete = new BootstrapDeleteButton("delete",
                    new StringResourceModel("delete", this, null)) {
                @Override
                protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
                    NewProjectPage.project.removeTransaction(transaction);
                    TransactionTableListPanel newComp = new TransactionTableListPanel(WICKETID_LIST_PANEL,
                            new ProjectTransactionsListGenerator(
                                    NewProjectPage.project.getProjectTransactions()));
                    newComp.add(new AttributeAppender("class", "budget-table"));
                    TransactionTableListPanel.this.replaceWith(newComp);
                    target.add(newComp);
                }
            };

            delete.add(AttributeModifier.remove("class"));
            delete.add(AttributeModifier.prepend("class", "round_delete"));

            listItem.add(linkToEdit);
            listItem.add(CRSIdLabel);
            listItem.add(geographicFocusLabel);
            listItem.add(financingInstitutionLabel);
            listItem.add(reportingYearLabel);
            listItem.add(amountUSD);
            listItem.add(amountRON);
            listItem.add(amountEUR);
            listItem.add(delete);
        }
    };
    itemsListView.setOutputMarkupId(true);
    this.add(modal);
    this.add(itemsListView);

}

From source file:org.hippoecm.frontend.plugins.standards.list.resolvers.CssClass.java

License:Apache License

public static AttributeModifier clear() {
    return AttributeModifier.remove(CLASS_ATTRIBUTE);
}

From source file:org.hippoecm.frontend.plugins.standards.list.resolvers.TitleAttribute.java

License:Apache License

public static AttributeModifier clear() {
    return AttributeModifier.remove(TITLE_ATTRIBUTE);
}

From source file:org.sakaiproject.attendance.tool.util.AttendanceFeedbackPanel.java

License:Educational Community License

public void clear() {
    getFeedbackMessages().clear();
    this.add(AttributeModifier.remove("class"));
}