Package org.jboss.forge.addon.ui.annotation

Examples of org.jboss.forge.addon.ui.annotation.Command


         // Class may not be loaded yet
         logger.log(Level.SEVERE, "Error while finding " + method.getDeclaringClass() + " as a service");
         return null;
      }
      Object instance = service.get();
      Command ann = method.getAnnotation(Command.class);

      List<Predicate<UIContext>> enabledPredicates = new ArrayList<>();
      for (Class<? extends Predicate<UIContext>> type : ann.enabled())
      {
         enabledPredicates.add(registry.getServices(type).get());
      }
      return new AnnotationCommandAdapter(method, instance, factory, enabledPredicates);
   }
View Full Code Here


   }

   @Override
   public UICommandMetadata getMetadata(UIContext context)
   {
      Command ann = method.getAnnotation(Command.class);
      String name = ann.value();
      if (name.isEmpty())
      {
         name = method.getName();
      }
      return Metadata.forCommand(method.getDeclaringClass()).name(name).description(ann.help())
               .category(Categories.create(ann.categories()));
   }
View Full Code Here

   }

   private UICommand createAnnotatedCommand(Method method)
   {
      Object instance = registry.getServices(method.getDeclaringClass()).get();
      Command ann = method.getAnnotation(Command.class);
      EnableCommandHandler handler = registry.getServices(ann.enabledHandler()).get();
      return new AnnotationCommandAdapter(method, instance, factory, handler);
   }
View Full Code Here

   }

   @Override
   public UICommandMetadata getMetadata(UIContext context)
   {
      Command ann = method.getAnnotation(Command.class);
      String name = ann.value();
      if (name.isEmpty())
      {
         name = method.getName();
      }
      return Metadata.forCommand(method.getDeclaringClass()).name(name).description(ann.help());
   }
View Full Code Here

   }

   @Override
   public UICommandMetadata getMetadata(UIContext context)
   {
      Command ann = method.getAnnotation(Command.class);
      String name = ann.value();
      if (name.isEmpty())
      {
         name = method.getName();
      }
      return Metadata.forCommand(method.getDeclaringClass()).name(name).description(ann.help())
               .category(Categories.create(ann.categories()));
   }
View Full Code Here

         // Class may not be loaded yet
         logger.log(Level.SEVERE, "Error while finding " + method.getDeclaringClass() + " as a service");
         return null;
      }
      Object instance = service.get();
      Command ann = method.getAnnotation(Command.class);

      List<Predicate<UIContext>> enabledPredicates = new ArrayList<>();
      for (Class<? extends Predicate<UIContext>> type : ann.enabled())
      {
         enabledPredicates.add(registry.getServices(type).get());
      }
      return new AnnotationCommandAdapter(method, instance, factory, enabledPredicates);
   }
View Full Code Here

   }

   @Override
   public UICommandMetadata getMetadata(UIContext context)
   {
      Command ann = method.getAnnotation(Command.class);
      String name = ann.value();
      if (name.isEmpty())
      {
         name = method.getName();
      }
      return Metadata.forCommand(method.getDeclaringClass()).name(name).description(ann.help())
               .category(Categories.create(ann.categories()));
   }
View Full Code Here

   }

   @Override
   public UICommandMetadata getMetadata(UIContext context)
   {
      Command ann = method.getAnnotation(Command.class);
      String name = ann.value();
      if (name.isEmpty())
      {
         name = method.getName();
      }
      return Metadata.forCommand(method.getDeclaringClass()).name(name).description(ann.help())
               .category(Categories.create(ann.categories()));
   }
View Full Code Here

TOP

Related Classes of org.jboss.forge.addon.ui.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.