common.gui
Class PopupList

java.lang.Object
  extended bycommon.gui.PopupList
All Implemented Interfaces:
java.util.EventListener, java.awt.event.FocusListener, java.awt.event.WindowListener

public class PopupList
extends java.lang.Object
implements java.awt.event.FocusListener, java.awt.event.WindowListener

A popup control for displaying a arbitrary list of items.


Constructor Summary
PopupList()
          Create a new PopupList.
PopupList(int visibleRowCount)
          Create a new PopupList.
 
Method Summary
 void addActionListener(java.awt.event.ActionListener listener)
          Add an java.awt.event.ActionListener.
 void cancel()
          Cancel the popup.
 void disableKeyStrokeCycling()
          Deprecated. As of CC 0.9.0, this method does nothing.
 void enableKeyStrokeCycling(java.lang.String anActionName)
          Deprecated. As of CC 0.9.0, this method does nothing.
 void focusGained(java.awt.event.FocusEvent evt)
           
 void focusLost(java.awt.event.FocusEvent evt)
           
 java.lang.Object getSelectedActualItem()
          Returns the selected actual item.
 ListItem getSelectedItem()
          Returns the selected item.
 void setItems(java.util.List theItems)
          Set the items to show.
 void setRequestTextAreaFocusOnCancel(boolean b)
          Set whether focus should go to the main text area if this popup is cancelled.
 void setSelectedActualItem(java.lang.Object actualItem)
          Sets the selected actual item.
 void show(org.gjt.sp.jedit.View view)
          Show this popup in a window.
static PopupList show(org.gjt.sp.jedit.View view, java.util.List items, java.awt.event.ActionListener listener)
          Show this popup.
static PopupList show(org.gjt.sp.jedit.View view, java.util.List items, java.lang.Object selectedActualItem, java.awt.event.ActionListener listener)
          Show this popup.
 void windowActivated(java.awt.event.WindowEvent evt)
          Handle a window activated event.
 void windowClosed(java.awt.event.WindowEvent evt)
          Handle a window closed event.
 void windowClosing(java.awt.event.WindowEvent evt)
          Handle a window closing event.
 void windowDeactivated(java.awt.event.WindowEvent evt)
          Handle a window deactivated event.
 void windowDeiconified(java.awt.event.WindowEvent evt)
          Handle a window deiconified event.
 void windowIconified(java.awt.event.WindowEvent evt)
          Handle a window iconified event.
 void windowOpened(java.awt.event.WindowEvent evt)
          Handle a window opened event.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PopupList

public PopupList()
Create a new PopupList.


PopupList

public PopupList(int visibleRowCount)
Create a new PopupList.

Method Detail

enableKeyStrokeCycling

public void enableKeyStrokeCycling(java.lang.String anActionName)
Deprecated. As of CC 0.9.0, this method does nothing.

Enable key stroke cycling.


disableKeyStrokeCycling

public void disableKeyStrokeCycling()
Deprecated. As of CC 0.9.0, this method does nothing.

Disable key stroke cycling.


setItems

public void setItems(java.util.List theItems)
Set the items to show.


getSelectedItem

public ListItem getSelectedItem()
Returns the selected item.


getSelectedActualItem

public java.lang.Object getSelectedActualItem()
Returns the selected actual item. This is equivalent of calling getSelectedItem().getActualItem().


setSelectedActualItem

public void setSelectedActualItem(java.lang.Object actualItem)
Sets the selected actual item.


setRequestTextAreaFocusOnCancel

public void setRequestTextAreaFocusOnCancel(boolean b)
Set whether focus should go to the main text area if this popup is cancelled. The default is false.


show

public void show(org.gjt.sp.jedit.View view)
Show this popup in a window.


cancel

public void cancel()
Cancel the popup.


addActionListener

public void addActionListener(java.awt.event.ActionListener listener)
Add an java.awt.event.ActionListener.


show

public static PopupList show(org.gjt.sp.jedit.View view,
                             java.util.List items,
                             java.lang.Object selectedActualItem,
                             java.awt.event.ActionListener listener)
Show this popup.

Parameters:
view - The view requesting the popup.
items - The list of ListItems to show.
selectedActualItem - The ListItem.getActualItem() that is selected.
listener - The java.awt.event.ActionListener to invoke when a selection is made.

show

public static PopupList show(org.gjt.sp.jedit.View view,
                             java.util.List items,
                             java.awt.event.ActionListener listener)
Show this popup.

Parameters:
view - The view requesting the popup.
items - The list of ListItems to show.
listener - The java.awt.event.ActionListener to invoke when a selection is made.

focusGained

public final void focusGained(java.awt.event.FocusEvent evt)
Specified by:
focusGained in interface java.awt.event.FocusListener

focusLost

public final void focusLost(java.awt.event.FocusEvent evt)
Specified by:
focusLost in interface java.awt.event.FocusListener

windowClosing

public final void windowClosing(java.awt.event.WindowEvent evt)
Handle a window closing event.

Specified by:
windowClosing in interface java.awt.event.WindowListener

windowClosed

public final void windowClosed(java.awt.event.WindowEvent evt)
Handle a window closed event.

Specified by:
windowClosed in interface java.awt.event.WindowListener

windowOpened

public final void windowOpened(java.awt.event.WindowEvent evt)
Handle a window opened event.

Specified by:
windowOpened in interface java.awt.event.WindowListener

windowActivated

public final void windowActivated(java.awt.event.WindowEvent evt)
Handle a window activated event.

Specified by:
windowActivated in interface java.awt.event.WindowListener

windowDeactivated

public final void windowDeactivated(java.awt.event.WindowEvent evt)
Handle a window deactivated event.

Specified by:
windowDeactivated in interface java.awt.event.WindowListener

windowIconified

public final void windowIconified(java.awt.event.WindowEvent evt)
Handle a window iconified event.

Specified by:
windowIconified in interface java.awt.event.WindowListener

windowDeiconified

public final void windowDeiconified(java.awt.event.WindowEvent evt)
Handle a window deiconified event.

Specified by:
windowDeiconified in interface java.awt.event.WindowListener