ca.sqlpower.architect.swingui
Class TabbedDataEntryPanel

java.lang.Object
  extended by ca.sqlpower.architect.swingui.TabbedDataEntryPanel
All Implemented Interfaces:
ca.sqlpower.swingui.DataEntryPanel

public class TabbedDataEntryPanel
extends java.lang.Object
implements ca.sqlpower.swingui.DataEntryPanel

The TabbedDataEntryPanel aggregates one or more DataEntryPanel instances into a single DataEntryPanel with one tab for each sub-panel. It provides applyChanges and discardChanges methods that "do the right thing" by broadcasting the corresponding request to all the panels being managed by the current instance.


Constructor Summary
TabbedDataEntryPanel()
           
 
Method Summary
 void addTab(java.lang.String name, ca.sqlpower.swingui.DataEntryPanel panel)
          Adds the given panel as a tab of this panel.
 boolean applyChanges()
          Applies changes to every panel managed by this instance.
 void discardChanges()
          Discards changes on every panel managed by this instance.
 javax.swing.JComponent getPanel()
          Returns the tabbed pane that aggregates all the panels managed by this instance.
 boolean hasUnsavedChanges()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TabbedDataEntryPanel

public TabbedDataEntryPanel()
Method Detail

addTab

public void addTab(java.lang.String name,
                   ca.sqlpower.swingui.DataEntryPanel panel)
Adds the given panel as a tab of this panel.

Parameters:
name - The string to attach to the tab for the given panel
panel - The panel to manage

applyChanges

public boolean applyChanges()
Applies changes to every panel managed by this instance.

Specified by:
applyChanges in interface ca.sqlpower.swingui.DataEntryPanel
Returns:
True if and only if each panel's applyChanges() returned success.

discardChanges

public void discardChanges()
Discards changes on every panel managed by this instance.

Specified by:
discardChanges in interface ca.sqlpower.swingui.DataEntryPanel

getPanel

public javax.swing.JComponent getPanel()
Returns the tabbed pane that aggregates all the panels managed by this instance.

Specified by:
getPanel in interface ca.sqlpower.swingui.DataEntryPanel

hasUnsavedChanges

public boolean hasUnsavedChanges()
Specified by:
hasUnsavedChanges in interface ca.sqlpower.swingui.DataEntryPanel


Copyright © 2003-2007 SQL Power Group Inc. www.sqlpower.ca