jdk/src/share/classes/javax/swing/JToolBar.java

Print this page

        

*** 20,54 **** * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ - package javax.swing; - import java.awt.Color; import java.awt.Component; - import java.awt.ComponentOrientation; import java.awt.Container; import java.awt.Dimension; import java.awt.Graphics; import java.awt.Insets; import java.awt.LayoutManager; import java.awt.LayoutManager2; ! import java.awt.event.*; ! import java.beans.*; - import javax.swing.border.Border; import javax.swing.plaf.*; import javax.accessibility.*; import java.io.Serializable; import java.io.ObjectOutputStream; - import java.io.ObjectInputStream; import java.io.IOException; - import java.util.Hashtable; - /** * <code>JToolBar</code> provides a component that is useful for * displaying commonly used <code>Action</code>s or controls. * For examples and information on using tool bars see --- 20,49 ---- * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ package javax.swing; import java.awt.Component; import java.awt.Container; import java.awt.Dimension; import java.awt.Graphics; import java.awt.Insets; import java.awt.LayoutManager; import java.awt.LayoutManager2; ! import java.beans.JavaBean; ! import java.beans.BeanProperty; ! import java.beans.PropertyChangeEvent; ! import java.beans.PropertyChangeListener; import javax.swing.plaf.*; import javax.accessibility.*; import java.io.Serializable; import java.io.ObjectOutputStream; import java.io.IOException; /** * <code>JToolBar</code> provides a component that is useful for * displaying commonly used <code>Action</code>s or controls. * For examples and information on using tool bars see
*** 76,94 **** * 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}. * - * @beaninfo - * attribute: isContainer true - * description: A component which displays commonly used controls or Actions. - * * @author Georges Saab * @author Jeff Shapiro * @see Action * @since 1.2 */ @SuppressWarnings("serial") // Same-version serialization only public class JToolBar extends JComponent implements SwingConstants, Accessible { /** * @see #getUIClassID --- 71,87 ---- * 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}. * * @author Georges Saab * @author Jeff Shapiro * @see Action * @since 1.2 */ + @JavaBean(defaultProperty = "UI", description = "A component which displays commonly used controls or Actions.") + @SwingContainer @SuppressWarnings("serial") // Same-version serialization only public class JToolBar extends JComponent implements SwingConstants, Accessible { /** * @see #getUIClassID
*** 173,188 **** /** * Sets the L&amp;F object that renders this component. * * @param ui the <code>ToolBarUI</code> L&amp;F object * @see UIDefaults#getUI - * @beaninfo - * bound: true - * hidden: true - * attribute: visualUpdate true - * description: The UI object that implements the Component's LookAndFeel. */ public void setUI(ToolBarUI ui) { super.setUI(ui); } /** --- 166,178 ---- /** * Sets the L&amp;F object that renders this component. * * @param ui the <code>ToolBarUI</code> L&amp;F object * @see UIDefaults#getUI */ + @BeanProperty(hidden = true, visualUpdate = true, description + = "The UI object that implements the Component's LookAndFeel.") public void setUI(ToolBarUI ui) { super.setUI(ui); } /**
*** 210,219 **** --- 200,210 ---- * * @return the string "ToolBarUI" * @see JComponent#getUIClassID * @see UIDefaults#getUI */ + @BeanProperty(bound = false) public String getUIClassID() { return uiClassID; }
*** 264,278 **** * effectively be ignored). * * @param m an <code>Insets</code> object that defines the space * between the border and the buttons * @see Insets - * @beaninfo - * description: The margin between the tool bar's border and contents - * bound: true - * expert: true */ public void setMargin(Insets m) { Insets old = margin; margin = m; firePropertyChange("margin", old, m); --- 255,267 ---- * effectively be ignored). * * @param m an <code>Insets</code> object that defines the space * between the border and the buttons * @see Insets */ + @BeanProperty(expert = true, description + = "The margin between the tool bar's border and contents") public void setMargin(Insets m) { Insets old = margin; margin = m; firePropertyChange("margin", old, m);
*** 315,329 **** * Some look and feels might not implement painted borders; * they will ignore this property. * * @param b if true, the border is painted * @see #isBorderPainted - * @beaninfo - * description: Does the tool bar paint its borders? - * bound: true - * expert: true */ public void setBorderPainted(boolean b) { if ( paintBorder != b ) { boolean old = paintBorder; --- 304,316 ---- * Some look and feels might not implement painted borders; * they will ignore this property. * * @param b if true, the border is painted * @see #isBorderPainted */ + @BeanProperty(expert = true, description + = "Does the tool bar paint its borders?") public void setBorderPainted(boolean b) { if ( paintBorder != b ) { boolean old = paintBorder;
*** 374,388 **** * they will ignore this property. * * @param b if <code>true</code>, the tool bar can be moved; * <code>false</code> otherwise * @see #isFloatable - * @beaninfo - * description: Can the tool bar be made to float by the user? - * bound: true - * preferred: true */ public void setFloatable( boolean b ) { if ( floatable != b ) { boolean old = floatable; --- 361,373 ---- * they will ignore this property. * * @param b if <code>true</code>, the tool bar can be moved; * <code>false</code> otherwise * @see #isFloatable */ + @BeanProperty(preferred = true, description + = "Can the tool bar be made to float by the user?") public void setFloatable( boolean b ) { if ( floatable != b ) { boolean old = floatable;
*** 416,432 **** * @param o the new orientation -- either <code>HORIZONTAL</code> or * <code>VERTICAL</code> * @exception IllegalArgumentException if orientation is neither * <code>HORIZONTAL</code> nor <code>VERTICAL</code> * @see #getOrientation - * @beaninfo - * description: The current orientation of the tool bar - * bound: true - * preferred: true - * enum: HORIZONTAL SwingConstants.HORIZONTAL - * VERTICAL SwingConstants.VERTICAL */ public void setOrientation( int o ) { checkOrientation( o ); if ( orientation != o ) --- 401,415 ---- * @param o the new orientation -- either <code>HORIZONTAL</code> or * <code>VERTICAL</code> * @exception IllegalArgumentException if orientation is neither * <code>HORIZONTAL</code> nor <code>VERTICAL</code> * @see #getOrientation */ + @BeanProperty(preferred = true, enumerationValues = { + "SwingConstants.HORIZONTAL", + "SwingConstants.VERTICAL"}, description + = "The current orientation of the tool bar") public void setOrientation( int o ) { checkOrientation( o ); if ( orientation != o )
*** 449,464 **** * The implementation of a look and feel may choose to ignore this * property. * * @param rollover true for rollover toolbar buttons; otherwise false * @since 1.4 - * @beaninfo - * bound: true - * preferred: true - * attribute: visualUpdate true - * description: Will draw rollover button borders in the toolbar. */ public void setRollover(boolean rollover) { putClientProperty("JToolBar.isRollover", rollover ? Boolean.TRUE : Boolean.FALSE); } --- 432,444 ---- * The implementation of a look and feel may choose to ignore this * property. * * @param rollover true for rollover toolbar buttons; otherwise false * @since 1.4 */ + @BeanProperty(preferred = true, visualUpdate = true, description + = "Will draw rollover button borders in the toolbar.") public void setRollover(boolean rollover) { putClientProperty("JToolBar.isRollover", rollover ? Boolean.TRUE : Boolean.FALSE); }
*** 834,843 **** --- 814,824 ---- * A new AccessibleJToolBar instance is created if necessary. * * @return an AccessibleJToolBar that serves as the * AccessibleContext of this JToolBar */ + @BeanProperty(bound = false) public AccessibleContext getAccessibleContext() { if (accessibleContext == null) { accessibleContext = new AccessibleJToolBar(); } return accessibleContext;