Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarsten Thoms2018-02-24 09:02:16 -0500
committerAlexander Kurtakov2018-02-24 11:00:00 -0500
commitccb9f3de46a5e7c6801a7cead1e3a8e938d90866 (patch)
tree9d6bd3bcfd2896bbabbf9ff6a7bcd01a47950951 /examples
parent113e773e53e827e2495b0710e781964bc40d9674 (diff)
downloadeclipse.platform.swt-ccb9f3de46a5e7c6801a7cead1e3a8e938d90866.tar.gz
eclipse.platform.swt-ccb9f3de46a5e7c6801a7cead1e3a8e938d90866.tar.xz
eclipse.platform.swt-ccb9f3de46a5e7c6801a7cead1e3a8e938d90866.zip
Bug 531633 - Replace usage of System.getProperty("file.separator")
Change-Id: I609d4b7e6415a113e2afcf790cc72d9a7c6199c0 Signed-off-by: Karsten Thoms <karsten.thoms@itemis.de>
Diffstat (limited to 'examples')
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/clipboard/ClipboardExample.java5
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/dnd/DNDExample.java4
2 files changed, 5 insertions, 4 deletions
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/clipboard/ClipboardExample.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/clipboard/ClipboardExample.java
index b3d29ba405..509d943911 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/clipboard/ClipboardExample.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/clipboard/ClipboardExample.java
@@ -12,6 +12,8 @@ package org.eclipse.swt.examples.clipboard;
import static org.eclipse.swt.events.SelectionListener.widgetSelectedAdapter;
+import java.io.File;
+
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.ScrolledComposite;
import org.eclipse.swt.custom.StyledText;
@@ -324,12 +326,11 @@ void createFileTransfer(Composite copyParent, Composite pasteParent){
FileDialog dialog = new FileDialog(shell, SWT.OPEN | SWT.MULTI);
String result = dialog.open();
if (result != null && result.length() > 0){
- String separator = System.getProperty("file.separator");
String path = dialog.getFilterPath();
String[] names = dialog.getFileNames();
for (String name : names) {
TableItem item = new TableItem(copyFileTable, SWT.NONE);
- item.setText(path+separator+name);
+ item.setText(path+File.separator+name);
}
}
}));
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/dnd/DNDExample.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/dnd/DNDExample.java
index ccceae24dc..3a9a8122dd 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/dnd/DNDExample.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/dnd/DNDExample.java
@@ -13,6 +13,7 @@ package org.eclipse.swt.examples.dnd;
import static org.eclipse.swt.events.SelectionListener.widgetSelectedAdapter;
+import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
@@ -511,11 +512,10 @@ private void createDragTypes(Composite parent) {
String result = dialog.open();
if (result != null && result.length() > 0) {
fileList.removeAll();
- String separator = System.getProperty("file.separator");
String path = dialog.getFilterPath();
String[] names = dialog.getFileNames();
for (String name : names) {
- fileList.add(path + separator + name);
+ fileList.add(path + File.separatorChar + name);
}
}
}));

Back to the top