Skip to main content

This CGIT instance is deprecated, and repositories have been moved to Gitlab or Github. See the repository descriptions for specific locations.

aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/AbstractCSSModelAdapter.java')
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/AbstractCSSModelAdapter.java105
1 files changed, 0 insertions, 105 deletions
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/AbstractCSSModelAdapter.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/AbstractCSSModelAdapter.java
deleted file mode 100644
index 46beaeca70..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/AbstractCSSModelAdapter.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.htmlcss;
-
-import java.util.Collection;
-import java.util.Iterator;
-
-import org.eclipse.wst.css.core.contenttype.ContentTypeIdForCSS;
-import org.eclipse.wst.css.core.internal.document.CSSModelImpl;
-import org.eclipse.wst.css.core.internal.provisional.adapters.ICSSModelAdapter;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
-import org.eclipse.wst.sse.core.INodeAdapter;
-import org.eclipse.wst.sse.core.INodeNotifier;
-import org.eclipse.wst.sse.core.IStructuredModel;
-import org.eclipse.wst.xml.core.document.IDOMNode;
-import org.w3c.dom.Element;
-
-/**
- */
-public abstract class AbstractCSSModelAdapter implements ICSSModelAdapter {
- private final static String CSS_ID = ContentTypeIdForCSS.ContentTypeID_CSS;
-
- private Element element = null;
- private ICSSModel model = null;
-
- /**
- */
- AbstractCSSModelAdapter() {
- super();
- }
-
- /**
- */
- protected ICSSModel createModel() {
- // create embedded CSS model (not for external CSS)
- if (getElement() == null)
- return null;
- IStructuredModel baseModel = ((IDOMNode) getElement()).getModel();
- ICSSModel newModel = (ICSSModel) baseModel.getModelManager().createUnManagedStructuredModelFor(CSS_ID);
- ((CSSModelImpl) newModel).setOwnerDOMNode(getElement());
- return newModel;
- }
-
- /**
- */
- public Element getElement() {
- return this.element;
- }
-
- /**
- */
- protected ICSSModel getExistingModel() {
- return this.model;
- }
-
- /**
- */
- 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;
- while (it.hasNext()) {
- INodeAdapter adapter = (INodeAdapter) it.next();
- if (adapter instanceof StyleListener) {
- StyleListener listener = (StyleListener) adapter;
- listener.styleChanged();
- }
- }
- }
-
- /**
- */
- void setElement(Element element) {
- this.element = element;
- }
-
- /**
- * check
- * 1. If attributes of element is valid (type,rel ...)
- * 2. If content model supports this element / attribute (future ?)
- */
- protected boolean isValidAttribute() {
- return (getElement() != null);
- }
-
- /**
- */
- protected void setModel(ICSSModel model) {
- this.model = model;
- }
-} \ No newline at end of file

Back to the top