@Override public UISelectOne<VALUETYPE> setDescription(String description) { getDelegate().setDescription(description); return this; }
@Override public UISelectOne<VALUETYPE> setDescription(Callable<String> description) { getDelegate().setDescription(description); return this; }
private void configureStack(InputComponentFactory factory, final UIContext context) { NoStackFacet defaultStack = SimpleContainer.getServices(getClass().getClassLoader(), NoStackFacet.class) .get(); Imported<StackFacet> stacks = SimpleContainer.getServices(getClass().getClassLoader(), StackFacet.class); final List<StackFacet> list = Lists.toList(stacks); Collections.sort(list, new StackFacetComparator()); stack = factory.createSelectOne("stack", StackFacet.class) .setLabel("Stack") .setDescription("The technology stack to be used in this project") .setValueChoices(() -> list.stream() .filter((stackFacet) -> (type.hasValue() || type.hasDefaultValue()) && type.getValue().supports(stackFacet.getStack())) .collect(Collectors.toSet())) // Enable stack field only if any stack is available .setEnabled(() -> Sets.toSet(stack.getValueChoices()).size() > 1) .setDefaultValue(defaultStack) .setItemLabelConverter((facet) -> context.getProvider().isGUI() ? facet.getStack().getName() : Commands.shellifyOptionValue(facet.getStack().getName())); }
@Override public void initializeUI(UIBuilder builder) throws Exception { dependencyResolver = SimpleContainer.getServices(getClass().getClassLoader(), DependencyResolver.class).get(); InputComponentFactory factory = builder.getInputComponentFactory(); dbType = factory.createSelectOne("dbType", DatabaseType.class).setLabel("Database Type") .setDescription("The database driver to be added to this project").setRequired(true) .setNote(() -> { return (dbType.hasValue()) ? dbType.getValue().getDriverCoordinate().toString() : null; }) .setValueChoices(DatabaseType.getTypesWithDriverSet()); version = factory.createInput("version", String.class).setLabel("Driver Version") .setDescription("The JDBC driver version to be used") .setCompleter(new UICompleter<String>() { @Override public Iterable<String> getCompletionProposals(UIContext context, InputComponent<?, String> input, String value) { return Completers.fromValues(getVersionsFor(dbType.getValue())).getCompletionProposals(context, input, value); } }); scope = factory.createSelectOne("scope", String.class).setLabel("Dependency Scope") .setDescription("The scope this database driver dependency should use when added to this project") .setRequired(true) .setDefaultValue("runtime") .setValueChoices(Arrays.asList("compile", "provided", "runtime", "test")); builder.add(dbType).add(version).add(scope); }
.setDescription("The database catalog for which to generate entities.") .setDefaultValue(() -> { Iterator<String> it = databaseCatalog.getValueChoices().iterator(); .setDescription("The database schema for which to generate entities.") .setDefaultValue(() -> { Iterator<String> it = databaseSchema.getValueChoices().iterator();
}).setDescription(new Callable<String>() { @Override public String call() throws Exception {
.setDescription("Select the database connection profile you want to use"); connectionProfilePassword = factory.createInput("connectionProfilePassword", String.class) .setLabel("Connection Profile Password")
}).setDescription(new Callable<String>()
Project project = getSelectedProject(uiContext); targetClass = inputFactory.createSelectOne("targetClass", JavaResource.class); targetClass.setDescription("The class where the field will be created"); targetClass.setRequired(true);
@Override public void initializeUI(UIBuilder builder) throws Exception { this.branchName = getInputComponentFactory().createInput("branchName", String.class).setLabel("Branch name") .setDefaultValue("master"); this.create = getInputComponentFactory().createInput("create", Boolean.class).setLabel("Create branch") .setDefaultValue(false); this.trackingMode = getInputComponentFactory().createSelectOne("trackingMode", SetupUpstreamMode.class) .setLabel("Track").setDescription("Remote tracking mode") .setDefaultValue(SetupUpstreamMode.SET_UPSTREAM); this.force = getInputComponentFactory().createInput("forge", Boolean.class).setLabel("Force") .setDefaultValue(false); builder.add(branchName).add(create).add(trackingMode).add(force); }
hibernateDialect = factory.createSelectOne("hibernateDialect", HibernateDialect.class) .setLabel("Hibernate Dialect") .setDescription("The Hibernate dialect to use").setRequired(true); driverLocation = factory.createInput("driverLocation", FileResource.class) .setLabel("Driver Location") driverClass = factory.createSelectOne("driverClass", Class.class) .setLabel("Driver Class") .setDescription("The class name of the JDBC driver").setRequired(true); verifyConnection = factory.createInput("verifyConnection", Boolean.class).setLabel("Verify Database Connection") .setDescription("Attempt to connect to the database and verify connectivity");
.setDescription("Sets type of default archive") .setValueChoices(ARCHIVE_TYPES);