org.ceryle.ui.xnode
Class XNodeRevisionManagerUtils

java.lang.Object
  extended by org.ceryle.ui.xnode.XNodeRevisionManagerUtils

public class XNodeRevisionManagerUtils
extends Object

An utility class providing a set of common utility methods for both the XNodeRevisionManagerDialog and XNodeRevisionManagerPanel. This also maintains the state of the three limit flags: count, space, and age.

Since:
JDK1.4
Version:
$Id: XNodeRevisionManagerUtils.java,v 3.2 2007-06-20 01:28:30 altheim Exp $
Author:
Murray Altheim

Field Summary
protected  JButton btn_all
           
protected  JButton btn_delete
           
protected  JButton btn_none
           
protected  JButton btn_select
           
protected  int m_daylimit
           
protected  boolean m_selByAge
           
protected  JLabel m_summary
           
protected  PropertyManager pm
           
 
Constructor Summary
XNodeRevisionManagerUtils(RevisionTableModel tablemodel)
           
 
Method Summary
protected  void complyWithChecked()
          Sets the state and visibility of various buttons and messages based on the revision count and selection.
protected  int deleteSelected(XNodeCollection xnc, boolean confirm)
          After user confirmation, deletes the selected revisions.
 Clock getClock()
          Returns the clock used for timestamp parsing and display.
 int getDayLimit()
          Returns the current day limit.
 int getHighlightCount()
           
protected  List getXNodeParents(List revisions)
          Return the List of XNodes for the List of XNodeRevisions.
 boolean hasHighlighted()
           
 boolean isHighlighted(int row)
          Returns true if the revision is over one of the three limits.
 boolean isSelectByAge()
          Returns true if select by age is active.
 boolean isSelectByCount()
          Returns true if select by count is active.
 boolean isSelectBySpace()
          Returns true if select by space is active.
protected  boolean overCountLimit(int row)
          Returns true if the revision at the specified row is over the count limit.
protected  boolean overSpaceLimit(int row)
          Returns true if the revision at the specified row is over the space limit.
 void saveProperties()
          Save dialog settings (state of UI check boxes).
 void setDayLimit(int limit)
          Sets the day limit.
 void setSelectByAge(boolean enable)
          Enables or disabled the select by age mode.
 void setSelectByCount(boolean enable)
          Enables or disabled the select by count mode.
 void setSelectBySpace(boolean enable)
          Enables or disabled the select by space mode.
protected  void setSummaryText(int count, int size, int highlighted, int selected)
          Set the summary text based on the revision count, the total size (in characters), and the number of revisions that have been highlighted (via the limits) and selected (using the checkboxes).
 void setUI(JButton selectButton, JButton allButton, JButton noneButton, JButton deleteButton, JLabel summaryText)
          Sets the buttons that are to react to changes in the model.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_selByAge

protected boolean m_selByAge

m_daylimit

protected int m_daylimit

btn_select

protected JButton btn_select

btn_all

protected JButton btn_all

btn_none

protected JButton btn_none

btn_delete

protected JButton btn_delete

m_summary

protected JLabel m_summary

pm

protected PropertyManager pm
Constructor Detail

XNodeRevisionManagerUtils

public XNodeRevisionManagerUtils(RevisionTableModel tablemodel)
Method Detail

setUI

public void setUI(JButton selectButton,
                  JButton allButton,
                  JButton noneButton,
                  JButton deleteButton,
                  JLabel summaryText)
Sets the buttons that are to react to changes in the model.


getClock

public Clock getClock()
Returns the clock used for timestamp parsing and display.


deleteSelected

protected int deleteSelected(XNodeCollection xnc,
                             boolean confirm)
After user confirmation, deletes the selected revisions.

Parameters:
xnc - the XNodeCollection to which the changes are written.
confirm - if true a confirmation dialog is displayed.
Returns:
the number of deleted revisions.

getXNodeParents

protected List getXNodeParents(List revisions)
Return the List of XNodes for the List of XNodeRevisions. This is actually maintained as a Set, checking for duplicates.


overCountLimit

protected boolean overCountLimit(int row)
Returns true if the revision at the specified row is over the count limit.


overSpaceLimit

protected boolean overSpaceLimit(int row)
Returns true if the revision at the specified row is over the space limit.


isSelectByCount

public boolean isSelectByCount()
Returns true if select by count is active.


setSelectByCount

public void setSelectByCount(boolean enable)
Enables or disabled the select by count mode.


isSelectBySpace

public boolean isSelectBySpace()
Returns true if select by space is active.


setSelectBySpace

public void setSelectBySpace(boolean enable)
Enables or disabled the select by space mode.


isSelectByAge

public boolean isSelectByAge()
Returns true if select by age is active.


setSelectByAge

public void setSelectByAge(boolean enable)
Enables or disabled the select by age mode.


getDayLimit

public int getDayLimit()
Returns the current day limit.


setDayLimit

public void setDayLimit(int limit)
Sets the day limit.


hasHighlighted

public boolean hasHighlighted()

getHighlightCount

public int getHighlightCount()

isHighlighted

public boolean isHighlighted(int row)
Returns true if the revision is over one of the three limits.


complyWithChecked

protected void complyWithChecked()
Sets the state and visibility of various buttons and messages based on the revision count and selection.


setSummaryText

protected void setSummaryText(int count,
                              int size,
                              int highlighted,
                              int selected)
Set the summary text based on the revision count, the total size (in characters), and the number of revisions that have been highlighted (via the limits) and selected (using the checkboxes).


saveProperties

public void saveProperties()
Save dialog settings (state of UI check boxes).



The Ceryle Project. Copyright ©2001-2007 Murray Altheim, All Rights Reserved. See LICENSE included with distribution.