[forge-dev] [JBoss JIRA] Created: (SEAMFORGE-157) If in the Java Source tree, Entity plugin should default to current directory

Lincoln Baxter III (JIRA) jira-events at lists.jboss.org
Mon May 2 22:37:18 EDT 2011


If in the Java Source tree, Entity plugin should default to current directory
-----------------------------------------------------------------------------

                 Key: SEAMFORGE-157
                 URL: https://issues.jboss.org/browse/SEAMFORGE-157
             Project: Seam Forge
          Issue Type: Enhancement
          Components: Builtin Plugins
    Affects Versions: 1.0.0.Alpha3
            Reporter: Lincoln Baxter III
            Assignee: Jason Porter


[jbw2011] as7 $ 
[jbw2011] as7 $ entity --named Jason
 ? In which package you'd like to create this @Entity, or enter for default: [org.jboss.jbw.demos.domain] 


Default to the current directory if under JavaSourceFacet.getSourceFolders(...)


-- Concept

{code}   @DefaultCommand(help = "Create a JPA @Entity")
   public void newEntity(
            @Option(required = true,
                     name = "named",
                     description = "The @Entity name") final String entityName) throws FileNotFoundException
   {
      // TODO this should accept a qualified name as a parameter instead of
      // prompting for the package later
      PersistenceFacet jpa = project.getFacet(PersistenceFacet.class);
      JavaSourceFacet java = project.getFacet(JavaSourceFacet.class);

      String entityPackage = shell.promptCommon(
               "In which package you'd like to create this @Entity, or enter for default:",
               PromptType.JAVA_PACKAGE, jpa.getEntityPackage());{code}
      
If 
     {code} java.getBasePackageResource(){code}
is a parent of
    {code}  shell.getCurrentDirectory(){code}

Prompt to use the current directory, otherwise do the current prompt

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the forge-dev mailing list