Examples of INodeNotifier


Examples of org.eclipse.wst.sse.core.internal.provisional.INodeNotifier

  /**
   */
  private void notifyStructureChanged(Node root) {
    if (root == null)
      return;
    INodeNotifier notifier = (INodeNotifier) root;
    try {
      // Its important to "keep going" if exception occurs, since this
      // notification
      // comes in between "about to change" and "changed" events. We do
      // log, however,
      // since would indicate a program error.
      notifier.notify(INodeNotifier.STRUCTURE_CHANGED, null, null, null, -1);
    } catch (Exception e) {
      Logger.logException("A structured model client threw following exception during adapter notification (" + INodeNotifier.EVENT_TYPE_STRINGS[INodeNotifier.STRUCTURE_CHANGED] + " )", e); //$NON-NLS-1$ //$NON-NLS-2$
    }

  }
View Full Code Here

Examples of org.eclipse.wst.sse.core.internal.provisional.INodeNotifier

    Class clazz = validator.getClass();

    Node child = parent.getFirstChild();
    while (child != null) {
      if (child.getNodeType() == Node.ELEMENT_NODE) {
        INodeNotifier notifier = (INodeNotifier) child;
        ValidationAdapter va = (ValidationAdapter) notifier.getExistingAdapter(clazz);
        if (va == null) {
          notifier.addAdapter(validator);
          va = validator;
        }
        // bug 143213 - Can't batch validate open HTML files when
        // as-you-type validation is enabled
        va.setReporter(validator.getReporter());
View Full Code Here

Examples of org.eclipse.wst.sse.core.internal.provisional.INodeNotifier

    for (int i = 0; i < children.getLength(); i++) {
      Node child = children.item(i);
      if (child == null || child.getNodeType() != Node.ELEMENT_NODE)
        continue;

      INodeNotifier notifier = (INodeNotifier) child;
      ValidationAdapter va = (ValidationAdapter) notifier.getExistingAdapter(clazz);
      if (va == null) {
        notifier.addAdapter(validator);
        va = validator;
      }
      va.validate((IndexedRegion) child);
    }
  }
View Full Code Here

Examples of org.eclipse.wst.sse.core.internal.provisional.INodeNotifier

   * @return the list
   * see org.eclipse.wst.html.core.htmlcss.HTMLDocumentAdapter#addStyleSheet(org.w3c.dom.Element)
   */
  public static List getStyleSheets(Element element) {
    List styleSheets = new ArrayList();
    INodeNotifier docnotifier = (INodeNotifier) element.getOwnerDocument();
    IStyleSheetListAdapter adapter = (IStyleSheetListAdapter) docnotifier
        .getAdapterFor(IStyleSheetListAdapter.class);

    StyleSheetList ssl = (adapter == null ? null : adapter.getStyleSheets());

    if (ssl != null) {
View Full Code Here

Examples of org.eclipse.wst.sse.core.internal.provisional.INodeNotifier

                .equalsIgnoreCase(HTML40Namespace.ElementName.HEAD)) {
          isContainer = true;
        }
      }
    } else {
      INodeNotifier notifier = element;

      // (lium) Increase performance: since this method is called tooooo
      // many times,
      // and getAdapterFor() is slow, so add a check on the tagName to
      // filter
      // those stylesheet stuff first.
      if (IHTMLConstants.TAG_LINK.equalsIgnoreCase(tagName)
          || IHTMLConstants.TAG_STYLE.equalsIgnoreCase(tagName)) {
        INodeAdapter adapter = notifier
            .getAdapterFor(IStyleSheetAdapter.class);
        if (adapter instanceof IStyleSheetAdapter) {
                    // XXX: see bug 171740.  This is a (hopefully) temporary
                    // workaround that avoids having the call to getSheet throw an NPE
                    IStyleSheetAdapter sheetAdapter = (IStyleSheetAdapter) adapter;
View Full Code Here

Examples of org.eclipse.wst.sse.core.internal.provisional.INodeNotifier

      if (localName != null && localName.equalsIgnoreCase(HTML40Namespace.ElementName.HTML)) {
        // taglib html tag
        isContainer = true;
      }
      else {
        INodeNotifier notifier = element;
        INodeAdapter adapter = notifier.getAdapterFor(IStyleSheetAdapter.class);
        if (adapter != null && adapter instanceof IStyleSheetAdapter) {
          this.styleAdapters.addElement(adapter);
        }
      }
    }
    if (isContainer) {
      INodeNotifier notifier = element;
      if (notifier.getExistingAdapter(IStyleSheetListAdapter.class) == null) {
        notifier.addAdapter(this);
      }
      for (Node child = element.getFirstChild(); child != null; child = child.getNextSibling()) {
        if (child.getNodeType() != Node.ELEMENT_NODE)
          continue;
        addStyleSheet((Element) child);
View Full Code Here

Examples of org.eclipse.wst.sse.core.internal.provisional.INodeNotifier

  }

  /**
   */
  private void notifyStyleSheetsChanged(Document target) {
    INodeNotifier notifier = (INodeNotifier) target;
    if (notifier == null)
      return;
    Collection adapters = notifier.getAdapters();
    if (adapters == null)
      return;
    Iterator it = adapters.iterator();
    if (it == null)
      return;
View Full Code Here

Examples of org.eclipse.wst.sse.core.internal.provisional.INodeNotifier

  }

  /**
   */
  protected void notifyStyleChanged(Element target) {
    INodeNotifier notifier = (INodeNotifier) target;
    if (notifier == null)
      return;
    Collection adapters = notifier.getAdapters();
    if (adapters == null)
      return;
    Iterator it = adapters.iterator();
    if (it == null)
      return;
View Full Code Here

Examples of org.eclipse.wst.sse.core.internal.provisional.INodeNotifier

  /**
   */
  private ICSSModel getCSSModel(Attr attr) {
    if (attr == null)
      return null;
    INodeNotifier notifier = (INodeNotifier) attr.getOwnerElement();
    if (notifier == null)
      return null;
    INodeAdapter adapter = notifier.getAdapterFor(IStyleDeclarationAdapter.class);
    if (adapter == null)
      return null;
    if (!(adapter instanceof IStyleDeclarationAdapter))
      return null;
    IStyleDeclarationAdapter styleAdapter = (IStyleDeclarationAdapter) adapter;
View Full Code Here

Examples of org.eclipse.wst.sse.core.internal.provisional.INodeNotifier

    if (model == null)
      return null;
    ICSSNode document = model.getDocument();
    if (document == null)
      return null;
    INodeNotifier notifier = (INodeNotifier) document;
    CSSSourceFormatter formatter = (CSSSourceFormatter) notifier.getAdapterFor(CSSSourceFormatter.class);
    // try another way to get formatter
    if (formatter == null)
      formatter = CSSSourceFormatterFactory.getInstance().getSourceFormatter(notifier);
    if (formatter == null)
      return null;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.