edu.neu.ccs.gui
Interface StringObjectView

All Superinterfaces:
JPTConstants, SwingConstants
All Known Implementing Classes:
StringObjectDropdown, StringObjectRadioPanel

public interface StringObjectView
extends JPTConstants

The interface for views designed to permit the selection of an object using an associated string in a StringObjectMap.

Since:
2.3
Version:
2.3

Field Summary
static String VIEW_STATE
          Bound property name for the view state.
 
Fields inherited from interface edu.neu.ccs.util.JPTConstants
ABOVE, ALIGNMENT, BELOW, BOTTOM_LEFT, BOTTOM_RIGHT, DEFAULT, FONT, INPUT_PROPERTIES, MANDATORY, OPTIONAL, ORIENTATION, TOP_LEFT, TOP_RIGHT, VALUE
 
Fields inherited from interface javax.swing.SwingConstants
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
 
Method Summary
 void addActionListener(ActionListener listener)
          Adds an ActionListener.
 Object getSelectedObject()
          Returns the object corresponding to the currently selected string in the view.
 String getSelectedString()
          Returns the currently selected string in the view.
 void removeActionListener(ActionListener listener)
          Removes an ActionListener.
 void setSelectedObject(Object object)
          Sets the view to the string corresponding to the given object.
 void setSelectedString(String string)
          Sets the view to the string provided that the string is in the internal map.
 

Field Detail

VIEW_STATE

public static final String VIEW_STATE
Bound property name for the view state.

See Also:
Constant Field Values
Method Detail

getSelectedString

public String getSelectedString()
Returns the currently selected string in the view.

Returns:
the selected string
See Also:
getSelectedObject()

getSelectedObject

public Object getSelectedObject()
Returns the object corresponding to the currently selected string in the view.

Returns:
the selected object
See Also:
getSelectedString()

setSelectedString

public void setSelectedString(String string)

Sets the view to the string provided that the string is in the internal map.

Does nothing if the string is null or is not in the internal map.

Does nothing if the view state will be unchanged.

Parameters:
string - the string to use to set the view
See Also:
setSelectedObject(Object)

setSelectedObject

public void setSelectedObject(Object object)

Sets the view to the string corresponding to the given object.

Does nothing if the object is null or is not in the internal map.

Parameters:
object - the object to use to set the view
See Also:
setSelectedString(String)

addActionListener

public void addActionListener(ActionListener listener)
Adds an ActionListener.

Parameters:
listener - the ActionListener that is to be notified
See Also:
removeActionListener(ActionListener)

removeActionListener

public void removeActionListener(ActionListener listener)
Removes an ActionListener.

Parameters:
listener - the ActionListener to remove
See Also:
addActionListener(ActionListener)