1   package com.atlassian.maven.plugins.amps.codegen.prompter.common;
2   
3   import com.atlassian.maven.plugins.amps.codegen.annotations.ModuleCreatorClass;
4   import com.atlassian.maven.plugins.amps.codegen.prompter.AbstractModulePrompter;
5   import com.atlassian.plugins.codegen.modules.PluginModuleLocation;
6   import com.atlassian.plugins.codegen.modules.common.GadgetModuleCreator;
7   import com.atlassian.plugins.codegen.modules.common.GadgetProperties;
8   
9   import org.codehaus.plexus.components.interactivity.Prompter;
10  import org.codehaus.plexus.components.interactivity.PrompterException;
11  
12  /**
13   * @since 3.5
14   */
15  @ModuleCreatorClass(GadgetModuleCreator.class)
16  public class GadgetPrompter extends AbstractModulePrompter<GadgetProperties>
17  {
18  
19      public GadgetPrompter(Prompter prompter)
20      {
21          super(prompter);
22  
23      }
24  
25      @Override
26      public GadgetProperties promptForBasicProperties(PluginModuleLocation moduleLocation) throws PrompterException
27      {
28          String moduleName = promptNotBlank("Enter Gadget Name", "My Gadget");
29  
30          GadgetProperties props = new GadgetProperties(moduleName);
31          String gadgetLocation = promptNotBlank("Enter Gadget XML location", "gadgets/" + props.getModuleKey() + "/gadget.xml");
32  
33          props.setLocation(gadgetLocation);
34  
35          return props;
36      }
37  
38      @Override
39      public void promptForAdvancedProperties(GadgetProperties props, PluginModuleLocation moduleLocation) throws PrompterException
40      {
41  
42      }
43  }