diff options
author | malenkov <none@none> | 2008-05-07 23:20:32 +0400 |
---|---|---|
committer | malenkov <none@none> | 2008-05-07 23:20:32 +0400 |
commit | ca4abd6b513caef68d13a0a17abb5c15d402353c (patch) | |
tree | bcff2738e8d3dce8c44f5528bbdf0ed6ee51fcb7 /src/share/classes/javax/swing | |
parent | e18c7a4718a117dffb4b709154e90f11224eb994 (diff) |
4935607: RFE: LTP: Should be possible to set the TRANSIENT attribute of propertiies to FALSE
Summary: Add the Transient annotation and support it (JSR-273)
Reviewed-by: peterz, loneid
Diffstat (limited to 'src/share/classes/javax/swing')
-rw-r--r-- | src/share/classes/javax/swing/AbstractButton.java | 7 | ||||
-rw-r--r-- | src/share/classes/javax/swing/DefaultListSelectionModel.java | 5 | ||||
-rw-r--r-- | src/share/classes/javax/swing/ImageIcon.java | 5 | ||||
-rw-r--r-- | src/share/classes/javax/swing/JComboBox.java | 7 | ||||
-rw-r--r-- | src/share/classes/javax/swing/JComponent.java | 10 | ||||
-rw-r--r-- | src/share/classes/javax/swing/JLabel.java | 4 | ||||
-rw-r--r-- | src/share/classes/javax/swing/JList.java | 8 | ||||
-rw-r--r-- | src/share/classes/javax/swing/JMenuBar.java | 4 | ||||
-rw-r--r-- | src/share/classes/javax/swing/JScrollPane.java | 11 | ||||
-rw-r--r-- | src/share/classes/javax/swing/JTabbedPane.java | 6 | ||||
-rw-r--r-- | src/share/classes/javax/swing/JViewport.java | 4 | ||||
-rw-r--r-- | src/share/classes/javax/swing/table/JTableHeader.java | 4 | ||||
-rw-r--r-- | src/share/classes/javax/swing/text/JTextComponent.java | 7 |
13 files changed, 62 insertions, 20 deletions
diff --git a/src/share/classes/javax/swing/AbstractButton.java b/src/share/classes/javax/swing/AbstractButton.java index b4d4ae1e2..53cb6139c 100644 --- a/src/share/classes/javax/swing/AbstractButton.java +++ b/src/share/classes/javax/swing/AbstractButton.java @@ -1,5 +1,5 @@ /* - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,7 +29,9 @@ import java.awt.event.*; import java.awt.image.*; import java.text.*; import java.awt.geom.*; -import java.beans.*; +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; +import java.beans.Transient; import java.util.Enumeration; import java.util.Vector; import java.io.Serializable; @@ -645,6 +647,7 @@ public abstract class AbstractButton extends JComponent implements ItemSelectabl * @see #setDisabledIcon * @see javax.swing.LookAndFeel#getDisabledIcon */ + @Transient public Icon getDisabledIcon() { if (disabledIcon == null) { disabledIcon = UIManager.getLookAndFeel().getDisabledIcon(this, getIcon()); diff --git a/src/share/classes/javax/swing/DefaultListSelectionModel.java b/src/share/classes/javax/swing/DefaultListSelectionModel.java index 78caa1941..329fa38b4 100644 --- a/src/share/classes/javax/swing/DefaultListSelectionModel.java +++ b/src/share/classes/javax/swing/DefaultListSelectionModel.java @@ -1,5 +1,5 @@ /* - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,6 +28,7 @@ package javax.swing; import java.util.EventListener; import java.util.BitSet; import java.io.Serializable; +import java.beans.Transient; import javax.swing.event.*; @@ -714,11 +715,13 @@ public class DefaultListSelectionModel implements ListSelectionModel, Cloneable, } /** {@inheritDoc} */ + @Transient public int getAnchorSelectionIndex() { return anchorIndex; } /** {@inheritDoc} */ + @Transient public int getLeadSelectionIndex() { return leadIndex; } diff --git a/src/share/classes/javax/swing/ImageIcon.java b/src/share/classes/javax/swing/ImageIcon.java index 38a9f22f2..74788f1a8 100644 --- a/src/share/classes/javax/swing/ImageIcon.java +++ b/src/share/classes/javax/swing/ImageIcon.java @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,6 +27,7 @@ package javax.swing; import java.awt.*; import java.awt.image.*; import java.beans.ConstructorProperties; +import java.beans.Transient; import java.net.URL; import java.io.Serializable; @@ -336,6 +337,7 @@ public class ImageIcon implements Icon, Serializable, Accessible { * Returns this icon's <code>Image</code>. * @return the <code>Image</code> object for this <code>ImageIcon</code> */ + @Transient public Image getImage() { return image; } @@ -436,6 +438,7 @@ public class ImageIcon implements Icon, Serializable, Accessible { * * @return the image observer, which may be null */ + @Transient public ImageObserver getImageObserver() { return imageObserver; } diff --git a/src/share/classes/javax/swing/JComboBox.java b/src/share/classes/javax/swing/JComboBox.java index a4d92427e..2230147f4 100644 --- a/src/share/classes/javax/swing/JComboBox.java +++ b/src/share/classes/javax/swing/JComboBox.java @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -24,7 +24,9 @@ */ package javax.swing; -import java.beans.*; +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; +import java.beans.Transient; import java.util.*; import java.awt.*; @@ -636,6 +638,7 @@ implements ItemSelectable,ListDataListener,ActionListener, Accessible { * or -1 if no item is selected or if * the currently selected item is not in the list */ + @Transient public int getSelectedIndex() { Object sObject = dataModel.getSelectedItem(); int i,c; diff --git a/src/share/classes/javax/swing/JComponent.java b/src/share/classes/javax/swing/JComponent.java index d26ec12eb..7d3881a1c 100644 --- a/src/share/classes/javax/swing/JComponent.java +++ b/src/share/classes/javax/swing/JComponent.java @@ -1,5 +1,5 @@ /* - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -43,7 +43,10 @@ import java.awt.Graphics2D; import java.awt.peer.LightweightPeer; import java.awt.dnd.DropTarget; import java.awt.font.FontRenderContext; -import java.beans.*; +import java.beans.PropertyChangeListener; +import java.beans.VetoableChangeListener; +import java.beans.VetoableChangeSupport; +import java.beans.Transient; import java.applet.Applet; @@ -1634,6 +1637,7 @@ public abstract class JComponent extends Container implements Serializable, * @see #setPreferredSize * @see ComponentUI */ + @Transient public Dimension getPreferredSize() { if (isPreferredSizeSet()) { return super.getPreferredSize(); @@ -1675,6 +1679,7 @@ public abstract class JComponent extends Container implements Serializable, * @see #setMaximumSize * @see ComponentUI */ + @Transient public Dimension getMaximumSize() { if (isMaximumSizeSet()) { return super.getMaximumSize(); @@ -1714,6 +1719,7 @@ public abstract class JComponent extends Container implements Serializable, * @see #setMinimumSize * @see ComponentUI */ + @Transient public Dimension getMinimumSize() { if (isMinimumSizeSet()) { return super.getMinimumSize(); diff --git a/src/share/classes/javax/swing/JLabel.java b/src/share/classes/javax/swing/JLabel.java index 1d51add5c..417892a83 100644 --- a/src/share/classes/javax/swing/JLabel.java +++ b/src/share/classes/javax/swing/JLabel.java @@ -1,5 +1,5 @@ /* - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,6 +31,7 @@ import java.awt.Image; import java.awt.*; import java.text.*; import java.awt.geom.*; +import java.beans.Transient; import java.io.ObjectOutputStream; import java.io.ObjectInputStream; @@ -422,6 +423,7 @@ public class JLabel extends JComponent implements SwingConstants, Accessible * @see javax.swing.LookAndFeel#getDisabledIcon * @see ImageIcon */ + @Transient public Icon getDisabledIcon() { if (!disabledIconSet && disabledIcon == null && defaultIcon != null) { disabledIcon = UIManager.getLookAndFeel().getDisabledIcon(this, defaultIcon); diff --git a/src/share/classes/javax/swing/JList.java b/src/share/classes/javax/swing/JList.java index 8446d05a8..a83a4c94e 100644 --- a/src/share/classes/javax/swing/JList.java +++ b/src/share/classes/javax/swing/JList.java @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,7 +31,9 @@ import java.awt.*; import java.util.Vector; import java.util.Locale; -import java.beans.*; +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; +import java.beans.Transient; import javax.swing.event.*; import javax.accessibility.*; @@ -724,6 +726,7 @@ public class JList extends JComponent implements Scrollable, Accessible * @return the value of the {@code cellRenderer} property * @see #setCellRenderer */ + @Transient public ListCellRenderer getCellRenderer() { return cellRenderer; } @@ -2153,6 +2156,7 @@ public class JList extends JComponent implements Scrollable, Accessible * @see #removeSelectionInterval * @see #addListSelectionListener */ + @Transient public int[] getSelectedIndices() { ListSelectionModel sm = getSelectionModel(); int iMin = sm.getMinSelectionIndex(); diff --git a/src/share/classes/javax/swing/JMenuBar.java b/src/share/classes/javax/swing/JMenuBar.java index f10a84bf3..d6f04fbb4 100644 --- a/src/share/classes/javax/swing/JMenuBar.java +++ b/src/share/classes/javax/swing/JMenuBar.java @@ -1,5 +1,5 @@ /* - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -32,6 +32,7 @@ import java.awt.Insets; import java.awt.Point; import java.awt.Rectangle; import java.awt.event.*; +import java.beans.Transient; import java.util.Vector; import java.util.Enumeration; @@ -236,6 +237,7 @@ public class JMenuBar extends JComponent implements Accessible,MenuElement * * @return the <code>JMenu</code> that delivers help to the user */ + @Transient public JMenu getHelpMenu() { throw new Error("getHelpMenu() not yet implemented."); } diff --git a/src/share/classes/javax/swing/JScrollPane.java b/src/share/classes/javax/swing/JScrollPane.java index 1db9e459f..13c1365c0 100644 --- a/src/share/classes/javax/swing/JScrollPane.java +++ b/src/share/classes/javax/swing/JScrollPane.java @@ -1,5 +1,5 @@ /* - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -43,8 +43,9 @@ import java.io.ObjectOutputStream; import java.io.ObjectInputStream; import java.io.IOException; -import java.beans.*; - +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; +import java.beans.Transient; /** * Provides a scrollable view of a lightweight component. @@ -822,6 +823,7 @@ public class JScrollPane extends JComponent implements ScrollPaneConstants, Acce * @return the <code>horizontalScrollBar</code> property * @see #setHorizontalScrollBar */ + @Transient public JScrollBar getHorizontalScrollBar() { return horizontalScrollBar; } @@ -880,6 +882,7 @@ public class JScrollPane extends JComponent implements ScrollPaneConstants, Acce * @return the <code>verticalScrollBar</code> property * @see #setVerticalScrollBar */ + @Transient public JScrollBar getVerticalScrollBar() { return verticalScrollBar; } @@ -1012,6 +1015,7 @@ public class JScrollPane extends JComponent implements ScrollPaneConstants, Acce * @return the <code>rowHeader</code> property * @see #setRowHeader */ + @Transient public JViewport getRowHeader() { return rowHeader; } @@ -1081,6 +1085,7 @@ public class JScrollPane extends JComponent implements ScrollPaneConstants, Acce * @return the <code>columnHeader</code> property * @see #setColumnHeader */ + @Transient public JViewport getColumnHeader() { return columnHeader; } diff --git a/src/share/classes/javax/swing/JTabbedPane.java b/src/share/classes/javax/swing/JTabbedPane.java index defffc711..706fc3732 100644 --- a/src/share/classes/javax/swing/JTabbedPane.java +++ b/src/share/classes/javax/swing/JTabbedPane.java @@ -1,5 +1,5 @@ /* - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,7 +27,7 @@ package javax.swing; import java.awt.*; import java.awt.event.*; -import java.beans.*; +import java.beans.Transient; import java.util.*; import javax.swing.event.*; import javax.swing.plaf.*; @@ -563,6 +563,7 @@ public class JTabbedPane extends JComponent * @return the index of the selected tab * @see #setSelectedIndex */ + @Transient public int getSelectedIndex() { return model.getSelectedIndex(); } @@ -648,6 +649,7 @@ public class JTabbedPane extends JComponent * @return the component corresponding to the selected tab * @see #setSelectedComponent */ + @Transient public Component getSelectedComponent() { int index = getSelectedIndex(); if (index == -1) { diff --git a/src/share/classes/javax/swing/JViewport.java b/src/share/classes/javax/swing/JViewport.java index 1825c7901..f5a16bbd2 100644 --- a/src/share/classes/javax/swing/JViewport.java +++ b/src/share/classes/javax/swing/JViewport.java @@ -1,5 +1,5 @@ /* - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,6 +30,7 @@ import java.awt.event.*; import java.awt.image.VolatileImage; import java.awt.peer.ComponentPeer; import java.applet.Applet; +import java.beans.Transient; import javax.swing.plaf.ViewportUI; import javax.swing.event.*; @@ -1257,6 +1258,7 @@ public class JViewport extends JComponent implements Accessible * * @return a <code>Dimension</code> object giving the size of the view */ + @Transient public Dimension getExtentSize() { return getSize(); } diff --git a/src/share/classes/javax/swing/table/JTableHeader.java b/src/share/classes/javax/swing/table/JTableHeader.java index fb99e058d..780996089 100644 --- a/src/share/classes/javax/swing/table/JTableHeader.java +++ b/src/share/classes/javax/swing/table/JTableHeader.java @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -37,6 +37,7 @@ import javax.swing.plaf.*; import javax.accessibility.*; import java.beans.PropertyChangeListener; +import java.beans.Transient; import java.io.ObjectOutputStream; import java.io.ObjectInputStream; @@ -325,6 +326,7 @@ public class JTableHeader extends JComponent implements TableColumnModelListener * @return the default renderer * @since 1.3 */ + @Transient public TableCellRenderer getDefaultRenderer() { return defaultRenderer; } diff --git a/src/share/classes/javax/swing/text/JTextComponent.java b/src/share/classes/javax/swing/text/JTextComponent.java index d340f281e..e45310035 100644 --- a/src/share/classes/javax/swing/text/JTextComponent.java +++ b/src/share/classes/javax/swing/text/JTextComponent.java @@ -1,5 +1,5 @@ /* - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,6 +29,7 @@ import java.lang.reflect.Method; import java.security.AccessController; import java.security.PrivilegedAction; +import java.beans.Transient; import java.util.Collections; import java.util.HashMap; import java.util.Hashtable; @@ -571,6 +572,7 @@ public abstract class JTextComponent extends JComponent implements Scrollable, A * * @return the caret */ + @Transient public Caret getCaret() { return caret; } @@ -1672,6 +1674,7 @@ public abstract class JTextComponent extends JComponent implements Scrollable, A * @return the position of the text insertion caret for the * text component >= 0 */ + @Transient public int getCaretPosition() { return caret.getDot(); } @@ -1797,6 +1800,7 @@ public abstract class JTextComponent extends JComponent implements Scrollable, A * * @return the start position >= 0 */ + @Transient public int getSelectionStart() { int start = Math.min(caret.getDot(), caret.getMark()); return start; @@ -1829,6 +1833,7 @@ public abstract class JTextComponent extends JComponent implements Scrollable, A * * @return the end position >= 0 */ + @Transient public int getSelectionEnd() { int end = Math.max(caret.getDot(), caret.getMark()); return end; |