Class ViewEntryPanel
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JPanel
-
- org.opends.guitools.controlpanel.ui.StatusGenericPanel
-
- org.opends.guitools.controlpanel.ui.ViewEntryPanel
-
- All Implemented Interfaces:
ImageObserver,MenuContainer,Serializable,Accessible,ConfigChangeListener
- Direct Known Subclasses:
LDIFViewEntryPanel
public abstract class ViewEntryPanel extends StatusGenericPanel
Abstract class containing code shared by the different LDAP entry view panels (Simplified View, Attribute View and LDIF View).- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.opends.guitools.controlpanel.ui.StatusGenericPanel
StatusGenericPanel.IgnoreItemListener
-
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
-
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
-
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
-
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
-
-
Field Summary
Fields Modifier and Type Field Description protected static booleandisplayOnlyWithAttrsStatic boolean used to know whether only attributes with values should be displayed or not.protected SortedSet<String>editableOperationalAttrNamesThe editable operational attributes.protected booleanignoreEntryChangeEventsWhether the entry change events should be ignored or not.protected SortedSet<String>schemaReadOnlyAttributesThe read-only attributes as they appear on the schema.protected SortedSet<String>schemaReadOnlyAttributesLowerCaseThe read-only attributes in lower case.-
Fields inherited from class org.opends.guitools.controlpanel.ui.StatusGenericPanel
COMBO_SEPARATOR, errorPane, NOT_APPLICABLE
-
Fields inherited from class javax.swing.JComponent
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
accessibleContext, 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
Constructors Constructor Description ViewEntryPanel()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddLDAPEntryChangedListener(LDAPEntryChangedListener listener)Adds an LDAP entry change listener.protected voidaddTitlePanel(Container c, GridBagConstraints gbc)Adds a title panel to the container.protected voidaddValuesInRDN(Entry entry)Adds the values in the RDN to the entry definition.protected voidappendLDIFLine(StringBuilder sb, String attrName, Object value)Appends the LDIF line corresponding to the value of an attribute to the provided StringBuilder.protected booleancheckSchema()Whether the schema must be checked or not.voidconfigurationChanged(ConfigurationChangeEvent ev)Method that is called when a change in the configuration occurred.protected abstract StringgetDisplayedDN()Returns the DN of the entry that the user is editing (it might differ from the DN of the entry in the tree if the user modified the DN).abstract EntrygetEntry()Returns an Entry object representing what the panel is displaying.protected ObjectClassValuegetObjectClassDescriptor(Iterable<ByteString> ocAttr, Schema schema)Returns an object class value representing all the object class values of the entry.protected Set<String>getObjectClassSuperiorValues(ObjectClass oc)Returns the list of superior object classes (to top) for a given object class.org.forgerock.i18n.LocalizableMessagegetTitle()Returns the title that will be used as title of the dialog.protected abstract List<Object>getValues(String attrName)Gets the values associated with a given attribute.static booleanisEditable(AttributeDescription attrDesc, Schema schema)Returns whether the provided attribute name is an editable attribute.protected booleanisPassword(String attrName)Returnstrueif the provided attribute name has password syntax andfalseotherwise.protected voidnotifyListeners()Notifies the entry changed listeners that the entry changed.voidokClicked()Notification that the ok button has been clicked, the panel is in charge of doing whatever is required (close the dialog, launch a task, etc.).voidremoveLDAPEntryChangedListener(LDAPEntryChangedListener listener)Removes an LDAP entry change listener.booleanrequiresBorder()Returnstrueif this panel requires some bordering (in general an EmptyBorder with some insets) andfalseotherwise.protected voidsetValues(Entry sr, String attrName)Sets the values displayed in the panel for a given attribute in the provided search result.abstract voidupdate(Entry sr, boolean isReadOnly, TreePath path)Updates the contents of the panel.protected voidupdateTitle(Entry sr, TreePath path)Updates the title panel with the provided entry.-
Methods inherited from class org.opends.guitools.controlpanel.ui.StatusGenericPanel
add, add, addBottomGlue, addConfigurationElementCreatedListener, addErrorPane, addErrorPane, addScheduleErrors, authenticationRequired, callConfigurationChangedInBackground, cancelClicked, checkCompatibleSuperiors, checkIntValue, checkOKButtonEnable, closeClicked, comboBoxSelected, createErrorPane, createRequiredLabel, displayBackend, displayConfirmationDialog, displayErrorDialog, displayErrorMessage, displayMainPanel, displayMessage, entryExists, getAuthenticateHTML, getButtonType, getConfigurationElementCreatedListeners, getInfo, getLabel, getLoginDialog, getMenuBar, getMonitoringValue, getPreferredFocusComponent, getRightPanelBorder, getScheduleArgs, getStartServerHTML, hasObjectClass, isBinary, isCategory, isDisposeOnClose, isEnableCancel, isEnableClose, isEnableOK, isLocal, isServerRunning, launchOperation, launchOperation, packParentDialog, rebuildIndexIfNecessary, removeConfigurationElementCreatedListener, requiresScroll, restartServer, setDisposeOnClose, setEnabledCancel, setEnabledOK, setInfo, setPrimaryInvalid, setPrimaryValid, setSecondaryInvalid, setSecondaryValid, startServer, stopServer, toBeDisplayed, updateBaseDNComboBoxModel, updateComboBoxModel, updateConfirmationPane, updateErrorPane, updateErrorPaneAndOKButtonIfAuthRequired, updateErrorPaneIfAuthRequired, updateErrorPaneIfServerRunningAndAuthRequired, updateIndexMap, updateMonitoringInfo, updateSimpleBackendComboBoxModel
-
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, getBaseline, getBaselineResizeBehavior, 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, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, 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, setEnabled, 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, 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, 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, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, 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, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
-
-
-
Field Detail
-
schemaReadOnlyAttributes
protected SortedSet<String> schemaReadOnlyAttributes
The read-only attributes as they appear on the schema.
-
schemaReadOnlyAttributesLowerCase
protected SortedSet<String> schemaReadOnlyAttributesLowerCase
The read-only attributes in lower case.
-
editableOperationalAttrNames
protected SortedSet<String> editableOperationalAttrNames
The editable operational attributes.
-
ignoreEntryChangeEvents
protected boolean ignoreEntryChangeEvents
Whether the entry change events should be ignored or not.
-
displayOnlyWithAttrs
protected static boolean displayOnlyWithAttrs
Static boolean used to know whether only attributes with values should be displayed or not.
-
-
Method Detail
-
okClicked
public void okClicked()
Description copied from class:StatusGenericPanelNotification that the ok button has been clicked, the panel is in charge of doing whatever is required (close the dialog, launch a task, etc.).- Specified by:
okClickedin classStatusGenericPanel
-
getEntry
public abstract Entry getEntry() throws OpenDsException
Returns an Entry object representing what the panel is displaying.- Returns:
- an Entry object representing what the panel is displaying.
- Throws:
OpenDsException- if the entry cannot be generated (in particular if the user provided invalid data).
-
update
public abstract void update(Entry sr, boolean isReadOnly, TreePath path)
Updates the contents of the panel.- Parameters:
sr- the search result to be used to update the panel.isReadOnly- whether the entry is read-only or not.path- the tree path associated with the entry in the tree.
-
addTitlePanel
protected void addTitlePanel(Container c, GridBagConstraints gbc)
Adds a title panel to the container.- Parameters:
c- the container where the title panel must be added.gbc- the grid bag constraints to be used.
-
checkSchema
protected boolean checkSchema()
Whether the schema must be checked or not.- Returns:
trueif the server is configured to check schema andfalseotherwise.
-
addLDAPEntryChangedListener
public void addLDAPEntryChangedListener(LDAPEntryChangedListener listener)
Adds an LDAP entry change listener.- Parameters:
listener- the listener.
-
removeLDAPEntryChangedListener
public void removeLDAPEntryChangedListener(LDAPEntryChangedListener listener)
Removes an LDAP entry change listener.- Parameters:
listener- the listener.
-
requiresBorder
public boolean requiresBorder()
Description copied from class:StatusGenericPanelReturnstrueif this panel requires some bordering (in general an EmptyBorder with some insets) andfalseotherwise.- Overrides:
requiresBorderin classStatusGenericPanel- Returns:
trueif this panel requires some bordering (in general an EmptyBorder with some insets) andfalseotherwise.
-
getDisplayedDN
protected abstract String getDisplayedDN()
Returns the DN of the entry that the user is editing (it might differ from the DN of the entry in the tree if the user modified the DN).- Returns:
- the DN of the entry that the user is editing.
-
notifyListeners
protected void notifyListeners()
Notifies the entry changed listeners that the entry changed.
-
updateTitle
protected void updateTitle(Entry sr, TreePath path)
Updates the title panel with the provided entry.- Parameters:
sr- the search result.path- the path to the node of the entry selected in the tree. Used to display the same icon as in the tree.
-
getObjectClassDescriptor
protected ObjectClassValue getObjectClassDescriptor(Iterable<ByteString> ocAttr, Schema schema)
Returns an object class value representing all the object class values of the entry.- Parameters:
ocAttr- the list of object class values.schema- the schema.- Returns:
- an object class value representing all the object class values of the entry.
-
addValuesInRDN
protected void addValuesInRDN(Entry entry)
Adds the values in the RDN to the entry definition.- Parameters:
entry- the entry to be updated.
-
getTitle
public org.forgerock.i18n.LocalizableMessage getTitle()
Description copied from class:StatusGenericPanelReturns the title that will be used as title of the dialog.- Specified by:
getTitlein classStatusGenericPanel- Returns:
- the title that will be used as title of the dialog.
-
configurationChanged
public void configurationChanged(ConfigurationChangeEvent ev)
Description copied from interface:ConfigChangeListenerMethod that is called when a change in the configuration occurred.- Parameters:
ev- the configuration change event.
-
appendLDIFLine
protected void appendLDIFLine(StringBuilder sb, String attrName, Object value)
Appends the LDIF line corresponding to the value of an attribute to the provided StringBuilder.- Parameters:
sb- the StringBuilder that must be updated.attrName- the attribute name.value- the attribute value.
-
isPassword
protected boolean isPassword(String attrName)
Returnstrueif the provided attribute name has password syntax andfalseotherwise.- Parameters:
attrName- the attribute name.- Returns:
trueif the provided attribute name has password syntax andfalseotherwise.
-
getValues
protected abstract List<Object> getValues(String attrName)
Gets the values associated with a given attribute. The values are the ones displayed in the panel.- Parameters:
attrName- the attribute name.- Returns:
- the values associated with a given attribute.
-
setValues
protected void setValues(Entry sr, String attrName)
Sets the values displayed in the panel for a given attribute in the provided search result.- Parameters:
sr- the search result to be updated.attrName- the attribute name.
-
isEditable
public static boolean isEditable(AttributeDescription attrDesc, Schema schema)
Returns whether the provided attribute name is an editable attribute.- Parameters:
attrDesc- the attribute description.schema- the schema.- Returns:
trueif the provided attribute name is an editable attribute,falseotherwise.
-
getObjectClassSuperiorValues
protected Set<String> getObjectClassSuperiorValues(ObjectClass oc)
Returns the list of superior object classes (to top) for a given object class.- Parameters:
oc- the object class.- Returns:
- the set of superior object classes for a given object classes.
-
-