Examples of PromptType


Examples of org.cast.isi.data.PromptType

  public Component makeResponseViewComponent(
      String wicketId, IModel<ISIResponse> model) {
    ISIResponse response = model.getObject();
    ISIPrompt prompt = (ISIPrompt) response.getPrompt();
    PromptType type = prompt.getType();
    if (type == PromptType.SINGLE_SELECT) {
      return makeXmlComponentViewer(wicketId, prompt);
    }
    else {
      return makeResponseViewer(wicketId, model);
View Full Code Here

Examples of org.cast.isi.data.PromptType

    xml.setOutputMarkupId(true);
    return xml;
  }

  public Component makeQuestionTextComponent(String wicketId, ISIPrompt prompt) {
    PromptType type = prompt.getType();
    if ((type == PromptType.SINGLE_SELECT) || (type == PromptType.RESPONSEAREA))
      return makeXmlQuestionTextComponent(wicketId, prompt);
    else if (type == PromptType.PAGE_NOTES)
      return new Label(wicketId, "<em>Page Notes</em>").setEscapeModelStrings(false);
    else
View Full Code Here

Examples of org.cast.isi.data.PromptType

    List<Response> responses = getResponses();
    if (responses.isEmpty())
      return null;
    Response response = responses.get(0);
    ISIPrompt prompt = (ISIPrompt) response.getPrompt();
    PromptType type = prompt.getType();
    if (type.equals(PromptType.SINGLE_SELECT))
      return response.getResponseData().getScore();
    else
      return response.getScore();
  }
View Full Code Here

Examples of org.jboss.forge.shell.PromptType

      Object[] parameters = new Object[command.getOptions().size()];
      for (OptionMetadata option : command.getOptions())
      {

         PromptType promptType = option.getPromptType();
         String defaultValue = option.getDefaultValue();
         Class<?> optionType = option.getBoxedType();
         String optionDescriptor = option.getOptionDescriptor() + ": ";

         Object value;
         if (option.isPipeOut())
         {
            value = pipeOut;
         }
         else if (option.isPipeIn())
         {
            value = pipeIn;

            if (pipeIn != null)
            {
               if (InputStream.class.isAssignableFrom(option.getBoxedType()))
               {
                  value = new InputStream()
                  {
                     int cursor = 0;
                     int len = pipeIn.length();

                     @Override
                     public int read() throws IOException
                     {
                        return cursor != len ? pipeIn.charAt(cursor++) : -1;
                     }
                  };
               }
            }

         }
         else
         {
            value = valueMap.get(option);
         }

         if (!option.isPipeOut() && !option.isPipeIn())
         {
            // TODO Is this really where we want to do PromptType conversion?
            value = doPromptTypeConversions(value, promptType);

            if ((value != null) && option.getBoxedType().isEnum() && !Enums.hasValue(option.getType(), value))
            {
               ShellMessages.info(shell, "Could not parse [" + value + "]... please try again...");
               if (!option.hasCustomCompleter())
               {
                  value = shell.promptEnum(optionDescriptor, (Class<Enum>) option.getType());
               }
               else
               {
                  value = shell.promptCompleter(optionDescriptor, option.getCompleterType());
               }
            }
            else if (((value != null) && (promptType != null)) && !promptType.matches(value.toString()))
            {
               // make sure the current option value is OK
               ShellMessages.info(shell, "Could not parse [" + value + "]... please try again...");
               if (promptType.equals(PromptType.JAVA_PACKAGE))
               {
                  String defaultPackage = value == null ? "" : Packages.toValidPackageName((String) value);
                  value = shell.promptCommon(optionDescriptor, promptType, defaultPackage);
               }
               else
View Full Code Here

Examples of org.jboss.forge.shell.PromptType

      Object[] parameters = new Object[command.getOptions().size()];
      for (OptionMetadata option : command.getOptions())
      {

         PromptType promptType = option.getPromptType();
         String defaultValue = option.getDefaultValue();
         Class<?> optionType = option.getBoxedType();
         String optionDescriptor = option.getOptionDescriptor() + ": ";

         Object value;
         if (option.isPipeOut())
         {
            value = pipeOut;
         }
         else if (option.isPipeIn())
         {
            value = pipeIn;

            if (pipeIn != null)
            {
               if (InputStream.class.isAssignableFrom(option.getBoxedType()))
               {
                  value = new InputStream()
                  {
                     int cursor = 0;
                     int len = pipeIn.length();

                     @Override
                     public int read() throws IOException
                     {
                        return cursor != len ? pipeIn.charAt(cursor++) : -1;
                     }
                  };
               }
            }

         }
         else
         {
            value = valueMap.get(option);
         }

         if (!option.isPipeOut() && !option.isPipeIn())
         {
            // TODO Is this really where we want to do PromptType conversion?
            value = doPromptTypeConversions(value, promptType);

            if ((value != null) && option.getBoxedType().isEnum() && !Enums.hasValue(option.getType(), value))
            {
               ShellMessages.info(shell, "Could not parse [" + value + "]... please try again...");
               if (!option.hasCustomCompleter())
               {
                  value = shell.promptEnum(optionDescriptor, (Class<Enum>) option.getType());
               }
               else
               {
                  value = shell.promptCompleter(optionDescriptor, option.getCompleterType());
               }
            }
            else if (((value != null) && (promptType != null)) && !promptType.matches(value.toString()))
            {
               // make sure the current option value is OK
               ShellMessages.info(shell, "Could not parse [" + value + "]... please try again...");
               value = shell.promptCommon(optionDescriptor, promptType);
            }
View Full Code Here

Examples of org.jboss.forge.shell.PromptType

      Object[] parameters = new Object[command.getOptions().size()];
      for (OptionMetadata option : command.getOptions())
      {

         PromptType promptType = option.getPromptType();
         String defaultValue = option.getDefaultValue();
         Class<?> optionType = option.getBoxedType();
         String optionDescriptor = option.getOptionDescriptor() + ": ";

         Object value;
         if (option.isPipeOut())
         {
            value = pipeOut;
         }
         else if (option.isPipeIn())
         {
            value = pipeIn;

            if (pipeIn != null)
            {
               if (InputStream.class.isAssignableFrom(option.getBoxedType()))
               {
                  value = new InputStream()
                  {
                     int cursor = 0;
                     int len = pipeIn.length();

                     @Override
                     public int read() throws IOException
                     {
                        return cursor != len ? pipeIn.charAt(cursor++) : -1;
                     }
                  };
               }
            }

         }
         else
         {
            value = valueMap.get(option);
         }

         if (!option.isPipeOut() && !option.isPipeIn())
         {
            // TODO Is this really where we want to do PromptType conversion?
            value = doPromptTypeConversions(value, promptType);

            if ((value != null) && option.getBoxedType().isEnum() && !Enums.hasValue(option.getType(), value))
            {
               ShellMessages.info(shell, "Could not parse [" + value + "]... please try again...");
               if (!option.hasCustomCompleter())
               {
                  value = shell.promptEnum(optionDescriptor, (Class<Enum>) option.getType());
               }
               else
               {
                  value = shell.promptCompleter(optionDescriptor, option.getCompleterType());
               }
            }
            else if (((value != null) && (promptType != null)) && !promptType.matches(value.toString()))
            {
               // make sure the current option value is OK
               ShellMessages.info(shell, "Could not parse [" + value + "]... please try again...");
               value = shell.promptCommon(optionDescriptor, promptType);
            }
View Full Code Here

Examples of org.speakright.core.render.PromptType

  }

  void setPromptType(PromptValue prompt, Node node)
  {
        String parentName = m_mostRecentParent.m_name;
    PromptType type = PromptType.MAIN1;
    if (parentName.equals("main1")) {
      type = PromptType.MAIN1;
    }
    else if (parentName.equals("main2")) {
      type = PromptType.MAIN2;
    }
    else if (parentName.equals("main3")) {
      type = PromptType.MAIN3;
    }
    else if (parentName.equals("silence1")) {
      type = PromptType.SILENCE1;
    }
    else if (parentName.equals("silence2")) {
      type = PromptType.SILENCE2;
    }
    else if (parentName.equals("silence3")) {
      type = PromptType.SILENCE3;
    }
    else if (parentName.equals("silence4")) {
      type = PromptType.SILENCE4;
    }
    else if (parentName.equals("noreco1")) {
      type = PromptType.NORECO1;
    }
    else if (parentName.equals("noreco2")) {
      type = PromptType.NORECO2;
    }
    else if (parentName.equals("noreco3")) {
      type = PromptType.NORECO3;
    }
    else if (parentName.equals("noreco4")) {
      type = PromptType.NORECO4;
    }
   
    prompt.m_promptType = type.toString();
  }
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.