/* AbstractCellEditor.java --
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
{
static final long serialVersionUID = -1048006551406220959L;
- /**
- * listenerList
- */
- protected EventListenerList listenerList;
+ /**
+ * listenerList
+ */
+ protected EventListenerList listenerList;
- /**
- * changeEvent
- */
- protected transient ChangeEvent changeEvent;
+ /**
+ * changeEvent
+ */
+ protected transient ChangeEvent changeEvent;
/**
* Constructor AbstractCellEditor
listeners [index].editingCanceled (changeEvent);
}
}
-
-
-} // AbstractCellEditor
+}
/* DefaultListSelectionModel.java --
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
public class DefaultListSelectionModel implements Cloneable, ListSelectionModel, Serializable
{
- private EventListenerList listenerList = new EventListenerList();
+ protected EventListenerList listenerList = new EventListenerList();
int mode = SINGLE_SELECTION;
Vector sel = new Vector();
- {
- }
-
class Range
{
int i0, i1;
sel.addElement(new Range(index0, index1));
}
+ /**
+ * Adds a listener.
+ *
+ * @param listener the listener to add
+ *
+ * @see removeListSelectionListener
+ * @see getListSelectionListeners
+ */
public void addListSelectionListener(ListSelectionListener listener)
{
listenerList.add (ListSelectionListener.class, listener);
}
+ /**
+ * Removes a registered listener.
+ *
+ * @param listener the listener to remove
+ *
+ * @see addListSelectionListener
+ * @see getListSelectionListeners
+ */
public void removeListSelectionListener(ListSelectionListener listener)
{
listenerList.remove (ListSelectionListener.class, listener);
}
-
- public ListSelectionListener[] getListSelectionListeners()
- {
- return (ListSelectionListener[]) getListeners (ListSelectionListener.class);
- }
+ /**
+ * Returns an array of all registerers listeners.
+ *
+ * @return the array
+ *
+ * @since 1.3
+ *
+ * @see getListSelectionListener
+ */
public EventListener[] getListeners (Class listenerType)
{
return listenerList.getListeners (listenerType);
}
+
+ /**
+ * Returns an array of all registerd list selection listeners.
+ *
+ * @return the array
+ *
+ * @since 1.4
+ *
+ * @see addListSelectionListener
+ * @see removeListSelectionListener
+ * @see getListeners
+ */
+ public ListSelectionListener[] getListSelectionListeners()
+ {
+ return (ListSelectionListener[]) getListeners (ListSelectionListener.class);
+ }
}