本文整理汇总了Java中org.jboss.forge.addon.ui.hints.InputType类的典型用法代码示例。如果您正苦于以下问题:Java InputType类的具体用法?Java InputType怎么用?Java InputType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
InputType类属于org.jboss.forge.addon.ui.hints包,在下文中一共展示了InputType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initializeUI
import org.jboss.forge.addon.ui.hints.InputType; //导入依赖的package包/类
@Override
public void initializeUI(UIBuilder builder) throws Exception {
Project project = getSelectedProject(builder.getUIContext());
JavaSourceFacet facet = project.getFacet(JavaSourceFacet.class);
targetPackage.setCompleter(new PackageNameCompleter(facet));
targetPackage.addValidator(new PackageNameValidator());
targetPackage.getFacet(HintsFacet.class).setInputType(InputType.JAVA_PACKAGE_PICKER);
// if there is only one package then use that as default
Set<String> packages = new RouteBuilderCompleter(facet).getPackages();
if (packages.size() == 1) {
targetPackage.setDefaultValue(first(packages));
}
name.addValidator(new ClassNameValidator(false));
name.getFacet(HintsFacet.class).setInputType(InputType.JAVA_CLASS_PICKER);
builder.add(targetPackage).add(name);
}
示例2: initializeUI
import org.jboss.forge.addon.ui.hints.InputType; //导入依赖的package包/类
@Override
public void initializeUI(UIBuilder builder) throws Exception {
Project project = getSelectedProject(builder.getUIContext());
final JavaSourceFacet facet = project.getFacet(JavaSourceFacet.class);
// filter the list of components based on consumer and producer only
configureComponentName(project, componentName, false, false);
targetPackage.setCompleter(new PackageNameCompleter(facet));
targetPackage.addValidator(new PackageNameValidator());
targetPackage.getFacet(HintsFacet.class).setInputType(InputType.JAVA_PACKAGE_PICKER);
// if there is only one package then use that as default
Set<String> packages = new RouteBuilderCompleter(facet).getPackages();
if (packages.size() == 1) {
targetPackage.setDefaultValue(first(packages));
}
className.addValidator(new ClassNameValidator(false));
className.getFacet(HintsFacet.class).setInputType(InputType.JAVA_CLASS_PICKER);
builder.add(componentName).add(instanceName).add(targetPackage).add(className);
}
示例3: initializeUI
import org.jboss.forge.addon.ui.hints.InputType; //导入依赖的package包/类
@Override
public void initializeUI(UIBuilder builder) throws Exception {
Project project = getSelectedProject(builder.getUIContext());
boolean blueprint = CamelCommandsHelper.isBlueprintProject(project);
boolean spring = CamelCommandsHelper.isSpringProject(project);
directory.getFacet(HintsFacet.class).setInputType(InputType.DIRECTORY_PICKER);
if (blueprint) {
directory.setDefaultValue("OSGI-INF/blueprint");
} else if (spring) {
directory.setDefaultValue("META-INF/spring");
}
XmlFileCompleter xmlFileCompleter = createXmlFileCompleter(builder.getUIContext(), null);
Set<String> directories = xmlFileCompleter.getDirectories();
if (directories.size() == 1) {
directory.setDefaultValue(first(directories));
}
if (!directories.isEmpty()) {
directory.setCompleter(new StringCompleter(directories));
}
name.addValidator(new ResourceNameValidator("xml"));
name.getFacet(HintsFacet.class).setInputType(InputType.FILE_PICKER);
builder.add(directory).add(name);
}
示例4: initializeUI
import org.jboss.forge.addon.ui.hints.InputType; //导入依赖的package包/类
@Override
public void initializeUI(UIBuilder builder) throws Exception {
InputComponentFactory inputFactory = builder.getInputComponentFactory();
targetPackage = inputFactory.createInput("targetPackage", String.class)
.setLabel("Package Name")
.setRequired(true)
.setDescription("The package name where this type will be created");
targetPackage.getFacet(HintsFacet.class).setInputType(InputType.JAVA_PACKAGE_PICKER);
targetPackage.setValueConverter(new PackageRootConverter(getProjectFactory(), builder));
targetPackage.setDefaultValue(calculateDefaultPackage(builder.getUIContext()));
named = inputFactory.createInput("named", String.class)
.setLabel("Type Name").setRequired(true)
.setDescription("The type name");
named.addValidator((context) -> {
if (!Types.isSimpleName(named.getValue()))
context.addValidationError(named, "Invalid java type name.");
});
asClient = inputFactory.createInput(WildFlySwarmConfiguration.TEST_AS_CLIENT_FLAG_CONFIGURATION_ELEMENT, Boolean.class)
.setLabel("As Client").setDescription("Sets test mode to as client.");
mainClass = inputFactory.createInput(WildFlySwarmConfiguration.MAIN_CLASS_CONFIGURATION_ELEMENT, String.class)
.setLabel("Main Class").setDescription("Main Class to use as boot up during test execution.");
archiveType = inputFactory.createSelectOne(WildFlySwarmConfiguration.TEST_TYPE_CONFIGURATION_ELEMENT, String.class)
.setLabel("Archive Type")
.setDescription("Sets type of default archive")
.setValueChoices(ARCHIVE_TYPES);
builder.add(targetPackage)
.add(named)
.add(asClient)
.add(mainClass)
.add(archiveType);
}
示例5: getSupportedInputType
import org.jboss.forge.addon.ui.hints.InputType; //导入依赖的package包/类
@Override
protected String getSupportedInputType()
{
return InputType.RADIO;
}
示例6: getSupportedInputType
import org.jboss.forge.addon.ui.hints.InputType; //导入依赖的package包/类
@Override
protected String getSupportedInputType()
{
return InputType.TEXTBOX;
}
示例7: getSupportedInputType
import org.jboss.forge.addon.ui.hints.InputType; //导入依赖的package包/类
@Override
protected String getSupportedInputType()
{
return InputType.TEXTBOX;
}
示例8: getSupportedInputType
import org.jboss.forge.addon.ui.hints.InputType; //导入依赖的package包/类
@Override
protected String getSupportedInputType()
{
return InputType.CHECKBOX;
}
示例9: getSupportedInputType
import org.jboss.forge.addon.ui.hints.InputType; //导入依赖的package包/类
@Override
protected String getSupportedInputType()
{
return InputType.DIRECTORY_PICKER;
}
示例10: getSupportedInputType
import org.jboss.forge.addon.ui.hints.InputType; //导入依赖的package包/类
@Override
protected String getSupportedInputType()
{
return InputType.JAVA_CLASS_PICKER;
}
示例11: getSupportedInputType
import org.jboss.forge.addon.ui.hints.InputType; //导入依赖的package包/类
@Override
protected String getSupportedInputType()
{
return InputType.FILE_PICKER;
}
示例12: getSupportedInputType
import org.jboss.forge.addon.ui.hints.InputType; //导入依赖的package包/类
@Override
protected String getSupportedInputType()
{
return InputType.SECRET;
}
示例13: getSupportedInputType
import org.jboss.forge.addon.ui.hints.InputType; //导入依赖的package包/类
@Override
protected String getSupportedInputType()
{
return InputType.DROPDOWN;
}
示例14: getSupportedInputType
import org.jboss.forge.addon.ui.hints.InputType; //导入依赖的package包/类
@Override
protected String getSupportedInputType()
{
return InputType.TEXTAREA;
}
示例15: getSupportedInputType
import org.jboss.forge.addon.ui.hints.InputType; //导入依赖的package包/类
@Override
protected String getSupportedInputType()
{
return InputType.DEFAULT;
}