1 package com.atlassian.maven.plugins.amps.codegen.prompter.common.web;
2
3 import com.atlassian.maven.plugins.amps.codegen.annotations.ModuleCreatorClass;
4 import com.atlassian.plugins.codegen.modules.PluginModuleLocation;
5 import com.atlassian.plugins.codegen.modules.common.web.WebPanelModuleCreator;
6 import com.atlassian.plugins.codegen.modules.common.web.WebPanelProperties;
7
8 import org.codehaus.plexus.components.interactivity.Prompter;
9 import org.codehaus.plexus.components.interactivity.PrompterException;
10
11
12
13
14 @ModuleCreatorClass(WebPanelModuleCreator.class)
15 public class WebPanelPrompter extends AbstractWebFragmentPrompter<WebPanelProperties>
16 {
17
18 public WebPanelPrompter(Prompter prompter)
19 {
20 super(prompter);
21
22 }
23
24 @Override
25 public WebPanelProperties promptForBasicProperties(PluginModuleLocation moduleLocation) throws PrompterException
26 {
27 String moduleName = promptNotBlank("Enter Plugin Module Name", "My Web Panel");
28 String location = promptNotBlank("Enter Location (e.g. system.admin/globalsettings)");
29
30 WebPanelProperties props = new WebPanelProperties(moduleName, location);
31
32 suppressAdvancedNamePrompt();
33
34 return props;
35 }
36
37 @Override
38 public void promptForAdvancedProperties(WebPanelProperties props, PluginModuleLocation moduleLocation) throws PrompterException
39 {
40
41 props.setWeight(promptForInt("Weight", 1000));
42
43
44 props.setResources(promptForResources());
45
46
47 props.setContextProvider(promptForContextProvider());
48
49
50 props.setConditions(promptForConditions());
51 }
52 }