Class OptionsDialog

  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Window
              extended by java.awt.Dialog
                  extended by javax.swing.JDialog
                      extended by issrg.editor2.configurations.OptionsDialog
All Implemented Interfaces:
java.awt.event.ActionListener, java.awt.event.WindowListener, java.awt.image.ImageObserver, java.awt.MenuContainer,, java.util.EventListener, javax.accessibility.Accessible, javax.swing.event.ChangeListener, javax.swing.RootPaneContainer, javax.swing.WindowConstants

public class OptionsDialog
extends javax.swing.JDialog
implements java.awt.event.ActionListener, java.awt.event.WindowListener, javax.swing.event.ChangeListener

The Options/Configuration Dialog is the dialog that displays when the user clicks on the Tools/Configure Menu. The Dialog adds a JTabbedPane to the display and adds the required tabs that contain the panels with the settings that the user can modify.

So far the Dialog Only contains one tab. This is for the LDAP Configurations. Although other tabs could be added in a similar manner.

The LDAP Configuration, consists in that the user could add, delete or modify any new or existing LDAP directories. The dialog expects a change in the text fields or a selection from the available connections, in order for the function buttons to be made available. This is to guide the user. Directory Name, DNS Name and Port number, are compulsory for each Directory.

The Options Dialog contains two buttons. Save Changes, and Close. When Save Changes is pressed, it will save the modifications and exit the dialog, whilst hitting close will forget the modifications and exit the dialog.

Christian Azzopardi
See Also:
Serialized Form

Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JDialog
Nested classes/interfaces inherited from class java.awt.Dialog
Nested classes/interfaces inherited from class java.awt.Window
Nested classes/interfaces inherited from class java.awt.Container
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
Field Summary
 javax.swing.JTabbedPane tabbedPane
          The Tabbed Pane that is added to the main dialog display, and allows for new panels to be added to it.
Fields inherited from class javax.swing.JDialog
accessibleContext, rootPane, rootPaneCheckingEnabled
Fields inherited from class java.awt.Component
Fields inherited from interface javax.swing.WindowConstants
Fields inherited from interface java.awt.image.ImageObserver
Constructor Summary
OptionsDialog(ConfigurationComponent that, java.awt.Frame owner, RepositoryMultiBrowser rb)
          Creates a new instance of OptionsDialog.
Method Summary
 void actionPerformed(java.awt.event.ActionEvent av)
          When actionEvents are fired, the method will check from which button the action has come.
 javax.swing.JPanel createPanel(javax.swing.JPanel whichPanel)
 boolean getRepositoryLaunch()
 void replaceItemsFromStack()
          This will modify the undo/redo stacks as to their previous state.
 void setCaption(java.lang.String internalName, java.lang.String internationalName)
          Sets the text the component will show.
 void setRepositoryLaunch(boolean state)
 void setVisible(boolean b)
          Overridden setVisible method.
 void stateChanged(javax.swing.event.ChangeEvent e)
 void windowActivated(java.awt.event.WindowEvent e)
 void windowClosed(java.awt.event.WindowEvent e)
 void windowClosing(java.awt.event.WindowEvent e)
          When the dialog is closed, the window will behave in the same manner as if a user clicked on the close button.
 void windowDeactivated(java.awt.event.WindowEvent e)
 void windowDeiconified(java.awt.event.WindowEvent e)
 void windowIconified(java.awt.event.WindowEvent e)
 void windowOpened(java.awt.event.WindowEvent e)
 void writeToFile()
Methods inherited from class javax.swing.JDialog
addImpl, createRootPane, dialogInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update
Methods inherited from class java.awt.Dialog
addNotify, getTitle, hide, isModal, isResizable, isUndecorated, setModal, setResizable, setTitle, setUndecorated, show
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, finalize, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, isActive, isAlwaysOnTop, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setAlwaysOnTop, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationByPlatform, setLocationRelativeTo, toBack, toFront
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, 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, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, show, size, toString, transferFocus, transferFocusUpCycle
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail


public javax.swing.JTabbedPane tabbedPane
The Tabbed Pane that is added to the main dialog display, and allows for new panels to be added to it.

Constructor Detail


public OptionsDialog(ConfigurationComponent that,
                     java.awt.Frame owner,
                     RepositoryMultiBrowser rb)
Creates a new instance of OptionsDialog. This instance is created in the PEApplication Class. It is not set visible in this class. The scope is that the dialog will be 'always running' and will only be made visible when the shortcut to it from the main menu is clicked. It will retain the focus until closed.

The Constructor simply calls its superclass constructor setting owner which in this case is the PEApplication.

A WindowListener is needed to notify when the window has been closed.

The Tabbed Pane is added to the dialog display, and the first tab is added.

that - the Dialog Specific XML Editor.
owner - the owner of the Dialog.
Method Detail


public javax.swing.JPanel createPanel(javax.swing.JPanel whichPanel)


public void actionPerformed(java.awt.event.ActionEvent av)
When actionEvents are fired, the method will check from which button the action has come.

If the save button was clicked, the method will open the existing Config File (pe.cfg) and will Generate the new XML to save into that file. It will also unset the visibility of the Dialog, and create new Stacks for the undo/redo. (Otherwise when reopening the dialog box we can undo/redo the actions that were done before hitting this button)

If the Close button is hit, it will reset the undo/redo stacks and will unset the visibility of the dialog.

Specified by:
actionPerformed in interface java.awt.event.ActionListener


public void writeToFile()


public void replaceItemsFromStack()
This will modify the undo/redo stacks as to their previous state.


public void windowOpened(java.awt.event.WindowEvent e)
Specified by:
windowOpened in interface java.awt.event.WindowListener


public void windowIconified(java.awt.event.WindowEvent e)
Specified by:
windowIconified in interface java.awt.event.WindowListener


public void windowDeiconified(java.awt.event.WindowEvent e)
Specified by:
windowDeiconified in interface java.awt.event.WindowListener


public void windowDeactivated(java.awt.event.WindowEvent e)
Specified by:
windowDeactivated in interface java.awt.event.WindowListener


public void windowClosing(java.awt.event.WindowEvent e)
When the dialog is closed, the window will behave in the same manner as if a user clicked on the close button.

It will reset the undo/redo stacks, and unset the visibility of the dialog.

Specified by:
windowClosing in interface java.awt.event.WindowListener


public void windowClosed(java.awt.event.WindowEvent e)
Specified by:
windowClosed in interface java.awt.event.WindowListener


public void windowActivated(java.awt.event.WindowEvent e)
Specified by:
windowActivated in interface java.awt.event.WindowListener


public void setCaption(java.lang.String internalName,
                       java.lang.String internationalName)
Sets the text the component will show. If component parameter is not found in the list of parameters, the method will call its super method to attempt to find the component there.

internalName - The internal name used in the program.
internationalName - The international name to set the text to.


public void setVisible(boolean b)
Overridden setVisible method. Needed to refresh the dialog window correctly each time it is opened.

setVisible in class java.awt.Component


public void stateChanged(javax.swing.event.ChangeEvent e)
Specified by:
stateChanged in interface javax.swing.event.ChangeListener


public void setRepositoryLaunch(boolean state)


public boolean getRepositoryLaunch()