Package org.eclipse.jst.pagedesigner.converter

Examples of org.eclipse.jst.pagedesigner.converter.ITagConverter


   *
   * @param ele Element instance to be converted.
   * @return Converted Node instance.
   */
  protected Node previewConvertElement(Element ele) {
    ITagConverter converter = createTagConverter(ele);
    if (!converter.isVisualByHTML()) {
      return null;
    }
    converter.convertRefresh(null);
    Element result = converter.getResultElement();
    List children = converter.getChildModeList();
    if (children != null) {
      for (int i = 0, size = children.size(); i < size; i++) {
        Node child = (Node) children.get(i);
        if (child != null) {
          Node childPreview = previewConvert(child);
          if (childPreview != null) {
            ConvertPosition position = converter
                .getChildVisualPosition(child);
            if (position != null) {
              /* FIX for bug #179403
              // FIXME: not using index here, need fix.
              position.getParentNode().appendChild(childPreview);
View Full Code Here


    }

    @Override
    public void deactivate()
    {
        ITagConverter tagConverter = (ITagConverter) getModel();
        if (tagConverter != null)
        {
            tagConverter.dispose();
        }
       
        // always do super stuff
        super.deactivate();
    }
View Full Code Here

    /**
     * @return the tag converter
     */
    protected ITagConverter getTagConverter()
    {
      ITagConverter tagConverter = (ITagConverter)getModel();
      //need to call convertRefresh to get image (if any) from metadata
      if (tagConverter != null) {
        tagConverter.convertRefresh(null);
      }
      return tagConverter;
    }
View Full Code Here

  /*
   * (non-Javadoc)
   * @see org.eclipse.jst.pagedesigner.converter.IConverterFactory#createConverter(org.w3c.dom.Element, int)
   */
  public ITagConverter createConverter(Element element, int mode) {
    ITagConverter tagConverter = null;
    IDTInfo dtInfo = DTManager.getInstance().getDTInfo(element);
    if (dtInfo != null) {
      tagConverter = new DTTagConverter(element);
      tagConverter.setMode(mode);
    }
    return tagConverter;
  }
View Full Code Here

   * @param mode Mode flag (use IConverterFactory constants).
   * @param document Target IDOMDocument instance.
   * @return An ITagConverter instance for the specified Element and mode.
   */
  public ITagConverter getTagConverter(Element element, int mode, IDOMDocument document) {
    ITagConverter tagConverter = null;
    String nsURI = CMUtil.getElementNamespaceURI(element);
    //try MD-driven approach
    IConverterFactory tagConverterFactory = getTagConverterFactory(nsURI);
    if (tagConverterFactory != null) {
      tagConverter = tagConverterFactory.createConverter(element, mode);
      if (tagConverter != null) {
        tagConverter.setDestDocument(document);
      } else {
        //fallback to contributed (non-MD-driven) approach
        tagConverter = ConverterFactoryRegistry.getInstance().createTagConverter(element, mode, document);
      }
    }
View Full Code Here

TOP

Related Classes of org.eclipse.jst.pagedesigner.converter.ITagConverter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.