com.submersion.jspshop.adminlist
Class AdminList

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Panel
                    |
                    +--java.applet.Applet
                          |
                          +--javax.swing.JApplet
                                |
                                +--com.submersion.jspshop.adminlist.AdminList
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, javax.swing.RootPaneContainer, java.io.Serializable

public class AdminList
extends javax.swing.JApplet

An applet using a JList to show a representation of data in a list. Such as TypeNames.

See Also:
NetConnect, Serialized Form

Inner Class Summary
private  class AdminList.ListHandler
           
private  class AdminList.PopupHandler
           
 
Inner classes inherited from class javax.swing.JApplet
javax.swing.JApplet.AccessibleJApplet
 
Inner classes inherited from class java.applet.Applet
java.applet.Applet.AccessibleApplet
 
Inner classes inherited from class java.awt.Panel
java.awt.Panel.AccessibleAWTPanel
 
Inner classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Inner classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.AWTTreeLock
 
Field Summary
private  java.lang.String addMode
          The AddMode parameter from the Applet tag.
private  java.lang.String clickParam
          The ClickParam parameter from the Applet tag.
private  java.lang.String clickURL
          The ClickURL parameter from the Applet tag.
private  java.lang.String deleteMode
          The DeleteMode parameter from the Applet tag.
private  java.util.HashMap indices
          Contains the index of the List, and the ID of the actual ListItem.
private  javax.swing.JList list
          The actual Swing object used for the List
private  javax.swing.DefaultListModel listModel
          Used for the underlying data structure.
private  java.lang.String modeParam
          The ModeParam parameter from the Applet tag.
private  java.lang.String url
          The URL for NetConnect to get data from.
 
Fields inherited from class javax.swing.JApplet
accessibleContext, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.applet.Applet
serialVersionUID, stub
 
Fields inherited from class java.awt.Panel
base, nameCounter
 
Fields inherited from class java.awt.Container
component, containerListener, containerSerializedDataVersion, dbg, dispatcher, layoutMgr, listeningBoundsChildren, listeningChildren, maxSize, ncomponents, printing, printingThreads
 
Fields inherited from class java.awt.Component
actionListenerK, adjustmentListenerK, appContext, background, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, changeSupport, componentListener, componentListenerK, componentOrientation, componentSerializedDataVersion, containerListenerK, cursor, dropTarget, enabled, eventMask, focusListener, focusListenerK, font, foreground, graphicsConfig, hasFocus, height, hierarchyBoundsListener, hierarchyBoundsListenerK, hierarchyListener, hierarchyListenerK, incRate, inputMethodListener, inputMethodListenerK, isInc, isPacked, itemListenerK, keyListener, keyListenerK, LEFT_ALIGNMENT, locale, LOCK, metrics, minSize, mouseListener, mouseListenerK, mouseMotionListener, mouseMotionListenerK, name, nameExplicitlySet, newEventsOnly, ownedWindowK, parent, peer, peerFont, popups, prefSize, privateKey, RIGHT_ALIGNMENT, textListenerK, TOP_ALIGNMENT, valid, visible, width, windowClosingException, windowListenerK, x, y
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
AdminList()
           
 
Method Summary
 void init()
          Gets the parameters from the Applet tags, populates the default data, adds the listeners for the JList, and displays the JList in the applet.
private  void initialiseProperties()
          Reads all the properties passed in the Applet tag, validates them, and then stores them locally.
private  void openMode(int selectedIndex, java.lang.String mode)
          Called to create the URL for a Mode event and the sends the browser to that URL.
private  void openNode(int selectedIndex)
          Called to create the URL for an Open event and the sends the browser to that URL.
private  void populateData()
          Using NetConnect, connects to the URL (specified by the URL parameter), and tries to retrieve the data there.
 
Methods inherited from class javax.swing.JApplet
addImpl, createRootPane, createRootPaneException, getAccessibleContext, getContentPane, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isRootPaneCheckingEnabled, paramString, processKeyEvent, remove, setContentPane, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update
 
Methods inherited from class java.applet.Applet
destroy, getAppletContext, getAppletInfo, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus, start, stop
 
Methods inherited from class java.awt.Panel
, addNotify, constructComponentName
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, adjustListeningChildren, applyOrientation, checkGD, countComponents, createChildHierarchyEvents, createHierarchyEvents, deliverEvent, dispatchEventImpl, dispatchEventToSelf, doLayout, eventEnabled, findComponentAt, findComponentAt, findComponentAt, getAccessibleAt, getAccessibleChild, getAccessibleChildrenCount, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents_NoClientCode, getComponents, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMouseEventTarget, getPreferredSize, getWindow, initIDs, insets, invalidate, invalidateTree, isAncestorOf, layout, lightweightPaint, lightweightPrint, list, list, locate, minimumSize, nextFocus, numListening, paint, paintComponents, paintHeavyweightComponents, postProcessKeyEvent, postsOldMouseEvents, preferredSize, preProcessKeyEvent, print, printComponents, printHeavyweightComponents, processContainerEvent, processEvent, proxyEnableEvents, proxyRequestFocus, readObject, remove, removeAll, removeContainerListener, removeNotify, setFocusOwner, setFont, transferFocus, validate, validateTree, writeObject
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, areInputMethodsEnabled, bounds, checkImage, checkImage, checkWindowClosingException, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAccessibleIndexInParent, getAccessibleStateSet, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont_NoClientCode, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getInputContext, getInputMethodRequests, getLocation, getLocation, getLocationOnScreen_NoTreeLock, getLocationOnScreen, getName, getNativeContainer, getParent_NoClientCode, getParent, getPeer, getSize, getSize, getToolkit, getToolkitImpl, getTreeLock, getWidth, getWindowForObject, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isEnabledImpl, isFocusTraversable, isLightweight, isOpaque, isRecursivelyVisible, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, resetGC, reshape, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

indices

private java.util.HashMap indices
Contains the index of the List, and the ID of the actual ListItem.

clickURL

private java.lang.String clickURL
The ClickURL parameter from the Applet tag. Contains the URL that is used when a List Item is opened.

clickParam

private java.lang.String clickParam
The ClickParam parameter from the Applet tag. Contains the parameter name that is used to represnt the List item being opened.

listModel

private javax.swing.DefaultListModel listModel
Used for the underlying data structure.

list

private javax.swing.JList list
The actual Swing object used for the List

url

private java.lang.String url
The URL for NetConnect to get data from.

addMode

private java.lang.String addMode
The AddMode parameter from the Applet tag. Contains the Mode value for Adding new Items.

modeParam

private java.lang.String modeParam
The ModeParam parameter from the Applet tag. Contains the parameter name for specifying the mode of the call.

deleteMode

private java.lang.String deleteMode
The DeleteMode parameter from the Applet tag. Contains the Mode value for deleting.
Constructor Detail

AdminList

public AdminList()
Method Detail

init

public void init()
Gets the parameters from the Applet tags, populates the default data, adds the listeners for the JList, and displays the JList in the applet.
Overrides:
init in class java.applet.Applet

populateData

private void populateData()
Using NetConnect, connects to the URL (specified by the URL parameter), and tries to retrieve the data there. Then populates the List with that data.

initialiseProperties

private void initialiseProperties()
Reads all the properties passed in the Applet tag, validates them, and then stores them locally.

openNode

private void openNode(int selectedIndex)
Called to create the URL for an Open event and the sends the browser to that URL.
Parameters:
selectedIndex - The index of the item that was selected.

openMode

private void openMode(int selectedIndex,
                      java.lang.String mode)
Called to create the URL for a Mode event and the sends the browser to that URL.
Parameters:
selectedIndex - Index of the item selected.
mode - Mode to be constructed. For example: add,delete