Uploaded image for project: 'Forge'
  1. Forge
  2. FORGE-687

PromptType.JAVA_PACKAGE should support default package

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 1.0.5.Final
    • Fix Version/s: 1.4.0.Final
    • Component/s: UI - Shell
    • Labels:
      None

      Description

      If you want to prompt the user to provide some valid java package you'd specify PromptType.JAVA_PACKAGE. Unfortunately this prompt type considers the empty string as invalid package even though I'd argue that this is the default package.
      If I ask the user for the package, scaffolded resources would get created to, I'd do:

      prompt.promptCommon(target package: ", PromptType.JAVA_PACKAGE, project.getFacet(JavaSourceFacet.class).getBasePackageResource().toString())
      

      If I have no valid packageResource (ex. forge would return an invalid base package) I'd want to suggest the user to put his sources into the default package (for a maven project: src/main/java). I'd then feed a "" as default to the prompt:

      prompt.promptCommon(target package: ", PromptType.JAVA_PACKAGE, "")
      

      Unfortunately the PromptType.JAVA_PACKAGE would not validate the empty string. It would tell me that this is not a valid package.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  vineet.reynolds Vineet Reynolds
                  Reporter:
                  adietish Andre Dietisheim
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  4 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: