Package org.jboss.aesh.cl.completer

Examples of org.jboss.aesh.cl.completer.FileOptionCompleter


      InputType inputType = component.getFacet(HintsFacet.class).getInputType();
      OptionCompleter strategy = null;
      if (inputType == InputType.FILE_PICKER && cwd.isDirectory())
      {
         strategy = new FileOptionCompleter(cwd);
      }
      else if (inputType == InputType.DIRECTORY_PICKER && cwd.isDirectory())
      {
         strategy = new FileOptionCompleter(cwd, Filter.DIRECTORY);
      }
      else if (component instanceof SelectComponent)
      {
         strategy = new SelectComponentOptionCompleter((SelectComponent<?, Object>) component, converterFactory);
      }
      else if (Resource.class.isAssignableFrom(component.getValueType()))
      {
         // fall back to Resource completion.
         strategy = new FileOptionCompleter(cwd);
      }
      // Always try UICompleter first and then fallback to the chosen strategy
      strategy = new UICompleterOptionCompleter(strategy, context, component, converterFactory);
      return strategy;
   }
View Full Code Here


      String inputType = component.getFacet(HintsFacet.class).getInputType();
      OptionCompleter<CompleterInvocation> strategy = null;
      if (InputType.FILE_PICKER.equals(inputType) && cwd.isDirectory())
      {
         strategy = new FileOptionCompleter(Filter.ALL);
      }
      else if (InputType.DIRECTORY_PICKER.equals(inputType) && cwd.isDirectory())
      {
         strategy = new FileOptionCompleter(Filter.DIRECTORY);
      }
      else if (component instanceof SelectComponent)
      {
         strategy = new SelectComponentOptionCompleter((SelectComponent<?, Object>) component, converterFactory);
      }
      else if (Resource.class.isAssignableFrom(component.getValueType()))
      {
         // fall back to Resource completion.
         strategy = new FileOptionCompleter(Filter.ALL);
      }
      // Always try UICompleter first and then fallback to the chosen strategy
      strategy = new UICompleterOptionCompleter(strategy, context, component, converterFactory);
      return strategy;
   }
View Full Code Here

               .getUnderlyingResourceObject();
      InputType inputType = component.getFacet(HintsFacet.class).getInputType();
      OptionCompleter strategy = null;
      if (inputType == InputType.FILE_PICKER && cwd.isDirectory())
      {
         strategy = new FileOptionCompleter(cwd);
      }
      else if (inputType == InputType.DIRECTORY_PICKER && cwd.isDirectory())
      {
         strategy = new FileOptionCompleter(cwd, Filter.DIRECTORY);
      }
      else if (component instanceof SelectComponent)
      {
         strategy = new SelectComponentOptionCompleter((SelectComponent<?, Object>) component, converterFactory);
      }
View Full Code Here

      InputType inputType = component.getFacet(HintsFacet.class).getInputType();
      OptionCompleter<CompleterInvocation> strategy = null;
      if (inputType == InputType.FILE_PICKER && cwd.isDirectory())
      {
         strategy = new FileOptionCompleter(Filter.ALL);
      }
      else if (inputType == InputType.DIRECTORY_PICKER && cwd.isDirectory())
      {
         strategy = new FileOptionCompleter(Filter.DIRECTORY);
      }
      else if (component instanceof SelectComponent)
      {
         strategy = new SelectComponentOptionCompleter((SelectComponent<?, Object>) component, converterFactory);
      }
      else if (Resource.class.isAssignableFrom(component.getValueType()))
      {
         // fall back to Resource completion.
         strategy = new FileOptionCompleter(Filter.ALL);
      }
      // Always try UICompleter first and then fallback to the chosen strategy
      strategy = new UICompleterOptionCompleter(strategy, context, component, converterFactory);
      return strategy;
   }
View Full Code Here

      String inputType = component.getFacet(HintsFacet.class).getInputType();
      OptionCompleter<CompleterInvocation> strategy = null;
      if (InputType.FILE_PICKER.equals(inputType) && cwd.isDirectory())
      {
         strategy = new FileOptionCompleter(new AllResourceFilter());
      }
      else if (InputType.DIRECTORY_PICKER.equals(inputType) && cwd.isDirectory())
      {
         strategy = new FileOptionCompleter(new DirectoryResourceFilter());
      }
      else if (component instanceof SelectComponent)
      {
         strategy = new SelectComponentOptionCompleter((SelectComponent<?, Object>) component, converterFactory);
      }
      else if (Resource.class.isAssignableFrom(component.getValueType()))
      {
         // fall back to Resource completion.
         strategy = new FileOptionCompleter(new AllResourceFilter());
      }
      // Always try UICompleter first and then fallback to the chosen strategy
      strategy = new UICompleterOptionCompleter(strategy, context, component, converterFactory);
      return strategy;
   }
View Full Code Here

TOP

Related Classes of org.jboss.aesh.cl.completer.FileOptionCompleter

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.