macaw.presentationLayer
Class MacawStateEditor

java.lang.Object
  extended by macaw.presentationLayer.MacawStateEditor
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener, DisplayableListItemAdder, DisplayableListItemDeleter, DisplayableListItemEditor, DisplayableListItemViewer
Direct Known Subclasses:
AvailabilityStateEditor, CategoryStateEditor, CleaningStateEditor

public abstract class MacawStateEditor
extends java.lang.Object
implements java.awt.event.ActionListener, DisplayableListItemAdder, DisplayableListItemEditor, DisplayableListItemViewer, DisplayableListItemDeleter


Copyright 2010 Medical Research Council Unit for Lifelong Health and Ageing Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Version:
1.0
Author:
Kevin Garwood (kgarwood@users.sourceforge.net)

Field Summary
protected  User currentUser
           
protected  MacawCurationAPI database
           
protected  javax.swing.JDialog dialog
           
protected  java.lang.String listNameOwner
           
protected  javax.swing.JTextField nameField
           
protected  java.lang.String nameFieldLabelText
           
protected  SessionProperties sessionProperties
           
protected  UserInterfaceFactory userInterfaceFactory
           
 
Constructor Summary
MacawStateEditor(SessionProperties sessionProperties)
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent event)
           
abstract  void addItems(java.lang.String listOwnerName, DisplayableList displayableList)
           
protected  void close()
          method invoked when the user presses the Cancel button
protected  javax.swing.JPanel createDefaultMainFormPanel()
           
protected  javax.swing.JPanel createInformationPanel()
          creates a panel with text describing what the rest of the dialog is about.
protected  javax.swing.JPanel createNameFieldPanel()
           
abstract  void deleteListItems(java.lang.String listOwnerName, DisplayableList parentList)
           
abstract  void editListItem(java.lang.String listItemOwner, Displayable listItem, DisplayableList displayableList)
           
 Displayable getItem()
           
protected  boolean isEditingCancelled()
          indicates whether the dialog was closed because editing changes were approved or if the user pressed the "Cancel" button.
protected  boolean isFormValid()
           
protected  void restore()
           
protected  void save()
           
protected  void setDialogInformation(java.lang.String dialogInformation)
           
protected  void setDialogTitle(java.lang.String title)
           
protected  void setEditableData(MacawListChoice listChoiceItem, DisplayableList parentList, java.lang.String listNameOwner)
           
protected  void setViewableData(MacawListChoice listChoiceItem)
           
 void show()
           
abstract  void viewListItem(Displayable listItem)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sessionProperties

protected SessionProperties sessionProperties

userInterfaceFactory

protected UserInterfaceFactory userInterfaceFactory

database

protected MacawCurationAPI database

currentUser

protected User currentUser

dialog

protected javax.swing.JDialog dialog

nameFieldLabelText

protected java.lang.String nameFieldLabelText

nameField

protected javax.swing.JTextField nameField

listNameOwner

protected java.lang.String listNameOwner
Constructor Detail

MacawStateEditor

public MacawStateEditor(SessionProperties sessionProperties)
Method Detail

createDefaultMainFormPanel

protected javax.swing.JPanel createDefaultMainFormPanel()

createInformationPanel

protected javax.swing.JPanel createInformationPanel()
creates a panel with text describing what the rest of the dialog is about.

Returns:

createNameFieldPanel

protected javax.swing.JPanel createNameFieldPanel()

setDialogTitle

protected void setDialogTitle(java.lang.String title)

setDialogInformation

protected void setDialogInformation(java.lang.String dialogInformation)

show

public void show()

restore

protected void restore()

save

protected void save()

close

protected void close()
method invoked when the user presses the Cancel button


isEditingCancelled

protected boolean isEditingCancelled()
indicates whether the dialog was closed because editing changes were approved or if the user pressed the "Cancel" button.


setEditableData

protected void setEditableData(MacawListChoice listChoiceItem,
                               DisplayableList parentList,
                               java.lang.String listNameOwner)

setViewableData

protected void setViewableData(MacawListChoice listChoiceItem)

isFormValid

protected boolean isFormValid()

addItems

public abstract void addItems(java.lang.String listOwnerName,
                              DisplayableList displayableList)
                       throws MacawException
Specified by:
addItems in interface DisplayableListItemAdder
Throws:
MacawException

editListItem

public abstract void editListItem(java.lang.String listItemOwner,
                                  Displayable listItem,
                                  DisplayableList displayableList)
                           throws MacawException
Specified by:
editListItem in interface DisplayableListItemEditor
Throws:
MacawException

getItem

public Displayable getItem()

viewListItem

public abstract void viewListItem(Displayable listItem)
                           throws MacawException
Specified by:
viewListItem in interface DisplayableListItemViewer
Throws:
MacawException

deleteListItems

public abstract void deleteListItems(java.lang.String listOwnerName,
                                     DisplayableList parentList)
                              throws MacawException
Specified by:
deleteListItems in interface DisplayableListItemDeleter
Throws:
MacawException

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent event)
Specified by:
actionPerformed in interface java.awt.event.ActionListener