diff options
Diffstat (limited to 'examples')
8 files changed, 18 insertions, 19 deletions
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/FileViewer.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/FileViewer.java index 28e8369abb..2245f907f7 100644 --- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/FileViewer.java +++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/FileViewer.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2016 IBM Corporation and others. + * Copyright (c) 2000, 2017 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -34,7 +34,6 @@ import org.eclipse.swt.dnd.DropTarget; import org.eclipse.swt.dnd.DropTargetAdapter; import org.eclipse.swt.dnd.DropTargetEvent; import org.eclipse.swt.dnd.FileTransfer; -import org.eclipse.swt.dnd.Transfer; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.events.SelectionListener; @@ -536,7 +535,7 @@ public class FileViewer { */ private DropTarget createTreeDropTarget(final Tree tree) { DropTarget dropTarget = new DropTarget(tree, DND.DROP_MOVE | DND.DROP_COPY); - dropTarget.setTransfer(new Transfer[] { FileTransfer.getInstance() }); + dropTarget.setTransfer(FileTransfer.getInstance()); dropTarget.addDropListener(new DropTargetAdapter() { @Override public void dragEnter(DropTargetEvent event) { @@ -845,7 +844,7 @@ public class FileViewer { */ private DropTarget createTableDropTarget(final Table table){ DropTarget dropTarget = new DropTarget(table, DND.DROP_MOVE | DND.DROP_COPY); - dropTarget.setTransfer(new Transfer[] { FileTransfer.getInstance() }); + dropTarget.setTransfer(FileTransfer.getInstance() ); dropTarget.addDropListener(new DropTargetAdapter() { @Override public void dragEnter(DropTargetEvent event) { diff --git a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet171.java b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet171.java index c6da4c1820..a99ae3bfc5 100644 --- a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet171.java +++ b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet171.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2016 IBM Corporation and others. + * Copyright (c) 2000, 2017 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -238,7 +238,7 @@ public static void main(String[] args) { } }); DropTarget targetMyType = new DropTarget(label2, DND.DROP_COPY | DND.DROP_DEFAULT); - targetMyType.setTransfer(new Transfer[] { MyTransfer.getInstance() }); + targetMyType.setTransfer(MyTransfer.getInstance()); targetMyType.addDropListener(new DropTargetAdapter() { @Override public void dragEnter(DropTargetEvent event) { @@ -265,7 +265,7 @@ public static void main(String[] args) { }); DropTarget targetMyType2 = new DropTarget(label3, DND.DROP_COPY | DND.DROP_DEFAULT); - targetMyType2.setTransfer(new Transfer[] { MyTransfer2.getInstance() }); + targetMyType2.setTransfer(MyTransfer2.getInstance()); targetMyType2.addDropListener(new DropTargetAdapter() { @Override public void dragEnter(DropTargetEvent event) { diff --git a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet185.java b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet185.java index b242921753..d65d541d70 100644 --- a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet185.java +++ b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet185.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2016 IBM Corporation and others. + * Copyright (c) 2000, 2017 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -52,7 +52,7 @@ public static void main (String [] args) { } }); DropTarget dropTarget = new DropTarget(table, DND.DROP_COPY | DND.DROP_DEFAULT); - dropTarget.setTransfer(new Transfer[] {TextTransfer.getInstance(), FileTransfer.getInstance()}); + dropTarget.setTransfer(TextTransfer.getInstance(), FileTransfer.getInstance()); dropTarget.addDropListener(new DropTargetAdapter() { FileTransfer fileTransfer = FileTransfer.getInstance(); TextTransfer textTransfer = TextTransfer.getInstance(); diff --git a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet210.java b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet210.java index 7309d41a37..aeaf948f52 100644 --- a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet210.java +++ b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet210.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2016 IBM Corporation and others. + * Copyright (c) 2000, 2017 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -71,7 +71,7 @@ public static void main (String [] args) { final StyledText text2 = new StyledText(shell, style); text2.setText(string2); DropTarget target = new DropTarget(text2, DND.DROP_DEFAULT | DND.DROP_MOVE | DND.DROP_COPY | DND.DROP_LINK); - target.setTransfer(new Transfer[] {TextTransfer.getInstance()}); + target.setTransfer(TextTransfer.getInstance()); target.addDropListener(new DropTargetAdapter() { @Override public void dragEnter(DropTargetEvent e) { diff --git a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet257.java b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet257.java index 35d2746cb0..5a9e1a9db2 100644 --- a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet257.java +++ b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet257.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2016 IBM Corporation and others. + * Copyright (c) 2007, 2017 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -80,7 +80,7 @@ public static void main (String [] args) { }); DropTarget target = new DropTarget(text, DND.DROP_DEFAULT | DND.DROP_MOVE | DND.DROP_COPY | DND.DROP_LINK); - target.setTransfer(new Transfer[] {TextTransfer.getInstance()}); + target.setTransfer(TextTransfer.getInstance()); target.addDropListener(new DropTargetAdapter() { @Override public void dragEnter(DropTargetEvent event) { diff --git a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet284.java b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet284.java index b69f8730b6..b7e45e59cc 100644 --- a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet284.java +++ b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet284.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2016 IBM Corporation and others. + * Copyright (c) 2007, 2017 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -62,7 +62,7 @@ public static void setDragSource (final Label label) { public static void setDropTarget (final Label label) { int operations = DND.DROP_MOVE | DND.DROP_COPY | DND.DROP_LINK; DropTarget target = new DropTarget(label, operations); - target.setTransfer(new Transfer[] {URLTransfer.getInstance()}); + target.setTransfer(URLTransfer.getInstance()); target.addDropListener (new DropTargetAdapter() { @Override public void dragEnter(DropTargetEvent e) { diff --git a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet79.java b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet79.java index 7fdc22319e..bf92b3515f 100644 --- a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet79.java +++ b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet79.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2016 IBM Corporation and others. + * Copyright (c) 2000, 2017 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -158,7 +158,7 @@ public static void main (String [] args) { } }); DropTarget target = new DropTarget (label2, DND.DROP_COPY | DND.DROP_DEFAULT); - target.setTransfer (new Transfer [] {MyTransfer.getInstance ()}); + target.setTransfer (MyTransfer.getInstance ()); target.addDropListener (new DropTargetAdapter () { @Override public void dragEnter (DropTargetEvent event) { diff --git a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet84.java b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet84.java index 63545fc73c..7f48f6d0fb 100644 --- a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet84.java +++ b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet84.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2016 IBM Corporation and others. + * Copyright (c) 2000, 2017 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -63,7 +63,7 @@ public static void main(String[] args) { final Text text = new Text(shell, SWT.BORDER | SWT.MULTI); text.setText("Drop Target"); DropTarget target = new DropTarget(text, DND.DROP_DEFAULT | DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK); - target.setTransfer(new Transfer[] {TextTransfer.getInstance()}); + target.setTransfer(TextTransfer.getInstance()); target.addDropListener(new DropTargetAdapter() { @Override public void dragEnter(DropTargetEvent event) { |