org.jopendocument.util
Class DesktopEnvironment

java.lang.Object
  extended by org.jopendocument.util.DesktopEnvironment
Direct Known Subclasses:
DesktopEnvironment.Gnome, DesktopEnvironment.KDE, DesktopEnvironment.Mac, DesktopEnvironment.Unknown, DesktopEnvironment.Windows, DesktopEnvironment.XFCE

public abstract class DesktopEnvironment
extends java.lang.Object

A desktop environment like Gnome or MacOS.

Author:
Sylvain CUAZ
See Also:
getDE()

Nested Class Summary
static class DesktopEnvironment.Gnome
           
static class DesktopEnvironment.KDE
           
static class DesktopEnvironment.Mac
           
static class DesktopEnvironment.Unknown
           
static class DesktopEnvironment.Windows
           
static class DesktopEnvironment.XFCE
           
 
Method Summary
static java.lang.String cmdSubstitution(java.lang.Process p)
           
static DesktopEnvironment getDE()
           
 java.io.File getDocumentsFolder()
           
 java.io.File getPreferencesFolder(java.lang.String appName)
           
 java.lang.String getVersion()
           
static void main(java.lang.String[] args)
           
 java.lang.String quoteParamForExec(java.lang.String s)
           
static void resetDE()
           
static boolean test(java.lang.String... command)
          Execute the passed command and test its return code.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

test

public static final boolean test(java.lang.String... command)
                          throws RTInterruptedException
Execute the passed command and test its return code.

Parameters:
command - the command to execute.
Returns:
false if the return code is not 0 or an exception is thrown.
Throws:
RTInterruptedException - if this is interrupted while waiting.

cmdSubstitution

public static final java.lang.String cmdSubstitution(java.lang.Process p)
                                              throws java.io.IOException
Throws:
java.io.IOException

getDE

public static final DesktopEnvironment getDE()

resetDE

public static final void resetDE()

getVersion

public final java.lang.String getVersion()

getDocumentsFolder

public java.io.File getDocumentsFolder()

getPreferencesFolder

public java.io.File getPreferencesFolder(java.lang.String appName)

quoteParamForExec

public java.lang.String quoteParamForExec(java.lang.String s)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

main

public static void main(java.lang.String[] args)