|
org.netbeans.modules.editor.lib/3 3.23.0 19 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.netbeans.editor.ext.ToolTipSupport
public class ToolTipSupport
Support for editor tooltips. Once the user stops moving the mouse
for the INITIAL_DELAY milliseconds the enterTimer fires
and the updateToolTip() method is called which searches
for the action named ExtKit.buildToolTipAction and if found
it executes it. The tooltips can be displayed by either calling
setToolTipText(java.lang.String)
or setToolTip(javax.swing.JComponent).
However only one of the above ways should be used
not a combination of both because in such case
the text could be propagated in the previously set
custom tooltip component.
| Field Summary | |
|---|---|
static int |
DISMISS_DELAY
Delay after which the tooltip will be hidden automatically in milliseconds. |
static int |
FLAG_HIDE_ON_MOUSE_MOVE
|
static int |
FLAG_HIDE_ON_TIMER
|
static int |
FLAG_PERMANENT
|
static int |
FLAGS_HEAVYWEIGHT_TOOLTIP
|
static int |
FLAGS_LIGHTWEIGHT_TOOLTIP
|
static int |
INITIAL_DELAY
Initial delay before the tooltip is shown in milliseconds. |
static String |
PROP_DISMISS_DELAY
Property for the dismiss delay change |
static String |
PROP_ENABLED
Property for the enabled flag change |
static String |
PROP_INITIAL_DELAY
Property for the initial delay change |
static String |
PROP_STATUS
Property for the visibility status change. |
static String |
PROP_TOOL_TIP
Property for the tooltip component change |
static String |
PROP_TOOL_TIP_TEXT
Property for the tooltip text change |
static int |
STATUS_COMPONENT_VISIBLE
Status indicating that the tooltip is visible because setToolTip(javax.swing.JComponent)
was called. |
static int |
STATUS_HIDDEN
Status indicating that the tooltip is not showing on the screen. |
static int |
STATUS_TEXT_VISIBLE
Status indicating that the tooltip is visible because setToolTipText(java.lang.String)
was called. |
static int |
STATUS_VISIBILITY_ENABLED
Status indicating that the tooltip is not showing on the screen but once either the setToolTipText(java.lang.String)
or setToolTip(javax.swing.JComponent) gets called
the tooltip will become visible. |
| Method Summary | |
|---|---|
void |
addPropertyChangeListener(PropertyChangeListener listener)
Add the listener for the property changes. |
protected void |
componentToolTipTextChanged(PropertyChangeEvent evt)
Called automatically when the JComponent.TOOL_TIP_TEXT_KEY
property of the corresponding editor component
gets changed.By default it calls setToolTipText(java.lang.String)
with the new tooltip text of the component. |
protected JComponent |
createDefaultToolTip()
Create the default tooltip component. |
protected void |
firePropertyChange(String propertyName,
Object oldValue,
Object newValue)
Fire the change of the given property. |
int |
getDismissDelay()
|
String |
getIdentifierUnderCursor()
Helper method to get the identifier under the mouse cursor. |
int |
getInitialDelay()
|
MouseEvent |
getLastMouseEvent()
|
int |
getStatus()
|
JComponent |
getToolTip()
|
String |
getToolTipText()
|
boolean |
isEnabled()
|
boolean |
isToolTipVisible()
|
void |
removePropertyChangeListener(PropertyChangeListener listener)
|
void |
setDismissDelay(int delay)
Set the delay between displaying of the tooltip and its automatic hiding in milliseconds. |
void |
setEnabled(boolean enabled)
Set whether the tooltip support is enabled. |
void |
setInitialDelay(int delay)
Set the delay between stopping mouse movement and displaying of the tooltip in milliseconds. |
void |
setToolTip(JComponent toolTip)
Set the tooltip component. |
void |
setToolTip(JComponent toolTip,
PopupManager.HorizontalBounds horizontalBounds,
PopupManager.Placement placement)
|
void |
setToolTip(JComponent toolTip,
PopupManager.HorizontalBounds horizontalBounds,
PopupManager.Placement placement,
int horizontalAdjustment,
int verticalAdjustment)
|
void |
setToolTip(JComponent toolTip,
PopupManager.HorizontalBounds horizontalBounds,
PopupManager.Placement placement,
int horizontalAdjustment,
int verticalAdjustment,
int flags)
|
void |
setToolTipText(String text)
Set the tooltip text to make the tooltip to be shown on the screen. |
void |
setToolTipVisible(boolean visible)
Set the visibility of the tooltip. |
protected void |
updateToolTip()
Update the tooltip by running corresponding action ExtKit.buildToolTipAction. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String PROP_TOOL_TIP
public static final String PROP_TOOL_TIP_TEXT
public static final String PROP_STATUS
public static final String PROP_ENABLED
public static final String PROP_INITIAL_DELAY
public static final String PROP_DISMISS_DELAY
public static final int INITIAL_DELAY
public static final int DISMISS_DELAY
public static final int STATUS_HIDDEN
public static final int STATUS_VISIBILITY_ENABLED
setToolTipText(java.lang.String)
or setToolTip(javax.swing.JComponent) gets called
the tooltip will become visible.
public static final int STATUS_TEXT_VISIBLE
setToolTipText(java.lang.String)
was called.
public static final int STATUS_COMPONENT_VISIBLE
setToolTip(javax.swing.JComponent)
was called.
public static final int FLAG_HIDE_ON_MOUSE_MOVE
public static final int FLAG_HIDE_ON_TIMER
public static final int FLAG_PERMANENT
public static final int FLAGS_LIGHTWEIGHT_TOOLTIP
public static final int FLAGS_HEAVYWEIGHT_TOOLTIP
| Method Detail |
|---|
public final JComponent getToolTip()
public void setToolTip(JComponent toolTip)
toolTip - component that either contains the tooltip
or that will display a text tooltip.
public void setToolTip(JComponent toolTip,
PopupManager.HorizontalBounds horizontalBounds,
PopupManager.Placement placement)
public void setToolTip(JComponent toolTip,
PopupManager.HorizontalBounds horizontalBounds,
PopupManager.Placement placement,
int horizontalAdjustment,
int verticalAdjustment)
public void setToolTip(JComponent toolTip,
PopupManager.HorizontalBounds horizontalBounds,
PopupManager.Placement placement,
int horizontalAdjustment,
int verticalAdjustment,
int flags)
protected JComponent createDefaultToolTip()
protected void updateToolTip()
ExtKit.buildToolTipAction. This method gets
called once the enterTimer fires and it can be overriden
by children.
public void setToolTipVisible(boolean visible)
visible - whether tooltip should become visible or not.
If true the status is changed to STATUS_VISIBILITY_ENABLED
and updateToolTip() is called.
It is still possible that the tooltip will not be showing on the screen in case the tooltip or tooltip text are left unchanged.
public boolean isToolTipVisible()
getStatus() gives the exact visibility state.public final int getStatus()
STATUS_HIDDEN
or STATUS_VISIBILITY_ENABLED
or STATUS_TEXT_VISIBLE
or STATUS_COMPONENT_VISIBLE.public String getToolTipText()
public void setToolTipText(String text)
text - tooltip text to be displayed.public String getIdentifierUnderCursor()
public boolean isEnabled()
public void setEnabled(boolean enabled)
enabled - whether the tooltip will be enabled or not.public int getInitialDelay()
public void setInitialDelay(int delay)
public int getDismissDelay()
public void setDismissDelay(int delay)
public final MouseEvent getLastMouseEvent()
protected void componentToolTipTextChanged(PropertyChangeEvent evt)
JComponent.TOOL_TIP_TEXT_KEY
property of the corresponding editor component
gets changed.setToolTipText(java.lang.String)
with the new tooltip text of the component.
public void addPropertyChangeListener(PropertyChangeListener listener)
listener - listener to be added.public void removePropertyChangeListener(PropertyChangeListener listener)
protected void firePropertyChange(String propertyName,
Object oldValue,
Object newValue)
propertyName - name of the fired propertyoldValue - old value of the propertynewValue - new value of the property.
|
org.netbeans.modules.editor.lib/3 3.23.0 19 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||