Examples of XMLModelNotifier


Examples of org.eclipse.wst.xml.core.internal.document.XMLModelNotifier

    if (node == null)
      return;
    IDOMModel model = node.getModel();
    if (model == null)
      return;
    XMLModelNotifier notifier = model.getModelNotifier();
    if (notifier == null)
      return;

    // before updating, all sub-models should be loaded!
    DocumentStyle document = (DocumentStyle) model.getDocument();
    StyleSheetList styles = document.getStyleSheets();
    if (styles != null) {
      int n = styles.getLength();
      ImportedCollector trav = new ImportedCollector();
      for (int i = 0; i < n; i++) {
        org.w3c.dom.stylesheets.StyleSheet sheet = styles.item(i);
        if (sheet instanceof ICSSNode)
          trav.apply((ICSSNode) sheet);
      }
    }

    // flash style changed events
    if (styleChangedNodes != null) {
      Object[] elements = styleChangedNodes.toArray();
      for (int i = 0; elements != null && i < elements.length; i++)
        notifyStyleChanged((Element) elements[i]);
      styleChangedNodes.clear();
    }

    // to notify GEF tree
    if (document instanceof INodeNotifier) {
      Collection adapters = ((INodeNotifier) document).getAdapters();
      if (adapters == null)
        return;
      Iterator it = adapters.iterator();
      if (it == null)
        return;
      while (it.hasNext()) {
        INodeAdapter adapter = (INodeAdapter) it.next();
        if (adapter instanceof ICSSStyleListener) {
          ((ICSSStyleListener) adapter).styleUpdate(srcModel);
        }
      }
    }

    notifier.propertyChanged(node);
  }
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.