# This patch file was generated by NetBeans IDE # Following Index: paths are relative to: /opt/datos/daniel/tmp/main-silver # This patch can be applied using context Tools: Patch action on respective folder. # It uses platform neutral UTF-8 encoding and \n newlines. # Above lines and this line are ignored by the patching process. Index: groovy.grailsproject/src/org/netbeans/modules/groovy/grailsproject/GrailsProject.java --- groovy.grailsproject/src/org/netbeans/modules/groovy/grailsproject/GrailsProject.java +++ groovy.grailsproject/src/org/netbeans/modules/groovy/grailsproject/GrailsProject.java @@ -46,6 +46,9 @@ import java.awt.Image; import java.beans.PropertyChangeListener; +import java.io.FileInputStream; +import java.io.IOException; +import java.util.Properties; import java.util.logging.Logger; import javax.swing.Icon; import javax.swing.ImageIcon; @@ -96,6 +99,7 @@ private SourceRoots sourceRoots; private SourceRoots testRoots; private Lookup lookup; + private Info info; public GrailsProject(FileObject projectDir, ProjectState projectState) { @@ -105,6 +109,7 @@ this.cpProvider = new ClassPathProviderImpl(getSourceRoots(), getTestSourceRoots(), this); this.commandSupport = new GrailsCommandSupport(this); this.buildConfig = new BuildConfig(this); + this.info = new Info(); } @Override @@ -133,7 +138,7 @@ lookup = Lookups.fixed( this, //project spec requires a project be in its own lookup projectState, //allow outside code to mark the project as needing saving - new Info(), //Project information implementation + getInfo(), //Project information implementation new GrailsActionProvider(this), GrailsSources.create(this), new GrailsServerState(this), @@ -169,8 +174,15 @@ return this.testRoots; } - private final class Info implements ProjectInformation { + public Info getInfo() { + if (this.info == null) { + this.info = new Info(); + } + return this.info; + } + public final class Info implements ProjectInformation { + @Override public Icon getIcon() { Image image = ImageUtilities.loadImage(GrailsConstants.GRAILS_ICON_16x16); @@ -184,8 +196,22 @@ @Override public String getDisplayName() { - return getName(); + String appName = getProjectDirectory().getName(); + try { + Properties prop = new Properties(); + prop.load(new FileInputStream(getProjectDirectory().getPath() + "/application.properties")); + + String appVersion = prop.getProperty("app.version") != null + ?" [" + prop.getProperty("app.version") + "]" + :""; + + if (prop.getProperty("app.name") != null) { + appName = prop.getProperty("app.name") + appVersion; } + } catch (IOException ex) { + } + return appName; + } @Override public void addPropertyChangeListener(PropertyChangeListener pcl) { Index: groovy.grailsproject/src/org/netbeans/modules/groovy/grailsproject/ui/GrailsLogicalViewProvider.java --- groovy.grailsproject/src/org/netbeans/modules/groovy/grailsproject/ui/GrailsLogicalViewProvider.java +++ groovy.grailsproject/src/org/netbeans/modules/groovy/grailsproject/ui/GrailsLogicalViewProvider.java @@ -125,7 +125,7 @@ @Override public String getDisplayName() { - return project.getProjectDirectory().getName(); + return project.getInfo().getDisplayName(); } @Override