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:
authordavid_williams2005-04-18 08:00:30 +0000
committerdavid_williams2005-04-18 08:00:30 +0000
commit4ad020f33bd9ae4c3b1dcc95ac14804bea8d4ac0 (patch)
tree85c347c480c85d69864be569d20183b0035d20eb /bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/IModelLoader.java
parent84861fab6da9bfdc0b203655234476fcb334ca7c (diff)
downloadwebtools.sourceediting-4ad020f33bd9ae4c3b1dcc95ac14804bea8d4ac0.tar.gz
webtools.sourceediting-4ad020f33bd9ae4c3b1dcc95ac14804bea8d4ac0.tar.xz
webtools.sourceediting-4ad020f33bd9ae4c3b1dcc95ac14804bea8d4ac0.zip
continuing internalization
Diffstat (limited to 'bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/IModelLoader.java')
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/IModelLoader.java86
1 files changed, 86 insertions, 0 deletions
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/IModelLoader.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/IModelLoader.java
new file mode 100644
index 0000000000..e7766c8f06
--- /dev/null
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/IModelLoader.java
@@ -0,0 +1,86 @@
+/*******************************************************************************
+ * 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
+ * Jens Lukowski/Innoopract - initial renaming/restructuring
+ *
+ *******************************************************************************/
+package org.eclipse.wst.sse.core.internal.provisional;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.List;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.wst.sse.core.internal.encoding.EncodingRule;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
+
+
+/**
+ * Responsible for creating a new Model from a resource, or as a new, empty
+ * instance.
+ *
+ */
+public interface IModelLoader {
+ /**
+ * This method should perform all the model initialization required before
+ * it contains content, namely, it should call newModel, the
+ * createNewStructuredDocument(), then setAdapterFactories. (this is
+ * tentative)
+ */
+ IStructuredModel createModel();
+
+ /**
+ * Method createModel. Creates a new model based on old one.
+ *
+ * @param oldModel
+ * @return IStructuredModel
+ */
+ IStructuredModel createModel(IStructuredModel oldModel);
+
+ /**
+ * This method must return those factories which must be attached to the
+ * structuredModel before content is applied.
+ */
+ List getAdapterFactories();
+
+ void load(IFile file, IStructuredModel model) throws IOException, CoreException;
+
+ void load(InputStream inputStream, IStructuredModel model, EncodingRule encodingRule) throws IOException;
+
+ void load(String filename, InputStream inputStream, IStructuredModel model, String encodingName, String lineDelimiter) throws IOException;
+
+ IModelLoader newInstance();
+
+ /**
+ * This method should always return an new, empty Structured Model
+ * appropriate for itself.
+ */
+ IStructuredModel newModel();
+
+ IStructuredModel reinitialize(IStructuredModel model);
+
+ /**
+ * This method should get a fresh copy of the data, and repopulate the
+ * models ... normally by a call to setText on the structuredDocument, for
+ * StructuredModels. This method is needed in some cases where clients are
+ * sharing a model and then changes canceled. Say for example, one editor
+ * and several "displays" are sharing a model, if the editor is closed
+ * without saving changes, then the displays still need a model, but they
+ * should revert to the original unsaved version.
+ */
+ void reload(InputStream inputStream, IStructuredModel model);
+
+ /**
+ * Create a Structured Model with the given StructuredDocument instance as
+ * its document (instead of a new document instance as well)
+ */
+ IStructuredModel createModel(IStructuredDocument document, String baseLocation);
+
+}

Back to the top