aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/java/sip/communicator/impl/osdependent/DesktopServiceImpl.java
blob: 507197215416e09e9d853aac4c7f4b2fc16767a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/*
 * Jitsi, the OpenSource Java VoIP and Instant Messaging client.
 *
 * Distributable under LGPL license.
 * See terms of license at gnu.org.
 */
package net.java.sip.communicator.impl.osdependent;

import java.io.*;
import java.net.*;

import net.java.sip.communicator.service.desktop.*;

/**
 * Implementation of the <tt>DesktopService</tt>.
 *
 * @author Yana Stamcheva
 */
public class DesktopServiceImpl
    implements DesktopService
{
    private final Desktop defaultDesktop;

    /**
     * Creates a <tt>DesktopServiceImpl</tt> and initializes the default
     * desktop to use for all desktop operations.
     */
    public DesktopServiceImpl()
    {
        defaultDesktop = Desktop.getDefaultDesktop();
    }

    /**
     * Invokes the default desktop browse method.
     *
     * @see DesktopService#browse(URI)
     */
    public void browse(URI uri)
        throws NullPointerException,
        IllegalArgumentException,
        UnsupportedOperationException,
        IOException,
        SecurityException
    {
        defaultDesktop.getPeer().browse(uri);
    }

    /**
     * Invokes the default desktop edit method.
     *
     * @see DesktopService#edit(File)
     */
    public void edit(File file)
        throws NullPointerException,
        IllegalArgumentException,
        UnsupportedOperationException,
        IOException,
        SecurityException
    {
        defaultDesktop.getPeer().edit(file);
    }

    /**
     * Invokes the default desktop open method.
     *
     * @see DesktopService#open(File)
     */
    public void open(File file)
        throws NullPointerException,
        IllegalArgumentException,
        UnsupportedOperationException,
        IOException,
        SecurityException
    {
        defaultDesktop.getPeer().open(file);
    }

    /**
     * Invokes the default desktop print method.
     *
     * @see DesktopService#print(File)
     */
    public void print(File file)
        throws NullPointerException,
        IllegalArgumentException,
        UnsupportedOperationException,
        IOException,
        SecurityException
    {
        defaultDesktop.getPeer().print(file);
    }
}