< prev index next >

src/java.desktop/share/classes/javax/swing/JToolTip.java

Print this page

        

*** 34,49 **** import java.util.Objects; /** * Used to display a "Tip" for a Component. Typically components provide api ! * to automate the process of using <code>ToolTip</code>s. ! * For example, any Swing component can use the <code>JComponent</code> ! * <code>setToolTipText</code> method to specify the text * for a standard tooltip. A component that wants to create a custom ! * <code>ToolTip</code> ! * display can override <code>JComponent</code>'s <code>createToolTip</code> * method and use a subclass of this class. * <p> * See <a href="http://docs.oracle.com/javase/tutorial/uiswing/components/tooltip.html">How to Use Tool Tips</a> * in <em>The Java Tutorial</em> * for further documentation. --- 34,49 ---- import java.util.Objects; /** * Used to display a "Tip" for a Component. Typically components provide api ! * to automate the process of using {@code ToolTip}s. ! * For example, any Swing component can use the {@code JComponent} ! * {@code setToolTipText} method to specify the text * for a standard tooltip. A component that wants to create a custom ! * {@code ToolTip} ! * display can override {@code JComponent}'s {@code createToolTip} * method and use a subclass of this class. * <p> * See <a href="http://docs.oracle.com/javase/tutorial/uiswing/components/tooltip.html">How to Use Tool Tips</a> * in <em>The Java Tutorial</em> * for further documentation.
*** 57,67 **** * Serialized objects of this class will not be compatible with * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage * of all JavaBeans&trade; ! * has been added to the <code>java.beans</code> package. * Please see {@link java.beans.XMLEncoder}. * * @see JComponent#setToolTipText * @see JComponent#createToolTip * @author Dave Moore --- 57,67 ---- * Serialized objects of this class will not be compatible with * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage * of all JavaBeans&trade; ! * has been added to the {@code java.beans} package. * Please see {@link java.beans.XMLEncoder}. * * @see JComponent#setToolTipText * @see JComponent#createToolTip * @author Dave Moore
*** 86,96 **** } /** * Returns the L&amp;F object that renders this component. * ! * @return the <code>ToolTipUI</code> object that renders this component */ public ToolTipUI getUI() { return (ToolTipUI)ui; } --- 86,96 ---- } /** * Returns the L&amp;F object that renders this component. * ! * @return the {@code ToolTipUI} object that renders this component */ public ToolTipUI getUI() { return (ToolTipUI)ui; }
*** 116,128 **** } /** * Sets the text to show when the tool tip is displayed. ! * The string <code>tipText</code> may be <code>null</code>. * ! * @param tipText the <code>String</code> to display * @beaninfo * preferred: true * bound: true * description: Sets the text of the tooltip */ --- 116,128 ---- } /** * Sets the text to show when the tool tip is displayed. ! * The string {@code tipText} may be {@code null}. * ! * @param tipText the {@code String} to display * @beaninfo * preferred: true * bound: true * description: Sets the text of the tooltip */
*** 137,162 **** } } /** * Returns the text that is shown when the tool tip is displayed. ! * The returned value may be <code>null</code>. * ! * @return the <code>String</code> that is displayed */ public String getTipText() { return tipText; } /** * Specifies the component that the tooltip describes. ! * The component <code>c</code> may be <code>null</code> * and will have no effect. * <p> * This is a bound property. * ! * @param c the <code>JComponent</code> being described * @see JComponent#createToolTip * @beaninfo * bound: true * description: Sets the component that the tooltip describes. */ --- 137,162 ---- } } /** * Returns the text that is shown when the tool tip is displayed. ! * The returned value may be {@code null}. * ! * @return the {@code String} that is displayed */ public String getTipText() { return tipText; } /** * Specifies the component that the tooltip describes. ! * The component {@code c} may be {@code null} * and will have no effect. * <p> * This is a bound property. * ! * @param c the {@code JComponent} being described * @see JComponent#createToolTip * @beaninfo * bound: true * description: Sets the component that the tooltip describes. */
*** 167,177 **** firePropertyChange("component", oldValue, c); } /** * Returns the component the tooltip applies to. ! * The returned value may be <code>null</code>. * * @return the component that the tooltip describes * * @see JComponent#createToolTip */ --- 167,177 ---- firePropertyChange("component", oldValue, c); } /** * Returns the component the tooltip applies to. ! * The returned value may be {@code null}. * * @return the component that the tooltip describes * * @see JComponent#createToolTip */
*** 188,199 **** return true; } /** ! * See <code>readObject</code> and <code>writeObject</code> ! * in <code>JComponent</code> for more * information about serialization in Swing. */ private void writeObject(ObjectOutputStream s) throws IOException { s.defaultWriteObject(); if (getUIClassID().equals(uiClassID)) { --- 188,199 ---- return true; } /** ! * See {@code readObject} and {@code writeObject} ! * in {@code JComponent} for more * information about serialization in Swing. */ private void writeObject(ObjectOutputStream s) throws IOException { s.defaultWriteObject(); if (getUIClassID().equals(uiClassID)) {
*** 205,222 **** } } /** ! * Returns a string representation of this <code>JToolTip</code>. * This method * is intended to be used only for debugging purposes, and the * content and format of the returned string may vary between * implementations. The returned string may be empty but may not ! * be <code>null</code>. * ! * @return a string representation of this <code>JToolTip</code> */ protected String paramString() { String tipTextString = (tipText != null ? tipText : ""); --- 205,222 ---- } } /** ! * Returns a string representation of this {@code JToolTip}. * This method * is intended to be used only for debugging purposes, and the * content and format of the returned string may vary between * implementations. The returned string may be empty but may not ! * be {@code null}. * ! * @return a string representation of this {@code JToolTip} */ protected String paramString() { String tipTextString = (tipText != null ? tipText : "");
*** 245,264 **** return accessibleContext; } /** * This class implements accessibility support for the ! * <code>JToolTip</code> class. It provides an implementation of the * Java Accessibility API appropriate to tool tip user-interface elements. * <p> * <strong>Warning:</strong> * Serialized objects of this class will not be compatible with * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage * of all JavaBeans&trade; ! * has been added to the <code>java.beans</code> package. * Please see {@link java.beans.XMLEncoder}. */ @SuppressWarnings("serial") protected class AccessibleJToolTip extends AccessibleJComponent { --- 245,264 ---- return accessibleContext; } /** * This class implements accessibility support for the ! * {@code JToolTip} class. It provides an implementation of the * Java Accessibility API appropriate to tool tip user-interface elements. * <p> * <strong>Warning:</strong> * Serialized objects of this class will not be compatible with * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage * of all JavaBeans&trade; ! * has been added to the {@code java.beans} package. * Please see {@link java.beans.XMLEncoder}. */ @SuppressWarnings("serial") protected class AccessibleJToolTip extends AccessibleJComponent {
< prev index next >