當前位置: 首頁>>代碼示例>>Java>>正文


Java UIInputMany類代碼示例

本文整理匯總了Java中org.jboss.forge.addon.ui.input.UIInputMany的典型用法代碼示例。如果您正苦於以下問題:Java UIInputMany類的具體用法?Java UIInputMany怎麽用?Java UIInputMany使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


UIInputMany類屬於org.jboss.forge.addon.ui.input包,在下文中一共展示了UIInputMany類的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: build

import org.jboss.forge.addon.ui.input.UIInputMany; //導入依賴的package包/類
@Override
public ForgeComponent build(final UIContext context, final InputComponent<?, Object> input)
{
   return new ListComponent((UIInputMany<Object>) input)
   {
      @Override
      protected String editSelectedItem(String item)
      {
         return showEditDialog("Edit item", item);
      }

      @Override
      protected String findItemToAdd()
      {
         return showEditDialog("Add item", "");
      }

      private String showEditDialog(String title, final String initialValue)
      {
         return Messages.showInputDialog(IDEUtil.projectFromContext(context),
                  "", title, Messages.getQuestionIcon(), initialValue, null);
      }
   };
}
 
開發者ID:forge,項目名稱:intellij-idea-plugin,代碼行數:25,代碼來源:TextBoxMultipleComponentBuilder.java

示例2: build

import org.jboss.forge.addon.ui.input.UIInputMany; //導入依賴的package包/類
@Override
public ForgeComponent build(final UIContext context, InputComponent<?, Object> input)
{
   return new ListComponent((UIInputMany<Object>) input)
   {
      @Override
      protected String editSelectedItem(String item)
      {
         return IDEUtil.chooseFile(context, FileChooserDescriptorFactory.createSingleFolderDescriptor(), item);
      }

      @Override
      protected String findItemToAdd()
      {
         return IDEUtil.chooseFile(context, FileChooserDescriptorFactory.createSingleFolderDescriptor(), "");
      }
   };
}
 
開發者ID:forge,項目名稱:intellij-idea-plugin,代碼行數:19,代碼來源:DirectoryChooserMultipleComponentBuilder.java

示例3: build

import org.jboss.forge.addon.ui.input.UIInputMany; //導入依賴的package包/類
@Override
public ForgeComponent build(final UIContext context, InputComponent<?, Object> input)
{
   return new ListComponent((UIInputMany<Object>) input)
   {
      @Override
      protected String editSelectedItem(String item)
      {
         return IDEUtil.chooseClass(context, item);
      }

      @Override
      protected String findItemToAdd()
      {
         return IDEUtil.chooseClass(context, "");
      }
   };
}
 
開發者ID:forge,項目名稱:intellij-idea-plugin,代碼行數:19,代碼來源:JavaClassChooserMultipleComponentBuilder.java

示例4: build

import org.jboss.forge.addon.ui.input.UIInputMany; //導入依賴的package包/類
@Override
public ForgeComponent build(final UIContext context, InputComponent<?, Object> input)
{
   return new ListComponent((UIInputMany<Object>) input)
   {
      @Override
      protected String editSelectedItem(String item)
      {
         return IDEUtil.chooseFile(context, FileChooserDescriptorFactory.createSingleLocalFileDescriptor(), item);
      }

      @Override
      protected String findItemToAdd()
      {
         return IDEUtil.chooseFile(context, FileChooserDescriptorFactory.createSingleLocalFileDescriptor(), "");
      }
   };
}
 
開發者ID:forge,項目名稱:intellij-idea-plugin,代碼行數:19,代碼來源:FileChooserMultipleComponentBuilder.java

示例5: getSupportedInputComponentTypes

import org.jboss.forge.addon.ui.input.UIInputMany; //導入依賴的package包/類
@Override
protected Class<?>[] getSupportedInputComponentTypes()
{
   return new Class<?>[] { UIInputMany.class };
}
 
開發者ID:forge,項目名稱:intellij-idea-plugin,代碼行數:6,代碼來源:TextBoxMultipleComponentBuilder.java

示例6: ListComponent

import org.jboss.forge.addon.ui.input.UIInputMany; //導入依賴的package包/類
public ListComponent(UIInputMany<Object> input)
{
   this.input = input;

   converter = converterFactory.getConverter(input.getValueType(), String.class);
}
 
開發者ID:forge,項目名稱:intellij-idea-plugin,代碼行數:7,代碼來源:ListComponent.java

示例7: initializeConfigurationOptionComponents

import org.jboss.forge.addon.ui.input.UIInputMany; //導入依賴的package包/類
@SuppressWarnings({ "unchecked", "rawtypes" })
private void initializeConfigurationOptionComponents(UIBuilder builder)
{
    for (final ConfigurationOption option : WindupConfiguration.getWindupConfigurationOptions())
    {
        InputComponent<?, ?> inputComponent = null;
        switch (option.getUIType())
        {
        case SINGLE:
        {
            UIInput<?> inputSingle = componentFactory.createInput(option.getName(), option.getType());
            inputSingle.setDefaultValue(new DefaultValueAdapter(option));
            inputComponent = inputSingle;
            break;
        }
        case MANY:
        {
            // forge can't handle "Path", so use File
            Class<?> optionType = option.getType() == Path.class ? File.class : option.getType();

            UIInputMany<?> inputMany = componentFactory.createInputMany(option.getName(), optionType);
            inputMany.setDefaultValue(new DefaultValueAdapter(option, Iterable.class));
            inputComponent = inputMany;
            break;
        }
        case SELECT_MANY:
        {
            UISelectMany<?> selectMany = componentFactory.createSelectMany(option.getName(), option.getType());
            selectMany.setValueChoices((Iterable) option.getAvailableValues());
            selectMany.setDefaultValue(new DefaultValueAdapter(option, Iterable.class));
            inputComponent = selectMany;
            break;
        }
        case SELECT_ONE:
        {
            UISelectOne<?> selectOne = componentFactory.createSelectOne(option.getName(), option.getType());
            selectOne.setValueChoices((Iterable) option.getAvailableValues());
            selectOne.setDefaultValue(new DefaultValueAdapter(option));
            inputComponent = selectOne;
            break;
        }
        case DIRECTORY:
        {
            UIInput<DirectoryResource> directoryInput = componentFactory.createInput(option.getName(),
                        DirectoryResource.class);
            directoryInput.setDefaultValue(new DefaultValueAdapter(option, DirectoryResource.class));
            inputComponent = directoryInput;
            break;
        }
        case FILE:
        {
            UIInput<?> fileInput = componentFactory.createInput(option.getName(), FileResource.class);
            fileInput.setDefaultValue(new DefaultValueAdapter(option, FileResource.class));
            inputComponent = fileInput;
            break;
        }
        case FILE_OR_DIRECTORY:
        {
            UIInput<?> fileOrDirInput = componentFactory.createInput(option.getName(), FileResource.class);
            fileOrDirInput.setDefaultValue(new DefaultValueAdapter(option, FileResource.class));
            inputComponent = fileOrDirInput;
            break;
        }
        }
        if (inputComponent == null)
        {
            throw new IllegalArgumentException("Could not build input component for: " + option);
        }
        inputComponent.setLabel(option.getLabel());
        inputComponent.setRequired(option.isRequired());
        inputComponent.setDescription(option.getDescription());
        builder.add(inputComponent);
        inputOptions.put(option, inputComponent);
    }
}
 
開發者ID:windup,項目名稱:windup,代碼行數:76,代碼來源:WindupCommand.java


注:本文中的org.jboss.forge.addon.ui.input.UIInputMany類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。