org.astrogrid.desktop.modules.adqlEditor.commands
Class MultipleColumnInsertCommand

java.lang.Object
  extended by javax.swing.undo.AbstractUndoableEdit
      extended by org.astrogrid.desktop.modules.adqlEditor.commands.AbstractCommand
          extended by org.astrogrid.desktop.modules.adqlEditor.commands.MultipleColumnInsertCommand
All Implemented Interfaces:
Serializable, UndoableEdit, CommandExec, CommandInfo

public class MultipleColumnInsertCommand
extends AbstractCommand

Author:
Jeff Lusted jl99@star.le.ac.uk
See Also:
Serialized Form

Nested Class Summary
 class MultipleColumnInsertCommand.MCIUndoManager
           
 
Nested classes/interfaces inherited from interface org.astrogrid.desktop.modules.adqlEditor.commands.CommandExec
CommandExec.Result
 
Field Summary
protected  ColumnBean[] columns
           
protected  MultipleColumnInsertCommand.MCIUndoManager internalUndoManager
           
protected  boolean joinRelated
           
private static org.apache.commons.logging.Log logger
           
protected  TableBean table
           
protected  String tableAlias
           
 
Fields inherited from class org.astrogrid.desktop.modules.adqlEditor.commands.AbstractCommand
adqlTree, childElement, childToken, childType, maxOccurs, minOccurs, parentToken, parentType, undoManager
 
Fields inherited from class javax.swing.undo.AbstractUndoableEdit
RedoName, UndoName
 
Fields inherited from interface org.astrogrid.desktop.modules.adqlEditor.commands.CommandExec
ERROR, FAILED, OK, WARNING
 
Constructor Summary
MultipleColumnInsertCommand(AdqlTree adqlTree, UndoManager undoManager, AdqlNode parentTarget, SchemaType childType)
           
 
Method Summary
protected  CommandExec.Result _execute()
           
private  CommandExec.Result addSelectedColumns()
           
 CommandExec.Result execute()
           
 AdqlNode findFromClause(TreePath path)
           
private  AdqlNode findJoinTableNode(TreePath current)
           
private  AdqlNode findJoinTableNodeFromAbove(TreePath current)
           
private  AdqlNode findJoinTableNodeFromBelow(TreePath current)
           
private  TreePath findParentSelect(TreePath path)
           
private  boolean findSuitableExistingTable()
           
 AdqlNode findTablesHolder(TreePath path)
           
private  SchemaType getArrayOfFromTableType()
           
 int[] getChildIndexArray()
           
 Object[] getChildObjectArray()
           
 CutCommand getColumnCutCommand()
           
private  SchemaType getColumnReferenceType()
           
 ColumnBean[] getColumns()
           
private  SchemaType getFromType()
           
private  SchemaType getJoinTableType()
           
private  SchemaType getSelectType()
           
 TableBean getTable()
           
 String getTableAlias()
           
 StandardInsertCommand getTableContainerInsertCommand()
           
 CutCommand getTableCutCommand()
           
 TableInsertCommand getTableInsertCommand()
           
private  SchemaType getTableType()
           
 boolean isChildEnabled()
           
 boolean isColumnCutPresent()
           
 boolean isTableContainerInsertPresent()
           
 boolean isTableCutPresent()
           
 boolean isTableInsertPresent()
           
private  CommandExec.Result maintainArrayOfJoinTables(AdqlNode joinNode)
           
private  CommandExec.Result maintainFromTables(TreePath path)
           
 void setColumns(ColumnBean[] columns)
           
 void setTable(TableBean table)
           
 void setTableAlias(String alias)
           
 String toString()
           
 
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, isChildHeldInArray, isChildInPatternContext, isChildMandatorySingleton, isChildOptionalSingleton, isChildSupportedType, isChildTableLinked, isInitializedStatusGood, isInsertableIntoArray, isParentSuitablePasteTargetFor, setMessages
 
Methods inherited from class javax.swing.undo.AbstractUndoableEdit
addEdit, canRedo, canUndo, die, getPresentationName, getRedoPresentationName, getUndoPresentationName, isSignificant, redo, replaceEdit, undo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

logger

private static final org.apache.commons.logging.Log logger

table

protected TableBean table

columns

protected ColumnBean[] columns

tableAlias

protected String tableAlias

internalUndoManager

protected MultipleColumnInsertCommand.MCIUndoManager internalUndoManager

joinRelated

protected boolean joinRelated
Constructor Detail

MultipleColumnInsertCommand

public MultipleColumnInsertCommand(AdqlTree adqlTree,
                                   UndoManager undoManager,
                                   AdqlNode parentTarget,
                                   SchemaType childType)
Parameters:
target -
-
Method Detail

getTable

public TableBean getTable()

setTable

public void setTable(TableBean table)

getTableAlias

public String getTableAlias()

setTableAlias

public void setTableAlias(String alias)

getColumns

public ColumnBean[] getColumns()

setColumns

public void setColumns(ColumnBean[] columns)

isColumnCutPresent

public boolean isColumnCutPresent()

getColumnCutCommand

public CutCommand getColumnCutCommand()

isTableCutPresent

public boolean isTableCutPresent()

getTableCutCommand

public CutCommand getTableCutCommand()

isTableInsertPresent

public boolean isTableInsertPresent()

getTableInsertCommand

public TableInsertCommand getTableInsertCommand()

isTableContainerInsertPresent

public boolean isTableContainerInsertPresent()

getTableContainerInsertCommand

public StandardInsertCommand getTableContainerInsertCommand()

getChildObjectArray

public Object[] getChildObjectArray()

getChildIndexArray

public int[] getChildIndexArray()

execute

public CommandExec.Result execute()
Specified by:
execute in interface CommandExec
Overrides:
execute in class AbstractCommand

_execute

protected CommandExec.Result _execute()

addSelectedColumns

private CommandExec.Result addSelectedColumns()

maintainArrayOfJoinTables

private CommandExec.Result maintainArrayOfJoinTables(AdqlNode joinNode)

maintainFromTables

private CommandExec.Result maintainFromTables(TreePath path)

findParentSelect

private TreePath findParentSelect(TreePath path)

findFromClause

public AdqlNode findFromClause(TreePath path)

findJoinTableNode

private AdqlNode findJoinTableNode(TreePath current)

findJoinTableNodeFromAbove

private AdqlNode findJoinTableNodeFromAbove(TreePath current)

findJoinTableNodeFromBelow

private AdqlNode findJoinTableNodeFromBelow(TreePath current)

findSuitableExistingTable

private boolean findSuitableExistingTable()

findTablesHolder

public AdqlNode findTablesHolder(TreePath path)

getFromType

private SchemaType getFromType()

getSelectType

private SchemaType getSelectType()

getColumnReferenceType

private SchemaType getColumnReferenceType()

getArrayOfFromTableType

private SchemaType getArrayOfFromTableType()

getJoinTableType

private SchemaType getJoinTableType()

getTableType

private SchemaType getTableType()

toString

public String toString()
Overrides:
toString in class AbstractCommand

isChildEnabled

public boolean isChildEnabled()
Specified by:
isChildEnabled in interface CommandInfo
Overrides:
isChildEnabled in class AbstractCommand


Copyright © 2002-2010 AstroGrid. All Rights Reserved.