org.progeeks.meta.swing.editor
Class TableUI

java.lang.Object
  extended by org.progeeks.meta.swing.AbstractPropertyUI
      extended by org.progeeks.meta.swing.AbstractPropertyEditor
          extended by org.progeeks.meta.swing.editor.TableUI
All Implemented Interfaces:
MetaPropertyEditor, MetaPropertyRenderer, MetaPropertyUI

public class TableUI
extends AbstractPropertyEditor
implements MetaPropertyRenderer

An editor/renderer implementation for a List of meta-objects that can be displayed in a JTable.

Version:
$Revision: 1.10 $
Author:
Paul Speed

Constructor Summary
TableUI(MetaPropertyContext viewContext)
           
 
Method Summary
protected  java.lang.Object addItem()
          Called to add a new item by interacting with the user.
protected  java.lang.Object editItem(int i, java.lang.Object value)
          Called to edit an object of the specified index and value.
 java.awt.Component getUIComponent()
          Returns the component that allows modification of the associated property mutator.
 boolean hasAddButton()
          Returns true if the dialog should have an add button if the property mutator supports it.
 boolean hasEditButton()
          Returns true if the dialog should have an edit button if the property mutator supports it.
 boolean hasRemoveButton()
          Returns true if the dialog should have a remove button if the property mutator supports it.
 boolean isSingleColumn()
          Returns false since lists should be full-width controls.
protected  void propertyChanged(java.beans.PropertyChangeEvent event)
          Called when the value contained in the mutator changes.
protected  void releaseComponent()
          Implemented by subclasses to release any component-related resources.
protected  java.lang.Object removeItem(int i)
          Called to remove the item at the specified index.
protected  void resetComponentValue()
          Called to set the component value to a default state.
protected  void setComponentValue(java.lang.Object value)
          Called to set the current value displayed in the component.
 void setPropertyMutator(PropertyMutator mutator)
          Intercepted to configure the list panel to most appropriately modify the list.
 
Methods inherited from class org.progeeks.meta.swing.AbstractPropertyEditor
flushEdits
 
Methods inherited from class org.progeeks.meta.swing.AbstractPropertyUI
getPropertyMutator, getViewContext, initializeView, isLabeled, release, setPropertyValue, setupToolTipText, terminateView
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.progeeks.meta.swing.MetaPropertyUI
getViewContext, initializeView, isLabeled, release
 

Constructor Detail

TableUI

public TableUI(MetaPropertyContext viewContext)
Method Detail

hasEditButton

public boolean hasEditButton()
Returns true if the dialog should have an edit button if the property mutator supports it. This allows subclasses to specifically override.


hasRemoveButton

public boolean hasRemoveButton()
Returns true if the dialog should have a remove button if the property mutator supports it. This allows subclasses to specifically override.


hasAddButton

public boolean hasAddButton()
Returns true if the dialog should have an add button if the property mutator supports it. This allows subclasses to specifically override.


setPropertyMutator

public void setPropertyMutator(PropertyMutator mutator)
Intercepted to configure the list panel to most appropriately modify the list.

Specified by:
setPropertyMutator in interface MetaPropertyUI
Overrides:
setPropertyMutator in class AbstractPropertyUI

isSingleColumn

public boolean isSingleColumn()
Returns false since lists should be full-width controls.

Specified by:
isSingleColumn in interface MetaPropertyUI
Overrides:
isSingleColumn in class AbstractPropertyUI

getUIComponent

public java.awt.Component getUIComponent()
Returns the component that allows modification of the associated property mutator.

Specified by:
getUIComponent in interface MetaPropertyUI
Specified by:
getUIComponent in class AbstractPropertyUI

releaseComponent

protected void releaseComponent()
Implemented by subclasses to release any component-related resources.

Specified by:
releaseComponent in class AbstractPropertyEditor

setComponentValue

protected void setComponentValue(java.lang.Object value)
Called to set the current value displayed in the component.

Specified by:
setComponentValue in class AbstractPropertyUI

resetComponentValue

protected void resetComponentValue()
Called to set the component value to a default state. The default implementation calls setComponentValue(null).

Overrides:
resetComponentValue in class AbstractPropertyUI

propertyChanged

protected void propertyChanged(java.beans.PropertyChangeEvent event)
Called when the value contained in the mutator changes. The default implementation ignores property changes if the value is the same as the current cached value either by reference or by .equals().

Overrides:
propertyChanged in class AbstractPropertyUI

addItem

protected java.lang.Object addItem()
Called to add a new item by interacting with the user. Returns the created object if the interaction was successful. Returns null if no object was created. Subclasses can override this method to hook in additional processing if needed.


editItem

protected java.lang.Object editItem(int i,
                                    java.lang.Object value)
Called to edit an object of the specified index and value. Both are provided in case they are needed by subclasses. The edited value is returned if successful. Returns null if the object was not changed, editing was canceled, etc.. Subclasses can override this method to hook in additional processing if needed.


removeItem

protected java.lang.Object removeItem(int i)
Called to remove the item at the specified index. Returns the item that was removed. Subclasses can override this method to hook in additional processing if needed.



Copyright © 2002-2003 Paul Speed. All Rights Reserved.