Lines 67-72
Link Here
|
67 |
*/ |
67 |
*/ |
68 |
public class ResourceInfoPage extends PropertyPage { |
68 |
public class ResourceInfoPage extends PropertyPage { |
69 |
|
69 |
|
|
|
70 |
private Button flattenBox; |
71 |
|
70 |
private Button editableBox; |
72 |
private Button editableBox; |
71 |
|
73 |
|
72 |
private Button executableBox; |
74 |
private Button executableBox; |
Lines 86-91
Link Here
|
86 |
private boolean previousArchiveValue; |
88 |
private boolean previousArchiveValue; |
87 |
|
89 |
|
88 |
private boolean previousDerivedValue; |
90 |
private boolean previousDerivedValue; |
|
|
91 |
|
92 |
private boolean previousFlattenValue; |
89 |
|
93 |
|
90 |
private int previousPermissionsValue; |
94 |
private int previousPermissionsValue; |
91 |
|
95 |
|
Lines 104-110
Link Here
|
104 |
private static String ARCHIVE = IDEWorkbenchMessages.ResourceInfo_archive; |
108 |
private static String ARCHIVE = IDEWorkbenchMessages.ResourceInfo_archive; |
105 |
|
109 |
|
106 |
private static String DERIVED = IDEWorkbenchMessages.ResourceInfo_derived; |
110 |
private static String DERIVED = IDEWorkbenchMessages.ResourceInfo_derived; |
107 |
|
111 |
|
108 |
private static String TYPE_TITLE = IDEWorkbenchMessages.ResourceInfo_type; |
112 |
private static String TYPE_TITLE = IDEWorkbenchMessages.ResourceInfo_type; |
109 |
|
113 |
|
110 |
private static String LOCATION_TITLE = IDEWorkbenchMessages.ResourceInfo_location; |
114 |
private static String LOCATION_TITLE = IDEWorkbenchMessages.ResourceInfo_location; |
Lines 116-121
Link Here
|
116 |
private static String PATH_TITLE = IDEWorkbenchMessages.ResourceInfo_path; |
120 |
private static String PATH_TITLE = IDEWorkbenchMessages.ResourceInfo_path; |
117 |
|
121 |
|
118 |
private static String TIMESTAMP_TITLE = IDEWorkbenchMessages.ResourceInfo_lastModified; |
122 |
private static String TIMESTAMP_TITLE = IDEWorkbenchMessages.ResourceInfo_lastModified; |
|
|
123 |
|
124 |
private static String FOLDER_HIERARCHY_TITLE = IDEWorkbenchMessages.ResourceInfo_folderHierarchy; |
125 |
|
126 |
private static String FLATTEN = IDEWorkbenchMessages.ResourceInfo_flatten; |
119 |
|
127 |
|
120 |
private static String FILE_ENCODING_TITLE = IDEWorkbenchMessages.WorkbenchPreference_encoding; |
128 |
private static String FILE_ENCODING_TITLE = IDEWorkbenchMessages.WorkbenchPreference_encoding; |
121 |
|
129 |
|
Lines 196-202
Link Here
|
196 |
Composite locationComposite = new Composite(basicInfoComposite, |
204 |
Composite locationComposite = new Composite(basicInfoComposite, |
197 |
SWT.NULL); |
205 |
SWT.NULL); |
198 |
layout = new GridLayout(); |
206 |
layout = new GridLayout(); |
199 |
layout.numColumns = 2; |
207 |
layout.numColumns = resource.isFloating() ? 1:2; |
200 |
layout.marginWidth = 0; |
208 |
layout.marginWidth = 0; |
201 |
layout.marginHeight = 0; |
209 |
layout.marginHeight = 0; |
202 |
locationComposite.setLayout(layout); |
210 |
locationComposite.setLayout(layout); |
Lines 221-244
Link Here
|
221 |
locationValue.setBackground(locationValue.getDisplay().getSystemColor( |
229 |
locationValue.setBackground(locationValue.getDisplay().getSystemColor( |
222 |
SWT.COLOR_WIDGET_BACKGROUND)); |
230 |
SWT.COLOR_WIDGET_BACKGROUND)); |
223 |
|
231 |
|
224 |
Button editButton = new Button(locationComposite, SWT.PUSH); |
232 |
if (!resource.isFloating()) { |
225 |
editButton.setText(EDIT_TITLE); |
233 |
Button editButton = new Button(locationComposite, SWT.PUSH); |
226 |
setButtonLayoutData(editButton); |
234 |
editButton.setText(EDIT_TITLE); |
227 |
((GridData) editButton.getLayoutData()).verticalAlignment = SWT.TOP; |
235 |
setButtonLayoutData(editButton); |
228 |
int locationValueHeight = locationValue.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).y; |
236 |
((GridData) editButton.getLayoutData()).verticalAlignment = SWT.TOP; |
229 |
int editButtonHeight = editButton.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).y; |
237 |
int locationValueHeight = locationValue.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).y; |
230 |
int verticalIndent = (editButtonHeight - locationValueHeight) / 2 ; |
238 |
int editButtonHeight = editButton.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).y; |
231 |
((GridData) locationTitle.getLayoutData()).verticalIndent = verticalIndent; |
239 |
int verticalIndent = (editButtonHeight - locationValueHeight) / 2 ; |
232 |
((GridData) locationValue.getLayoutData()).verticalIndent = verticalIndent; |
240 |
((GridData) locationTitle.getLayoutData()).verticalIndent = verticalIndent; |
233 |
editButton.addSelectionListener(new SelectionListener() { |
241 |
((GridData) locationValue.getLayoutData()).verticalIndent = verticalIndent; |
234 |
public void widgetDefaultSelected(SelectionEvent e) { |
242 |
editButton.addSelectionListener(new SelectionListener() { |
235 |
editLinkLocation(); |
243 |
public void widgetDefaultSelected(SelectionEvent e) { |
236 |
} |
244 |
editLinkLocation(); |
237 |
|
245 |
} |
238 |
public void widgetSelected(SelectionEvent e) { |
246 |
|
239 |
editLinkLocation(); |
247 |
public void widgetSelected(SelectionEvent e) { |
240 |
} |
248 |
editLinkLocation(); |
241 |
}); |
249 |
} |
|
|
250 |
}); |
251 |
} |
242 |
|
252 |
|
243 |
// displayed in all cases since the link can be changed to a path variable any time by the user in this dialog |
253 |
// displayed in all cases since the link can be changed to a path variable any time by the user in this dialog |
244 |
Label resolvedLocationTitle = new Label(basicInfoComposite, |
254 |
Label resolvedLocationTitle = new Label(basicInfoComposite, |
Lines 311-316
Link Here
|
311 |
timeStampValue.setLayoutData(new GridData(GridData.FILL_HORIZONTAL |
321 |
timeStampValue.setLayoutData(new GridData(GridData.FILL_HORIZONTAL |
312 |
| GridData.GRAB_HORIZONTAL)); |
322 |
| GridData.GRAB_HORIZONTAL)); |
313 |
|
323 |
|
|
|
324 |
if (resource instanceof IContainer) |
325 |
{ |
326 |
Label folderHierarchyLabel = new Label(basicInfoComposite, SWT.NONE); |
327 |
folderHierarchyLabel.setText(FOLDER_HIERARCHY_TITLE); |
328 |
|
329 |
flattenBox = new Button(basicInfoComposite, SWT.CHECK | SWT.RIGHT); |
330 |
flattenBox.setAlignment(SWT.LEFT); |
331 |
flattenBox.setText(FLATTEN); |
332 |
previousFlattenValue = ((IContainer) resource).isFlatten(); |
333 |
flattenBox.setSelection(previousFlattenValue); |
334 |
} |
335 |
|
314 |
return basicInfoComposite; |
336 |
return basicInfoComposite; |
315 |
} |
337 |
} |
316 |
|
338 |
|
Lines 899-904
Link Here
|
899 |
this.derivedBox.setSelection(false); |
921 |
this.derivedBox.setSelection(false); |
900 |
} |
922 |
} |
901 |
|
923 |
|
|
|
924 |
if (this.flattenBox != null) { |
925 |
this.flattenBox.setSelection(false); |
926 |
} |
927 |
|
902 |
if (permissionBoxes != null) { |
928 |
if (permissionBoxes != null) { |
903 |
int defaultPermissionValues = getDefaulPermissions(resource.getType() == IResource.FOLDER); |
929 |
int defaultPermissionValues = getDefaulPermissions(resource.getType() == IResource.FOLDER); |
904 |
setPermissionsSelection(defaultPermissionValues); |
930 |
setPermissionsSelection(defaultPermissionValues); |
Lines 1000-1005
Link Here
|
1000 |
derivedBox.setSelection(isDerived); |
1026 |
derivedBox.setSelection(isDerived); |
1001 |
} |
1027 |
} |
1002 |
} |
1028 |
} |
|
|
1029 |
if (this.flattenBox != null) { |
1030 |
boolean localFlattenValue = flattenBox.getSelection(); |
1031 |
if (previousFlattenValue != localFlattenValue) { |
1032 |
((IContainer)resource).setFlatten(localFlattenValue, 0, null); |
1033 |
boolean isFlatten = ((IContainer)resource).isFlatten(); |
1034 |
previousFlattenValue = isFlatten; |
1035 |
flattenBox.setSelection(isFlatten); |
1036 |
} |
1037 |
} |
1003 |
} catch (CoreException exception) { |
1038 |
} catch (CoreException exception) { |
1004 |
ErrorDialog.openError(getShell(), |
1039 |
ErrorDialog.openError(getShell(), |
1005 |
IDEWorkbenchMessages.InternalError, exception |
1040 |
IDEWorkbenchMessages.InternalError, exception |