documentation
diff --git a/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/core/ISnippetCategory.java b/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/core/ISnippetCategory.java
index 668d7a9..aae417c 100644
--- a/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/core/ISnippetCategory.java
+++ b/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/core/ISnippetCategory.java
@@ -10,6 +10,11 @@
*******************************************************************************/
package org.eclipse.wst.common.snippets.core;
+/**
+ * Represents a category containing individual snippets.
+ *
+ * @since 1.0
+ */
public interface ISnippetCategory extends ISnippetsEntry {
/**
* @return an array of the items within this category
diff --git a/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/core/ISnippetItem.java b/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/core/ISnippetItem.java
index a0d3b49..beb20e0 100644
--- a/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/core/ISnippetItem.java
+++ b/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/core/ISnippetItem.java
@@ -13,6 +13,8 @@
/**
* A snippet item is the actual object draggable from the Snippets view.
+ *
+ * @since 1.0
*/
public interface ISnippetItem extends ISnippetsEntry {
/**
diff --git a/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/core/ISnippetVariable.java b/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/core/ISnippetVariable.java
index 6522fe0..45461db 100644
--- a/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/core/ISnippetVariable.java
+++ b/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/core/ISnippetVariable.java
@@ -10,6 +10,12 @@
*******************************************************************************/
package org.eclipse.wst.common.snippets.core;
+/**
+ * A variable is a user-prompted value meant to be filled-in by the user
+ * during insertion.
+ *
+ * @since 1.0
+ */
public interface ISnippetVariable {
/**
* @return Returns the default value for this variable
diff --git a/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/core/ISnippetsEntry.java b/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/core/ISnippetsEntry.java
index 8d41409..dce3724 100644
--- a/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/core/ISnippetsEntry.java
+++ b/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/core/ISnippetsEntry.java
@@ -16,6 +16,8 @@
* A Snippets Entry is an abstract notion encapsulating the values used to
* represent Snippet Items and Containers. No object implements only this
* interface.
+ *
+ * @since 1.0
*/
public interface ISnippetsEntry {
diff --git a/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/ui/DefaultSnippetInsertion.java b/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/ui/DefaultSnippetInsertion.java
index 6fdc34a..e30b31f 100644
--- a/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/ui/DefaultSnippetInsertion.java
+++ b/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/ui/DefaultSnippetInsertion.java
@@ -40,11 +40,17 @@
* An insertion implementation that supports ISnippetVariables. The content
* string of the item can contain markers, in the form ${+variable+}, that
* will be replaced with user-supplied values at insertion time.
+ *
+ * @since 1.0
*/
public class DefaultSnippetInsertion implements ISnippetInsertion {
private ISnippetItem fItem = null;
private Transfer[] fSupportedTransfers = null;
+ /**
+ * Default constructor. Subclasses may call, but only the Snippets view
+ * should ever instantiate an insertion.
+ */
public DefaultSnippetInsertion() {
super();
}
@@ -57,10 +63,18 @@
}
/**
+ * Insert the current snippet item.
+ *
* @param editorPart
+ * the editor part that is active
* @param textEditor
+ * the text editor (or adapter) with which to interact (may be
+ * the same as editorPart)
* @param document
+ * the text document to update
* @param textSelection
+ * the selection of text within the document to be replaced by
+ * the inserted snippet
* @throws BadLocationException
*/
protected void doInsert(IEditorPart editorPart, ITextEditor textEditor, IDocument document, ITextSelection textSelection) throws BadLocationException {
@@ -135,6 +149,14 @@
}
}
+ /**
+ * Gets the string to be inserted by interacting further with the user if
+ * needed.
+ *
+ * @param host
+ * Shell to use for creating dialogs
+ * @return the string to be inserted
+ */
protected String getInsertString(Shell host) {
if (fItem == null)
return ""; //$NON-NLS-1$
diff --git a/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/ui/ISnippetInsertion.java b/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/ui/ISnippetInsertion.java
index 9bec111..18fbaa5 100644
--- a/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/ui/ISnippetInsertion.java
+++ b/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/ui/ISnippetInsertion.java
@@ -20,6 +20,8 @@
* An insertion class is responsible for inserting a snippet item's contents
* into editors. Implementors are responsible for supporting the drag-and-drop
* mechanism and inserting the snippet's text into a given editor part.
+ *
+ * @since 1.0
*/
public interface ISnippetInsertion {
@@ -71,7 +73,7 @@
* for determining which Transfer types to allow and what transfer data to
* set during Drag and Drop operations.
*
- * @param targetPart
+ * @param targetPart the target editor part
*/
void setEditorPart(IEditorPart targetPart);