de.goerntkai.scot.app.document
Class SCoTBlock

java.lang.Object
  extended byde.goerntkai.scot.app.document.SCoTBlock
All Implemented Interfaces:
ISCoTComponent
Direct Known Subclasses:
DivisionBlock, FragmentBlock, ListBlock, SimpleBlock, TableBlock, TablerowBlock

public abstract class SCoTBlock
extends java.lang.Object
implements ISCoTComponent

A SCoTBlock is just a container for ISCoTComponents.

A SCoTBlock is content which HTML representation is a blockbuilding tag. SCoTBlock consists usually of one or more lines in the SCoT document.

Version:
$Id: SCoTBlock.java,v 1.5 2005/05/19 20:19:36 GoerntKai Exp $
Author:
Kai Görnt

Constructor Summary
SCoTBlock()
          Deprecated.  
SCoTBlock(Configuration aConfiguration)
          This constructor sets the configuration.
 
Method Summary
 void add(ISCoTComponent component)
          Adds another component.
abstract  void add(java.lang.String line)
          Adds another component from a line string.
 org.w3c.dom.Attr[] getAttributes(org.w3c.dom.Document doc)
          Returns the attributes for this block as an array of DOM nodes.
 ISCoTComponent[] getComponents()
          Returns all components belonging to this block as an array.
 Configuration getConfiguration()
           
 ISCoTComponent getLastComponent()
          Returns the last component.
abstract  boolean isMeaningEqual(java.lang.String line)
          Returns true when the meaning of the line is the same as the meaning of the block and false if not.
 void replaceLastComponentBy(ISCoTComponent component)
          Replaces the last component by the given one.
 void setAttributes(java.lang.String[] someAttributes)
          Sets the attributes for this block.
abstract  org.w3c.dom.Node toHTML(org.w3c.dom.Document doc)
          Returns the HTML representation of the element.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SCoTBlock

public SCoTBlock()
Deprecated.  

The standard constructor. Does nothing special.


SCoTBlock

public SCoTBlock(Configuration aConfiguration)

This constructor sets the configuration.

Parameters:
aConfiguration - the configuration of this application
Method Detail

add

public void add(ISCoTComponent component)

Adds another component.

Parameters:
component - the new ISCoTComponent

add

public abstract void add(java.lang.String line)
                  throws SCoTException

Adds another component from a line string.

Parameters:
line - the definition of the new component
Throws:
SCoTException

getAttributes

public org.w3c.dom.Attr[] getAttributes(org.w3c.dom.Document doc)

Returns the attributes for this block as an array of DOM nodes. This method uses the parent document to create the attribute nodes.

Returns null if the attributes are not set.

Parameters:
doc - the parent document
Returns:
attributes for this block

getComponents

public ISCoTComponent[] getComponents()

Returns all components belonging to this block as an array.

Returns:
all ISCoTComponents

getConfiguration

public Configuration getConfiguration()
Returns:
configuration of the application

getLastComponent

public ISCoTComponent getLastComponent()

Returns the last component.

Returns:
the last ISCoTComponent

isMeaningEqual

public abstract boolean isMeaningEqual(java.lang.String line)

Returns true when the meaning of the line is the same as the meaning of the block and false if not.

Parameters:
line - the line to be checked
Returns:
wether the line has the same meaning as the block

replaceLastComponentBy

public void replaceLastComponentBy(ISCoTComponent component)

Replaces the last component by the given one.

Parameters:
component - the new component to replace the last one

setAttributes

public void setAttributes(java.lang.String[] someAttributes)

Sets the attributes for this block.

Parameters:
someAttributes - the attributes to set

toHTML

public abstract org.w3c.dom.Node toHTML(org.w3c.dom.Document doc)

Returns the HTML representation of the element. Uses the parent document for creating the node.

Specified by:
toHTML in interface ISCoTComponent
Parameters:
doc - the parent document
Returns:
the HTML representation
See Also:
ISCoTComponent.toHTML(org.w3c.dom.Document)


© 2004 by Kai Görnt