org.jboss.forge.addon.ui.metadata.UICommandMetadata Java Examples

The following examples show how to use org.jboss.forge.addon.ui.metadata.UICommandMetadata. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SetupCommandTest.java    From thorntail-addon with Eclipse Public License 1.0 6 votes vote down vote up
@Test
public void checkCommandMetadata() throws Exception
{
   try (CommandController controller = uiTestHarness.createCommandController(SetupCommand.class,
            project.getRoot()))
   {
      controller.initialize();
      // Checks the command metadata
      assertTrue(controller.getCommand() instanceof SetupCommand);
      UICommandMetadata metadata = controller.getMetadata();
      assertEquals("Thorntail: Setup", metadata.getName());
      assertEquals("Thorntail", metadata.getCategory().getName());
      assertNull(metadata.getCategory().getSubCategory());
      assertEquals(3, controller.getInputs().size());
      assertFalse(controller.hasInput("dummy"));
      assertTrue(controller.hasInput("httpPort"));
      assertTrue(controller.hasInput("contextPath"));
      assertTrue(controller.hasInput("portOffset"));
   }
}
 
Example #2
Source File: NewBuildCommand.java    From fabric8-forge with Apache License 2.0 5 votes vote down vote up
@Override
public UICommandMetadata getMetadata(UIContext context) {
    return Metadata.from(super.getMetadata(context), getClass())
            .category(Categories.create(CATEGORY))
            .name(CATEGORY + ": New Build")
            .description("Create a new build configuration");
}
 
Example #3
Source File: CreateTestClassCommandTest.java    From thorntail-addon with Eclipse Public License 1.0 5 votes vote down vote up
@Test
public void checkCommandMetadata() throws Exception
{
   try (CommandController controller = uiTestHarness.createCommandController(CreateTestClassCommand.class,
            project.getRoot()))
   {
      controller.initialize();

      UICommandMetadata metadata = controller.getMetadata();
      assertThat(controller.getCommand(), is(instanceOf(CreateTestClassCommand.class)));
      assertThat(metadata.getName(), is("Thorntail: New Test"));
      assertThat(metadata.getCategory().getName(), is("Thorntail"));
      assertThat(metadata.getCategory().getSubCategory(), is(nullValue()));
   }
}
 
Example #4
Source File: NewIntegrationTestBuildCommand.java    From fabric8-forge with Apache License 2.0 5 votes vote down vote up
@Override
public UICommandMetadata getMetadata(UIContext context) {
    return Metadata.from(super.getMetadata(context), getClass())
            .category(Categories.create(CATEGORY))
            .name(CATEGORY + ": New Integration Test Build")
            .description("Create a new integration test build configuration");
}
 
Example #5
Source File: DevOpsEditCommand.java    From fabric8-forge with Apache License 2.0 5 votes vote down vote up
@Override
public UICommandMetadata getMetadata(UIContext context) {
    return Metadata.forCommand(getClass())
            .category(Categories.create(AbstractDevOpsCommand.CATEGORY))
            .name(AbstractDevOpsCommand.CATEGORY + ": Edit")
            .description("Edit the DevOps configuration for this project");
}
 
Example #6
Source File: NewIntegrationTestClassCommand.java    From fabric8-forge with Apache License 2.0 5 votes vote down vote up
@Override
public UICommandMetadata getMetadata(UIContext context) {
    return Metadata.from(super.getMetadata(context), getClass())
            .category(Categories.create(CATEGORY))
            .name(CATEGORY + ": New Integration Test Class")
            .description("Create a new integration test class and adds any extra required dependencies to the pom.xml");
}
 
Example #7
Source File: ScanClassesCommand.java    From fabric8-forge with Apache License 2.0 5 votes vote down vote up
@Override
public UICommandMetadata getMetadata(UIContext context)
{
	return Metadata
			.forCommand(getClass())
			.name("Introspector: Scan classes")
			.description("Find/filter available classes in the project")
			.category(Categories.create("Introspector"));
}
 
Example #8
Source File: DevOpsPipelineCommand.java    From fabric8-forge with Apache License 2.0 5 votes vote down vote up
@Override
public UICommandMetadata getMetadata(UIContext context) {
    return Metadata.forCommand(getClass())
            .category(Categories.create(AbstractDevOpsCommand.CATEGORY))
            .name(AbstractDevOpsCommand.CATEGORY + ": Pipeline")
            .description("Configures the pipeline for this project");
}
 
Example #9
Source File: DevOpsEditOptionalStep.java    From fabric8-forge with Apache License 2.0 5 votes vote down vote up
@Override
public UICommandMetadata getMetadata(UIContext context) {
    return Metadata.forCommand(getClass())
            .category(Categories.create(AbstractDevOpsCommand.CATEGORY))
            .name(AbstractDevOpsCommand.CATEGORY + ": Configure Optional")
            .description("Configure the Project options for the new project");
}
 
Example #10
Source File: RunCommand.java    From thorntail-addon with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public UICommandMetadata getMetadata(UIContext context)
{
   return Metadata.from(super.getMetadata(context), getClass()).name("Thorntail: Run")
            .description("Run the project using the 'thorntail:run' maven plugin")
            .category(Categories.create("Thorntail"));
}
 
Example #11
Source File: SpringBootNewProjectCommand.java    From fabric8-forge with Apache License 2.0 5 votes vote down vote up
@Override
public UICommandMetadata getMetadata(UIContext context) {
    return Metadata.from(super.getMetadata(context), getClass())
            .category(Categories.create(CATEGORY))
            .name(CATEGORY + ": New Project")
            .description("Create a new Spring Boot project");
}
 
Example #12
Source File: ServicesList.java    From fabric8-forge with Apache License 2.0 5 votes vote down vote up
@Override
public UICommandMetadata getMetadata(UIContext context) {
    return Metadata.from(super.getMetadata(context), getClass())
            .category(Categories.create(CATEGORY))
            .name(CATEGORY + ": Service List")
            .description("Lists the services in a kubernetes cloud");
}
 
Example #13
Source File: DetectFractionsCommand.java    From thorntail-addon with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public UICommandMetadata getMetadata(UIContext context)
{
   return Metadata.from(super.getMetadata(context), getClass()).name("Thorntail: Detect Fractions")
            .description("Detect the needed fractions for the current project")
            .category(Categories.create("Thorntail"));
}
 
Example #14
Source File: ServiceDelete.java    From fabric8-forge with Apache License 2.0 5 votes vote down vote up
@Override
public UICommandMetadata getMetadata(UIContext context) {
    return Metadata.from(super.getMetadata(context), getClass())
            .category(Categories.create(CATEGORY))
            .name(CATEGORY + ": Service Delete")
            .description("Deletes the given service from the kubernetes cloud");
}
 
Example #15
Source File: PodsList.java    From fabric8-forge with Apache License 2.0 5 votes vote down vote up
@Override
public UICommandMetadata getMetadata(UIContext context) {
    return Metadata.from(super.getMetadata(context), getClass())
            .category(Categories.create(CATEGORY))
            .name(CATEGORY + ": Pod List")
            .description("Lists the pods in a kubernetes cloud");
}
 
Example #16
Source File: ReplicationControllersList.java    From fabric8-forge with Apache License 2.0 5 votes vote down vote up
@Override
public UICommandMetadata getMetadata(UIContext context) {
    return Metadata.from(super.getMetadata(context), getClass())
            .category(Categories.create(CATEGORY))
            .name(CATEGORY + ": Replication Controller List")
            .description("Lists the replication controllers in a kubernetes cloud");
}
 
Example #17
Source File: NamespaceSet.java    From fabric8-forge with Apache License 2.0 5 votes vote down vote up
@Override
public UICommandMetadata getMetadata(UIContext context) {
    return Metadata.from(super.getMetadata(context), getClass())
            .category(Categories.create(CATEGORY))
            .name(CATEGORY + ": Namespace Set")
            .description("Sets the current namespace");
}
 
Example #18
Source File: NamespaceGet.java    From fabric8-forge with Apache License 2.0 5 votes vote down vote up
@Override
public UICommandMetadata getMetadata(UIContext context) {
    return Metadata.from(super.getMetadata(context), getClass())
            .category(Categories.create(CATEGORY))
            .name(CATEGORY + ": Namespace Get")
            .description("Displays the current namespace");
}
 
Example #19
Source File: Apply.java    From fabric8-forge with Apache License 2.0 5 votes vote down vote up
@Override
public UICommandMetadata getMetadata(UIContext context) {
    return Metadata.from(super.getMetadata(context), getClass())
            .category(Categories.create(CATEGORY))
            .name(CATEGORY + ": Apply")
            .description("Applies the given JSON configuration to kubernetes to create pods, replication controllers or services");
}
 
Example #20
Source File: ReplicationControllerDelete.java    From fabric8-forge with Apache License 2.0 5 votes vote down vote up
@Override
public UICommandMetadata getMetadata(UIContext context) {
    return Metadata.from(super.getMetadata(context), getClass())
            .category(Categories.create(CATEGORY))
            .name(CATEGORY + ": Replication Controller Delete")
            .description("Deletes the given replication controller from the kubernetes cloud");
}
 
Example #21
Source File: PodInfo.java    From fabric8-forge with Apache License 2.0 5 votes vote down vote up
@Override
public UICommandMetadata getMetadata(UIContext context) {
    return Metadata.from(super.getMetadata(context), getClass())
            .category(Categories.create(CATEGORY))
            .name(CATEGORY + ": Pod Info")
            .description("Shows detailed information for the given pod in the kubernetes cloud");
}
 
Example #22
Source File: UICommands.java    From fabric8-forge with Apache License 2.0 5 votes vote down vote up
public static CommandInfoDTO createCommandInfoDTO(RestUIContext context, UICommand command) {
    CommandInfoDTO answer;
    UICommandMetadata metadata = command.getMetadata(context);
    String metadataName = unshellifyName(metadata.getName());
    String id = shellifyName(metadataName);
    String description = metadata.getDescription();
    String category = toStringOrNull(metadata.getCategory());
    String docLocation = toStringOrNull(metadata.getDocLocation());
    boolean enabled = command.isEnabled(context);
    answer = new CommandInfoDTO(id, metadataName, description, category, docLocation, enabled);
    return answer;
}
 
Example #23
Source File: AddNodeXmlStep.java    From fabric8-forge with Apache License 2.0 4 votes vote down vote up
@Override
public UICommandMetadata getMetadata(UIContext context) {
    return Metadata.forCommand(ConfigureEndpointPropertiesStep.class).name(
            "Camel: Add EIP").category(Categories.create(CATEGORY))
            .description(String.format("Configure %s options (%s of %s)", getGroup(), getIndex(), getTotal()));
}
 
Example #24
Source File: RouteResetStatsCommand.java    From fabric8-forge with Apache License 2.0 4 votes vote down vote up
@Override
public UICommandMetadata getMetadata(UIContext context) {
    return Metadata.forCommand(ConnectCommand.class).name(
            "camel-route-reset-stats").category(Categories.create(CATEGORY))
            .description("Reset route performance stats from a CamelContext");
}
 
Example #25
Source File: RestApiDocCommand.java    From fabric8-forge with Apache License 2.0 4 votes vote down vote up
@Override
public UICommandMetadata getMetadata(UIContext context) {
    return Metadata.forCommand(ConnectCommand.class).name(
            "camel-rest-api-doc").category(Categories.create(CATEGORY))
            .description("List the Camel REST services API documentation (requires camel-swagger-java on classpath)");
}
 
Example #26
Source File: RouteInfoCommand.java    From fabric8-forge with Apache License 2.0 4 votes vote down vote up
@Override
public UICommandMetadata getMetadata(UIContext context) {
    return Metadata.forCommand(ConnectCommand.class).name(
            "camel-route-info").category(Categories.create(CATEGORY))
            .description("Display information about a Camel route.");
}
 
Example #27
Source File: ConnectCommand.java    From fabric8-forge with Apache License 2.0 4 votes vote down vote up
@Override
public UICommandMetadata getMetadata(UIContext context) {
    return Metadata.forCommand(ConnectCommand.class).name(
            "camel-connect").category(Categories.create(CATEGORY))
            .description("Connects to a Jolokia agent");
}
 
Example #28
Source File: ListFractionsCommand.java    From thorntail-addon with Eclipse Public License 1.0 4 votes vote down vote up
@Override
public UICommandMetadata getMetadata(UIContext context) {
    return Metadata.from(super.getMetadata(context), getClass()).name("Thorntail: List Fractions")
            .description("List all the available fractions")
            .category(Categories.create("Thorntail"));
}
 
Example #29
Source File: ComponentListCommand.java    From fabric8-forge with Apache License 2.0 4 votes vote down vote up
@Override
public UICommandMetadata getMetadata(UIContext context) {
    return Metadata.forCommand(ConnectCommand.class).name(
            "camel-component-list").category(Categories.create(CATEGORY))
            .description("Lists all Camel components that are used by a Camel context");
}
 
Example #30
Source File: CamelNewCamelContextXmlCommand.java    From fabric8-forge with Apache License 2.0 4 votes vote down vote up
@Override
public UICommandMetadata getMetadata(UIContext context) {
    return Metadata.forCommand(CamelNewRouteBuilderCommand.class).name(
            "Camel: New CamelContext XML").category(Categories.create(CATEGORY))
            .description("Creates a new XML file with CamelContext");
}