Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 145842 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/ui/internal/ide/model/WorkbenchFile.java (-1 / +9 lines)
Lines 14-19 Link Here
14
import org.eclipse.core.resources.IResource;
14
import org.eclipse.core.resources.IResource;
15
import org.eclipse.core.runtime.content.IContentType;
15
import org.eclipse.core.runtime.content.IContentType;
16
import org.eclipse.jface.resource.ImageDescriptor;
16
import org.eclipse.jface.resource.ImageDescriptor;
17
import org.eclipse.osgi.util.TextProcessor;
17
import org.eclipse.ui.ISharedImages;
18
import org.eclipse.ui.ISharedImages;
18
import org.eclipse.ui.PlatformUI;
19
import org.eclipse.ui.PlatformUI;
19
import org.eclipse.ui.ide.IDE;
20
import org.eclipse.ui.ide.IDE;
Lines 22-28 Link Here
22
 * An IWorkbenchAdapter that represents IFiles.
23
 * An IWorkbenchAdapter that represents IFiles.
23
 */
24
 */
24
public class WorkbenchFile extends WorkbenchResource {
25
public class WorkbenchFile extends WorkbenchResource {
25
    /**
26
    /* (non-Javadoc)
27
	 * @see org.eclipse.ui.internal.ide.model.WorkbenchResource#getLabel(java.lang.Object)
28
	 */
29
	public String getLabel(Object o) {
30
		return TextProcessor.process(super.getLabel(o));
31
	}
32
33
	/**
26
     *	Answer the appropriate base image to use for the passed resource, optionally
34
     *	Answer the appropriate base image to use for the passed resource, optionally
27
     *	considering the passed open status as well iff appropriate for the type of
35
     *	considering the passed open status as well iff appropriate for the type of
28
     *	passed resource
36
     *	passed resource
(-)src/org/eclipse/ui/views/properties/FilePropertySource.java (-18 / +21 lines)
Lines 15-20 Link Here
15
import org.eclipse.core.resources.IFile;
15
import org.eclipse.core.resources.IFile;
16
import org.eclipse.core.resources.IResource;
16
import org.eclipse.core.resources.IResource;
17
import org.eclipse.core.runtime.IPath;
17
import org.eclipse.core.runtime.IPath;
18
import org.eclipse.jface.viewers.IBasicPropertyConstants;
19
import org.eclipse.osgi.util.TextProcessor;
18
20
19
/**
21
/**
20
 * The FilePropertySource gives the extra information that is shown for files
22
 * The FilePropertySource gives the extra information that is shown for files
Lines 64-71 Link Here
64
     * Method declared on IPropertySource.
66
     * Method declared on IPropertySource.
65
     */
67
     */
66
    public Object getPropertyValue(Object key) {
68
    public Object getPropertyValue(Object key) {
67
69
    	Object returnValue = (key.equals(IBasicPropertyConstants.P_TEXT)) ? TextProcessor
68
        Object returnValue = super.getPropertyValue(key);
70
				.process(element.getName())
71
				: super.getPropertyValue(key);
69
72
70
        if (returnValue != null) {
73
        if (returnValue != null) {
71
			return returnValue;
74
			return returnValue;
Lines 84-106 Link Here
84
    private String getSizeString(IFile file) {
87
    private String getSizeString(IFile file) {
85
        if (!file.isLocal(IResource.DEPTH_ZERO)) {
88
        if (!file.isLocal(IResource.DEPTH_ZERO)) {
86
			return NOT_LOCAL_TEXT;
89
			return NOT_LOCAL_TEXT;
87
		} else {
90
		} 
88
            IPath location = file.getLocation();
91
        
89
            if (location == null) {
92
        IPath location = file.getLocation();
90
                if (file.isLinked()) {
93
        if (location == null) {
91
					return UNDEFINED_PATH_VARIABLE;
94
            if (file.isLinked()) {
92
				}
95
				return UNDEFINED_PATH_VARIABLE;
93
96
			}
94
                return FILE_NOT_FOUND;
97
95
            } else {
98
            return FILE_NOT_FOUND;
96
                File localFile = location.toFile();
99
        } 
97
100
        
98
                if (localFile.exists()) {
101
        File localFile = location.toFile();
99
                    return Long.toString(localFile.length());
102
100
                }
103
        if (localFile.exists()) {
101
                return FILE_NOT_FOUND;
104
            return Long.toString(localFile.length());
102
            }
103
        }
105
        }
106
        return FILE_NOT_FOUND;
104
    }
107
    }
105
108
106
}
109
}
(-)src/org/eclipse/ui/views/properties/ResourcePropertySource.java (-35 / +30 lines)
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
}
(-)Eclipse UI/org/eclipse/ui/internal/ReopenEditorMenu.java (-1 / +2 lines)
Lines 20-25 Link Here
20
import org.eclipse.jface.dialogs.MessageDialog;
20
import org.eclipse.jface.dialogs.MessageDialog;
21
import org.eclipse.jface.util.SafeRunnable;
21
import org.eclipse.jface.util.SafeRunnable;
22
import org.eclipse.osgi.util.NLS;
22
import org.eclipse.osgi.util.NLS;
23
import org.eclipse.osgi.util.TextProcessor;
23
import org.eclipse.swt.SWT;
24
import org.eclipse.swt.SWT;
24
import org.eclipse.swt.events.SelectionAdapter;
25
import org.eclipse.swt.events.SelectionAdapter;
25
import org.eclipse.swt.events.SelectionEvent;
26
import org.eclipse.swt.events.SelectionEvent;
Lines 165-171 Link Here
165
                }
166
                }
166
            }
167
            }
167
        }
168
        }
168
        return sb.toString();
169
        return TextProcessor.process(sb.toString(), TextProcessor.getDefaultDelimiters() + "]");//$NON-NLS-1$
169
    }
170
    }
170
171
171
    /**
172
    /**

Return to bug 145842