Examples of OptionDescriptor


Examples of net.sf.apptools.data.OptionDescriptor

        };

        final String title = CoreMessages.getString("ProbeMakerPlugIn.TITLE_REMOVING_PROBES"); //$NON-NLS-1$
        final String message = CoreMessages.getString("ProbeMakerPlugIn.QUERY_REMOVE_TARGETS"); //$NON-NLS-1$

        final DataDescriptor option = new OptionDescriptor(message,null,"OPTION",options,true); //$NON-NLS-1$
        final DataHolder dh = new DefaultDataHolder(new DataDescriptor[] { option });

        if (!platform.getUI().inputData(dh,title)) {
          return;
        }
View Full Code Here

Examples of net.sf.apptools.data.OptionDescriptor

        };

        final String title = CoreMessages.getString("ProbeMakerPlugIn.TITLE_REMOVING_PROBES"); //$NON-NLS-1$
        final String message = CoreMessages.getString("ProbeMakerPlugIn.QUERY_REMOVE_TARGETS"); //$NON-NLS-1$

        final DataDescriptor option = new OptionDescriptor(message,null,"OPTION",options,true); //$NON-NLS-1$
        final DataHolder dh = new DefaultDataHolder(new DataDescriptor[] { option });

        if (!platform.getUI().inputData(dh,title)) {
          return;
        }
View Full Code Here

Examples of net.sf.apptools.data.OptionDescriptor

        };

        final String title = CoreMessages.getString("ProbeMakerPlugIn.TITLE_REMOVING_PROBES"); //$NON-NLS-1$
        final String message = CoreMessages.getString("ProbeMakerPlugIn.QUERY_REMOVE_TARGETS"); //$NON-NLS-1$

        final DataDescriptor option = new OptionDescriptor(message,null,"OPTION",options,true); //$NON-NLS-1$
        final DataHolder dh = new DefaultDataHolder(new DataDescriptor[] { option });

        if (!platform.getUI().inputData(dh,title)) {
          return;
        }
View Full Code Here

Examples of net.sf.apptools.data.OptionDescriptor

        };

        final String title = CoreMessages.getString("ProbeMakerPlugIn.TITLE_REMOVING_PROBES"); //$NON-NLS-1$
        final String message = CoreMessages.getString("ProbeMakerPlugIn.QUERY_REMOVE_TARGETS"); //$NON-NLS-1$

        final DataDescriptor option = new OptionDescriptor(message,null,"OPTION",options,true); //$NON-NLS-1$
        final DataHolder dh = new DefaultDataHolder(new DataDescriptor[] { option });

        if (!platform.getUI().inputData(dh,title)) {
          return;
        }
View Full Code Here

Examples of org.crsh.cli.descriptor.OptionDescriptor

        if (parameter.getDeclaredType().isPrimitive() || parameter.isRequired()) {
          if (parameter instanceof ArgumentDescriptor) {
            ArgumentDescriptor argument = (ArgumentDescriptor)parameter;
            throw new SyntaxException("Missing argument " + argument.getName());
          } else {
            OptionDescriptor option = (OptionDescriptor)parameter;
            throw new SyntaxException("Missing option " + option.getNames());
          }
        }
      } else {
        ((Binding)parameter).set(target, args, value);
      }
View Full Code Here

Examples of org.crsh.cli.descriptor.OptionDescriptor

              } else {
                response.add(new Event.Stop.Unresolved.NoSuchOption(optionToken));
              }
            }
          } else {
            OptionDescriptor desc = req.command.resolveOption(literal.getValue());
            if (desc != null) {
              req.tokenizer.next();
              int arity = desc.getArity();
              LinkedList<Token.Literal.Word> values = new LinkedList<Token.Literal.Word>();
              while (arity > 0) {
                if (req.tokenizer.hasNext()) {
                  Token a = req.tokenizer.peek();
                  if (a instanceof Token.Whitespace) {
View Full Code Here

Examples of org.crsh.cli.descriptor.OptionDescriptor

  @Override
  protected void addParameter(ParameterDescriptor parameter) throws IntrospectionException {

    // Check we can add the option
    if (parameter instanceof OptionDescriptor) {
      OptionDescriptor option = (OptionDescriptor)parameter;
      Set<String> blah = new HashSet<String>();
      for (String optionName : option.getNames()) {
        blah.add((optionName.length() == 1 ? "-" : "--") + optionName);
      }
      for (MethodDescriptor<T> method : methods.values()) {
        Set<String> diff = new HashSet<String>(method.getOptionNames());
        diff.retainAll(blah);
View Full Code Here

Examples of org.crsh.cli.descriptor.OptionDescriptor

      @Option(names = "i")
      private int i;
    }
    CommandDescriptor<Instance<A>> ai = CommandFactory.DEFAULT.create(A.class);
    assertEquals(1,ai.getOptions().size());
    OptionDescriptor i = ai.getOption("-i");
    assertEquals(Arrays.asList("i"),i.getNames());
  }
View Full Code Here

Examples of org.crsh.cli.descriptor.OptionDescriptor

      @Option(names = "I")
      private int i;
    }
    CommandDescriptor<Instance<A>> ai = CommandFactory.DEFAULT.create(A.class);
    assertEquals(1,ai.getOptions().size());
    OptionDescriptor i = ai.getOption("-I");
    assertEquals(Arrays.asList("I"),i.getNames());
  }
View Full Code Here

Examples of org.crsh.cli.descriptor.OptionDescriptor

      String l;
    }

    CommandDescriptor<Instance<A>> a = CommandFactory.DEFAULT.create(A.class);
    assertEquals(1,a.getOptions().size());
    OptionDescriptor i = a.getOption("-l");
    assertEquals(Arrays.asList("l"),i.getNames());
    assertTrue(i.getAnnotation() instanceof Level);
  }
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.