Package net.sourceforge.javautil.ui.command.annotation

Examples of net.sourceforge.javautil.ui.command.annotation.Command


  /**
   * @param clazz A class that must have a {@link Command} set on it.
   * @return A command class for the target class, or null if the class passed does not have the required annotation
   */
  public static UICommandClass getFor (Class clazz) {
    Command command = (Command) clazz.getAnnotation(Command.class);
    if (command == null) return null;
   
    return new UICommandClass(command, ClassCache.getFor(clazz));
  }
View Full Code Here


  public UICommandSetClass (ClassDescriptor descriptor) {
    this.instance = descriptor.newInstance();
   
    ClassMethod[] methods = descriptor.getMethods(Command.class);
    for (ClassMethod method : methods) {
      Command command = method.getAnnotation(Command.class);
      String name = "".equals(command.name()) ? method.getName().toLowerCase() : command.name();
      this.add( (CMD) new UICommandMethod(this, instance, method, name, command.value()) );
    }
  }
View Full Code Here

TOP

Related Classes of net.sourceforge.javautil.ui.command.annotation.Command

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.