Humboldt Alignment Editor 2.5.0

eu.esdihumboldt.hale.ui.selection.impl
Class DefaultSchemaSelection

java.lang.Object
  extended by eu.esdihumboldt.hale.ui.selection.impl.DefaultSchemaSelection
All Implemented Interfaces:
SchemaSelection, org.eclipse.jface.viewers.ISelection, org.eclipse.jface.viewers.IStructuredSelection

public class DefaultSchemaSelection
extends Object
implements org.eclipse.jface.viewers.IStructuredSelection, SchemaSelection

A selection with source and target EntityDefinitions

Author:
Simon Templer
Partner:
01 / Fraunhofer Institute for Computer Graphics Research

Nested Class Summary
static class DefaultSchemaSelection.SchemaStructuredMode
          Defines modes specifying the behavior of the selection as IStructuredSelection
 
Constructor Summary
DefaultSchemaSelection()
          Creates an empty selection
DefaultSchemaSelection(Collection<EntityDefinition> sourceItems, Collection<EntityDefinition> targetItems, DefaultSchemaSelection.SchemaStructuredMode mode)
          Creates a selection that is initialized with the given items
 
Method Summary
 void addSourceItem(EntityDefinition item)
          Adds a source item
 void addTargetItem(EntityDefinition item)
          Adds a target item
 Object getFirstElement()
           
 EntityDefinition getFirstItem(SchemaSpaceID schema)
          Get the first selected item of the given schema
 EntityDefinition getFirstSourceItem()
          Get the first selected source item
 EntityDefinition getFirstTargetItem()
          Get the first selected target item
 Set<EntityDefinition> getSourceItems()
           
 Set<EntityDefinition> getTargetItems()
           
 boolean isEmpty()
           
 Iterator<?> iterator()
           
 int size()
           
 Object[] toArray()
           
 List<EntityDefinition> toList()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultSchemaSelection

public DefaultSchemaSelection()
Creates an empty selection


DefaultSchemaSelection

public DefaultSchemaSelection(Collection<EntityDefinition> sourceItems,
                              Collection<EntityDefinition> targetItems,
                              DefaultSchemaSelection.SchemaStructuredMode mode)
Creates a selection that is initialized with the given items

Parameters:
sourceItems - the source items
targetItems - the target items
mode - the selection structured mode
Method Detail

addSourceItem

public void addSourceItem(EntityDefinition item)
Adds a source item

Parameters:
item - the item to add

addTargetItem

public void addTargetItem(EntityDefinition item)
Adds a target item

Parameters:
item - the item to add

getSourceItems

public Set<EntityDefinition> getSourceItems()
Specified by:
getSourceItems in interface SchemaSelection
Returns:
the sourceItems
See Also:
SchemaSelection.getSourceItems()

getTargetItems

public Set<EntityDefinition> getTargetItems()
Specified by:
getTargetItems in interface SchemaSelection
Returns:
the targetItems
See Also:
SchemaSelection.getTargetItems()

getFirstSourceItem

public EntityDefinition getFirstSourceItem()
Description copied from interface: SchemaSelection
Get the first selected source item

Specified by:
getFirstSourceItem in interface SchemaSelection
Returns:
the first selected source item or null
See Also:
SchemaSelection.getFirstSourceItem()

getFirstTargetItem

public EntityDefinition getFirstTargetItem()
Description copied from interface: SchemaSelection
Get the first selected target item

Specified by:
getFirstTargetItem in interface SchemaSelection
Returns:
the first selected target item or null
See Also:
SchemaSelection.getFirstTargetItem()

getFirstItem

public EntityDefinition getFirstItem(SchemaSpaceID schema)
Description copied from interface: SchemaSelection
Get the first selected item of the given schema

Specified by:
getFirstItem in interface SchemaSelection
Parameters:
schema - the schema type
Returns:
the first selected item or null
See Also:
SchemaSelection.getFirstItem(SchemaSpaceID)

getFirstElement

public Object getFirstElement()
Specified by:
getFirstElement in interface org.eclipse.jface.viewers.IStructuredSelection
See Also:
IStructuredSelection.getFirstElement()

iterator

public Iterator<?> iterator()
Specified by:
iterator in interface org.eclipse.jface.viewers.IStructuredSelection
See Also:
IStructuredSelection.iterator()

size

public int size()
Specified by:
size in interface org.eclipse.jface.viewers.IStructuredSelection
See Also:
IStructuredSelection.size()

toArray

public Object[] toArray()
Specified by:
toArray in interface org.eclipse.jface.viewers.IStructuredSelection
See Also:
IStructuredSelection.toArray()

toList

public List<EntityDefinition> toList()
Specified by:
toList in interface org.eclipse.jface.viewers.IStructuredSelection
See Also:
IStructuredSelection.toList()

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface org.eclipse.jface.viewers.ISelection
See Also:
ISelection.isEmpty()

Humboldt Alignment Editor 2.5.0

Build 2012-12-03_12-30-59
Revision 9d2dd4b0318cda9f1393b1ddd390f7f792d70a2d