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.

summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/document/XMLStyleModelImpl.java')
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/document/XMLStyleModelImpl.java67
1 files changed, 67 insertions, 0 deletions
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/document/XMLStyleModelImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/document/XMLStyleModelImpl.java
new file mode 100644
index 0000000000..62ea67e7ad
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/document/XMLStyleModelImpl.java
@@ -0,0 +1,67 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 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
+ *******************************************************************************/
+/*
+ * Created on Sep 2, 2003
+ *
+ * To change the template for this generated file go to
+ * Window>Preferences>Java>Code Generation>Code and Comments
+ */
+package org.eclipse.wst.html.core.document;
+
+import org.eclipse.wst.xml.core.internal.document.XMLModelImpl;
+import org.w3c.dom.Document;
+
+/**
+ * @author davidw
+ *
+ * To change the template for this generated type comment go to
+ * Window>Preferences>Java>Code Generation>Code and Comments
+ */
+public class XMLStyleModelImpl extends XMLModelImpl {
+ public XMLStyleModelImpl() {
+ // remember, the document is created in super constructor,
+ // via internalCreateDocument
+ super();
+ }
+
+ public void releaseFromEdit() {
+ releaseStyleSheets();
+ super.releaseFromEdit();
+ }
+
+ /**
+ */
+ public void releaseFromRead() {
+ releaseStyleSheets();
+ super.releaseFromRead();
+ }
+
+ private void releaseStyleSheets() {
+ if (!isShared()) {
+ Document doc = getDocument();
+ if (doc instanceof DocumentStyleImpl) {
+ ((DocumentStyleImpl) doc).releaseStyleSheets();
+ }
+ }
+ }
+
+ /**
+ * createDocument method
+ * @return org.w3c.dom.Document
+ */
+ protected Document internalCreateDocument() {
+ DocumentStyleImpl document = new DocumentStyleImpl();
+ document.setModel(this);
+ return document;
+ }
+
+
+} \ No newline at end of file

Back to the top