本文整理匯總了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);
}
};
}
示例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(), "");
}
};
}
示例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, "");
}
};
}
示例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(), "");
}
};
}
示例5: getSupportedInputComponentTypes
import org.jboss.forge.addon.ui.input.UIInputMany; //導入依賴的package包/類
@Override
protected Class<?>[] getSupportedInputComponentTypes()
{
return new Class<?>[] { UIInputMany.class };
}
示例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);
}
示例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);
}
}