org.oddjob.arooa.parsing
Interface DragPoint

All Superinterfaces:
ArooaConfiguration
All Known Implementing Classes:
DragConfiguration, DragContext

public interface DragPoint
extends ArooaConfiguration

A point in a configuration that supports drag and drop/cut and paste.

Author:
rob

Method Summary
 DragTransaction beginChange(ChangeHow how)
          Begin a change.
 String copy()
          Provide a copy of the configuration at from this DragPoint as XML.
 void cut()
          Remove this DragPoint from it's underlying configuration and remove any components in the configuration from the ComponentPool
 void paste(int index, String config)
          Parse an XML Text configuration and add the resultant component to this DragPoint with the given index.
 boolean supportsCut()
          True if this DragPoint supports the cut operation.
 boolean supportsPaste()
          True if this DragPoint supports the paste operation.
 
Methods inherited from interface org.oddjob.arooa.ArooaConfiguration
parse
 

Method Detail

beginChange

DragTransaction beginChange(ChangeHow how)
Begin a change. Changes must happen in a transaction because when dragging a component within the same session the cut must be done before the paste otherwise duplicate IDs would occur.

Parameters:
how - Should an existing transaction be in progress or not.
Returns:
A transaction. Never null.

supportsCut

boolean supportsCut()
True if this DragPoint supports the cut operation.

Returns:
true/false.

supportsPaste

boolean supportsPaste()
True if this DragPoint supports the paste operation.

Returns:
true/false.

copy

String copy()
Provide a copy of the configuration at from this DragPoint as XML.

Returns:
Text XML.

cut

void cut()
Remove this DragPoint from it's underlying configuration and remove any components in the configuration from the ComponentPool

This operation must be done within the context of a transaction.


paste

void paste(int index,
           String config)
           throws ArooaParseException
Parse an XML Text configuration and add the resultant component to this DragPoint with the given index.

This operation must be done within the context of a transaction.

Parameters:
index - The index. -1 will append.
config - The configuration.
Throws:
ArooaParseException - If the configuration could not be parsed.