Package jade.gui

Class VisualStringList

  • All Implemented Interfaces:
    ImageObserver, MenuContainer, Serializable, Accessible
    Direct Known Subclasses:
    VisualAIDList, VisualAPServiceList, VisualPropertiesList, VisualServicesList

    public class VisualStringList
    extends JPanel
    This class extends JPanel in order to provide a panel to show a list of string. Clicking the right button of the mouse a popUp menu with the allowed operations is showed. The method setEnabled permits to set the operation allowed. If enabled, three are the operation allowed: Add new item, Edit an existing item, Remove a selected item; otherwise only the view operation is allowed. Double clicking on a selected item permits the view/edit on it Example of using this class: JDialog d = new JDialog(); ... ArrayList a = new ArrayList(); a.add("element"); .... VisualStringList listGui = new VisualStringList(a.iterator); list.setEnabled(true); // to sets the popUpMenu to show the three choices Add Edit Remove list.setDimension(new Dimension(..,..)); d.getContentPane.().add(listGui); If the user needs to show more complex items, can extend this class and override the needed methods.
    Version:
    $Date$ $Revision$
    Author:
    Tiziana Trucco - CSELT S.p.A
    See Also:
    Serialized Form
    • Constructor Detail

      • VisualStringList

        public VisualStringList​(Iterator content,
                                Component ownerGui)
        Constructor of a panel showing a list of strings. By default the panel is editable and all the three operations (Add - Edit - Remove) are allowed.
        Parameters:
        content - an iterator of the items to show in the panel
    • Method Detail

      • setEnabled

        public void setEnabled​(boolean enabled)
        Use this method to enable/disable the Add and Remove fields of the popUp menu.
        Overrides:
        setEnabled in class JComponent
      • getElementName

        protected String getElementName​(Object el)
        This method returns the string that will be shown on the panel. Can be override by subclasses for more complex elements.
      • removeElement

        protected void removeElement​(Object el)
      • resetContent

        protected void resetContent​(Iterator content)
      • editElement

        protected Object editElement​(Object el,
                                     boolean isEditable)
      • getContent

        public Enumeration getContent()
        Returns the list of items
      • setDimension

        public void setDimension​(Dimension d)
        Sets the dimension of the panel.