|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent javax.swing.JPanel issrg.utils.gui.repository.WebDAV_DIT
public class WebDAV_DIT
The WebDAV_DIT class is a JPanel which has a single JTree in its Content Pane , which will display the Directory Information Tree for the WebDAV server. Construct it with the host (IP address or FQDN) and port number to your WebDAV server. Handle the fireWebDAV_DIT_valueChanged() event, to get the DN selected on the JTree and any ACs and AC file names under the DN.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
javax.swing.JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
javax.swing.JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
java.awt.Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
---|---|
static java.lang.String |
ace
|
protected javax.swing.event.EventListenerList |
listenerList
Create the listener list |
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
WebDAV_DIT(WebDAVSocket socket,
java.lang.String host,
int port)
|
|
WebDAV_DIT(WebDAVSocket socket,
java.lang.String host,
int port,
boolean collectionsOnly)
|
Method Summary | |
---|---|
void |
addMyEventListener(WebDAV_DIT_Listener listener)
This methods allows classes to register for WebDAV_DIT_Events |
void |
clearCollections()
Method to clear the collections in the tree. |
void |
convertDN2URI(java.lang.String dn)
Utility method to convert a DN to a URI. |
java.lang.String[] |
get$ACNames()
|
byte[] |
getAC(java.lang.String[] acsName,
int i)
Gets an AC under the current DN. |
AttributeCertificate[] |
getACs()
|
java.lang.String |
getDn()
|
java.lang.String |
getDnToURI()
|
java.lang.String |
getErrorMessage()
|
java.lang.String |
getHost()
|
int |
getPort()
|
java.lang.String[] |
getSplitDN()
|
void |
removeMyEventListener(WebDAV_DIT_Listener listener)
This methods allows classes to unregister for WebDAV_DIT_Events |
void |
setDn(java.lang.String dn)
|
void |
setEnabled(boolean enabled)
Method that overrides the WebDAV_DIT setEnabled. |
void |
setHost(java.lang.String host)
|
void |
setPort(int port)
|
void |
setResources(java.lang.String dir)
Sets the resources found under the collection specified. |
void |
setRoot(java.lang.Object o)
|
void |
setSelectionListener(javax.swing.event.TreeSelectionEvent tse)
update java doc |
void |
setSocket(WebDAVSocket socket)
|
void |
testConnection(java.lang.String uri)
Utility method to test the connection to the host:port. |
void |
treeWillCollapse(javax.swing.event.TreeExpansionEvent event)
Not implemented. |
void |
treeWillExpand(javax.swing.event.TreeExpansionEvent event)
Updates the tree structure when the tree is about to expand, i.e. |
void |
updateCollections()
Method to update the collections in the tree. |
void |
valueChanged(javax.swing.event.TreeSelectionEvent tse)
WebDAV_DIT internally handles the JTree valueChanged() event and fires its own custom event, so classes which implement this class can be notified of the event. |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class javax.swing.JComponent |
---|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
Methods inherited from class java.awt.Container |
---|
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
Methods inherited from class java.awt.Component |
---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String ace
protected javax.swing.event.EventListenerList listenerList
Constructor Detail |
---|
public WebDAV_DIT(WebDAVSocket socket, java.lang.String host, int port)
socket
- any class that implements the WebDAVSocket interfacehost
- e.g. the IP address (127.0.0.1) or FQDN (mysite.org)port
- e.g. 80 for HTTP and 443 for HTTPSpublic WebDAV_DIT(WebDAVSocket socket, java.lang.String host, int port, boolean collectionsOnly)
socket
- any class that implements the WebDAVSocket interfacehost
- e.g. the IP address (127.0.0.1) or FQDN (mysite.org)port
- e.g. 80 for HTTP and 443 for HTTPScollectionsOnly
- true if you do not want to retrieve resourcesMethod Detail |
---|
public void convertDN2URI(java.lang.String dn)
dn
- public void testConnection(java.lang.String uri) throws HTTPMessageException
uri
-
HTTPMessageException
- - if conneection fails.public void clearCollections()
public void updateCollections() throws HTTPMessageException
HTTPMessageException
- on errorpublic void setRoot(java.lang.Object o)
public void setResources(java.lang.String dir) throws HTTPMessageException
dir
- the name of the collection
HTTPMessageException
- on errorpublic void treeWillCollapse(javax.swing.event.TreeExpansionEvent event) throws javax.swing.tree.ExpandVetoException
treeWillCollapse
in interface javax.swing.event.TreeWillExpandListener
javax.swing.tree.ExpandVetoException
public void treeWillExpand(javax.swing.event.TreeExpansionEvent event) throws javax.swing.tree.ExpandVetoException
treeWillExpand
in interface javax.swing.event.TreeWillExpandListener
javax.swing.tree.ExpandVetoException
public void valueChanged(javax.swing.event.TreeSelectionEvent tse)
Gets the currently selected node in the tree and generates the URI. Calls the setResources method to find any resources under the collection. If there is none sets $ACs to null, otherwise retrieves every AC and updates the $ACNames with each ACs file name, and $ACs with each byte[] representation of the AC. Fire fireWebDAV_DIT_valueChanged to notify that DN, $ACs, and $ACNames have been updated.
valueChanged
in interface javax.swing.event.TreeSelectionListener
public void setSelectionListener(javax.swing.event.TreeSelectionEvent tse)
public byte[] getAC(java.lang.String[] acsName, int i) throws HTTPMessageException, java.io.IOException
acsName
- - array of AC names found under the current DN.i
- - the index of the AC name we want to retrieve (GET).
HTTPMessageException
- - if connection to host:port fails.
java.io.IOException
- - if base64 decoder fails.public AttributeCertificate[] getACs()
public java.lang.String[] get$ACNames()
public java.lang.String[] getSplitDN()
public java.lang.String getDnToURI()
public java.lang.String getDn()
public void setDn(java.lang.String dn)
public java.lang.String getErrorMessage()
public java.lang.String getHost()
public void setHost(java.lang.String host)
public int getPort()
public void setPort(int port)
public void setSocket(WebDAVSocket socket)
public void setEnabled(boolean enabled)
setEnabled
in class javax.swing.JComponent
public void addMyEventListener(WebDAV_DIT_Listener listener)
listener
- public void removeMyEventListener(WebDAV_DIT_Listener listener)
listener
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |