|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
issrg.utils.LDAP_DIT
This is a component that displays the LDAP DIT
This is a Panel that contains a display of the LDAP DIT. The location of the DIT is passed when constructing it. Then you can browse the DIT, and programs can send commands to update certain nodes (DIT structure update: created a node, created a child, deleted).
Nested Class Summary |
Nested classes inherited from class javax.swing.JPanel |
javax.swing.JPanel.AccessibleJPanel |
Nested classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
Nested classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
Nested classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
protected java.lang.String[] |
binaryAttrs
|
java.lang.String |
DEFAULT_ROOT_NAME
|
Fields inherited from class javax.swing.JComponent |
accessibleContext, listenerList, 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 | |
LDAP_DIT()
This constructor builds an empty tree and no DirContext connected to it. |
|
LDAP_DIT(javax.naming.directory.DirContext dc)
This constructor builds a tree starting with the given context. |
|
LDAP_DIT(java.lang.String url)
This constructor builds a tree, given the URL of the LDAP server to use as the root. |
Method Summary | |
static javax.naming.directory.DirContext |
connectTo(java.lang.String url)
This method creates a DirContext using the default LDAP provider (SUN), version (3). |
static javax.naming.directory.DirContext |
connectTo(java.lang.String url,
java.lang.String[] binaryAttrs)
This method creates a DirContext using the default LDAP provider (SUN), version (3) and the binary attributes that are provided. |
static java.lang.String |
dnWithoutBaseDN(javax.naming.directory.DirContext root,
java.lang.String dn)
This utility method strips off the base dn (the DN of the root context) from the given DN. |
java.lang.String[] |
getBinaryAttributes()
This method returns an array of attributes treated as binary by the DirContext. |
javax.naming.directory.DirContext |
getSelectedNode()
This method returns a DirContext corresponding to the selected node. |
void |
setBinaryAttributes(java.lang.String[] bin)
This methos sets which attributes should be treated as binary. |
void |
setEnabled(boolean enable)
Overriding the method so that the whole cascade of components is disabled or enabled. |
java.lang.String |
setRoot(javax.naming.directory.DirContext rootC)
This method sets a new Root Context for this Panel to display. |
java.lang.String |
setRoot(javax.naming.directory.DirContext rootC,
java.lang.String defaultRootName)
This method sets a new Root Context for this Panel to display. |
java.lang.String |
setRoot(java.lang.String url)
This method sets a new Root Context for this Panel to display using the LDAP URL as the reference to the root. |
void |
setSelectionListener(DITSelectionListener d)
This method sets a listener for two events: an item gets selected, or a user misses the tree (so it gets unselected, if anything). |
int |
showSelectionDialog(java.awt.Frame owner,
java.lang.String title)
Shows this LDAP_DIT object as a dialog modal to the owner Frame. |
static javax.naming.directory.DirContext |
showSelectionDialog(java.awt.Frame owner,
java.lang.String title,
javax.naming.directory.DirContext root)
This is a utility method that shows a dialog, where you can pick a LDAP entry and press OK or Cancel. |
Methods inherited from class javax.swing.JPanel |
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class javax.swing.JComponent |
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFont, setForeground, 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, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, 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, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, 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, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, 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 |
protected java.lang.String[] binaryAttrs
public final java.lang.String DEFAULT_ROOT_NAME
Constructor Detail |
public LDAP_DIT()
public LDAP_DIT(javax.naming.directory.DirContext dc) throws javax.naming.NamingException
dc
- - the DirContext of the root of the tree to be displayedpublic LDAP_DIT(java.lang.String url) throws javax.naming.NamingException
url
- - the String URL of the LDAP server to browseMethod Detail |
public java.lang.String setRoot(javax.naming.directory.DirContext rootC) throws javax.naming.NamingException
rootC
- DirContext to set as the root context for this view
javax.naming.NamingException
public java.lang.String setRoot(java.lang.String url) throws javax.naming.NamingException
url
- - the LDAP URL of the root to set.
javax.naming.NamingException
public java.lang.String[] getBinaryAttributes()
public void setBinaryAttributes(java.lang.String[] bin)
bin
- - the array of attributes to be treated as binaryconnectTo(java.lang.String)
public java.lang.String setRoot(javax.naming.directory.DirContext rootC, java.lang.String defaultRootName) throws javax.naming.NamingException
rootC
- DirContext to set as the root context for this view
javax.naming.NamingException
public javax.naming.directory.DirContext getSelectedNode() throws javax.naming.NamingException
javax.naming.NamingException
public void setSelectionListener(DITSelectionListener d)
d
- - the DITSelectionListener that handles all the eventspublic static javax.naming.directory.DirContext showSelectionDialog(java.awt.Frame owner, java.lang.String title, javax.naming.directory.DirContext root)
owner
- is the Frame, to which the dialog is displayed modallytitle
- is the title of the dialog displayedroot
- is the root Directory Context
actually,
- it does not throw anything, so if you want to process
the NamingExceptions that might otherwise be ignored, do the following:
ldit=new LDAP_DIT(root); ldit.showSelectionDialog(owner, title); ldit.getSelectedNode();
which is exactly what this routine does.
public int showSelectionDialog(java.awt.Frame owner, java.lang.String title)
owner
- is the Frame, to which the dialog is displayed modallytitle
- is the title of the dialog displayed
public static javax.naming.directory.DirContext connectTo(java.lang.String url) throws javax.naming.NamingException
url
- - the LDAP URL of the repository
javax.naming.NamingException
public static javax.naming.directory.DirContext connectTo(java.lang.String url, java.lang.String[] binaryAttrs) throws javax.naming.NamingException
url
- - the LDAP URL of the repository; should not be nullbinaryAttrs
- - the array of attributes to be used as binary; if null,
no attributes will be assumed binary
javax.naming.NamingException
public void setEnabled(boolean enable)
public static java.lang.String dnWithoutBaseDN(javax.naming.directory.DirContext root, java.lang.String dn) throws javax.naming.NamingException
root
- - the DirContext of the rootdn
- - the LDAP DN with or without the base DN
javax.naming.NamingException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |