@Override public String format(final int column, final String value) { return value.endsWith("*") ? pipeOut.renderColor(ShellColor.BOLD, value) : value; } };
@Override public String format(int column, String value) { if (value.endsWith("/")) { return out.renderColor(ShellColor.BLUE, value); } else { return value; } } };
private void printDep(final PipeOut out, final Dependency dep) { out.println( out.renderColor(ShellColor.BLUE, dep.getGroupId()) + out.renderColor(ShellColor.BOLD, " : ") + out.renderColor(ShellColor.BLUE, dep.getArtifactId()) + out.renderColor(ShellColor.BOLD, " : ") + out.renderColor(ShellColor.NONE, dep.getVersion() == null ? "" : dep.getVersion()) + out.renderColor(ShellColor.BOLD, " : ") + out.renderColor(ShellColor.NONE, dep.getPackagingType() == null ? "" : dep .getPackagingType().toLowerCase()) + out.renderColor(ShellColor.BOLD, " : ") + out.renderColor(determineDependencyShellColor(dep.getScopeTypeEnum()), dep.getScopeType() == null ? "compile" : dep.getScopeType() .toLowerCase())); }
private void printAllMessage(final boolean all, final PipeOut out, final String tok, final List<PluginMetadata> list) { if (list.size() > 1) { if (all) { ShellMessages.info(out, "The plugin [" + tok + "] is overloaded. Listing all candidates and their corresponding Resource scopes."); } else { ShellMessages .info(out, "The plugin [" + tok + "] is overloaded. Showing only the plugin for the first or active scope. Re-run with " + out.renderColor(ShellColor.BOLD, "'--all'") + " to display all scopes."); } } }
private void printGeneralHelp(final PipeOut out) { out.println("Welcome to " + out.renderColor(ShellColor.YELLOW, "JBoss Forge") + ", a next-generation " + "interactive Shell and project-generation tool. If you find yourself lost, or uncertain how " + "to complete an operation, you may press the " + out.renderColor(ShellColor.BOLD, "<TAB>") + " key for command-completion, or " + out.renderColor(ShellColor.BOLD, "<TAB><TAB>") + " for hints while typing a command."); out.println(); out.println("Type " + out.renderColor(ShellColor.BOLD, "'list-commands'") + " for a list of available " + "commands in the current Resource context."); out.println(); Project currentProject = shell.getCurrentProject(); if (currentProject != null) { out.println("Currently operating on the Project located at [" + currentProject.getProjectRoot().getFullyQualifiedName() + "]"); } else { out.println("You are not working on a project. Type " + out.renderColor(ShellColor.BOLD, "'help new-project'") + " to get started."); } }
@DefaultCommand public void show(final PipeOut out) { FacesFacet facet = project.getFacet(FacesFacet.class); ShellMessages.info(out, "Displaying current JSF configuration:"); out.println(); out.println(out.renderColor(ShellColor.BOLD, "Project State: ") + facet.getProjectStage()); out.println(out.renderColor(ShellColor.BOLD, "FacesServlet Mappings: ") + facet.getEffectiveFacesServletMappings()); out.println(out.renderColor(ShellColor.BOLD, "Faces Default Suffixes: ") + facet.getFacesDefaultSuffixes()); out.println(out.renderColor(ShellColor.BOLD, "Facelets Default Suffixes: ") + facet.getFaceletsDefaultSuffixes()); out.println(out.renderColor(ShellColor.BOLD, "Facelets View Mappings: ") + facet.getFaceletsViewMapping()); }
url = new URL(urlStr); } catch (Exception ex) { out.println(out.renderColor(ShellColor.RED, "Invalid Artifact URL: " + urlStr)); out.println(out.renderColor(ShellColor.RED, ex.toString())); return; out.println(out.renderColor(ShellColor.RED, "Invalid Artifact URL: " + urlStr)); out.println(out.renderColor(ShellColor.RED, ex.toString())); return;
out.println(out.renderColor(ShellColor.RED, "Service " + serviceName + " could not be found")); return; out.println(out.renderColor(ShellColor.YELLOW, "No binding")); return; model.setClazz(className); } catch (Exception e) { out.println(out.renderColor(ShellColor.RED, e.getMessage())); return;
private void printPlugin(final PipeOut out, final PluginMetadata p, final boolean all) out.println(out.renderColor(ShellColor.BOLD, "[" + p.getName() + "]") + " - " + (Strings.isNullOrEmpty(p.getHelp()) ? out.renderColor(ShellColor.ITALIC, NO_HELP) : p .getHelp())); if (!p.getResourceScopes().isEmpty() && all)
for (ComponentModel c : switchYard.getMergedSwitchYardConfig().getComposite().getComponents()) { 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; out.println(out.renderColor(ShellColor.RED, "Component " + componentName + " could not be found")); return; out.println(out.renderColor(ShellColor.YELLOW, "No reference is found in " + componentName)); return; out.println(out.renderColor(ShellColor.RED, "Unknown place " + where)); return;
@DefaultCommand public void about(final PipeOut out) { out.println(" _____ "); out.println(" | ___|__ _ __ __ _ ___ "); out.println(" | |_ / _ \\| `__/ _` |/ _ \\ " + out.renderColor(ShellColor.YELLOW, "\\\\")); out.println(" | _| (_) | | | (_| | __/ " + out.renderColor(ShellColor.YELLOW, "//")); out.println(" |_| \\___/|_| \\__, |\\___| "); out.println(" |___/ "); out.println(""); out.print(ShellColor.ITALIC, "JBoss Forge"); out.print(", version [ "); out.print(ShellColor.BOLD, environment.getRuntimeVersion()); out.print(" ] - JBoss, by "); out.print(ShellColor.RED, "Red Hat, Inc."); out.println(" [ http://forge.jboss.org ]"); }
out.println(out.renderColor(ShellColor.RED, "Service has already been promoted: " + serviceName)); return; out.println(out.renderColor(ShellColor.RED, "Component service not found: " + serviceName)); return;
out.println(out.renderColor(ShellColor.RED, "Reference has already been promoted: " + referenceName)); return; out.println(out.renderColor(ShellColor.RED, "Component reference not found: " + referenceName)); return;
out.println((!Strings.isNullOrEmpty(opt.getHelp()) ? opt.getHelp() : out.renderColor(ShellColor.ITALIC, NO_HELP))); i++; if (!Strings.isNullOrEmpty(opt.getShortName())) out.print(", " + out.renderColor(ShellColor.BOLD, "-" + opt.getShortName())); out.println((!Strings.isNullOrEmpty(opt.getHelp()) ? opt.getHelp() : out.renderColor(ShellColor.ITALIC, NO_HELP)));
out.print(ShellColor.BOLD, "[" + p.getName() + " " + c.getName() + "] "); out.println("- " + (!Strings.isNullOrEmpty(c.getHelp()) ? c.getHelp() : out.renderColor(ShellColor.ITALIC, NO_HELP)));
@Command(value = "find-plugin", help = "Searches the configured Forge plugin index for a plugin matching the given search text") public void find(@Option(description = "search string") final String searchString, final PipeOut out) throws Exception { List<PluginRef> pluginList = PluginUtil.findPlugin(shell, configuration, searchString); if (!pluginList.isEmpty()) { out.println(); } for (PluginRef ref : pluginList) { out.println(" - " + out.renderColor(ShellColor.BOLD, ref.getName()) + " (" + ref.getArtifact() + ")"); out.println("\tAuthor: " + ref.getAuthor()); out.println("\tWebsite: " + ref.getWebsite()); out.println("\tLocation: " + ref.getLocation()); out.println("\tTags: " + ref.getTags()); out.println("\tDescription: " + ref.getDescription()); out.println(); } }
out.println(out.renderColor(ShellColor.BOLD, "Unit: ") + unit.getName() + "\t" + out.renderColor(ShellColor.BOLD, "transaction-type: ") + unit.getTransactionType()); out.println("description:\t" + unit.getDescription()); out.println("provider:\t" + unit.getProvider());
out.println(out.renderColor(ShellColor.RED, "Unknown transformer type: " + type)); return;
out.println(out.renderColor(ShellColor.BLUE, "NOTE: Run 'mvn package' to make " + serviceName + " visible to SwitchYard shell."));
out.println(out.renderColor(ShellColor.RED, "Unknown validator type :" + type)); return;