public class Util
extends java.lang.Object
限定符和类型 | 字段和说明 |
---|---|
static java.lang.String |
PROPERTY_ALLOW_DECORATED_AUTOCOMPLETE_WINDOWS
If this system property is
true , then even the "main" two
auto-complete windows will allow window decorations via
PopupWindowDecorator . |
static java.lang.String |
PROPERTY_DONT_USE_SUBSTANCE_RENDERERS
If a system property is defined with this name and set, ignoring case,
to
true , this library will not attempt to use Substance
renderers. |
构造器和说明 |
---|
Util() |
限定符和类型 | 方法和说明 |
---|---|
static boolean |
browse(java.net.URI uri)
Attempts to open a web browser to the specified URI.
|
static java.lang.String |
getHexString(java.awt.Color c)
Returns a hex string for the specified color, suitable for HTML.
|
static java.awt.Rectangle |
getScreenBoundsForPoint(int x,
int y)
Returns the screen coordinates for the monitor that contains the
specified point.
|
static boolean |
getShouldAllowDecoratingMainAutoCompleteWindows()
Give apps a chance to decorate us with drop shadows, etc.
|
static boolean |
getUseSubstanceRenderers()
Returns whether we should attempt to use Substance cell renderers and
styles for things such as completion choices, if a Substance Look and
Feel is installed.
|
static boolean |
isLightForeground(java.awt.Color fg)
Returns whether the specified color is "light" to use as a foreground.
|
static boolean |
startsWithIgnoreCase(java.lang.String str,
java.lang.String start)
Returns whether
str starts with start ,
ignoring case. |
static java.lang.String |
stripHtml(java.lang.String text)
Strips any HTML from a string.
|
public static final java.lang.String PROPERTY_DONT_USE_SUBSTANCE_RENDERERS
true
, this library will not attempt to use Substance
renderers. Otherwise, if a Substance Look and Feel is installed, we
will attempt to use Substance cell renderers in all of our dropdowns.Note that we do not have a build dependency on Substance, so all access to Substance stuff is done via reflection. We will fall back onto default renderers if something goes horribly wrong.
public static final java.lang.String PROPERTY_ALLOW_DECORATED_AUTOCOMPLETE_WINDOWS
true
, then even the "main" two
auto-complete windows will allow window decorations via
PopupWindowDecorator
. If this property is undefined or
false
, they won't honor such decorations. This is due to
certain performance issues with translucent windows (used for drop
shadows), even as of Java 7u2.public static boolean browse(java.net.URI uri)
uri
- The URI to open. If this is null
, nothing
happens and this method returns false
.false
on JRE's older than 1.6.public static java.lang.String getHexString(java.awt.Color c)
c
- The color.#rrggbb
",
or null
if c
is null
.public static java.awt.Rectangle getScreenBoundsForPoint(int x, int y)
x
- The x-coordinate, in screen coordinates.y
- The y-coordinate, in screen coordinates.public static boolean getShouldAllowDecoratingMainAutoCompleteWindows()
PROPERTY_ALLOW_DECORATED_AUTOCOMPLETE_WINDOWS
public static boolean getUseSubstanceRenderers()
false
, we'll use our
standard rendering for completions, even when Substance is being used.public static final boolean isLightForeground(java.awt.Color fg)
true
indicate that the current Look and
Feel probably uses light text colors on a dark background.fg
- The foreground color.public static boolean startsWithIgnoreCase(java.lang.String str, java.lang.String start)
str
starts with start
,
ignoring case.str
- The string to check.start
- The prefix to check for.str
starts with start
,
ignoring case.public static java.lang.String stripHtml(java.lang.String text)
<html>
" for markup tags to be stripped.text
- The string.