Examples of DelegatedMarkupPanel


Examples of fr.openwide.core.wicket.more.markup.html.template.js.jquery.plugins.bootstrap.modal.component.DelegatedMarkupPanel

    return new Label(wicketId, new ResourceModel("artifact.rules.edit"));
  }

  @Override
  protected Component createBody(String wicketId) {
    DelegatedMarkupPanel body = new DelegatedMarkupPanel(wicketId, ArtifactNotificationRuleFormPopupPanel.class);
   
    ruleForm = new Form<ArtifactNotificationRule>("form", getModel());
    body.add(ruleForm);
   
    TextField<String> regexField = new RequiredTextField<String>("regex", BindingModel.of(ruleForm.getModel(),
        Binding.artifactNotificationRule().regex()));
    regexField.setLabel(new ResourceModel("artifact.rules.field.regex"));
    ruleForm.add(regexField);
View Full Code Here

Examples of fr.openwide.core.wicket.more.markup.html.template.js.jquery.plugins.bootstrap.modal.component.DelegatedMarkupPanel

    return body;
  }

  @Override
  protected Component createFooter(String wicketId) {
    DelegatedMarkupPanel footer = new DelegatedMarkupPanel(wicketId, ArtifactNotificationRuleFormPopupPanel.class);
   
    // Validate button
    AjaxButton validate = new AjaxButton("save", ruleForm) {
      private static final long serialVersionUID = 1L;
     
      @Override
      protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
        ArtifactNotificationRule rule = ArtifactNotificationRuleFormPopupPanel.this.getModelObject();
        FollowedArtifact followedArtifact = rule.getFollowedArtifact();
       
        if (StringUtils.hasText(rule.getRegex()) && rule.getType() != null) {
          try {
            if (artifactNotificationRuleService.isRuleValid(rule.getRegex())) {
             
              ArtifactNotificationRule ruleDuplicate =
                  artifactNotificationRuleService.getByFollowedArtifactAndRegex(followedArtifact, rule.getRegex());
              if (ruleDuplicate == null || rule.equals(ruleDuplicate)) {
                artifactNotificationRuleService.update(rule);
                getSession().success(getString("artifact.rules.edit.success"));
                closePopup(target);
                target.add(getPage());
              } else {
                LOGGER.warn("A rule with the same regex already exists");
                getSession().error(getString("artifact.rules.add.notUnique"));
              }
            } else {
              LOGGER.error("Invalid rule regex");
              getSession().error(getString("artifact.rules.add.invalidRegex"));
            }
          } catch (Exception e) {
            LOGGER.error("Error occured while updating the rule", e);
            getSession().error(getString("artifact.rules.edit.error"));
          }
        }
        FeedbackUtils.refreshFeedback(target, getPage());
      }
     
      @Override
      protected void onError(AjaxRequestTarget target, Form<?> form) {
        FeedbackUtils.refreshFeedback(target, getPage());
      }
    };
    validate.add(new Label("validateLabel", new ResourceModel("common.action.save")));
    footer.add(validate);
   
    // Cancel button
    AbstractLink cancel = new AbstractLink("cancel") {
      private static final long serialVersionUID = 1L;
    };
    addCancelBehavior(cancel);
    footer.add(cancel);
   
    return footer;
  }
View Full Code Here

Examples of fr.openwide.core.wicket.more.markup.html.template.js.jquery.plugins.bootstrap.modal.component.DelegatedMarkupPanel

    return new Label(wicketId, new StringResourceModel("artifact.version.edit", getModel()));
  }

  @Override
  protected Component createBody(String wicketId) {
    DelegatedMarkupPanel body = new DelegatedMarkupPanel(wicketId, ArtifactVersionFormPopupPanel.class);
   
    form = new Form<ArtifactVersion>("form", getModel());
    form.add(new VersionAdditionalInformationFormComponentPanel("additionalInformationPanel",
        BindingModel.of(getModel(), Binding.artifactVersion().additionalInformation())));
    body.add(form);
   
    return body;
  }
View Full Code Here

Examples of fr.openwide.core.wicket.more.markup.html.template.js.jquery.plugins.bootstrap.modal.component.DelegatedMarkupPanel

    return body;
  }

  @Override
  protected Component createFooter(String wicketId) {
    DelegatedMarkupPanel footer = new DelegatedMarkupPanel(wicketId, ArtifactVersionFormPopupPanel.class);
   
    // Validate button
    AjaxButton validate = new AjaxButton("save", form) {
      private static final long serialVersionUID = 1L;
     
      @Override
      protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
        ArtifactVersion artifactVersion = ArtifactVersionFormPopupPanel.this.getModelObject();
       
        try {
          artifactVersionService.update(artifactVersion);
          getSession().success(getString("artifact.version.edit.success"));
          closePopup(target);
          target.add(getPage());
        } catch (Exception e) {
          LOGGER.error("Error occured while updating the artifact version", e);
          getSession().error(getString("artifact.version.edit.error"));
        }
        FeedbackUtils.refreshFeedback(target, getPage());
      }
     
      @Override
      protected void onError(AjaxRequestTarget target, Form<?> form) {
        FeedbackUtils.refreshFeedback(target, getPage());
      }
    };
    validate.add(new Label("validateLabel", new ResourceModel("common.action.save")));
    footer.add(validate);
   
    // Cancel button
    AbstractLink cancel = new AbstractLink("cancel") {
      private static final long serialVersionUID = 1L;
    };
    addCancelBehavior(cancel);
    footer.add(cancel);
   
    return footer;
  }
View Full Code Here

Examples of fr.openwide.core.wicket.more.markup.html.template.js.jquery.plugins.bootstrap.modal.component.DelegatedMarkupPanel

    return new Label(wicketId, new ResourceModel("artifact.deprecation.title"));
  }

  @Override
  protected Component createBody(String wicketId) {
    DelegatedMarkupPanel body = new DelegatedMarkupPanel(wicketId, ArtifactDeprecationFormPopupPanel.class);
   
    form = new Form<Artifact>("form", getModel());
    body.add(form);
   
    final MarkupContainer relatedArtifactContainer = new WebMarkupContainer("relatedArtifactContainer");
    relatedArtifactContainer.setOutputMarkupId(true);
    form.add(relatedArtifactContainer);
   
View Full Code Here

Examples of fr.openwide.core.wicket.more.markup.html.template.js.jquery.plugins.bootstrap.modal.component.DelegatedMarkupPanel

    return body;
  }

  @Override
  protected Component createFooter(String wicketId) {
    DelegatedMarkupPanel footer = new DelegatedMarkupPanel(wicketId, ArtifactDeprecationFormPopupPanel.class);
   
    // Validate button
    AjaxButton validate = new AjaxButton("save", form) {
      private static final long serialVersionUID = 1L;
     
      @Override
      protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
        Artifact artifact = ArtifactDeprecationFormPopupPanel.this.getModelObject();
       
        try {
          if (artifact != null) {
            if (ArtifactDeprecationStatus.NORMAL.equals(artifact.getDeprecationStatus())) {
              artifact.setRelatedArtifact(null);
            }
            artifactService.update(artifact);
            getSession().success(getString("artifact.deprecation.success"));
          }
          closePopup(target);
          throw LinkFactory.get().getAssortedArtifactPageLinkDescriptor(getPage().getPageClass(), ArtifactDeprecationFormPopupPanel.this.getModel())
              .newRestartResponseException();
        } catch (RestartResponseException e) {
          throw e;
        } catch (Exception e) {
          LOGGER.error("Error occured while updating the artifact", e);
          getSession().error(getString("artifact.deprecation.error"));
        }
        FeedbackUtils.refreshFeedback(target, getPage());
      }
     
      @Override
      protected void onError(AjaxRequestTarget target, Form<?> form) {
        FeedbackUtils.refreshFeedback(target, getPage());
      }
    };
    validate.add(new Label("validateLabel", new ResourceModel("common.action.save")));
    footer.add(validate);
   
    // Cancel button
    AbstractLink cancel = new AbstractLink("cancel") {
      private static final long serialVersionUID = 1L;
    };
    addCancelBehavior(cancel);
    footer.add(cancel);
   
    return footer;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.