Lines 46-51
Link Here
|
46 |
|
46 |
|
47 |
import java.awt.Image; |
47 |
import java.awt.Image; |
48 |
import java.beans.PropertyChangeListener; |
48 |
import java.beans.PropertyChangeListener; |
|
|
49 |
import java.io.FileInputStream; |
50 |
import java.io.IOException; |
51 |
import java.util.Properties; |
49 |
import java.util.logging.Logger; |
52 |
import java.util.logging.Logger; |
50 |
import javax.swing.Icon; |
53 |
import javax.swing.Icon; |
51 |
import javax.swing.ImageIcon; |
54 |
import javax.swing.ImageIcon; |
Lines 96-101
Link Here
|
96 |
private SourceRoots sourceRoots; |
99 |
private SourceRoots sourceRoots; |
97 |
private SourceRoots testRoots; |
100 |
private SourceRoots testRoots; |
98 |
private Lookup lookup; |
101 |
private Lookup lookup; |
|
|
102 |
private Info info; |
99 |
|
103 |
|
100 |
|
104 |
|
101 |
public GrailsProject(FileObject projectDir, ProjectState projectState) { |
105 |
public GrailsProject(FileObject projectDir, ProjectState projectState) { |
Lines 105-110
Link Here
|
105 |
this.cpProvider = new ClassPathProviderImpl(getSourceRoots(), getTestSourceRoots(), this); |
109 |
this.cpProvider = new ClassPathProviderImpl(getSourceRoots(), getTestSourceRoots(), this); |
106 |
this.commandSupport = new GrailsCommandSupport(this); |
110 |
this.commandSupport = new GrailsCommandSupport(this); |
107 |
this.buildConfig = new BuildConfig(this); |
111 |
this.buildConfig = new BuildConfig(this); |
|
|
112 |
this.info = new Info(); |
108 |
} |
113 |
} |
109 |
|
114 |
|
110 |
@Override |
115 |
@Override |
Lines 133-139
Link Here
|
133 |
lookup = Lookups.fixed( |
138 |
lookup = Lookups.fixed( |
134 |
this, //project spec requires a project be in its own lookup |
139 |
this, //project spec requires a project be in its own lookup |
135 |
projectState, //allow outside code to mark the project as needing saving |
140 |
projectState, //allow outside code to mark the project as needing saving |
136 |
new Info(), //Project information implementation |
141 |
getInfo(), //Project information implementation |
137 |
new GrailsActionProvider(this), |
142 |
new GrailsActionProvider(this), |
138 |
GrailsSources.create(this), |
143 |
GrailsSources.create(this), |
139 |
new GrailsServerState(this), |
144 |
new GrailsServerState(this), |
Lines 169-176
Link Here
|
169 |
return this.testRoots; |
174 |
return this.testRoots; |
170 |
} |
175 |
} |
171 |
|
176 |
|
172 |
private final class Info implements ProjectInformation { |
177 |
public Info getInfo() { |
|
|
178 |
if (this.info == null) { |
179 |
this.info = new Info(); |
180 |
} |
181 |
return this.info; |
182 |
} |
173 |
|
183 |
|
|
|
184 |
public final class Info implements ProjectInformation { |
185 |
|
174 |
@Override |
186 |
@Override |
175 |
public Icon getIcon() { |
187 |
public Icon getIcon() { |
176 |
Image image = ImageUtilities.loadImage(GrailsConstants.GRAILS_ICON_16x16); |
188 |
Image image = ImageUtilities.loadImage(GrailsConstants.GRAILS_ICON_16x16); |
Lines 184-191
Link Here
|
184 |
|
196 |
|
185 |
@Override |
197 |
@Override |
186 |
public String getDisplayName() { |
198 |
public String getDisplayName() { |
187 |
return getName(); |
199 |
String appName = getProjectDirectory().getName(); |
|
|
200 |
try { |
201 |
Properties prop = new Properties(); |
202 |
prop.load(new FileInputStream(getProjectDirectory().getPath() + "/application.properties")); |
203 |
|
204 |
String appVersion = prop.getProperty("app.version") != null |
205 |
?" [" + prop.getProperty("app.version") + "]" |
206 |
:""; |
207 |
|
208 |
if (prop.getProperty("app.name") != null) { |
209 |
appName = prop.getProperty("app.name") + appVersion; |
188 |
} |
210 |
} |
|
|
211 |
} catch (IOException ex) { |
212 |
} |
213 |
return appName; |
214 |
} |
189 |
|
215 |
|
190 |
@Override |
216 |
@Override |
191 |
public void addPropertyChangeListener(PropertyChangeListener pcl) { |
217 |
public void addPropertyChangeListener(PropertyChangeListener pcl) { |