org.littleshoot.util
Class NativeUtils

java.lang.Object
  extended by org.littleshoot.util.NativeUtils

public class NativeUtils
extends Object

Utilities for native calls.


Constructor Summary
NativeUtils()
           
 
Method Summary
static void addTray(Image image, String name, PopupMenu popup)
          Adds a tray icon using reflection.
static void openFolder(File folder)
           
static Process openUri(String uri)
          Opens the specified URI using the native file system.
static boolean supportsTray()
          Uses reflection to determine whether or not this operating system and java version supports the system tray.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NativeUtils

public NativeUtils()
Method Detail

openUri

public static Process openUri(String uri)
Opens the specified URI using the native file system. Currently only HTTP URIs are officially supported.

Parameters:
uri - The URI to open.
Returns:
The Process started, or null if there was an error.

openFolder

public static void openFolder(File folder)
                       throws IOException
Throws:
IOException

addTray

public static void addTray(Image image,
                           String name,
                           PopupMenu popup)
Adds a tray icon using reflection. This succeeds if the underlying JVM is 1.6 and supports the system tray, failing otherwise.

Parameters:
image - The image to use for the system tray icon.
name - The name of the system tray item.
popup - The popup menu to display when someone clicks on the tray.

supportsTray

public static boolean supportsTray()
Uses reflection to determine whether or not this operating system and java version supports the system tray.

Returns:
true if it supports the tray, otherwise false.


Copyright © 2011-2013 LittleShoot. All Rights Reserved.