org.sadun.swt.widgets
Class MapEditor

java.lang.Object
  extended byorg.eclipse.swt.widgets.Widget
      extended byorg.eclipse.swt.widgets.Control
          extended byorg.eclipse.swt.widgets.Scrollable
              extended byorg.eclipse.swt.widgets.Composite
                  extended byorg.sadun.swt.widgets.MapEditor
All Implemented Interfaces:
org.eclipse.swt.graphics.Drawable
Direct Known Subclasses:
PropertiesEditor

public class MapEditor
extends org.eclipse.swt.widgets.Composite

A class to view/edit a map object and optionally edit its values.

Author:
Cristiano Sadun

Nested Class Summary
static class MapEditor.TableItemChangeException
          This exception can be raised by a TableItemChangeListener when the changed value of a property is problematic.
static interface MapEditor.TableItemChangeListener
          Classes implementing this interface can be notified of user-driven changes to the the properties displayed in a MapEditor.
 
Field Summary
 
Fields inherited from class org.eclipse.swt.widgets.Control
handle
 
Constructor Summary
MapEditor(org.eclipse.swt.widgets.Composite parent, java.lang.String groupName)
           
MapEditor(org.eclipse.swt.widgets.Composite parent, java.lang.String groupName, java.util.Map properties)
           
MapEditor(org.eclipse.swt.widgets.Composite parent, java.lang.String groupName, java.util.Map properties, boolean valuesEditable, boolean listEditable)
          Create a map editor component.
 
Method Summary
 void addTableItemChangeListener(MapEditor.TableItemChangeListener l)
          Add a MapEditor.TableItemChangeListener to the listener set.
 java.util.Map getMap()
           
static void main(java.lang.String[] args)
           
static java.util.Properties open(org.eclipse.swt.widgets.Shell parent, int x, int y, java.util.Properties properties)
           
static java.util.Properties open(org.eclipse.swt.widgets.Shell parent, java.util.Properties properties)
           
 void removeTableItemChangeListener(MapEditor.TableItemChangeListener l)
          Remove a MapEditor.TableItemChangeListener from the listener set.
 void setListEditable(boolean editable)
          Allow ore deny editing of property set - adding or deleting properties.
 void setProperties(java.util.Properties properties)
           
 void setValueEditable(boolean editable)
          Allow ore deny editing of property values.
 
Methods inherited from class org.eclipse.swt.widgets.Composite
checkSubclass, computeSize, getChildren, getLayout, getTabList, layout, layout, setFocus, setLayout, setTabList
 
Methods inherited from class org.eclipse.swt.widgets.Scrollable
computeTrim, getClientArea, getHorizontalBar, getVerticalBar
 
Methods inherited from class org.eclipse.swt.widgets.Control
addControlListener, addFocusListener, addHelpListener, addKeyListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addPaintListener, addTraverseListener, computeSize, forceFocus, getAccessible, getBackground, getBorderWidth, getBounds, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getParent, getShell, getSize, getToolTipText, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, redraw, redraw, removeControlListener, removeFocusListener, removeHelpListener, removeKeyListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removePaintListener, removeTraverseListener, setBackground, setBounds, setBounds, setCapture, setCursor, setEnabled, setFont, setForeground, setLayoutData, setLocation, setLocation, setMenu, setParent, setRedraw, setSize, setSize, setToolTipText, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, update
 
Methods inherited from class org.eclipse.swt.widgets.Widget
addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, setData, setData, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MapEditor

public MapEditor(org.eclipse.swt.widgets.Composite parent,
                 java.lang.String groupName,
                 java.util.Map properties,
                 boolean valuesEditable,
                 boolean listEditable)
Create a map editor component.

Parameters:
parent - the SWT parent
groupName - a descriptive name of the property set (e.g. "System Properties")
valuesEditable - if true the user can change values via the UI
listEditable - if true the user can add or delete map via the UI

MapEditor

public MapEditor(org.eclipse.swt.widgets.Composite parent,
                 java.lang.String groupName,
                 java.util.Map properties)

MapEditor

public MapEditor(org.eclipse.swt.widgets.Composite parent,
                 java.lang.String groupName)
Method Detail

setValueEditable

public void setValueEditable(boolean editable)
Allow ore deny editing of property values.

Parameters:
editable - if true property values will be editable.

setListEditable

public void setListEditable(boolean editable)
Allow ore deny editing of property set - adding or deleting properties.

Parameters:
editable - if true property set will be editable.

addTableItemChangeListener

public void addTableItemChangeListener(MapEditor.TableItemChangeListener l)
Add a MapEditor.TableItemChangeListener to the listener set.

Parameters:
l - the MapEditor.TableItemChangeListener to add.

removeTableItemChangeListener

public void removeTableItemChangeListener(MapEditor.TableItemChangeListener l)
Remove a MapEditor.TableItemChangeListener from the listener set.

Parameters:
l - the MapEditor.TableItemChangeListener to remove.

getMap

public java.util.Map getMap()
Returns:

setProperties

public void setProperties(java.util.Properties properties)

open

public static java.util.Properties open(org.eclipse.swt.widgets.Shell parent,
                                        int x,
                                        int y,
                                        java.util.Properties properties)

open

public static java.util.Properties open(org.eclipse.swt.widgets.Shell parent,
                                        java.util.Properties properties)

main

public static void main(java.lang.String[] args)