Package org.jboss.forge.addon.shell.ui

Examples of org.jboss.forge.addon.shell.ui.ShellValidationContext


   @SuppressWarnings("unchecked")
   @Override
   public CommandResult execute(CommandInvocation commandInvocation) throws IOException
   {
      boolean failure;
      ShellValidationContext validationContext = interaction.validate();
      List<String> errors = validationContext.getErrors();
      if (errors.isEmpty())
      {
         Result result = shell.execute(interaction);
         failure = (result instanceof Failed);
         if (result != null && result.getMessage() != null && !result.getMessage().isEmpty())
View Full Code Here


            {
               @Override
               public void validate(Object value) throws org.jboss.aesh.cl.validator.OptionValidatorException
               {
                  InputComponents.setValueFor(converterFactory, input, value);
                  ShellValidationContext validationContext = new ShellValidationContext(shellContext);
                  input.validate(validationContext);
                  List<String> errors = validationContext.getErrors();
                  if (!errors.isEmpty())
                  {
                     throw new OptionValidatorException(errors.get(0));
                  }
               }
View Full Code Here

      addWizardStep(current);
      Map<String, InputComponent<?, Object>> inputs = getInputs();
      CommandLineParser parser = commandLineUtil.generateParser(root, shellContext, inputs);
      CommandLine cmdLine = parser.parse(line, true);
      Map<String, InputComponent<?, Object>> populatedInputs = commandLineUtil.populateUIInputs(cmdLine, inputs);
      ShellValidationContext validationContext = validate();
      List<String> errors = validationContext.getErrors();
      if (errors.isEmpty())
      {
         if (current instanceof UIWizard)
         {
            NavigationResult next = ((UIWizard) current).next(getContext());
View Full Code Here

   }

   @Override
   public ShellValidationContext validate()
   {
      ShellValidationContext validationContext = new ShellValidationContext(getContext());
      for (ShellWizardStep step : steps)
      {
         for (InputComponent<?, Object> input : step.inputs.values())
         {
            input.validate(validationContext);
View Full Code Here

   }

   @Override
   public ShellValidationContext validate()
   {
      ShellValidationContext validationContext = new ShellValidationContext(getContext());
      for (InputComponent<?, Object> input : getInputs().values())
      {
         input.validate(validationContext);
      }
      command.validate(validationContext);
View Full Code Here

   @SuppressWarnings("unchecked")
   @Override
   public CommandResult execute(CommandInvocation commandInvocation) throws IOException
   {
      boolean failure;
      ShellValidationContext validationContext = interaction.validate();
      List<String> errors = validationContext.getErrors();
      if (errors.isEmpty())
      {
         Result result = shell.execute(interaction);
         failure = (result instanceof Failed);
         if (result != null && result.getMessage() != null && !result.getMessage().isEmpty())
View Full Code Here

            {
               @Override
               public void validate(Object value) throws org.jboss.aesh.cl.validator.OptionValidatorException
               {
                  InputComponents.setValueFor(converterFactory, input, value);
                  ShellValidationContext validationContext = new ShellValidationContext(shellContext);
                  input.validate(validationContext);
                  List<String> errors = validationContext.getErrors();
                  if (!errors.isEmpty())
                  {
                     throw new OptionValidatorException(errors.get(0));
                  }
               }
View Full Code Here

   }

   @Override
   public List<String> validate()
   {
      ShellValidationContext validationContext = new ShellValidationContext(getContext());
      for (InputComponent<?, Object> input : inputs.values())
      {
         input.validate(validationContext);
      }
      command.validate(validationContext);

      return validationContext.getErrors();
   }
View Full Code Here

   }

   @Override
   public List<String> validate()
   {
      ShellValidationContext validationContext = new ShellValidationContext(getContext());
      for (ShellWizardStep step : steps)
      {
         for (InputComponent<?, Object> input : step.inputs.values())
         {
            input.validate(validationContext);
         }
         step.command.validate(validationContext);
      }
      return validationContext.getErrors();
   }
View Full Code Here

TOP

Related Classes of org.jboss.forge.addon.shell.ui.ShellValidationContext

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.