View | Details | Raw Unified | Return to bug 381487 | Differences between
and this patch

Collapse All | Expand All

(-)a/bundles/org.eclipse.ui.ide/META-INF/MANIFEST.MF (-1 / +2 lines)
Lines 55-60 Link Here
55
 org.eclipse.jface.text;bundle-version="[3.2.0,4.0.0)",
55
 org.eclipse.jface.text;bundle-version="[3.2.0,4.0.0)",
56
 org.eclipse.ui.forms;bundle-version="[3.3.0,4.0.0)";resolution:=optional,
56
 org.eclipse.ui.forms;bundle-version="[3.3.0,4.0.0)";resolution:=optional,
57
 org.eclipse.equinox.p2.engine;bundle-version="[2.0.0,3.0.0)",
57
 org.eclipse.equinox.p2.engine;bundle-version="[2.0.0,3.0.0)",
58
 org.eclipse.equinox.p2.metadata;bundle-version="[2.0.0,3.0.0)"
58
 org.eclipse.equinox.p2.metadata;bundle-version="[2.0.0,3.0.0)",
59
 org.eclipse.equinox.bidi;bundle-version="0.9.0"
59
Import-Package: com.ibm.icu.text
60
Import-Package: com.ibm.icu.text
60
Bundle-RequiredExecutionEnvironment: J2SE-1.4
61
Bundle-RequiredExecutionEnvironment: J2SE-1.4
(-)a/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/dialogs/ProjectContentsLocationArea.java (-11 / +50 lines)
Lines 18-23 Link Here
18
18
19
import java.net.URI;
19
import java.net.URI;
20
import java.net.URISyntaxException;
20
import java.net.URISyntaxException;
21
import java.util.Locale;
21
22
22
import org.eclipse.core.filesystem.IFileInfo;
23
import org.eclipse.core.filesystem.IFileInfo;
23
import org.eclipse.core.filesystem.URIUtil;
24
import org.eclipse.core.filesystem.URIUtil;
Lines 25-35 Link Here
25
import org.eclipse.core.resources.ResourcesPlugin;
26
import org.eclipse.core.resources.ResourcesPlugin;
26
import org.eclipse.core.runtime.IStatus;
27
import org.eclipse.core.runtime.IStatus;
27
import org.eclipse.core.runtime.Platform;
28
import org.eclipse.core.runtime.Platform;
29
import org.eclipse.equinox.bidi.STextTypeHandlerFactory;
30
import org.eclipse.equinox.bidi.advanced.ISTextExpert;
31
import org.eclipse.equinox.bidi.advanced.STextExpertFactory;
28
import org.eclipse.jface.dialogs.IDialogSettings;
32
import org.eclipse.jface.dialogs.IDialogSettings;
29
import org.eclipse.osgi.util.TextProcessor;
30
import org.eclipse.swt.SWT;
33
import org.eclipse.swt.SWT;
31
import org.eclipse.swt.events.ModifyEvent;
34
import org.eclipse.swt.events.ModifyEvent;
32
import org.eclipse.swt.events.ModifyListener;
35
import org.eclipse.swt.events.ModifyListener;
36
import org.eclipse.swt.events.SegmentEvent;
37
import org.eclipse.swt.events.SegmentListener;
33
import org.eclipse.swt.events.SelectionAdapter;
38
import org.eclipse.swt.events.SelectionAdapter;
34
import org.eclipse.swt.events.SelectionEvent;
39
import org.eclipse.swt.events.SelectionEvent;
35
import org.eclipse.swt.layout.GridData;
40
import org.eclipse.swt.layout.GridData;
Lines 171-180 Link Here
171
176
172
				if (useDefaults) {
177
				if (useDefaults) {
173
					userPath = locationPathField.getText();
178
					userPath = locationPathField.getText();
174
					locationPathField.setText(TextProcessor
179
					locationPathField.setText(getDefaultPathDisplayString());
175
							.process(getDefaultPathDisplayString()));
176
				} else {
180
				} else {
177
					locationPathField.setText(TextProcessor.process(userPath));
181
					locationPathField.setText(userPath);
178
				}
182
				}
179
				String error = checkValidLocation();
183
				String error = checkValidLocation();
180
				errorReporter.reportError(error,
184
				errorReporter.reportError(error,
Lines 213-218 Link Here
213
		data.widthHint = SIZING_TEXT_FIELD_WIDTH;
217
		data.widthHint = SIZING_TEXT_FIELD_WIDTH;
214
		data.horizontalSpan = 2;
218
		data.horizontalSpan = 2;
215
		locationPathField.setLayoutData(data);
219
		locationPathField.setLayoutData(data);
220
		
221
		boolean isBidiSupportNeeded = false;
222
		
223
		String lang = Locale.getDefault().getLanguage();
224
		if ("iw".equals(lang) || "he".equals(lang) || "ar".equals(lang) || "fa".equals(lang) || "ur".equals(lang)) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
225
			String osName = System.getProperty("os.name").toLowerCase(); //$NON-NLS-1$
226
			if (osName.startsWith("windows") || osName.startsWith("linux") || osName.startsWith("mac")) { //$NON-NLS-1$	//$NON-NLS-2$ //$NON-NLS-3$
227
				isBidiSupportNeeded = true;
228
			}
229
		}
230
		if (isBidiSupportNeeded) {
231
			locationPathField.addSegmentListener(new SegmentListener() {
232
				final char LRE = 0x202A;
233
				final char LRM = 0x200E;
234
				final char PDF = 0x202C;
235
236
				public void getSegments(SegmentEvent event) {
237
					int length = event.lineText.length();
238
					int segments[];
239
					ISTextExpert expert =
240
							STextExpertFactory.getExpert(STextTypeHandlerFactory.FILE);
241
					segments = expert.leanBidiCharOffsets(event.lineText);
242
					
243
					event.segments = new int[segments.length+2];
244
					event.segments[0] = 0;
245
					System.arraycopy(segments, 0, event.segments, 1, segments.length);
246
					event.segments[segments.length+1] = length;
247
					
248
					event.segmentsChars = new char[event.segments.length];
249
					event.segmentsChars[0] = LRE;
250
					for (int i =1; i<event.segments.length-1;i++)
251
						event.segmentsChars[i] = LRM;
252
					event.segmentsChars[event.segments.length-1] = PDF;
253
					
254
				}
255
			});
256
		}
257
		
216
258
217
		// browse button
259
		// browse button
218
		browseButton = new Button(composite, SWT.PUSH);
260
		browseButton = new Button(composite, SWT.PUSH);
Lines 226-239 Link Here
226
		createFileSystemSelection(composite);
268
		createFileSystemSelection(composite);
227
269
228
		if (defaultEnabled) {
270
		if (defaultEnabled) {
229
			locationPathField.setText(TextProcessor
271
			locationPathField.setText(getDefaultPathDisplayString());
230
					.process(getDefaultPathDisplayString()));
231
		} else {
272
		} else {
232
			if (existingProject == null) {
273
			if (existingProject == null) {
233
				locationPathField.setText(IDEResourceInfoUtils.EMPTY_STRING);
274
				locationPathField.setText(IDEResourceInfoUtils.EMPTY_STRING);
234
			} else {
275
			} else {
235
				locationPathField.setText(TextProcessor.process(existingProject
276
				locationPathField.setText(existingProject.getLocation().toOSString());
236
						.getLocation().toOSString()));
237
			}
277
			}
238
		}
278
		}
239
279
Lines 375-381 Link Here
375
	 * @param selectedPath
415
	 * @param selectedPath
376
	 */
416
	 */
377
	private void updateLocationField(String selectedPath) {
417
	private void updateLocationField(String selectedPath) {
378
		locationPathField.setText(TextProcessor.process(selectedPath));
418
		locationPathField.setText(selectedPath);
379
	}
419
	}
380
420
381
	/**
421
	/**
Lines 473-480 Link Here
473
	public void updateProjectName(String newName) {
513
	public void updateProjectName(String newName) {
474
		projectName = newName;
514
		projectName = newName;
475
		if (isDefault()) {
515
		if (isDefault()) {
476
			locationPathField.setText(TextProcessor
516
			locationPathField.setText(getDefaultPathDisplayString());
477
					.process(getDefaultPathDisplayString()));
478
		}
517
		}
479
518
480
	}
519
	}

Return to bug 381487