/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

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