|
|||||||||
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.LDAP_DIT
public class 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/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 | |
---|---|
protected java.lang.String[] |
binaryAttrs
|
static java.lang.String |
DEFAULT_ROOT_NAME
|
static java.lang.String |
NO_TIMEOUT
|
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. |
static java.lang.String |
getConnectionTimeoutValue()
|
javax.naming.directory.DirContext |
getSelectedNode()
This method returns a DirContext corresponding to the selected node. |
void |
new_Tree()
Resets GUI part of the DIT Panel to display a new tree: just a root node, nothing more. |
void |
setBinaryAttributes(java.lang.String[] bin)
This methos sets which attributes should be treated as binary. |
static void |
setConnectionTimeoutValue(java.lang.String time)
|
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, 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 |
---|
protected java.lang.String[] binaryAttrs
public static final java.lang.String DEFAULT_ROOT_NAME
public static final java.lang.String NO_TIMEOUT
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 displayed
javax.naming.NamingException
public LDAP_DIT(java.lang.String url) throws javax.naming.NamingException
url
- - the String URL of the LDAP server to browse
javax.naming.NamingException
Method 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 new_Tree()
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 static java.lang.String getConnectionTimeoutValue()
public static void setConnectionTimeoutValue(java.lang.String time)
public void setEnabled(boolean enable)
setEnabled
in class javax.swing.JComponent
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 |