| | |
| | | import org.forgerock.opendj.config.StringPropertyDefinition; |
| | | import org.forgerock.opendj.config.Tag; |
| | | import org.forgerock.opendj.config.UndefinedDefaultBehaviorProvider; |
| | | import org.forgerock.opendj.config.client.ManagedObject; |
| | | |
| | | import com.forgerock.opendj.cli.ArgumentException; |
| | | import com.forgerock.opendj.cli.BooleanArgument; |
| | | import com.forgerock.opendj.cli.StringArgument; |
| | |
| | | * |
| | | * @param app |
| | | * The application console. |
| | | * @param d |
| | | * The managed object definition. |
| | | * @param mo |
| | | * The managed object. |
| | | * @param c |
| | | * The collection of properties to be displayed. |
| | | */ |
| | | public static void displaySingleComponent(ConsoleApplication app, |
| | | AbstractManagedObjectDefinition<?, ?> d, |
| | | ManagedObject<?> mo, |
| | | Collection<PropertyDefinition<?>> c) { |
| | | String ufn = mo.getManagedObjectPath().getName(); |
| | | if (ufn == null) |
| | | { |
| | | ufn = mo.getManagedObjectDefinition().getUserFriendlyName().toString(); |
| | | } |
| | | // Display the title. |
| | | app.println(INFO_DSCFG_HELP_HEADING_COMPONENT.get(d.getUserFriendlyName())); |
| | | app.println(INFO_DSCFG_HELP_HEADING_COMPONENT.get(ufn)); |
| | | |
| | | final AbstractManagedObjectDefinition<?, ?> d = mo.getManagedObjectDefinition(); |
| | | |
| | | app.println(); |
| | | app.println(d.getSynopsis()); |
| | |
| | | app.println(); |
| | | |
| | | // Headings. |
| | | TableBuilder builder = new TableBuilder(); |
| | | final TableBuilder builder = new TableBuilder(); |
| | | |
| | | builder.appendHeading(INFO_DSCFG_HEADING_PROPERTY_NAME.get()); |
| | | builder.appendHeading(INFO_DSCFG_HEADING_PROPERTY_OPTIONS.get()); |
| | |
| | | builder.addSortKey(0); |
| | | |
| | | // Output summary of each property. |
| | | for (PropertyDefinition<?> pd : c) { |
| | | for (final PropertyDefinition<?> pd : c) { |
| | | // Display the property. |
| | | builder.startRow(); |
| | | |
| | |
| | | builder.appendCell(getPropertyOptionSummary(pd)); |
| | | |
| | | // Display the syntax. |
| | | PropertyDefinitionUsageBuilder v = new PropertyDefinitionUsageBuilder( |
| | | final PropertyDefinitionUsageBuilder v = new PropertyDefinitionUsageBuilder( |
| | | false); |
| | | builder.appendCell(v.getUsage(pd)); |
| | | } |
| | | |
| | | TablePrinter printer = new TextTablePrinter(app.getErrorStream()); |
| | | builder.print(printer); |
| | | builder.print(new TextTablePrinter(app.getErrorStream())); |
| | | } |
| | | |
| | | |