17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26 package sun.awt.windows;
27
28
29 import java.awt.Desktop.Action;
30 import java.awt.peer.DesktopPeer;
31 import java.io.File;
32 import java.io.IOException;
33 import java.net.URI;
34
35
36 /**
37 * Concrete implementation of the interface <code>DesktopPeer</code> for
38 * the Windows platform.
39 *
40 * @see DesktopPeer
41 */
42 final class WDesktopPeer implements DesktopPeer {
43 /* Contants for the operation verbs */
44 private static String ACTION_OPEN_VERB = "open";
45 private static String ACTION_EDIT_VERB = "edit";
46 private static String ACTION_PRINT_VERB = "print";
47
48 @Override
49 public boolean isSupported(Action action) {
50 // OPEN, EDIT, PRINT, MAIL, BROWSE all supported on windows.
51 return true;
52 }
53
54 @Override
55 public void open(File file) throws IOException {
56 this.ShellExecute(file, ACTION_OPEN_VERB);
57 }
|
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26 package sun.awt.windows;
27
28
29 import java.awt.Desktop.Action;
30 import java.awt.peer.DesktopPeer;
31 import java.io.File;
32 import java.io.IOException;
33 import java.net.URI;
34
35
36 /**
37 * Concrete implementation of the interface {@code DesktopPeer} for
38 * the Windows platform.
39 *
40 * @see DesktopPeer
41 */
42 final class WDesktopPeer implements DesktopPeer {
43 /* Contants for the operation verbs */
44 private static String ACTION_OPEN_VERB = "open";
45 private static String ACTION_EDIT_VERB = "edit";
46 private static String ACTION_PRINT_VERB = "print";
47
48 @Override
49 public boolean isSupported(Action action) {
50 // OPEN, EDIT, PRINT, MAIL, BROWSE all supported on windows.
51 return true;
52 }
53
54 @Override
55 public void open(File file) throws IOException {
56 this.ShellExecute(file, ACTION_OPEN_VERB);
57 }
|