Package org.eclipse.wst.css.core.internal.provisional.document

Examples of org.eclipse.wst.css.core.internal.provisional.document.ICSSModel


  }

  /**
   */
  public ICSSModel getModel() {
    ICSSModel model = getExistingModel();
    if (model == null && isModelNecessary()) {
      model = createModel();
      if (model == null)
        return null;
     
      IStructuredDocument structuredDocument = model.getStructuredDocument();
      if (structuredDocument == null)
        return null;

      RegionParser parser = structuredDocument.getParser();
      if (parser instanceof CSSSourceParser) {
View Full Code Here


  }

  /**
   */
  public CSSStyleDeclaration getStyle() {
    ICSSModel model = getModel();
    if (model == null)
      return null;
    return (CSSStyleDeclaration) model.getDocument();
  }
View Full Code Here

   */
  private void setValue() {
    Element element = getElement();
    if (element == null)
      return;
    ICSSModel model = getExistingModel();
    if (model == null)
      return;
    IStructuredDocument structuredDocument = model.getStructuredDocument();
    if (structuredDocument == null)
      return;

    String value = null;
    IStructuredDocumentRegionList flatNodes = structuredDocument.getRegionList();
View Full Code Here

      notifyStyleChanged(element);
      return;
    }

    ICSSModel model = getExistingModel();
    if (model == null)
      return; // defer
    IStructuredDocument structuredDocument = model.getStructuredDocument();
    if (structuredDocument == null)
      return; // error

    String value = null;
    Attr attr = element.getAttributeNode(org.eclipse.wst.html.core.internal.provisional.HTML40Namespace.ATTR_NAME_STYLE);
View Full Code Here

  }

  /**
   */
  protected ICSSModel createModel(boolean notify) {
    ICSSModel newModel = super.createModel();
    if (notify && newModel != null) {
      // get ModelProvideAdapter
      IModelProvideAdapter adapter = (IModelProvideAdapter) ((INodeNotifier) getElement()).getAdapterFor(IModelProvideAdapter.class);
      // notify adapter
      if (adapter != null)
View Full Code Here

  }

  /**
   */
  public StyleSheet getSheet() {
    ICSSModel model = getModel();
    if (model == null)
      return null;
    return (StyleSheet) model.getDocument();
  }
View Full Code Here

  }

  /**
   */
  public void released() {
    ICSSModel currentModel = getModel();

    // get ModelProvideAdapter
    IModelProvideAdapter adapter = (IModelProvideAdapter) ((INodeNotifier) getElement()).getAdapterFor(IModelProvideAdapter.class);

    setElement(null);
    setModel(null);

    if (adapter != null)
      adapter.modelReleased(currentModel);

    if (currentModel != null)
      currentModel.releaseFromRead();
  }
View Full Code Here

  }

  /**
   */
  public void removed() {
    ICSSModel currentModel = getModel();

    setModel(null);

    // get ModelProvideAdapter
    IModelProvideAdapter adapter = (IModelProvideAdapter) ((INodeNotifier) getElement()).getAdapterFor(IModelProvideAdapter.class);
    if (adapter != null)
      adapter.modelRemoved(currentModel);

    if (currentModel != null)
      currentModel.releaseFromRead();
  }
View Full Code Here

  }

  /**
   */
  private String getCSSContent(IDOMNode text) {
    ICSSModel model = getCSSModel(text);
    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
View Full Code Here

  }

  /**
   */
  private String getCSSContent(Node text) {
    ICSSModel model = getCSSModel(text);
    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
View Full Code Here

TOP

Related Classes of org.eclipse.wst.css.core.internal.provisional.document.ICSSModel

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.