org.astrogrid.desktop.modules.adqlEditor.commands
Class EditTupleTextCommand
java.lang.Object
javax.swing.undo.AbstractUndoableEdit
org.astrogrid.desktop.modules.adqlEditor.commands.AbstractCommand
org.astrogrid.desktop.modules.adqlEditor.commands.EditTupleTextCommand
- All Implemented Interfaces:
- Serializable, UndoableEdit, CommandExec, CommandInfo
public class EditTupleTextCommand
- extends AbstractCommand
- Author:
- jl99@star.le.ac.uk
TODO To change the template for this generated type comment go to
Window - Preferences - Java - Code Style - Code Templates
- See Also:
- Serialized Form
|
Method Summary |
private CommandExec.Result |
_execute()
|
void |
_redo()
|
private boolean |
areEqual(String oldValue,
String newValue)
|
private void |
buildTypeList(AdqlNode parent,
SchemaType type)
|
private void |
crossValidateCreate(XmlObject element,
String attributeName,
String oldValue,
String newValue)
|
private void |
crossValidateDelete(XmlObject element,
String attributeName,
String oldValue,
String newValue)
|
private void |
crossValidateTableCreate(XmlObject tableElement,
String attributeName,
String oldAliasValue,
String newAliasValue)
|
private void |
crossValidateTableDelete(XmlObject tableElement,
String attributeName,
String oldValue,
String newValue)
|
private void |
crossValidateTableUpdate(XmlObject tableElement,
String attributeName,
String oldAliasValue,
String newAliasValue)
|
private void |
crossValidateUpdate(XmlObject element,
String attributeName,
String oldValue,
String newValue)
|
void |
die()
|
CommandExec.Result |
execute()
|
String[] |
getNewValues()
|
String[] |
getOldValues()
|
String |
getPresentationName()
|
private ArrayList<Object> |
getReferences()
|
private ArrayList<AdqlNode> |
getTypeList(String targetLocalName)
|
private ArrayList<Object> |
getUpdates()
|
private boolean |
isTableValidationRequired(XmlObject element,
String attributeName)
|
private boolean |
preValidateOK(XmlObject element,
String attributeName,
boolean attributeOptional,
String oldValue,
String newValue)
|
private boolean |
preValidateTable(XmlObject tableElement,
String attributeName,
boolean attributeOptional,
String oldAliasValue,
String newAliasValue)
|
void |
redo()
|
private void |
resetTypeList()
|
void |
setNewValues(String[] values)
|
void |
setOldValue(String[] oldValues)
|
void |
setSelectedValues(String[] values)
|
String |
toString()
|
void |
undo()
|
| Methods inherited from class org.astrogrid.desktop.modules.adqlEditor.commands.AbstractCommand |
addToEditStore, exchangeInEditStore, exchangeInEditStore, getChildDisplayName, getChildElement, getChildElementName, getChildEntry, getChildIndex, getChildMaxOccurs, getChildMinOccurs, getChildObject, getChildToken, getChildType, getFromEditStore, getMessages, getParentDisplayName, getParentElementName, getParentEntry, getParentObject, getParentToken, getParentType, isChildCascadeable, isChildColumnLinked, isChildDisallowed, isChildDrivenByEnumeratedAttribute, isChildDrivenByEnumeratedElement, isChildEnabled, isChildHeldInArray, isChildInPatternContext, isChildMandatorySingleton, isChildOptionalSingleton, isChildSupportedType, isChildTableLinked, isInitializedStatusGood, isInsertableIntoArray, isParentSuitablePasteTargetFor, setMessages |
log
private static final org.apache.commons.logging.Log log
fromTables
private HashMap<String,AdqlTree.TableData> fromTables
oldValues
private String[] oldValues
newValues
private String[] newValues
updates
private ArrayList<Object> updates
references
private ArrayList<Object> references
typeList
private ArrayList<AdqlNode> typeList
EditTupleTextCommand
public EditTupleTextCommand(AdqlTree adqlTree,
UndoManager undoManager,
AdqlNode target,
HashMap<String,AdqlTree.TableData> fromTables)
- Parameters:
target - source -
setNewValues
public void setNewValues(String[] values)
setSelectedValues
public void setSelectedValues(String[] values)
execute
public CommandExec.Result execute()
- Specified by:
execute in interface CommandExec- Overrides:
execute in class AbstractCommand
_execute
private CommandExec.Result _execute()
getReferences
private ArrayList<Object> getReferences()
getUpdates
private ArrayList<Object> getUpdates()
die
public void die()
- Specified by:
die in interface UndoableEdit- Overrides:
die in class AbstractUndoableEdit
redo
public void redo()
throws CannotRedoException
- Specified by:
redo in interface UndoableEdit- Overrides:
redo in class AbstractUndoableEdit
- Throws:
CannotRedoException
_redo
public void _redo()
throws CannotRedoException
- Throws:
CannotRedoException
undo
public void undo()
throws CannotUndoException
- Specified by:
undo in interface UndoableEdit- Overrides:
undo in class AbstractUndoableEdit
- Throws:
CannotUndoException
getPresentationName
public String getPresentationName()
- Specified by:
getPresentationName in interface UndoableEdit- Overrides:
getPresentationName in class AbstractUndoableEdit
getOldValues
public String[] getOldValues()
- Returns:
- the oldValue
setOldValue
public void setOldValue(String[] oldValues)
- Parameters:
oldValue - the oldValue to set
getNewValues
public String[] getNewValues()
- Returns:
- the newValue
areEqual
private boolean areEqual(String oldValue,
String newValue)
preValidateOK
private boolean preValidateOK(XmlObject element,
String attributeName,
boolean attributeOptional,
String oldValue,
String newValue)
crossValidateDelete
private void crossValidateDelete(XmlObject element,
String attributeName,
String oldValue,
String newValue)
crossValidateUpdate
private void crossValidateUpdate(XmlObject element,
String attributeName,
String oldValue,
String newValue)
crossValidateCreate
private void crossValidateCreate(XmlObject element,
String attributeName,
String oldValue,
String newValue)
isTableValidationRequired
private boolean isTableValidationRequired(XmlObject element,
String attributeName)
crossValidateTableDelete
private void crossValidateTableDelete(XmlObject tableElement,
String attributeName,
String oldValue,
String newValue)
crossValidateTableUpdate
private void crossValidateTableUpdate(XmlObject tableElement,
String attributeName,
String oldAliasValue,
String newAliasValue)
crossValidateTableCreate
private void crossValidateTableCreate(XmlObject tableElement,
String attributeName,
String oldAliasValue,
String newAliasValue)
preValidateTable
private boolean preValidateTable(XmlObject tableElement,
String attributeName,
boolean attributeOptional,
String oldAliasValue,
String newAliasValue)
getTypeList
private ArrayList<AdqlNode> getTypeList(String targetLocalName)
buildTypeList
private void buildTypeList(AdqlNode parent,
SchemaType type)
resetTypeList
private void resetTypeList()
toString
public String toString()
- Overrides:
toString in class AbstractCommand
Copyright © 2002-2010 AstroGrid. All Rights Reserved.