org.fife.ui.autocomplete
Class Util

java.lang.Object
  extended by org.fife.ui.autocomplete.Util

public class Util
extends Object

Utility methods for the auto-complete framework.

Version:
1.0
Author:
Robert Futrell

Constructor Summary
Util()
           
 
Method Summary
static boolean browse(URI uri)
          Attempts to open a web browser to the specified URI.
static String getHexString(Color c)
          Returns a hex string for the specified color, suitable for HTML.
static Rectangle getScreenBoundsForPoint(int x, int y)
          Returns the screen coordinates for the monitor that contains the specified point.
static boolean startsWithIgnoreCase(String str, String start)
          Returns whether str starts with start, ignoring case.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Util

public Util()
Method Detail

browse

public static boolean browse(URI uri)
Attempts to open a web browser to the specified URI.

Parameters:
uri - The URI to open. If this is null, nothing happens and this method returns false.
Returns:
Whether the operation was successful. This will be false on JRE's older than 1.6.

getHexString

public static String getHexString(Color c)
Returns a hex string for the specified color, suitable for HTML.

Parameters:
c - The color.
Returns:
The string representation, in the form "#rrggbb", or null if c is null.

getScreenBoundsForPoint

public static Rectangle getScreenBoundsForPoint(int x,
                                                int y)
Returns the screen coordinates for the monitor that contains the specified point. This is useful for setups with multiple monitors, to ensure that popup windows are positioned properly.

Parameters:
x - The x-coordinate, in screen coordinates.
y - The y-coordinate, in screen coordinates.
Returns:
The bounds of the monitor that contains the specified point.

startsWithIgnoreCase

public static boolean startsWithIgnoreCase(String str,
                                           String start)
Returns whether str starts with start, ignoring case.

Parameters:
str - The string to check.
start - The prefix to check for.
Returns:
Whether str starts with start, ignoring case.


Copyright © 2003-2011. All Rights Reserved.