Search in sources :

Example 21 with ICSSDocument

use of org.eclipse.wst.css.core.internal.provisional.document.ICSSDocument in project webtools.sourceediting by eclipse.

the class CSSNodeImpl method notifyAttrReplaced.

protected void notifyAttrReplaced(CSSNodeImpl newAttr, CSSNodeImpl oldAttr) {
    // for model
    ICSSDocument doc = getContainerDocument();
    if (doc == null)
        return;
    CSSModelImpl model = (CSSModelImpl) doc.getModel();
    if (model == null)
        return;
    model.attrReplaced(this, newAttr, oldAttr);
    // for adapters
    int type = CHANGE;
    if (newAttr == null)
        type = REMOVE;
    else if (oldAttr == null)
        type = ADD;
    notify(type, oldAttr, oldAttr, newAttr, getStartOffset());
}
Also used : ICSSDocument(org.eclipse.wst.css.core.internal.provisional.document.ICSSDocument)

Example 22 with ICSSDocument

use of org.eclipse.wst.css.core.internal.provisional.document.ICSSDocument in project webtools.sourceediting by eclipse.

the class CSSPrimitiveValueImpl method notifyValueChanged.

/**
 */
protected void notifyValueChanged(String oldValue) {
    // for model
    ICSSDocument doc = getContainerDocument();
    if (doc == null)
        return;
    CSSModelImpl model = (CSSModelImpl) doc.getModel();
    if (model == null)
        return;
    model.valueChanged(this, oldValue);
    // for adapters
    notify(CHANGE, new Short(fPrimitiveType), null, null, getStartOffset());
}
Also used : ICSSDocument(org.eclipse.wst.css.core.internal.provisional.document.ICSSDocument)

Example 23 with ICSSDocument

use of org.eclipse.wst.css.core.internal.provisional.document.ICSSDocument in project webtools.sourceediting by eclipse.

the class CSSAttrImpl method notifyValueChanged.

/**
 */
protected void notifyValueChanged(String oldValue) {
    if (this.ownerCSSNode == null)
        return;
    // for model
    ICSSDocument doc = ownerCSSNode.getContainerDocument();
    if (doc == null)
        return;
    CSSModelImpl model = (CSSModelImpl) doc.getModel();
    if (model == null)
        return;
    model.valueChanged(this, oldValue);
    // for adapters
    String value = getValue();
    this.ownerCSSNode.notify(CHANGE, this, oldValue, value, this.ownerCSSNode.getStartOffset());
}
Also used : ICSSDocument(org.eclipse.wst.css.core.internal.provisional.document.ICSSDocument)

Aggregations

ICSSDocument (org.eclipse.wst.css.core.internal.provisional.document.ICSSDocument)23 ICSSModel (org.eclipse.wst.css.core.internal.provisional.document.ICSSModel)12 CSSRule (org.w3c.dom.css.CSSRule)10 ICSSNode (org.eclipse.wst.css.core.internal.provisional.document.ICSSNode)9 ICSSStyleSheet (org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleSheet)8 CSSRuleList (org.w3c.dom.css.CSSRuleList)8 IStructuredModel (org.eclipse.wst.sse.core.internal.provisional.IStructuredModel)7 IFile (org.eclipse.core.resources.IFile)5 Path (org.eclipse.core.runtime.Path)5 IndexedRegion (org.eclipse.wst.sse.core.internal.provisional.IndexedRegion)4 Iterator (java.util.Iterator)2 List (java.util.List)2 ITextSelection (org.eclipse.jface.text.ITextSelection)2 ICompletionProposal (org.eclipse.jface.text.contentassist.ICompletionProposal)2 CSSFormatUtil (org.eclipse.wst.css.core.internal.formatter.CSSFormatUtil)2 CSSSourceFormatter (org.eclipse.wst.css.core.internal.formatter.CSSSourceFormatter)2 CSSMetaModelUtil (org.eclipse.wst.css.core.internal.metamodel.util.CSSMetaModelUtil)2 ICSSImportRule (org.eclipse.wst.css.core.internal.provisional.document.ICSSImportRule)2 SelectionCollector (org.eclipse.wst.css.core.internal.util.SelectionCollector)2 INodeNotifier (org.eclipse.wst.sse.core.internal.provisional.INodeNotifier)2