if (_shell.promptBoolean("backup standalone.xml '" + backup.getAbsolutePath() + "' already exists: remove it?")) { backup.delete(); } else {
private PackagingType updatePackaging(final Facet facet) throws Abort { List<PackagingType> types = ConstraintInspector.getCompatiblePackagingTypes(facet.getClass()); String facetName = ConstraintInspector.getName(facet.getClass()); PackagingType packaging = project.getFacet(PackagingFacet.class).getPackagingType(); if (types.isEmpty() || types.contains(packaging)) { return null; } else if (shell.promptBoolean("Facet [" + facetName + "] requires packaging type(s) " + types + ", but is currently [" + packaging + "]. Update packaging? (Note: this could deactivate other plugins in your project.)")) { if (types.size() == 1) { return types.get(0); } else { return shell.promptChoiceTyped("Select a new packaging type:", types); } } else { throw new Abort(); } }
@Command(help = "Reset the current shade configuration (includes all dependencies).") public void reset() throws XmlPullParserException, IOException { assertInstalled(); if (shell.promptBoolean("Really reset configuration?")) { removeShadePlugin(); install(); } }
public void onStartup(@Observes PostStartup startup) { Boolean enabled = configuration.getBoolean(ANALYTICS_ENABLED, null); if (enabled == null) { if (Boolean.getBoolean("forge.analytics.no_prompt")) { enabled = Boolean.FALSE; } else { enabled = shell .promptBoolean( "Will you allow the Forge team to receive anonymous usage statistics for this instance of JBoss Forge?", false); } configuration.setProperty(ANALYTICS_ENABLED, enabled); } setEnabled(enabled); if (enabled && isAllowedToRun()) { sendInfoToAnalytics(); } }
if (prompt && !shell.promptBoolean("The [" + ConstraintInspector.getName(facet.getClass()) + "] facet depends on the following missing facet(s): "
|| shell.promptBoolean( "Managed dependency already exists [" + gav.getGroupId() + ":" + gav.getArtifactId() + "], continue?", true)) else if (shell.promptBoolean("Use [" + availableVersions.get(0) + "] instead?", true))
@Command(help = "Remove all shade configurations from the POM") public void remove() throws XmlPullParserException, IOException { assertInstalled(); if (shell.promptBoolean("Really remove all shade configuration?")) { removeShadePlugin(); ShellMessages.info(shell, "Removed all shade configuration from POM."); } else if (!isInstalled()) ShellMessages.success(shell, "Shade is not configured."); else ShellMessages.info(shell, "Aborted."); }
public void removeRequest(@Observes final RemoveFacets request) { List<Facet> removed = new ArrayList<Facet>(); shell.printlnVerbose("Received Facet removal request " + request.getFacetTypes()); if (!request.promptRequested() || shell.promptBoolean("An action has requested to remove the following facets from your project " + request.getFacetTypes() + " continue?", true)) { for (Class<? extends Facet> type : request.getFacetTypes()) { Facet facet = factory.getFacet(type); if (project.hasFacet(type)) { removed.addAll(remove(facet, false)); } else { shell.printlnVerbose("Facet not installed" + type); } } } else if (request.promptRequested()) { throw new FacetActionAborted("Facet installation aborted."); } for (Facet facet : removed) { manager.fireEvent(new FacetRemoved(facet)); } }
shell.printlnVerbose("Received Facet installation request " + request.getFacetTypes()); if (!request.promptRequested() || shell.promptBoolean("An action has requested to install the following facets into your project " + request.getFacetTypes() + " continue?", true))
@Command("set-property") public void addProp( @Option(required = true, name = "name", completer = DependencyPropertyCompleter.class) final String name, @Option(required = true, name = "value") final String value, final PipeOut out) { DependencyFacet deps = project.getFacet(DependencyFacet.class); if (deps.getProperties().containsKey(name) && shell.promptBoolean("Update property [" + name + "=" + deps.getProperty(name) + "] to new value [" + value + "]", true)) { deps.setProperty(name, value); out.println("Updated..."); } else { deps.setProperty(name, value); out.println("Set property [" + name + "=" + value + "]"); } }
|| shell.promptBoolean("delete: " + resource.getName() + ": are you sure?", true))
if (c.getName().equals(componentName)) { out.println(out.renderColor(ShellColor.YELLOW, "Component " + componentName + " is defined by annotation and not in switchyard.xml.")); if (!_shell.promptBoolean("Put it into switchyard.xml so the policy could be added?")) { return;
if (!shell.promptBoolean("Directory " + buildDir.getFullyQualifiedName() + " already exists. Do you want to overwrite?", false))
if (!shell.promptBoolean(String.format("Dependency is managed [%s:%s:%s], reference the managed dependency?", existingDep.getGroupId(), existingDep.getArtifactId(), existingDep.getVersion()), true))
SchemaFilesModel files = new V1SchemaFilesModel(ValidateNamespace.DEFAULT.uri()).addEntry(entry); xmlValidate.setSchemaFiles(files); boolean namespaceAware = _shell.promptBoolean("Namespace aware?"); xmlValidate.setNamespaceAware(namespaceAware); boolean failOnWarn = _shell.promptBoolean("Fail on warning?"); xmlValidate.setFailOnWarning(failOnWarn); validate = xmlValidate;
@Command("remove-parent") public void removeParent(final PipeOut out) { MavenCoreFacet mvn = project.getFacet(MavenCoreFacet.class); Model pom = mvn.getPOM(); Parent parent = pom.getParent(); if (parent != null) { String parentId = parent.getGroupId() + ":" + parent.getArtifactId() + ":" + parent.getVersion() + " (" + (parent.getRelativePath() == null ? " " : parent.getRelativePath() + ")"); if (shell.promptBoolean("Are you sure you want to remove all parent information from this project? [ " + parentId + "]", false)) { out.println("Removed parent [ " + parentId + " ]"); pom.setParent(null); mvn.setPOM(pom); } else { out.println("Aborted..."); } } else { out.println("Nothing to remove..."); } }
value = shell.promptBoolean(optionDescriptor);
String xsltFile = _shell.promptCommon("XSLT file location", PromptType.ANY); xsltTransform.setXsltFile(xsltFile); boolean failOnWarn = _shell.promptBoolean("Fail on warning?"); xsltTransform.setFailOnWarning(failOnWarn); transform = xsltTransform;
if (shell.promptBoolean("The EJB class already exists, do you want to overwrite it?"))
&& !shell.promptBoolean( "An existing installation for version [" + pluginSlot + "] of this plugin was found. Replace it?", true))