org.cafesip.gwtcomp.client.ui
Class PropertyViewer

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.google.gwt.user.client.ui.Composite
              extended by org.cafesip.gwtcomp.client.ui.PropertyViewer
All Implemented Interfaces:
com.google.gwt.user.client.EventListener

public class PropertyViewer
extends com.google.gwt.user.client.ui.Composite

A panel for viewing properties. A property consists of two elements - a key and a value. This widget displays properties in a tabular format. Properties can be sorted if desired.

Examples:

CSS Style Rules:

Screen-Shots:


Nested Class Summary
 
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled
 
Field Summary
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
PropertyViewer()
          A constructor for this class.
PropertyViewer(boolean showHeader, boolean allowSort)
          A constructor for this class.
 
Method Summary
 void addProperty(java.lang.String key, java.lang.String value)
          Add a property to be displayed.
 void addProperty(java.lang.String key, com.google.gwt.user.client.ui.Widget widget)
          Add a property to be displayed.
 void clear()
          Clear the property list.
 java.lang.String getKeyCaption()
          Returns the caption for the Key column.
 java.lang.String getValueCaption()
          Returns the caption for the value column.
 void setKeyCaption(java.lang.String keyCaption)
          Sets the caption for the key column.
 void setProperties(java.util.HashMap<java.lang.String,java.lang.String> p)
          Sets a list of properties using a HashMap object.
 void setValueCaption(java.lang.String valueCaption)
          Sets the caption for the value column.
 
Methods inherited from class com.google.gwt.user.client.ui.Composite
getWidget, initWidget, isAttached, onAttach, onBrowserEvent, onDetach, setWidget
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
doAttachChildren, doDetachChildren, getParent, onLoad, onUnload, removeFromParent
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setElement, setElement, setHeight, setPixelSize, setSize, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkEvents, toString, unsinkEvents
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PropertyViewer

public PropertyViewer(boolean showHeader,
                      boolean allowSort)
A constructor for this class. Creates a property viewer object.

Parameters:
showHeader - true if the header is to be displayed
allowSort - true if the sort icons are to be displayed

PropertyViewer

public PropertyViewer()
A constructor for this class. Creates a property viewer object with header and sort icons.

Method Detail

addProperty

public void addProperty(java.lang.String key,
                        java.lang.String value)
Add a property to be displayed.

Parameters:
key - the property key
value - a string value

addProperty

public void addProperty(java.lang.String key,
                        com.google.gwt.user.client.ui.Widget widget)
Add a property to be displayed.

Parameters:
key - the property key
widget - a widget to be displayed as text (instead of a text)

clear

public void clear()
Clear the property list.


setProperties

public void setProperties(java.util.HashMap<java.lang.String,java.lang.String> p)
Sets a list of properties using a HashMap object.

Parameters:
p - the hashmap object. The key and the values for the hashmap must be Strings.

getKeyCaption

public java.lang.String getKeyCaption()
Returns the caption for the Key column.

Returns:
Returns the keyCaption.

setKeyCaption

public void setKeyCaption(java.lang.String keyCaption)
Sets the caption for the key column.

Parameters:
keyCaption - The keyCaption to set.

getValueCaption

public java.lang.String getValueCaption()
Returns the caption for the value column.

Returns:
Returns the valueCaption.

setValueCaption

public void setValueCaption(java.lang.String valueCaption)
Sets the caption for the value column.

Parameters:
valueCaption - The valueCaption to set.


http://www.cafesip.org