PageRenderTime 23ms CodeModel.GetById 8ms app.highlight 9ms RepoModel.GetById 1ms app.codeStats 0ms

/plugin-module-codegen-maven-client/src/main/java/com/atlassian/maven/plugins/amps/codegen/prompter/common/web/WebPanelPrompter.java

https://bitbucket.org/mmeinhold/amps
Java | 52 lines | 32 code | 13 blank | 7 comment | 0 complexity | c2ea8d1f21f7857c80555e38241f2084 MD5 | raw file
 1package com.atlassian.maven.plugins.amps.codegen.prompter.common.web;
 2
 3import com.atlassian.maven.plugins.amps.codegen.annotations.ModuleCreatorClass;
 4import com.atlassian.plugins.codegen.modules.PluginModuleLocation;
 5import com.atlassian.plugins.codegen.modules.common.web.WebPanelModuleCreator;
 6import com.atlassian.plugins.codegen.modules.common.web.WebPanelProperties;
 7
 8import org.codehaus.plexus.components.interactivity.Prompter;
 9import org.codehaus.plexus.components.interactivity.PrompterException;
10
11/**
12 * @since 3.6
13 */
14@ModuleCreatorClass(WebPanelModuleCreator.class)
15public 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        //WEIGHT
41        props.setWeight(promptForInt("Weight", 1000));
42
43        //RESOURCES
44        props.setResources(promptForResources());
45
46        //CONTEXT PROVIDER
47        props.setContextProvider(promptForContextProvider());
48
49        //CONDITIONS
50        props.setConditions(promptForConditions());
51    }
52}