View | Details | Raw Unified | Return to bug 336037
Collapse All | Expand All

(-)ui/org/eclipse/jdt/internal/ui/preferences/JavadocConfigurationPropertyPage.java (-4 / +35 lines)
Lines 14-22 Link Here
14
import java.net.URL;
14
import java.net.URL;
15
15
16
import org.eclipse.swt.SWT;
16
import org.eclipse.swt.SWT;
17
import org.eclipse.swt.layout.GridData;
18
import org.eclipse.swt.layout.GridLayout;
17
import org.eclipse.swt.widgets.Composite;
19
import org.eclipse.swt.widgets.Composite;
18
import org.eclipse.swt.widgets.Control;
20
import org.eclipse.swt.widgets.Control;
21
import org.eclipse.swt.widgets.Label;
19
import org.eclipse.swt.widgets.Shell;
22
import org.eclipse.swt.widgets.Shell;
23
import org.eclipse.swt.widgets.Text;
20
24
21
import org.eclipse.core.runtime.Assert;
25
import org.eclipse.core.runtime.Assert;
22
import org.eclipse.core.runtime.CoreException;
26
import org.eclipse.core.runtime.CoreException;
Lines 45-50 Link Here
45
import org.eclipse.jdt.core.JavaCore;
49
import org.eclipse.jdt.core.JavaCore;
46
import org.eclipse.jdt.core.JavaModelException;
50
import org.eclipse.jdt.core.JavaModelException;
47
51
52
import org.eclipse.jdt.internal.corext.javadoc.JavaDocLocations;
48
import org.eclipse.jdt.internal.corext.util.JavaModelUtil;
53
import org.eclipse.jdt.internal.corext.util.JavaModelUtil;
49
import org.eclipse.jdt.internal.corext.util.Messages;
54
import org.eclipse.jdt.internal.corext.util.Messages;
50
55
Lines 69-74 Link Here
69
74
70
	private JavadocConfigurationBlock fJavadocConfigurationBlock;
75
	private JavadocConfigurationBlock fJavadocConfigurationBlock;
71
	private boolean fIsValidElement;
76
	private boolean fIsValidElement;
77
	private boolean fIsReadOnly;
72
78
73
	private IPath fContainerPath;
79
	private IPath fContainerPath;
74
	private IClasspathEntry fEntry;
80
	private IClasspathEntry fEntry;
Lines 131-141 Link Here
131
			setDescription(Messages.format(PreferencesMessages.JavadocConfigurationPropertyPage_not_supported, containerName));
137
			setDescription(Messages.format(PreferencesMessages.JavadocConfigurationPropertyPage_not_supported, containerName));
132
			return null;
138
			return null;
133
		}
139
		}
140
		IClasspathEntry entry= JavaModelUtil.findEntryInContainer(container, jarPath);
134
		if (status.getCode() == ClasspathContainerInitializer.ATTRIBUTE_READ_ONLY) {
141
		if (status.getCode() == ClasspathContainerInitializer.ATTRIBUTE_READ_ONLY) {
135
			setDescription(Messages.format(PreferencesMessages.JavadocConfigurationPropertyPage_read_only, containerName));
142
			setDescription(Messages.format(PreferencesMessages.JavadocConfigurationPropertyPage_read_only, containerName));
136
			return null;
143
			fIsReadOnly= true;
144
			return entry;
137
		}
145
		}
138
		IClasspathEntry entry= JavaModelUtil.findEntryInContainer(container, jarPath);
139
		Assert.isNotNull(entry);
146
		Assert.isNotNull(entry);
140
		setDescription(PreferencesMessages.JavadocConfigurationPropertyPage_IsPackageFragmentRoot_description);
147
		setDescription(PreferencesMessages.JavadocConfigurationPropertyPage_IsPackageFragmentRoot_description);
141
		return entry;
148
		return entry;
Lines 145-152 Link Here
145
	 * @see PreferencePage#createContents(Composite)
152
	 * @see PreferencePage#createContents(Composite)
146
	 */
153
	 */
147
	protected Control createContents(Composite parent) {
154
	protected Control createContents(Composite parent) {
148
		if (!fIsValidElement) {
155
		if (!fIsValidElement || fIsReadOnly) {
149
			return new Composite(parent, SWT.NONE);
156
			Composite inner= new Composite(parent, SWT.NONE);
157
			
158
			if (fIsReadOnly) {
159
				GridLayout layout= new GridLayout();
160
				layout.marginWidth= 0;
161
				inner.setLayout(layout);
162
163
				Label label= new Label(inner, SWT.WRAP);
164
				label.setText(PreferencesMessages.JavadocConfigurationPropertyPage_location_path);
165
				
166
				Text location= new Text(inner, SWT.READ_ONLY | SWT.WRAP);
167
				GridData gd= new GridData(GridData.HORIZONTAL_ALIGN_FILL);
168
				gd.widthHint= convertWidthInCharsToPixels(80);
169
				location.setLayoutData(gd);
170
				String locationPath= PreferencesMessages.JavadocConfigurationPropertyPage_locationPath_none;
171
				if (fEntry != null) {
172
					URL javadocUrl= JavaDocLocations.getLibraryJavadocLocation(fEntry);
173
					if (javadocUrl != null) {
174
						locationPath= javadocUrl.toExternalForm();
175
					}
176
				}
177
				location.setText(locationPath);
178
				Dialog.applyDialogFont(inner);
179
			}
180
			return inner;
150
		}
181
		}
151
182
152
		IJavaElement elem= getJavaElement();
183
		IJavaElement elem= getJavaElement();
(-)ui/org/eclipse/jdt/internal/ui/preferences/NativeLibrariesPropertyPage.java (-13 / +46 lines)
Lines 13-21 Link Here
13
import java.lang.reflect.InvocationTargetException;
13
import java.lang.reflect.InvocationTargetException;
14
14
15
import org.eclipse.swt.SWT;
15
import org.eclipse.swt.SWT;
16
import org.eclipse.swt.layout.GridData;
17
import org.eclipse.swt.layout.GridLayout;
16
import org.eclipse.swt.widgets.Composite;
18
import org.eclipse.swt.widgets.Composite;
17
import org.eclipse.swt.widgets.Control;
19
import org.eclipse.swt.widgets.Control;
20
import org.eclipse.swt.widgets.Label;
18
import org.eclipse.swt.widgets.Shell;
21
import org.eclipse.swt.widgets.Shell;
22
import org.eclipse.swt.widgets.Text;
19
23
20
import org.eclipse.core.runtime.Assert;
24
import org.eclipse.core.runtime.Assert;
21
import org.eclipse.core.runtime.CoreException;
25
import org.eclipse.core.runtime.CoreException;
Lines 62-67 Link Here
62
66
63
	private NativeLibrariesConfigurationBlock fConfigurationBlock;
67
	private NativeLibrariesConfigurationBlock fConfigurationBlock;
64
	private boolean fIsValidElement;
68
	private boolean fIsValidElement;
69
	private boolean fIsReadOnly;
65
	private IClasspathEntry fEntry;
70
	private IClasspathEntry fEntry;
66
	private IPath fContainerPath;
71
	private IPath fContainerPath;
67
	private String fInitialNativeLibPath;
72
	private String fInitialNativeLibPath;
Lines 83-89 Link Here
83
					if (entry.getEntryKind() == IClasspathEntry.CPE_CONTAINER) {
88
					if (entry.getEntryKind() == IClasspathEntry.CPE_CONTAINER) {
84
						fContainerPath= entry.getPath();
89
						fContainerPath= entry.getPath();
85
						fEntry= handleContainerEntry(fContainerPath, elem.getJavaProject(), root.getPath());
90
						fEntry= handleContainerEntry(fContainerPath, elem.getJavaProject(), root.getPath());
86
						fIsValidElement= fEntry != null;
91
						fIsValidElement= fEntry != null && !fIsReadOnly;
87
					} else {
92
					} else {
88
						fContainerPath= null;
93
						fContainerPath= null;
89
						fEntry= entry;
94
						fEntry= entry;
Lines 114-124 Link Here
114
			setDescription(Messages.format(PreferencesMessages.NativeLibrariesPropertyPage_not_supported, containerName));
119
			setDescription(Messages.format(PreferencesMessages.NativeLibrariesPropertyPage_not_supported, containerName));
115
			return null;
120
			return null;
116
		}
121
		}
122
		IClasspathEntry entry= JavaModelUtil.findEntryInContainer(container, jarPath);
117
		if (status.getCode() == ClasspathContainerInitializer.ATTRIBUTE_READ_ONLY) {
123
		if (status.getCode() == ClasspathContainerInitializer.ATTRIBUTE_READ_ONLY) {
118
			setDescription(Messages.format(PreferencesMessages.NativeLibrariesPropertyPage_read_only, containerName));
124
			setDescription(Messages.format(PreferencesMessages.NativeLibrariesPropertyPage_read_only, containerName));
119
			return null;
125
			fIsReadOnly= true;
126
			return entry;
120
		}
127
		}
121
		IClasspathEntry entry= JavaModelUtil.findEntryInContainer(container, jarPath);
122
		Assert.isNotNull(entry);
128
		Assert.isNotNull(entry);
123
		return entry;
129
		return entry;
124
	}
130
	}
Lines 127-147 Link Here
127
	 * {@inheritDoc}
133
	 * {@inheritDoc}
128
	 */
134
	 */
129
	protected Control createContents(Composite parent) {
135
	protected Control createContents(Composite parent) {
130
		if (!fIsValidElement)
136
		if (!fIsValidElement || fIsReadOnly) {
131
			return new Composite(parent, SWT.NONE);
137
			Composite inner= new Composite(parent, SWT.NONE);
138
			
139
			if (fIsReadOnly) {
140
				GridLayout layout= new GridLayout();
141
				layout.marginWidth= 0;
142
				inner.setLayout(layout);
143
144
				Label label= new Label(inner, SWT.WRAP);
145
				label.setText(PreferencesMessages.NativeLibrariesPropertyPage_location_path);
146
				
147
				Text location= new Text(inner, SWT.READ_ONLY | SWT.WRAP);
148
				GridData gd= new GridData(GridData.HORIZONTAL_ALIGN_FILL);
149
				gd.widthHint= convertWidthInCharsToPixels(80);
150
				location.setLayoutData(gd);
151
				String locationPath= PreferencesMessages.NativeLibrariesPropertyPage_locationPath_none;
152
				if (fEntry != null) {
153
					String nativeLibrariesPath= getNativeLibrariesPath(fEntry);
154
					if (nativeLibrariesPath != null)
155
						locationPath= nativeLibrariesPath;
156
				}
157
				location.setText(locationPath);
158
				Dialog.applyDialogFont(inner);
159
			}
160
			return inner;
161
		}
132
162
133
		IJavaElement elem= getJavaElement();
163
		IJavaElement elem= getJavaElement();
134
		if (elem == null)
164
		if (elem == null)
135
			return new Composite(parent, SWT.NONE);
165
			return new Composite(parent, SWT.NONE);
136
166
137
		fInitialNativeLibPath= null;
167
		fInitialNativeLibPath= getNativeLibrariesPath(fEntry);
138
		IClasspathAttribute[] extraAttributes= fEntry.getExtraAttributes();
139
		for (int i= 0; i < extraAttributes.length; i++) {
140
			if (extraAttributes[i].getName().equals(JavaRuntime.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY)) {
141
				fInitialNativeLibPath= extraAttributes[i].getValue();
142
				break;
143
			}
144
		}
145
		fConfigurationBlock= new NativeLibrariesConfigurationBlock(this, getShell(), fInitialNativeLibPath, fEntry);
168
		fConfigurationBlock= new NativeLibrariesConfigurationBlock(this, getShell(), fInitialNativeLibPath, fEntry);
146
		Control control= fConfigurationBlock.createContents(parent);
169
		Control control= fConfigurationBlock.createContents(parent);
147
170
Lines 149-154 Link Here
149
		return control;
172
		return control;
150
	}
173
	}
151
174
175
	private static String getNativeLibrariesPath(IClasspathEntry entry) {
176
		IClasspathAttribute[] extraAttributes= entry.getExtraAttributes();
177
		for (int i= 0; i < extraAttributes.length; i++) {
178
			if (extraAttributes[i].getName().equals(JavaRuntime.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY)) {
179
				return extraAttributes[i].getValue();
180
			}
181
		}
182
		return null;
183
	}
184
152
	/**
185
	/**
153
	 * {@inheritDoc}
186
	 * {@inheritDoc}
154
	 */
187
	 */
(-)ui/org/eclipse/jdt/internal/ui/preferences/PreferencesMessages.java (+6 lines)
Lines 232-237 Link Here
232
	public static String JavadocConfigurationPropertyPage_IsPackageFragmentRoot_description;
232
	public static String JavadocConfigurationPropertyPage_IsPackageFragmentRoot_description;
233
	public static String JavadocConfigurationPropertyPage_IsIncorrectElement_description;
233
	public static String JavadocConfigurationPropertyPage_IsIncorrectElement_description;
234
	public static String JavadocConfigurationPropertyPage_IsJavaProject_description;
234
	public static String JavadocConfigurationPropertyPage_IsJavaProject_description;
235
	public static String JavadocConfigurationPropertyPage_location_path;
236
	public static String JavadocConfigurationPropertyPage_locationPath_none;
235
	public static String JavadocConfigurationBlock_browse_folder_button;
237
	public static String JavadocConfigurationBlock_browse_folder_button;
236
	public static String JavadocConfigurationBlock_error_notafolder;
238
	public static String JavadocConfigurationBlock_error_notafolder;
237
	public static String JavadocConfigurationBlock_javadocFolderDialog_label;
239
	public static String JavadocConfigurationBlock_javadocFolderDialog_label;
Lines 267-276 Link Here
267
	public static String SourceAttachmentPropertyPage_error_title;
269
	public static String SourceAttachmentPropertyPage_error_title;
268
	public static String SourceAttachmentPropertyPage_error_message;
270
	public static String SourceAttachmentPropertyPage_error_message;
269
	public static String SourceAttachmentPropertyPage_invalid_container;
271
	public static String SourceAttachmentPropertyPage_invalid_container;
272
	public static String SourceAttachmentPropertyPage_location_path;
273
	public static String SourceAttachmentPropertyPage_locationPath_none;
270
	public static String SourceAttachmentPropertyPage_noarchive_message;
274
	public static String SourceAttachmentPropertyPage_noarchive_message;
271
	public static String NativeLibrariesPropertyPage_invalidElementSelection_desription;
275
	public static String NativeLibrariesPropertyPage_invalidElementSelection_desription;
272
	public static String NativeLibrariesPropertyPage_errorAttaching_title;
276
	public static String NativeLibrariesPropertyPage_errorAttaching_title;
273
	public static String NativeLibrariesPropertyPage_errorAttaching_message;
277
	public static String NativeLibrariesPropertyPage_errorAttaching_message;
278
	public static String NativeLibrariesPropertyPage_location_path;
279
	public static String NativeLibrariesPropertyPage_locationPath_none;
274
	public static String AppearancePreferencePage_description;
280
	public static String AppearancePreferencePage_description;
275
	public static String AppearancePreferencePage_methodreturntype_label;
281
	public static String AppearancePreferencePage_methodreturntype_label;
276
	public static String AppearancePreferencePage_showCategory_label;
282
	public static String AppearancePreferencePage_showCategory_label;
(-)ui/org/eclipse/jdt/internal/ui/preferences/PreferencesMessages.properties (+6 lines)
Lines 235-240 Link Here
235
JavadocConfigurationPropertyPage_IsIncorrectElement_description=Javadoc location can only be attached to Java projects or archives and class folders in Java projects. Source folders use the location specified at their project.
235
JavadocConfigurationPropertyPage_IsIncorrectElement_description=Javadoc location can only be attached to Java projects or archives and class folders in Java projects. Source folders use the location specified at their project.
236
JavadocConfigurationPropertyPage_IsJavaProject_description=Specify the location of the project\'s Javadoc documentation. This location is used by the Javadoc export wizard as the default value and by the \'Open Attached Javadoc\' action. For example: \'file:/c:/myworkspace/myproject/doc\'.
236
JavadocConfigurationPropertyPage_IsJavaProject_description=Specify the location of the project\'s Javadoc documentation. This location is used by the Javadoc export wizard as the default value and by the \'Open Attached Javadoc\' action. For example: \'file:/c:/myworkspace/myproject/doc\'.
237
JavadocConfigurationPropertyPage_invalid_container=The current class path entry belongs to container ''{0}'' which can not be configured.
237
JavadocConfigurationPropertyPage_invalid_container=The current class path entry belongs to container ''{0}'' which can not be configured.
238
JavadocConfigurationPropertyPage_location_path=&Location path:
239
JavadocConfigurationPropertyPage_locationPath_none=(none)
238
JavadocConfigurationPropertyPage_not_supported=The current class path entry belongs to container ''{0}'' which does not support the attachment of Javadoc to its entries.
240
JavadocConfigurationPropertyPage_not_supported=The current class path entry belongs to container ''{0}'' which does not support the attachment of Javadoc to its entries.
239
241
240
JavadocConfigurationBlock_browse_archive_button=&Browse...
242
JavadocConfigurationBlock_browse_archive_button=&Browse...
Lines 274-279 Link Here
274
SourceAttachmentPropertyPage_not_supported=The current class path entry belongs to container ''{0}'' which does not support the attachment of sources to its entries.
276
SourceAttachmentPropertyPage_not_supported=The current class path entry belongs to container ''{0}'' which does not support the attachment of sources to its entries.
275
SourceAttachmentPropertyPage_noarchive_message=Source can only be attached to archive and class folders in Java projects.
277
SourceAttachmentPropertyPage_noarchive_message=Source can only be attached to archive and class folders in Java projects.
276
SourceAttachmentPropertyPage_invalid_container=The current class path entry belongs to container ''{0}'' which can not be configured.
278
SourceAttachmentPropertyPage_invalid_container=The current class path entry belongs to container ''{0}'' which can not be configured.
279
SourceAttachmentPropertyPage_location_path=&Location path:
280
SourceAttachmentPropertyPage_locationPath_none=(none)
277
281
278
NativeLibrariesPropertyPage_invalidElementSelection_desription=Native libraries can not be attached to the selected element.
282
NativeLibrariesPropertyPage_invalidElementSelection_desription=Native libraries can not be attached to the selected element.
279
NativeLibrariesPropertyPage_errorAttaching_message=An error occurred while associating the library.
283
NativeLibrariesPropertyPage_errorAttaching_message=An error occurred while associating the library.
Lines 888-893 Link Here
888
ProjectSelectionDialog_filter=Show only &projects with project specific settings
892
ProjectSelectionDialog_filter=Show only &projects with project specific settings
889
NativeLibrariesPropertyPage_errorAttaching_title=Error Attaching native library
893
NativeLibrariesPropertyPage_errorAttaching_title=Error Attaching native library
890
NativeLibrariesPropertyPage_invalid_container=The current class path entry belongs to container ''{0}'' which can not be configured.
894
NativeLibrariesPropertyPage_invalid_container=The current class path entry belongs to container ''{0}'' which can not be configured.
895
NativeLibrariesPropertyPage_location_path=&Location path:
896
NativeLibrariesPropertyPage_locationPath_none=(none)
891
NativeLibrariesPropertyPage_not_supported=The current class path entry belongs to container ''{0}'' which does not support the attachment of native libraries to its entries.
897
NativeLibrariesPropertyPage_not_supported=The current class path entry belongs to container ''{0}'' which does not support the attachment of native libraries to its entries.
892
NativeLibrariesPropertyPage_read_only=The current class path entry belongs to container ''{0}'' which does not allow user modifications to native libraries on its entries.
898
NativeLibrariesPropertyPage_read_only=The current class path entry belongs to container ''{0}'' which does not allow user modifications to native libraries on its entries.
893
899
(-)ui/org/eclipse/jdt/internal/ui/preferences/SourceAttachmentPropertyPage.java (-7 / +29 lines)
Lines 18-23 Link Here
18
import org.eclipse.swt.widgets.Composite;
18
import org.eclipse.swt.widgets.Composite;
19
import org.eclipse.swt.widgets.Control;
19
import org.eclipse.swt.widgets.Control;
20
import org.eclipse.swt.widgets.Label;
20
import org.eclipse.swt.widgets.Label;
21
import org.eclipse.swt.widgets.Text;
21
22
22
import org.eclipse.core.runtime.CoreException;
23
import org.eclipse.core.runtime.CoreException;
23
import org.eclipse.core.runtime.IAdaptable;
24
import org.eclipse.core.runtime.IAdaptable;
Lines 41-46 Link Here
41
import org.eclipse.jdt.core.IJavaProject;
42
import org.eclipse.jdt.core.IJavaProject;
42
import org.eclipse.jdt.core.IPackageFragmentRoot;
43
import org.eclipse.jdt.core.IPackageFragmentRoot;
43
import org.eclipse.jdt.core.JavaCore;
44
import org.eclipse.jdt.core.JavaCore;
45
import org.eclipse.jdt.core.JavaModelException;
44
46
45
import org.eclipse.jdt.internal.corext.util.JavaModelUtil;
47
import org.eclipse.jdt.internal.corext.util.JavaModelUtil;
46
import org.eclipse.jdt.internal.corext.util.Messages;
48
import org.eclipse.jdt.internal.corext.util.Messages;
Lines 90-96 Link Here
90
			fEntry= null;
92
			fEntry= null;
91
			fRoot= getJARPackageFragmentRoot();
93
			fRoot= getJARPackageFragmentRoot();
92
			if (fRoot == null || fRoot.getKind() != IPackageFragmentRoot.K_BINARY) {
94
			if (fRoot == null || fRoot.getKind() != IPackageFragmentRoot.K_BINARY) {
93
				return createMessageContent(composite, PreferencesMessages.SourceAttachmentPropertyPage_noarchive_message);
95
				return createMessageContent(composite, PreferencesMessages.SourceAttachmentPropertyPage_noarchive_message, null);
94
			}
96
			}
95
97
96
			IPath containerPath= null;
98
			IPath containerPath= null;
Lines 101-116 Link Here
101
				ClasspathContainerInitializer initializer= JavaCore.getClasspathContainerInitializer(containerPath.segment(0));
103
				ClasspathContainerInitializer initializer= JavaCore.getClasspathContainerInitializer(containerPath.segment(0));
102
				IClasspathContainer container= JavaCore.getClasspathContainer(containerPath, jproject);
104
				IClasspathContainer container= JavaCore.getClasspathContainer(containerPath, jproject);
103
				if (initializer == null || container == null) {
105
				if (initializer == null || container == null) {
104
					return createMessageContent(composite, Messages.format(PreferencesMessages.SourceAttachmentPropertyPage_invalid_container, BasicElementLabels.getPathLabel(containerPath, false)));
106
					return createMessageContent(composite, Messages.format(PreferencesMessages.SourceAttachmentPropertyPage_invalid_container, BasicElementLabels.getPathLabel(containerPath, false)), fRoot);
105
				}
107
				}
106
				String containerName= container.getDescription();
108
				String containerName= container.getDescription();
107
109
108
				IStatus status= initializer.getSourceAttachmentStatus(containerPath, jproject);
110
				IStatus status= initializer.getSourceAttachmentStatus(containerPath, jproject);
109
				if (status.getCode() == ClasspathContainerInitializer.ATTRIBUTE_NOT_SUPPORTED) {
111
				if (status.getCode() == ClasspathContainerInitializer.ATTRIBUTE_NOT_SUPPORTED) {
110
					return createMessageContent(composite, Messages.format(PreferencesMessages.SourceAttachmentPropertyPage_not_supported, containerName));
112
					return createMessageContent(composite, Messages.format(PreferencesMessages.SourceAttachmentPropertyPage_not_supported, containerName), null);
111
				}
113
				}
112
				if (status.getCode() == ClasspathContainerInitializer.ATTRIBUTE_READ_ONLY) {
114
				if (status.getCode() == ClasspathContainerInitializer.ATTRIBUTE_READ_ONLY) {
113
					return createMessageContent(composite, Messages.format(PreferencesMessages.SourceAttachmentPropertyPage_read_only, containerName));
115
					return createMessageContent(composite, Messages.format(PreferencesMessages.SourceAttachmentPropertyPage_read_only, containerName), fRoot);
114
				}
116
				}
115
				entry= JavaModelUtil.findEntryInContainer(container, fRoot.getPath());
117
				entry= JavaModelUtil.findEntryInContainer(container, fRoot.getPath());
116
			}
118
			}
Lines 121-132 Link Here
121
			return fSourceAttachmentBlock.createControl(composite);
123
			return fSourceAttachmentBlock.createControl(composite);
122
		} catch (CoreException e) {
124
		} catch (CoreException e) {
123
			JavaPlugin.log(e);
125
			JavaPlugin.log(e);
124
			return createMessageContent(composite, PreferencesMessages.SourceAttachmentPropertyPage_noarchive_message);
126
			return createMessageContent(composite, PreferencesMessages.SourceAttachmentPropertyPage_noarchive_message, null);
125
		}
127
		}
126
	}
128
	}
127
129
128
130
129
	private Control createMessageContent(Composite composite, String message) {
131
	private Control createMessageContent(Composite composite, String message, IPackageFragmentRoot root) {
130
		Composite inner= new Composite(composite, SWT.NONE);
132
		Composite inner= new Composite(composite, SWT.NONE);
131
		GridLayout layout= new GridLayout();
133
		GridLayout layout= new GridLayout();
132
		layout.marginHeight= 0;
134
		layout.marginHeight= 0;
Lines 137-144 Link Here
137
		gd.widthHint= convertWidthInCharsToPixels(80);
139
		gd.widthHint= convertWidthInCharsToPixels(80);
138
140
139
		Label label= new Label(inner, SWT.LEFT + SWT.WRAP);
141
		Label label= new Label(inner, SWT.LEFT + SWT.WRAP);
140
		label.setText(message);
141
		label.setLayoutData(gd);
142
		label.setLayoutData(gd);
143
		
144
		try {
145
			if (root != null) {
146
				message= message + "\n\n" + PreferencesMessages.SourceAttachmentPropertyPage_location_path; //$NON-NLS-1$
147
				
148
				Text location= new Text(inner, SWT.READ_ONLY | SWT.WRAP);
149
				gd= new GridData(GridData.HORIZONTAL_ALIGN_FILL);
150
				gd.widthHint= convertWidthInCharsToPixels(80);
151
				location.setLayoutData(gd);
152
				IPath sourceAttachmentPath= root.getSourceAttachmentPath();
153
				String locationPath= PreferencesMessages.SourceAttachmentPropertyPage_locationPath_none;
154
				if (sourceAttachmentPath != null)
155
					locationPath= sourceAttachmentPath.toString();
156
				location.setText(locationPath);
157
			}
158
		} catch (JavaModelException e) {
159
			JavaPlugin.log(e);
160
			// don't show location
161
		}
162
		
163
		label.setText(message);
142
		return inner;
164
		return inner;
143
	}
165
	}
144
166

Return to bug 336037