Examples of UICommandMetadata


Examples of org.jboss.forge.addon.ui.metadata.UICommandMetadata

   public String getCommandName(UIContext context, UICommand cmd)
   {
      String name = null;
      try
      {
         UICommandMetadata metadata = cmd.getMetadata(context);
         name = metadata.getName();
         if (!context.getProvider().isGUI())
         {
            name = shellifyName(name);
         }
      }
View Full Code Here

Examples of org.jboss.forge.addon.ui.metadata.UICommandMetadata

               {
                  command = null;
               }
               else
               {
                  UICommandMetadata metadata = subflow.peek().controller.getCommand().getMetadata(context);
                  command = createCommand((Class<? extends UICommand>) metadata.getType());
               }
            }
            else
            {
               command = createCommand(result[0]);
View Full Code Here

Examples of org.jboss.forge.addon.ui.metadata.UICommandMetadata

   {
      String result = "!!! Failed to load Metadata via `" + UICommand.class.getName()
               + ".getMetadata(UIContext ctx)` !!!";
      try
      {
         UICommandMetadata metadata = command.getMetadata(context);
         result = metadata.toString();
      }
      catch (Exception e)
      {
         log.log(Level.SEVERE, "Could not call method " + UICommand.class.getName()
                  + "`getMetadata(UIContext ctx)` of type [" + command + "].", e);
View Full Code Here

Examples of org.jboss.forge.addon.ui.metadata.UICommandMetadata

   }

   private ProcessedCommand generateCommand(final UICommand command, final ShellContext shellContext,
            final Map<String, InputComponent<?, Object>> inputs)
   {
      UICommandMetadata metadata = command.getMetadata(shellContext);
      ProcessedCommand parameter = new ProcessedCommand(ShellUtil.shellifyName(metadata.getName()),
               metadata.getDescription(), ForgeCommandValidator.INSTANCE);

      for (final InputComponent<?, Object> input : inputs.values())
      {
         final Object defaultValue = InputComponents.getValueFor(input);
         final boolean isMultiple = input instanceof ManyValued;
View Full Code Here

Examples of org.jboss.forge.addon.ui.metadata.UICommandMetadata

         UIContext uiContext = context.getUIContext();
         if (uiContext instanceof ShellContext)
         {
            ShellContext shellContext = (ShellContext) uiContext;
            PrintStream err = shellContext.getProvider().getOutput().err();
            UICommandMetadata metadata = command.getMetadata(shellContext);
            if (metadata != null)
               ShellMessages.error(err, "Error while executing '" + metadata.getName() + "'");
            if (shellContext.isVerbose())
            {
               failure.printStackTrace(err);
            }
            else
View Full Code Here

Examples of org.jboss.forge.addon.ui.metadata.UICommandMetadata

   }

   private ProcessedCommand generateCommand(final CommandController command, final ShellContext shellContext,
            final Map<String, InputComponent<?, ?>> inputs)
   {
      UICommandMetadata metadata = (command instanceof WizardCommandController) ? ((WizardCommandController) command)
               .getInitialMetadata() : command.getMetadata();
      String cmdName = ShellUtil.shellifyName(metadata.getName()).toLowerCase();
      String cmdDescription = metadata.getDescription();
      final ProcessedCommand parameter = new ProcessedCommand(cmdName, cmdDescription,
               (Class<? extends CommandValidator<?>>) null, null);

      for (Entry<String, InputComponent<?, ?>> entry : inputs.entrySet())
      {
View Full Code Here

Examples of org.jboss.forge.addon.ui.metadata.UICommandMetadata

      CommandController result = null;
      Iterable<UICommand> commands = commandFactory.getCommands();
      for (UICommand command : commands)
      {
         UIContextImpl context = getUIContextInstance(initialSelection);
         UICommandMetadata metadata = command.getMetadata(context);
         if (name.equals(metadata.getName()))
         {
            result = factory.createSingleController(context, getUIRuntimeInstance(), command);
            break;
         }
      }
View Full Code Here

Examples of org.jboss.forge.addon.ui.metadata.UICommandMetadata

   }

   private ProcessedCommand generateCommand(final CommandController command, final ShellContext shellContext,
            final Map<String, InputComponent<?, ?>> inputs)
   {
      UICommandMetadata metadata = (command instanceof WizardCommandController) ? ((WizardCommandController) command)
               .getInitialMetadata() : command.getMetadata();
      ProcessedCommand parameter = new ProcessedCommand(ShellUtil.shellifyName(metadata.getName()),
               metadata.getDescription(), ForgeCommandValidator.INSTANCE);

      for (final InputComponent<?, ?> input : inputs.values())
      {
         final Object defaultValue = InputComponents.getValueFor(input);
         final boolean isMultiple = input instanceof ManyValued;
View Full Code Here

Examples of org.jboss.forge.addon.ui.metadata.UICommandMetadata

   }

   private ProcessedCommand generateCommand(final CommandController command, final ShellContext shellContext,
            final Map<String, InputComponent<?, ?>> inputs)
   {
      UICommandMetadata metadata = (command instanceof WizardCommandController) ? ((WizardCommandController) command)
               .getInitialMetadata() : command.getMetadata();
      final ProcessedCommand parameter = new ProcessedCommand(ShellUtil.shellifyName(metadata.getName()),
               metadata.getDescription(), (CommandValidator<?>) null);

      for (Entry<String,InputComponent<?, ?>> entry: inputs.entrySet()) {
         final String inputName = entry.getKey();
         final InputComponent<?, ?> input = entry.getValue();
         final Object defaultValue = InputComponents.getValueFor(input);
View Full Code Here

Examples of org.jboss.forge.addon.ui.metadata.UICommandMetadata

   }

   private ProcessedCommand generateCommand(final UICommand command, final ShellContext shellContext,
            final Map<String, InputComponent<?, Object>> inputs)
   {
      UICommandMetadata metadata = command.getMetadata(shellContext);
      ProcessedCommand parameter = new ProcessedCommand(ShellUtil.shellifyName(metadata.getName()),
               metadata.getDescription());

      for (final InputComponent<?, Object> input : inputs.values())
      {
         final Object defaultValue = InputComponents.getValueFor(input);
         final boolean isMultiple = input instanceof ManyValued;
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.