Package org.zeroexchange.web.components.link

Examples of org.zeroexchange.web.components.link.AjaxLinkPanel


            items.add(new ToolbarItem()  {
                private static final long serialVersionUID = 1L;
   
                @Override
                public Component getComponent(String componentId) {
                    return new AjaxLinkPanel(componentId, new ResourceModel(MKEY_RESOURCE_UNBOUND)) {
                        private static final long serialVersionUID = 1L;
   
                        @Override
                        protected void onClick(AjaxRequestTarget target) {
                            resourceRemover.remove(resource.getId());
View Full Code Here


        items.add(new ToolbarItem() {
            private static final long serialVersionUID = 1L;

            @Override
            public Component getComponent(String componentId) {
                return new AjaxLinkPanel(
                    componentId, new ResourceModel(MKEY_DELETE_MESSAGES)) {
                        private static final long serialVersionUID = 1L;
   
                        @Override
                        protected void onClick(AjaxRequestTarget target) {
View Full Code Here

            @Override
            public Component getActionComponent(String componentId, final Contract contract) {
                final boolean isModificationAllowed = authorizedUserService.isUserLogged() &&
                        ContractStatus.COMPLETED != contract.getStatus();
               
                return new AjaxLinkPanel(componentId, new ResourceModel(isModificationAllowed ?
                        MKEY_CONTRACT_EDIT : MKEY_CONTRACT_VIEW)) {
                    private static final long serialVersionUID = 1L;

                    @Override
                    protected void onClick(AjaxRequestTarget target) {
                        setResponsePage(isModificationAllowed ? EditContract.class : ViewContract.class,
                                new PageParameters().add(
                                    ContractDetails.PARAM_CONTRACT_ID,
                                    contract.getId()));
                    }
                };
            }
        });

        // 'Remove' action
        actions.add(new ParentAwareRowAction<Contract>() {
            private static final long serialVersionUID = 1L;

            @Override
            public Component getActionComponent(String componentId, final Contract contract) {
                if(contract.getStatus() != ContractStatus.UNCOMPLETED) {
                    return null;
                }

                Integer currentUserId = authorizedUserService.getCurrentUserId();
                User contractOwner = contract.getOwner();
                if(contractOwner == null || currentUserId == null || !currentUserId.equals(contractOwner.getId())) {
                    return null;
                }
               
                return new AjaxLinkPanel(componentId, new ResourceModel(MKEY_CONTRACT_REMOVE)) {
                    private static final long serialVersionUID = 1L;

                    @Override
                    protected void onClick(AjaxRequestTarget target) {
                        contractRemover.remove(contract.getId());
View Full Code Here

TOP

Related Classes of org.zeroexchange.web.components.link.AjaxLinkPanel

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.