DhSection Class

DhSection Class

This Package | All Packages

DhElement
  |
  +--DhBaseContainer
    |
    +--DhSection
public class DhSection
extends DhBaseContainer
implements DhIFilterableObject

Represents an element container that uses traditional HTML one-dimensional flow layout. Elements that are added into this kind of container cannot be positioned in x-y coordinates but rather "flow" around each other. For a version of this container that is based on x-y positioning, see DhPanel.

Constructors
Name Description
DhSection() Creates a DhSection section container.

Methods
Name Description
add(DhElement element) Adds an element into this container, following all other elements.
add(DhElement element, int insertFlag ) Adds an element either at the beginning or at the end of this container, depending on the DhInsertEnum value in the insertFlag parameter.
add(DhElement element, DhElement relativeTo, int insertFlag) Adds an element either at the beginning or end of this container, or before or after another element, depending on the insertFlag parameter.
addFilter(DhFilter filter) Adds a filter to this element and applies it immediately.
addFilter(DhFilter filter, boolean bApply) Adds a filter to this element.
addFilter(DhFilter filter, boolean bApply, boolean bFlush) Adds a filter to this element.
addOnFormReset( DhEventHandler h ) Topic under construction.
addOnHTTPSubmit( DhEventHandler h ) Topic under construction.
addText( String text ) Appends a text string to the current section.
addTransition(DhFilter trans) Adds a transition effect to this element.
applyFilters() Applies filters that were previously deferred.
findElement(String id) Topic under construction.
findFilter(Class filterClass) Retrieves the current filter with the specified filter class.
getAsForm( ) Retrieves the current FORM/DIV state.
getMatchingChildElements( String strQuery, boolean fRecursive ) Topic under construction.
moveElement( DhElement element, int newOrder ) Moves an element to a new numeric order in the flow.
newLine() Appends a new line to the current section.
remove(DhElement element) Removes an element from this container.
removeAll() Removes all child elements from this container.
removeAllFilters() Removes all filters from this element automatically.
removeAllFilters(boolean bApply) Removes all filters from this element.
removeFilter(DhFilter filter) Removes the specified filter from this element.
removeFilter(DhFilter filter, boolean bApply) Removes the specified filter from this element.
removeOnFormReset( DhEventHandler h ) Topic under construction.
removeOnHTTPSubmit( DhEventHandler h ) Topic under construction.
replaceFilter(DhFilter filter1, DhFilter filter2) Provides an easy way to swap filters.
replaceFilter(DhFilter filter1, DhFilter filter2, boolean bApply) Replaces filters currently applied to the document.
setAsForm( boolean fAsForm ) Forces this DhSection to produce an HTML FORM or DIV section.
setHTMLGenerator( DhHTMLGenerator htmlGen ) Topic under construction.

Constructors

DhSection.DhSection

Syntax
public DhSection();
Description

Creates a DhSection section container.

Methods

DhSection.add

Syntax 1
public void add( DhElement element );
Parameters
element
The DhElement to add to the end of the flow of this container.
Description

Adds an element into this container, following all other elements.



Syntax 2
public void add( DhElement element, int insertFlag );
Parameters
element
The DhElement to add to this container.
insertFlag
One of the valid and applicable DhInsertEnum insert constants. The valid values are:
  • INSERT_END
  • INSERT_BEGINNING
Description

Adds an element either at the beginning or at the end of this container, depending on the DhInsertEnum value in the insertFlag parameter.



Syntax 3
public void add( DhElement element, DhElement relativeTo, int insertFlag );
Parameters
element
The DhElement object to add to this container.
relativeTo
The DhElement object referred to when using the INSERT_BEFORE or INSERT_AFTER constants for the insertFlag parameter.
insertFlag
One of the valid and applicable DhInsertEnum insert constants. The valid values for insertFlag are:
  • INSERT_END inserts into the end of the flow or into this container. The relativeTo parameter must be null.
  • INSERT_BEGINNING inserts into the beginning of the flow or this container. The relativeTo parameter must be null.
  • INSERT_BEFORE inserts before the element referred to by the relativeTo parameter. The relativeTo parameter must not be null.
  • INSERT_AFTER insert after the element referred to by the relativeTo parameter. The relativeTo parameter must not be null.
Description

Adds an element either at the beginning or end of this container, or before or after another element, depending on the insertFlag parameter.

DhSection.addFilter

Syntax 1
public void addFilter( DhFilter filter );
Parameters
filter
The DhFilter object to apply.
Description

Adds a filter to this element and applies it immediately. Filters added this way are combined with other filters that were previously added and not explicity flushed or removed.

Exceptions

wfc.html.DhCantAddElementException Thrown if this type of filter already exists on this element.



Syntax 2
public void addFilter( DhFilter filter, boolean bApply );
Parameters
filter
The DhFilter object to apply.
bApply
Set to true to apply the filter directly; set to false to delay applying the filter.
Description

Adds a filter to this element. You can apply the filter immediately or delay application. Delaying application is useful if you are applying more than one filter to this element. Filters added this way are combined with other filters that were previously added and not explicity flushed or removed.

Exceptions

wfc.html.DhCantAddElementException thrown if this type of filter already exists on this element.

See Also
applyFilters, replaceFilter



Syntax 3
public void addFilter( DhFilter filter, boolean bApply, boolean bFlush );
Parameters
filter
The DhFilter object to apply.
bApply
Set to true to apply the filter directly; set to false to delay applying the filter.
bFlush
Set to true to flush the previously applied filters; set to false to combine filter with those already present.
Description

Adds a filter to this element. You can apply the filter immediately or delay application. Delaying application is useful if you are applying more than one filter to this element. You can also specify whether to flush filters that were previously applied to this element or combine this filter with those already present.

Exceptions

wfc.html.DhCantAddElementException thrown if this type of filter already exists on this element.

See Also
applyFilters, replaceFilter

DhSection.addOnFormReset

Syntax
public void addOnFormReset( DhEventHandler h );
Description

Topic under construction.

DhSection.addOnHTTPSubmit

Syntax
public void addOnHTTPSubmit( DhEventHandler h );
Description

Topic under construction.

DhSection.addText

Syntax
public void addText( String text );
Parameters
text
The text string.
Description

Appends a text string to the current section.

DhSection.addTransition

Syntax
public void addTransition( DhFilter trans );
Parameters
trans
The transition effect you will run.
Description

Adds a transition effect to this element. You must call this method before you can run the effect. Note that this functionality is provided for extension only (see the sample classes). This package does provide transition effects.

Exceptions

wfc.html.DhCantAddElementException Thrown if this type of transition effect already exists on this element.

See Also
replaceFilter

DhSection.applyFilters

Syntax
public void applyFilters();
Description

Applies filters that were previously deferred. Use this method if you called addFilter(DhFilter,boolean) with false for the second paramater. This function applies every filter that was added to this element.

See Also
addFilter(DhFilter,boolean), addFilter

DhSection.findElement

Syntax
public DhElement findElement( String id );
Description

Topic under construction.

DhSection.findFilter

Syntax
public DhFilter findFilter( Class filterClass );
Parameters
filterClass
The class of the filter you are looking for, for example, wfc.html.DhDropShadowFilter.
Return Value

Returns the DhFilter (if found) that is of type filterClass.

Description

Retrieves the current filter with the specified filter class.

DhSection.getAsForm

Syntax
public synchronized boolean getAsForm( );
Return Value

Returns true if set to FORM, or returns false if set to DIV.

Description

Retrieves the current FORM/DIV state. The FORM state can be set by using setAsForm or adding a DhSubmitButton into the DhSection.

See Also
setAsForm

DhSection.getMatchingChildElements

Syntax
public IEnumerator getMatchingChildElements( String strQuery, boolean fRecursive );
Description

Topic under construction.

Overrides

getMatchingChildElements(String,boolean) in DhBaseContainer.

DhSection.moveElement

Syntax
public void moveElement( DhElement element, int newOrder );
Parameters
element
The DhElement to move.
newOrder
The new numeric order in the flow of this container.
Description

Moves an element to a new numeric order in the flow.

DhSection.newLine

Syntax
public void newLine();
Description

Appends a new line to the current section. All elements added after this call will be on a new line.

DhSection.remove

Syntax
public int remove( DhElement element );
Parameters
element
The DhElement to remove from this container.
Return Value

Returns topic under construction.

Description

Removes an element from this container. If the element was visible prior to this call, it will not be visible after the call.

DhSection.removeAll

Syntax
public void removeAll();
Description

Removes all child elements from this container. These elements would no longer be visible if they were added prior to this call.

DhSection.removeAllFilters

Syntax 1
public void removeAllFilters();
Description

Removes all filters from this element automatically.



Syntax 2
public void removeAllFilters( boolean bApply );
Description

Removes all filters from this element. You can clear all filters on this element or delay removal.

DhSection.removeFilter

Syntax 1
public void removeFilter( DhFilter filter );
Parameters
filter
A reference to the filter to remove.
Description

Removes the specified filter from this element. This method automatically reapplies filters that may be left after this method is called.

See Also
findFilter.



Syntax 2
public void removeFilter( DhFilter filter, boolean bApply );
Parameters
filter
A reference to the filter to remove.
bApply
Set to true to reapply other filters left on this element; set to false to delay reapplying the filters.
Description

Removes the specified filter from this element. You can reapply filters that may be left after this method is called, or you can delay reapplying filters if you are removing more than one filter.

See Also
findFilter.

DhSection.removeOnFormReset

Syntax
public void removeOnFormReset( DhEventHandler h );
Description

Topic under construction.

DhSection.removeOnHTTPSubmit

Syntax
public void removeOnHTTPSubmit( DhEventHandler h );
Description

Topic under construction.

DhSection.replaceFilter

Syntax 1
public void replaceFilter( DhFilter filter1, DhFilter filter2 );
Parameters
filter1
The filter to be replaced.
filter2
The filter that is to replace filter1.
Description

Provides an easy way to swap filters. It automatically applies all the changes immediately.



Syntax 2
public void replaceFilter( DhFilter filter1, DhFilter filter2, boolean bApply );
Parameters
filter1
The filter to be replaced.
filter2
The filter that is to replace filter1
bApply
Set to true to apply visual changes now; set to false to delay making changes.
Description

Replaces filters currently applied to the document. This method provides an easy way to swap filters. You can specify whether to apply all the changes immediately or to delay making changes until later.

See Also
applyFilters

DhSection.setAsForm

Syntax
public synchronized void setAsForm( boolean fAsForm );
Parameters
fAsForm
Set to true to set as FORM; set to false to set as DIV.
Description

Forces this DhSection to produce an HTML FORM or DIV section.

DhSection.setHTMLGenerator

Syntax
public synchronized void setHTMLGenerator( DhHTMLGenerator htmlGen );
Description

Topic under construction.

Overrides

setHTMLGenerator(DhHTMLGenerator) in DhBaseContainer.