mirror of git://gcc.gnu.org/git/gcc.git
AbstractAction.java: Reformated.
2004-01-23 Michael Koch <konqueror@gmx.de> * javax/swing/AbstractAction.java: Reformated. (getPropertyChangeListeners): New method. * javax/swing/AbstractCellEditor.java: Reformated. (getCellEditorListeners): New method. * javax/swing/DefaultListSelectionModel.java (listenerList): New field. (listeners): Removed. (get_listeners): Removed. (addListSelectionListener): Rewritten. (removeListSelectionListener): Rewritten. (getListSelectionListeners): New method. (getListeners): New method. * javax/swing/JComboBox.java: Imports reworked. (addActionListener): Implemented. (removeActionListener): Implemented. (addItemListener): Implemented. (removeItemListener): Implemented. (addPopupMenuListener): Implemented. (removePopupMenuListener): Implemented. (getActionListeners): New method. (getItemListeners): New method. (getPopupMenuListeners): New method. From-SVN: r76413
This commit is contained in:
parent
5d7b2198ba
commit
3ac55a5a69
|
|
@ -1,3 +1,28 @@
|
||||||
|
2004-01-23 Michael Koch <konqueror@gmx.de>
|
||||||
|
|
||||||
|
* javax/swing/AbstractAction.java: Reformated.
|
||||||
|
(getPropertyChangeListeners): New method.
|
||||||
|
* javax/swing/AbstractCellEditor.java: Reformated.
|
||||||
|
(getCellEditorListeners): New method.
|
||||||
|
* javax/swing/DefaultListSelectionModel.java
|
||||||
|
(listenerList): New field.
|
||||||
|
(listeners): Removed.
|
||||||
|
(get_listeners): Removed.
|
||||||
|
(addListSelectionListener): Rewritten.
|
||||||
|
(removeListSelectionListener): Rewritten.
|
||||||
|
(getListSelectionListeners): New method.
|
||||||
|
(getListeners): New method.
|
||||||
|
* javax/swing/JComboBox.java: Imports reworked.
|
||||||
|
(addActionListener): Implemented.
|
||||||
|
(removeActionListener): Implemented.
|
||||||
|
(addItemListener): Implemented.
|
||||||
|
(removeItemListener): Implemented.
|
||||||
|
(addPopupMenuListener): Implemented.
|
||||||
|
(removePopupMenuListener): Implemented.
|
||||||
|
(getActionListeners): New method.
|
||||||
|
(getItemListeners): New method.
|
||||||
|
(getPopupMenuListeners): New method.
|
||||||
|
|
||||||
2004-01-23 Michael Koch <konqueror@gmx.de>
|
2004-01-23 Michael Koch <konqueror@gmx.de>
|
||||||
|
|
||||||
* gnu/java/net/protocol/http/Connection.java
|
* gnu/java/net/protocol/http/Connection.java
|
||||||
|
|
|
||||||
|
|
@ -56,10 +56,6 @@ public abstract class AbstractAction
|
||||||
{
|
{
|
||||||
static final long serialVersionUID = -6803159439231523484L;
|
static final long serialVersionUID = -6803159439231523484L;
|
||||||
|
|
||||||
//-------------------------------------------------------------
|
|
||||||
// Variables --------------------------------------------------
|
|
||||||
//-------------------------------------------------------------
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* enabled
|
* enabled
|
||||||
*/
|
*/
|
||||||
|
|
@ -76,11 +72,6 @@ public abstract class AbstractAction
|
||||||
*/
|
*/
|
||||||
private transient HashMap store = new HashMap();
|
private transient HashMap store = new HashMap();
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------------------
|
|
||||||
// Initialization ---------------------------------------------
|
|
||||||
//-------------------------------------------------------------
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor AbstractAction
|
* Constructor AbstractAction
|
||||||
*/
|
*/
|
||||||
|
|
@ -106,11 +97,6 @@ public abstract class AbstractAction
|
||||||
putValue(SMALL_ICON, icon);
|
putValue(SMALL_ICON, icon);
|
||||||
} // AbstractAction()
|
} // AbstractAction()
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------------------
|
|
||||||
// Methods ----------------------------------------------------
|
|
||||||
//-------------------------------------------------------------
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* readObject
|
* readObject
|
||||||
* @param stream TODO
|
* @param stream TODO
|
||||||
|
|
@ -185,28 +171,46 @@ public abstract class AbstractAction
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* firePropertyChange
|
* firePropertyChange
|
||||||
|
*
|
||||||
* @param propertyName TODO
|
* @param propertyName TODO
|
||||||
* @param oldValue TODO
|
* @param oldValue TODO
|
||||||
* @param newValue TODO
|
* @param newValue TODO
|
||||||
*/
|
*/
|
||||||
protected void firePropertyChange(String propertyName,
|
protected void firePropertyChange(String propertyName, Object oldValue,
|
||||||
Object oldValue, Object newValue) {
|
Object newValue)
|
||||||
|
{
|
||||||
changeSupport.firePropertyChange(propertyName, oldValue, newValue);
|
changeSupport.firePropertyChange(propertyName, oldValue, newValue);
|
||||||
} // firePropertyChange()
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* addPropertyChangeListener
|
* addPropertyChangeListener
|
||||||
* @param listener TODO
|
*
|
||||||
|
* @param listener the listener to add
|
||||||
*/
|
*/
|
||||||
public synchronized void addPropertyChangeListener(PropertyChangeListener listener) {
|
public void addPropertyChangeListener(PropertyChangeListener listener)
|
||||||
|
{
|
||||||
changeSupport.addPropertyChangeListener(listener);
|
changeSupport.addPropertyChangeListener(listener);
|
||||||
} // addPropertyChangeListener()
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* removePropertyChangeListener
|
* removePropertyChangeListener
|
||||||
* @param listener TODO
|
*
|
||||||
|
* @param listener the listener to remove
|
||||||
*/
|
*/
|
||||||
public synchronized void removePropertyChangeListener(PropertyChangeListener listener) {
|
public void removePropertyChangeListener(PropertyChangeListener listener)
|
||||||
|
{
|
||||||
changeSupport.removePropertyChangeListener(listener);
|
changeSupport.removePropertyChangeListener(listener);
|
||||||
} // removePropertyChangeListener()
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns all registered listeners.
|
||||||
|
*
|
||||||
|
* @return array of listeners.
|
||||||
|
*
|
||||||
|
* @since 1.4
|
||||||
|
*/
|
||||||
|
public PropertyChangeListener[] getPropertyChangeListeners()
|
||||||
|
{
|
||||||
|
return changeSupport.getPropertyChangeListeners();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -54,10 +54,6 @@ public abstract class AbstractCellEditor
|
||||||
{
|
{
|
||||||
static final long serialVersionUID = -1048006551406220959L;
|
static final long serialVersionUID = -1048006551406220959L;
|
||||||
|
|
||||||
//-------------------------------------------------------------
|
|
||||||
// Variables --------------------------------------------------
|
|
||||||
//-------------------------------------------------------------
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* listenerList
|
* listenerList
|
||||||
*/
|
*/
|
||||||
|
|
@ -68,11 +64,6 @@ public abstract class AbstractCellEditor
|
||||||
*/
|
*/
|
||||||
protected transient ChangeEvent changeEvent;
|
protected transient ChangeEvent changeEvent;
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------------------
|
|
||||||
// Initialization ---------------------------------------------
|
|
||||||
//-------------------------------------------------------------
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor AbstractCellEditor
|
* Constructor AbstractCellEditor
|
||||||
*/
|
*/
|
||||||
|
|
@ -80,11 +71,6 @@ public abstract class AbstractCellEditor
|
||||||
// TODO
|
// TODO
|
||||||
} // AbstractCellEditor()
|
} // AbstractCellEditor()
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------------------
|
|
||||||
// Methods ----------------------------------------------------
|
|
||||||
//-------------------------------------------------------------
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* isCellEditable
|
* isCellEditable
|
||||||
* @param event TODO
|
* @param event TODO
|
||||||
|
|
@ -118,41 +104,67 @@ public abstract class AbstractCellEditor
|
||||||
// TODO
|
// TODO
|
||||||
} // cancelCellEditing()
|
} // cancelCellEditing()
|
||||||
|
|
||||||
/**
|
|
||||||
* addCellEditorListener
|
|
||||||
* @param listener TODO
|
|
||||||
*/
|
|
||||||
public void addCellEditorListener(CellEditorListener listener) {
|
|
||||||
// TODO
|
|
||||||
} // addCellEditorListener()
|
|
||||||
|
|
||||||
/**
|
|
||||||
* removeCellEditorListener
|
|
||||||
* @param listener TODO
|
|
||||||
*/
|
|
||||||
public void removeCellEditorListener(CellEditorListener listener) {
|
|
||||||
// TODO
|
|
||||||
} // removeCellEditorListener()
|
|
||||||
|
|
||||||
/**
|
|
||||||
* fireEditingStopped
|
|
||||||
*/
|
|
||||||
protected void fireEditingStopped() {
|
|
||||||
// TODO
|
|
||||||
} // fireEditingStopped()
|
|
||||||
|
|
||||||
/**
|
|
||||||
* fireEditingCanceled
|
|
||||||
*/
|
|
||||||
protected void fireEditingCanceled() {
|
|
||||||
// TODO
|
|
||||||
} // fireEditingCanceled()
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getCellEditorValue
|
* getCellEditorValue
|
||||||
* @returns Object
|
* @returns Object
|
||||||
*/
|
*/
|
||||||
public abstract Object getCellEditorValue();
|
public abstract Object getCellEditorValue();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* addCellEditorListener
|
||||||
|
*
|
||||||
|
* @param listener The listener to add
|
||||||
|
*/
|
||||||
|
public void addCellEditorListener (CellEditorListener listener)
|
||||||
|
{
|
||||||
|
listenerList.add (CellEditorListener.class, listener);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* removeCellEditorListener
|
||||||
|
*
|
||||||
|
* @param listener The listener to remove
|
||||||
|
*/
|
||||||
|
public void removeCellEditorListener (CellEditorListener listener)
|
||||||
|
{
|
||||||
|
listenerList.remove (CellEditorListener.class, listener);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* getCellEditorListeners
|
||||||
|
*
|
||||||
|
* @since 1.4
|
||||||
|
*/
|
||||||
|
public CellEditorListener[] getCellEditorListeners()
|
||||||
|
{
|
||||||
|
return (CellEditorListener[]) listenerList.getListeners (CellEditorListener.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* fireEditingStopped
|
||||||
|
*/
|
||||||
|
protected void fireEditingStopped()
|
||||||
|
{
|
||||||
|
CellEditorListener[] listeners = getCellEditorListeners();
|
||||||
|
|
||||||
|
for (int index = 0; index < listeners.length; index++)
|
||||||
|
{
|
||||||
|
listeners [index].editingStopped (changeEvent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* fireEditingCanceled
|
||||||
|
*/
|
||||||
|
protected void fireEditingCanceled()
|
||||||
|
{
|
||||||
|
CellEditorListener[] listeners = getCellEditorListeners();
|
||||||
|
|
||||||
|
for (int index = 0; index < listeners.length; index++)
|
||||||
|
{
|
||||||
|
listeners [index].editingCanceled (changeEvent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
} // AbstractCellEditor
|
} // AbstractCellEditor
|
||||||
|
|
|
||||||
|
|
@ -42,32 +42,18 @@ import java.io.Serializable;
|
||||||
import java.util.EventListener;
|
import java.util.EventListener;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
import javax.swing.event.EventListenerList;
|
import javax.swing.event.EventListenerList;
|
||||||
|
import javax.swing.event.ListSelectionEvent;
|
||||||
import javax.swing.event.ListSelectionListener;
|
import javax.swing.event.ListSelectionListener;
|
||||||
|
|
||||||
public class DefaultListSelectionModel implements Cloneable, ListSelectionModel, Serializable
|
public class DefaultListSelectionModel implements Cloneable, ListSelectionModel, Serializable
|
||||||
{
|
{
|
||||||
|
private EventListenerList listenerList = new EventListenerList();
|
||||||
|
|
||||||
int mode = SINGLE_SELECTION;
|
int mode = SINGLE_SELECTION;
|
||||||
|
|
||||||
Vector sel = new Vector();
|
Vector sel = new Vector();
|
||||||
|
|
||||||
Vector listeners;
|
|
||||||
|
|
||||||
Vector get_listeners()
|
|
||||||
{
|
{
|
||||||
if (listeners == null)
|
|
||||||
listeners = new Vector();
|
|
||||||
return listeners;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void addListSelectionListener(ListSelectionListener listener)
|
|
||||||
{
|
|
||||||
get_listeners().addElement(listener);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void removeListSelectionListener(ListSelectionListener listener)
|
|
||||||
{
|
|
||||||
get_listeners().removeElement(listener);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class Range
|
class Range
|
||||||
|
|
@ -182,4 +168,24 @@ public class DefaultListSelectionModel implements Cloneable, ListSelectionModel,
|
||||||
|
|
||||||
sel.addElement(new Range(index0, index1));
|
sel.addElement(new Range(index0, index1));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void addListSelectionListener(ListSelectionListener listener)
|
||||||
|
{
|
||||||
|
listenerList.add (ListSelectionListener.class, listener);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void removeListSelectionListener(ListSelectionListener listener)
|
||||||
|
{
|
||||||
|
listenerList.remove (ListSelectionListener.class, listener);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ListSelectionListener[] getListSelectionListeners()
|
||||||
|
{
|
||||||
|
return (ListSelectionListener[]) getListeners (ListSelectionListener.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public EventListener[] getListeners (Class listenerType)
|
||||||
|
{
|
||||||
|
return listenerList.getListeners (listenerType);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -38,14 +38,27 @@ exception statement from your version. */
|
||||||
|
|
||||||
package javax.swing;
|
package javax.swing;
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.ItemSelectable;
|
||||||
import java.awt.event.*;
|
import java.awt.event.ActionEvent;
|
||||||
import java.beans.*;
|
import java.awt.event.ActionListener;
|
||||||
import java.io.*;
|
import java.awt.event.ItemEvent;
|
||||||
import java.util.*;
|
import java.awt.event.ItemListener;
|
||||||
import javax.accessibility.*;
|
import java.awt.event.KeyEvent;
|
||||||
import javax.swing.event.*;
|
import java.beans.PropertyChangeListener;
|
||||||
import javax.swing.plaf.*;
|
import java.io.IOException;
|
||||||
|
import java.io.ObjectOutputStream;
|
||||||
|
import java.util.Vector;
|
||||||
|
import javax.accessibility.Accessible;
|
||||||
|
import javax.accessibility.AccessibleContext;
|
||||||
|
import javax.accessibility.AccessibleAction;
|
||||||
|
import javax.accessibility.AccessibleRole;
|
||||||
|
import javax.accessibility.AccessibleSelection;
|
||||||
|
import javax.swing.event.MenuEvent;
|
||||||
|
import javax.swing.event.MenuListener;
|
||||||
|
import javax.swing.event.ListDataEvent;
|
||||||
|
import javax.swing.event.ListDataListener;
|
||||||
|
import javax.swing.event.PopupMenuListener;
|
||||||
|
import javax.swing.plaf.ComboBoxUI;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* JComboBox
|
* JComboBox
|
||||||
|
|
@ -579,38 +592,6 @@ public class JComboBox extends JComponent
|
||||||
return false; // TODO
|
return false; // TODO
|
||||||
} // isPopupVisible()
|
} // isPopupVisible()
|
||||||
|
|
||||||
/**
|
|
||||||
* addItemListener
|
|
||||||
* @param value0 TODO
|
|
||||||
*/
|
|
||||||
public void addItemListener(ItemListener value0) {
|
|
||||||
// TODO
|
|
||||||
} // addItemListener()
|
|
||||||
|
|
||||||
/**
|
|
||||||
* removeItemListener
|
|
||||||
* @param value0 TODO
|
|
||||||
*/
|
|
||||||
public void removeItemListener(ItemListener value0) {
|
|
||||||
// TODO
|
|
||||||
} // removeItemListener()
|
|
||||||
|
|
||||||
/**
|
|
||||||
* addActionListener
|
|
||||||
* @param value0 TODO
|
|
||||||
*/
|
|
||||||
public void addActionListener(ActionListener value0) {
|
|
||||||
// TODO
|
|
||||||
} // addActionListener()
|
|
||||||
|
|
||||||
/**
|
|
||||||
* removeActionListener
|
|
||||||
* @param value0 TODO
|
|
||||||
*/
|
|
||||||
public void removeActionListener(ActionListener value0) {
|
|
||||||
// TODO
|
|
||||||
} // removeActionListener()
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* setActionCommand
|
* setActionCommand
|
||||||
* @param value0 TODO
|
* @param value0 TODO
|
||||||
|
|
@ -834,6 +815,73 @@ public class JComboBox extends JComponent
|
||||||
} // if
|
} // if
|
||||||
return accessibleContext;
|
return accessibleContext;
|
||||||
} // getAccessibleContext()
|
} // getAccessibleContext()
|
||||||
|
/**
|
||||||
|
* addActionListener
|
||||||
|
* @param listener TODO
|
||||||
|
*/
|
||||||
|
public void addActionListener (ActionListener listener)
|
||||||
|
{
|
||||||
|
listenerList.add (ActionListener.class, listener);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* removeActionListener
|
||||||
|
* @param listener TODO
|
||||||
|
*/
|
||||||
|
public void removeActionListener (ActionListener listener)
|
||||||
|
{
|
||||||
|
listenerList.remove (ActionListener.class, listener);
|
||||||
|
}
|
||||||
|
|
||||||
} // JComboBox
|
/**
|
||||||
|
* @since 1.4
|
||||||
|
*/
|
||||||
|
public ActionListener[] getActionListeners()
|
||||||
|
{
|
||||||
|
return (ActionListener[]) getListeners (ActionListener.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* addItemListener
|
||||||
|
* @param listener TODO
|
||||||
|
*/
|
||||||
|
public void addItemListener(ItemListener listener)
|
||||||
|
{
|
||||||
|
listenerList.add (ItemListener.class, listener);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* removeItemListener
|
||||||
|
* @param listener TODO
|
||||||
|
*/
|
||||||
|
public void removeItemListener(ItemListener listener)
|
||||||
|
{
|
||||||
|
listenerList.remove (ItemListener.class, listener);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @since 1.4
|
||||||
|
*/
|
||||||
|
public ItemListener[] getItemListeners()
|
||||||
|
{
|
||||||
|
return (ItemListener[]) getListeners (ItemListener.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addPopupMenuListener (PopupMenuListener listener)
|
||||||
|
{
|
||||||
|
listenerList.add (PopupMenuListener.class, listener);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void removePopupMenuListener (PopupMenuListener listener)
|
||||||
|
{
|
||||||
|
listenerList.remove (PopupMenuListener.class, listener);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @since 1.4
|
||||||
|
*/
|
||||||
|
public PopupMenuListener[] getPopupMenuListeners()
|
||||||
|
{
|
||||||
|
return (PopupMenuListener[]) getListeners (PopupMenuListener.class);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue