|
Lines 19-24
Link Here
|
| 19 |
import org.eclipse.core.runtime.Assert; |
19 |
import org.eclipse.core.runtime.Assert; |
| 20 |
import org.eclipse.core.runtime.IPath; |
20 |
import org.eclipse.core.runtime.IPath; |
| 21 |
import org.eclipse.jface.viewers.IBasicPropertyConstants; |
21 |
import org.eclipse.jface.viewers.IBasicPropertyConstants; |
|
|
22 |
import org.eclipse.osgi.util.TextProcessor; |
| 22 |
import org.eclipse.ui.internal.views.properties.IDEPropertiesMessages; |
23 |
import org.eclipse.ui.internal.views.properties.IDEPropertiesMessages; |
| 23 |
|
24 |
|
| 24 |
/** |
25 |
/** |
|
Lines 155-168
Link Here
|
| 155 |
} |
156 |
} |
| 156 |
|
157 |
|
| 157 |
return FILE_NOT_FOUND; |
158 |
return FILE_NOT_FOUND; |
| 158 |
} else { |
159 |
} |
| 159 |
File localFile = location.toFile(); |
160 |
File localFile = location.toFile(); |
| 160 |
if (localFile.exists()) { |
161 |
if (localFile.exists()) { |
| 161 |
DateFormat format = new SimpleDateFormat(); |
162 |
DateFormat format = new SimpleDateFormat(); |
| 162 |
return format.format(new Date(localFile.lastModified())); |
163 |
return format.format(new Date(localFile.lastModified())); |
| 163 |
} |
|
|
| 164 |
return FILE_NOT_FOUND; |
| 165 |
} |
164 |
} |
|
|
165 |
return FILE_NOT_FOUND; |
| 166 |
} |
166 |
} |
| 167 |
|
167 |
|
| 168 |
/* (non-Javadoc) |
168 |
/* (non-Javadoc) |
|
Lines 187-204
Link Here
|
| 187 |
} |
187 |
} |
| 188 |
if (location == null) { |
188 |
if (location == null) { |
| 189 |
return FILE_NOT_FOUND; |
189 |
return FILE_NOT_FOUND; |
| 190 |
} else { |
190 |
} |
| 191 |
String locationString = location.toOSString(); |
191 |
String locationString = location.toOSString(); |
| 192 |
if (resolvedLocation != null && !isPathVariable(resource)) { |
192 |
if (resolvedLocation != null && !isPathVariable(resource)) { |
| 193 |
// No path variable used. Display the file not exist message |
193 |
// No path variable used. Display the file not exist message |
| 194 |
// in the location. Fixes bug 33318. |
194 |
// in the location. Fixes bug 33318. |
| 195 |
File file = resolvedLocation.toFile(); |
195 |
File file = resolvedLocation.toFile(); |
| 196 |
if (!file.exists()) { |
196 |
if (!file.exists()) { |
| 197 |
locationString += " " + FILE_NOT_EXIST_TEXT; //$NON-NLS-1$ |
197 |
locationString += " " + FILE_NOT_EXIST_TEXT; //$NON-NLS-1$ |
| 198 |
} |
|
|
| 199 |
} |
198 |
} |
| 200 |
return locationString; |
|
|
| 201 |
} |
199 |
} |
|
|
200 |
return locationString; |
| 202 |
} |
201 |
} |
| 203 |
|
202 |
|
| 204 |
/** |
203 |
/** |
|
Lines 217-231
Link Here
|
| 217 |
} |
216 |
} |
| 218 |
|
217 |
|
| 219 |
return FILE_NOT_FOUND; |
218 |
return FILE_NOT_FOUND; |
| 220 |
} else { |
219 |
} |
| 221 |
String locationString = location.toOSString(); |
220 |
String locationString = location.toOSString(); |
| 222 |
File file = location.toFile(); |
221 |
File file = location.toFile(); |
| 223 |
|
222 |
|
| 224 |
if (!file.exists()) { |
223 |
if (!file.exists()) { |
| 225 |
locationString += " " + FILE_NOT_EXIST_TEXT; //$NON-NLS-1$ |
224 |
locationString += " " + FILE_NOT_EXIST_TEXT; //$NON-NLS-1$ |
| 226 |
} |
|
|
| 227 |
return locationString; |
| 228 |
} |
225 |
} |
|
|
226 |
return locationString; |
| 229 |
} |
227 |
} |
| 230 |
|
228 |
|
| 231 |
/* (non-Javadoc) |
229 |
/* (non-Javadoc) |
|
Lines 234-242
Link Here
|
| 234 |
public IPropertyDescriptor[] getPropertyDescriptors() { |
232 |
public IPropertyDescriptor[] getPropertyDescriptors() { |
| 235 |
if (isPathVariable(element)) { |
233 |
if (isPathVariable(element)) { |
| 236 |
return propertyDescriptorsLinkVariable; |
234 |
return propertyDescriptorsLinkVariable; |
| 237 |
} else { |
|
|
| 238 |
return propertyDescriptors; |
| 239 |
} |
235 |
} |
|
|
236 |
return propertyDescriptors; |
| 240 |
} |
237 |
} |
| 241 |
|
238 |
|
| 242 |
/* (non-Javadoc) |
239 |
/* (non-Javadoc) |
|
Lines 247-263
Link Here
|
| 247 |
return element.getName(); |
244 |
return element.getName(); |
| 248 |
} |
245 |
} |
| 249 |
if (name.equals(IResourcePropertyConstants.P_PATH_RES)) { |
246 |
if (name.equals(IResourcePropertyConstants.P_PATH_RES)) { |
| 250 |
return element.getFullPath().toString(); |
247 |
return TextProcessor.process(element.getFullPath().toString()); |
| 251 |
} |
248 |
} |
| 252 |
if (name.equals(IResourcePropertyConstants.P_LAST_MODIFIED_RES)) { |
249 |
if (name.equals(IResourcePropertyConstants.P_LAST_MODIFIED_RES)) { |
| 253 |
return getDateStringValue(element); |
250 |
return getDateStringValue(element); |
| 254 |
} |
251 |
} |
| 255 |
if (name.equals(IResourcePropertyConstants.P_EDITABLE_RES)) { |
252 |
if (name.equals(IResourcePropertyConstants.P_EDITABLE_RES)) { |
| 256 |
if (element.isReadOnly()) { |
253 |
if (element.getResourceAttributes().isReadOnly()) { |
| 257 |
return IDEPropertiesMessages.ResourceProperty_false; |
254 |
return IDEPropertiesMessages.ResourceProperty_false; |
| 258 |
} else { |
255 |
} |
| 259 |
return IDEPropertiesMessages.ResourceProperty_true; |
256 |
return IDEPropertiesMessages.ResourceProperty_true; |
| 260 |
} |
|
|
| 261 |
} |
257 |
} |
| 262 |
if (name.equals(IResourcePropertyConstants.P_DERIVED_RES)) { |
258 |
if (name.equals(IResourcePropertyConstants.P_DERIVED_RES)) { |
| 263 |
return String.valueOf(element.isDerived()); |
259 |
return String.valueOf(element.isDerived()); |
|
Lines 266-275
Link Here
|
| 266 |
return String.valueOf(element.isLinked()); |
262 |
return String.valueOf(element.isLinked()); |
| 267 |
} |
263 |
} |
| 268 |
if (name.equals(IResourcePropertyConstants.P_LOCATION_RES)) { |
264 |
if (name.equals(IResourcePropertyConstants.P_LOCATION_RES)) { |
| 269 |
return getLocationText(element); |
265 |
return TextProcessor.process(getLocationText(element)); |
| 270 |
} |
266 |
} |
| 271 |
if (name.equals(IResourcePropertyConstants.P_RESOLVED_LOCATION_RES)) { |
267 |
if (name.equals(IResourcePropertyConstants.P_RESOLVED_LOCATION_RES)) { |
| 272 |
return getResolvedLocationText(element); |
268 |
return TextProcessor.process(getResolvedLocationText(element)); |
| 273 |
} |
269 |
} |
| 274 |
return null; |
270 |
return null; |
| 275 |
} |
271 |
} |
|
Lines 336-344
Link Here
|
| 336 |
IPath location = resource.getLocation(); |
332 |
IPath location = resource.getLocation(); |
| 337 |
if (location == null) { |
333 |
if (location == null) { |
| 338 |
return null; |
334 |
return null; |
| 339 |
} else { |
|
|
| 340 |
return location.toFile(); |
| 341 |
} |
335 |
} |
|
|
336 |
return location.toFile(); |
| 342 |
} |
337 |
} |
| 343 |
|
338 |
|
| 344 |
} |
339 |
} |