public class PromptSupport
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
PromptSupport.FocusBehavior |
Modifier and Type | Field and Description |
---|---|
(package private) static java.lang.String |
BACKGROUND |
(package private) static java.lang.String |
BEHAVIOR |
(package private) static java.lang.String |
FOREGROUND |
(package private) static java.lang.String |
IS_PROMPT_DISPLAYED |
(package private) static java.lang.String |
PROMPT |
(package private) static java.lang.String |
SET |
(package private) static java.lang.String |
STYLE |
Constructor and Description |
---|
PromptSupport() |
Modifier and Type | Method and Description |
---|---|
static org.eclipse.swt.graphics.Color |
getBackground(org.eclipse.swt.widgets.Control control)
Get the background color of the
control , when no text is
present. |
static PromptSupport.FocusBehavior |
getFocusBehavior(org.eclipse.swt.widgets.Control control)
Get the
PromptSupport.FocusBehavior of control . |
static int |
getFontStyle(org.eclipse.swt.widgets.Control control)
Returns the font style of the prompt text, which is a OR mix of
SWT.ITALIC, SWT.NONE or SWT.BOLD
|
static org.eclipse.swt.graphics.Color |
getForeground(org.eclipse.swt.widgets.Control control)
Get the foreground color of the prompt text.
|
static java.lang.String |
getPrompt(org.eclipse.swt.widgets.Control control)
Get the prompt text of
control . |
static void |
init(java.lang.String promptText,
org.eclipse.swt.graphics.Color promptForeground,
org.eclipse.swt.graphics.Color promptBackground,
org.eclipse.swt.widgets.Control control)
Convenience method to set the
promptText and
promptTextColor on a Control . |
(package private) static boolean |
isPromptDisplayed(org.eclipse.swt.widgets.Control control) |
static void |
setBackground(org.eclipse.swt.graphics.Color color,
org.eclipse.swt.widgets.Control control)
Sets the prompts background color on
control . |
static void |
setFocusBehavior(PromptSupport.FocusBehavior focusBehavior,
org.eclipse.swt.widgets.Control control)
Sets the
PromptSupport.FocusBehavior on control , if it is the
focus owner. |
static void |
setFontStyle(int fontStyle,
org.eclipse.swt.widgets.Control control)
Set the style of the prompt font, which is a OR mix of SWT.ITALIC,
SWT.NONE or SWT.BOLD
|
static void |
setForeground(org.eclipse.swt.graphics.Color color,
org.eclipse.swt.widgets.Control control)
Sets the foreground color of the prompt on
control . |
static void |
setPrompt(java.lang.String promptText,
org.eclipse.swt.widgets.Control control)
Sets the prompt text on
control |
(package private) static void |
setPromptDisplayed(org.eclipse.swt.widgets.Control control,
boolean newValue) |
static final java.lang.String BACKGROUND
static final java.lang.String FOREGROUND
static final java.lang.String STYLE
static final java.lang.String BEHAVIOR
static final java.lang.String PROMPT
static final java.lang.String SET
static final java.lang.String IS_PROMPT_DISPLAYED
public static void init(java.lang.String promptText, org.eclipse.swt.graphics.Color promptForeground, org.eclipse.swt.graphics.Color promptBackground, org.eclipse.swt.widgets.Control control)
Convenience method to set the promptText
and
promptTextColor
on a Control
.
promptText
- Prompt TextpromptForeground
- ForegroundpromptBackground
- Backgroundcontrol
- controljava.lang.IllegalArgumentException
- if the control is not a Text Box, a
Combo Box, a StyledText or a CCombopublic static org.eclipse.swt.graphics.Color getBackground(org.eclipse.swt.widgets.Control control)
control
, when no text is
present. If no color has been set, the control
background
color will be returned.textComponent
- public static void setBackground(org.eclipse.swt.graphics.Color color, org.eclipse.swt.widgets.Control control)
Sets the prompts background color on control
. This
background color will only be used when no text is present.
background
- control
- java.lang.IllegalArgumentException
- if the control is not a Text Box, a
Combo Box, a StyledText or a CCombopublic static PromptSupport.FocusBehavior getFocusBehavior(org.eclipse.swt.widgets.Control control)
PromptSupport.FocusBehavior
of control
.control
- PromptSupport.FocusBehavior
or PromptSupport.FocusBehavior.HIDE_PROMPT
if
none is setpublic static void setFocusBehavior(PromptSupport.FocusBehavior focusBehavior, org.eclipse.swt.widgets.Control control)
PromptSupport.FocusBehavior
on control
, if it is the
focus owner.focusBehavior
- control
- java.lang.IllegalArgumentException
- if the control is not a Text Box, a
Combo Box, a StyledText or a CCombopublic static int getFontStyle(org.eclipse.swt.widgets.Control control)
control
- public static void setFontStyle(int fontStyle, org.eclipse.swt.widgets.Control control)
Set the style of the prompt font, which is a OR mix of SWT.ITALIC, SWT.NONE or SWT.BOLD
fontStyle
- control
- java.lang.IllegalArgumentException
- if the control is not a Text Box, a
Combo Box, a StyledText or a CCombopublic static org.eclipse.swt.graphics.Color getForeground(org.eclipse.swt.widgets.Control control)
GREY
color will be returned.color
- GREY
if none is setpublic static void setForeground(org.eclipse.swt.graphics.Color color, org.eclipse.swt.widgets.Control control)
control
. This
color will be used when no text is present.promptTextColor
- textComponent
- java.lang.IllegalArgumentException
- if the control is not a Text Box, a
Combo Box, a StyledText or a CCombopublic static java.lang.String getPrompt(org.eclipse.swt.widgets.Control control)
control
.control
- public static void setPrompt(java.lang.String promptText, org.eclipse.swt.widgets.Control control)
Sets the prompt text on control
promptText
- textComponent
- java.lang.IllegalArgumentException
- if the control is not a Text Box, a
Combo Box, a StyledText or a CCombostatic boolean isPromptDisplayed(org.eclipse.swt.widgets.Control control)
static void setPromptDisplayed(org.eclipse.swt.widgets.Control control, boolean newValue)