org.eclipse.jst.pagedesigner.converter
Class HiddenTagConverter2

java.lang.Object
  extended by org.eclipse.jst.pagedesigner.converter.AbstractTagConverter
      extended by org.eclipse.jst.pagedesigner.converter.HiddenTagConverter2
All Implemented Interfaces:
IDOMFactory, ITagConverter, org.eclipse.jst.pagedesigner.css2.style.ITagEditInfo, org.eclipse.wst.sse.core.internal.provisional.INodeAdapter

public class HiddenTagConverter2
extends AbstractTagConverter

HiddenTagConverter2 is similiar to HiddenTagConverter, with the following difference:

  1. HiddenTagConverter2 will copy the DOM sub tree to the destination document.
TODO: this the wrong way to do this. This should sub-class HiddenTagConverter

Version:
1.5

Constructor Summary
HiddenTagConverter2(org.w3c.dom.Element host, org.eclipse.swt.graphics.Image image)
           
 
Method Summary
 org.eclipse.swt.graphics.Image getVisualImage()
          if isVisualByHTML() return false, then this method should return an image to be displayed in designer.
 boolean isMultiLevel()
          When the convert result in multi-level element.
 boolean isVisualByHTML()
          for some tags, they don't convert to HTML.
 boolean isWidget()
           
 
Methods inherited from class org.eclipse.jst.pagedesigner.converter.AbstractTagConverter
convertRefresh, createElement, createText, dispose, getChildModeList, getChildVisualPosition, getDestDocument, getHostElement, getMinHeight, getMinWidth, getMode, getNonVisualChildren, getResultElement, hasAttribute, isAdapterForType, isDesignerMode, isPreviewMode, needBorderDecorator, needTableDecorator, notifyChanged, setDestDocument, setMinHeight, setMinWidth, setMode, setNeedBorderDecorator
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HiddenTagConverter2

public HiddenTagConverter2(org.w3c.dom.Element host,
                           org.eclipse.swt.graphics.Image image)
Method Detail

isVisualByHTML

public boolean isVisualByHTML()
Description copied from interface: ITagConverter
for some tags, they don't convert to HTML. In that case, this method should return false for them. And if this method return false, then should return an image in getVisualImage() for displaying in the designer.

Specified by:
isVisualByHTML in interface ITagConverter
Overrides:
isVisualByHTML in class AbstractTagConverter
Returns:
true if the tag represents something that will be rendered visually at runtime

getVisualImage

public org.eclipse.swt.graphics.Image getVisualImage()
Description copied from interface: ITagConverter
if isVisualByHTML() return false, then this method should return an image to be displayed in designer. Normally this image will be a shared image for those hidden elements. It is this class's responsibility to dispose the image if the image is not a shared one.

Specified by:
getVisualImage in interface ITagConverter
Overrides:
getVisualImage in class AbstractTagConverter
Returns:
the placeholder image for non-visual tags

isMultiLevel

public boolean isMultiLevel()
Description copied from interface: ITagConverter
When the convert result in multi-level element. If this method return false, then the caller should not use child nodes of getHostElement()

Returns:
true if the host element has convertable children

isWidget

public boolean isWidget()
Returns:
true if the host element is a widget