From 585759024148ecbdcb83e11516837ee0aaf25505 Mon Sep 17 00:00:00 2001 From: teicher Date: Mon, 21 Jun 2004 14:38:00 +0000 Subject: javadoc --- .../org/eclipse/jface/text/link/LinkedModeUI.java | 77 +++++++++++++--------- .../jface/text/link/LinkedPositionAnnotations.java | 2 + .../eclipse/jface/text/link/ProposalPosition.java | 30 +++++++-- .../eclipse/jface/text/link/TabStopIterator.java | 4 +- .../src/org/eclipse/jface/text/link/package.html | 17 ++--- 5 files changed, 80 insertions(+), 50 deletions(-) diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/link/LinkedModeUI.java b/org.eclipse.jface.text/src/org/eclipse/jface/text/link/LinkedModeUI.java index 89e8ca631fe..d1535e37d43 100644 --- a/org.eclipse.jface.text/src/org/eclipse/jface/text/link/LinkedModeUI.java +++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/link/LinkedModeUI.java @@ -58,7 +58,7 @@ import org.eclipse.jface.text.source.IAnnotationModelExtension; import org.eclipse.jface.text.source.ISourceViewer; /** - * The UI for linked mode. Detects events that influence behaviour of the linked mode + * The UI for linked mode. Detects events that influence behavior of the linked mode * UI and acts upon them. *

* LinkedModeUI relies on all added @@ -66,6 +66,9 @@ import org.eclipse.jface.text.source.ISourceViewer; * ITextViewer that implement ITextViewerExtension, * and the documents being edited to implement IDocumentExtension3. *

+ *

+ * Clients may instantiate and extend this class. + *

* * @since 3.0 */ @@ -89,7 +92,10 @@ public class LinkedModeUI { public static final Object CYCLE_WHEN_NO_PARENT= new Object(); /** - * Listener that gets notified when the linked mode ui switches its focus position. + * Listener that gets notified when the linked mode UI switches its focus position. + *

+ * Clients may implement this interface. + *

*/ public static interface ILinkedModeUIFocusListener { /** @@ -125,7 +131,9 @@ public class LinkedModeUI { /** * A link target consists of a viewer and gets notified if the linked mode UI on * it is being shown. - * + *

+ * Clients may extend this class. + *

* @since 3.0 */ public static abstract class LinkedModeUITarget implements ILinkedModeUIFocusListener { @@ -216,6 +224,9 @@ public class LinkedModeUI { /** * Exit flags returned if a custom exit policy wants to exit linked mode. + *

+ * Clients may instantiate this class. + *

*/ public static class ExitFlags { /** The flags to return in the leave method. */ @@ -236,7 +247,10 @@ public class LinkedModeUI { /** * An exit policy can be registered by a caller to get custom exit - * behaviour. + * behavior. + *

+ * Clients may implement this interface. + *

*/ public interface IExitPolicy { /** @@ -543,39 +557,37 @@ public class LinkedModeUI { } }; - /** Whether this ui is in simple highlighting mode or not. */ + /** Whether this UI is in simple highlighting mode or not. */ private boolean fSimple; /** - * Creates a new UI on the given model and the set of - * viewers. The model must provide a tab stop sequence with a - * non-empty list of tab stops. + * Creates a new UI on the given model and the set of viewers. The model + * must provide a tab stop sequence with a non-empty list of tab stops. * * @param model the linked mode model - * @param targets the non-empty list of targets upon which the linked mode ui - * should act + * @param targets the non-empty list of targets upon which the linked mode + * UI should act */ public LinkedModeUI(LinkedModeModel model, LinkedModeUITarget[] targets) { constructor(model, targets); } /** - * Conveniance ctor for just one viewer. + * Convenience constructor for just one viewer. * * @param model the linked mode model - * @param viewer the viewer upon which the linked mode ui - * should act + * @param viewer the viewer upon which the linked mode UI should act */ public LinkedModeUI(LinkedModeModel model, ITextViewer viewer) { constructor(model, new LinkedModeUITarget[]{new EmptyTarget(viewer)}); } /** - * Conveniance ctor for multiple viewers. + * Convenience constructor for multiple viewers. * * @param model the linked mode model - * @param viewers the non-empty list of viewers upon which the linked mode ui - * should act + * @param viewers the non-empty list of viewers upon which the linked mode + * UI should act */ public LinkedModeUI(LinkedModeModel model, ITextViewer[] viewers) { LinkedModeUITarget[] array= new LinkedModeUITarget[viewers.length]; @@ -586,11 +598,10 @@ public class LinkedModeUI { } /** - * Conveniance ctor for one target. + * Convenience constructor for one target. * * @param model the linked mode model - * @param target the target upon which the linked mode ui - * should act + * @param target the target upon which the linked mode UI should act */ public LinkedModeUI(LinkedModeModel model, LinkedModeUITarget target) { constructor(model, new LinkedModeUITarget[]{target}); @@ -634,7 +645,7 @@ public class LinkedModeUI { } /** - * Sets an IExitPolicy to customize the exit behaviour of + * Sets an IExitPolicy to customize the exit behavior of * this linked mode UI. * * @param policy the exit policy to use. @@ -644,16 +655,18 @@ public class LinkedModeUI { } /** - * Sets the exit position to move the caret to when linked mode mode is exited. + * Sets the exit position to move the caret to when linked mode mode is + * exited. * * @param target the target where the exit position is located * @param offset the offset of the exit position * @param length the length of the exit position (in case there should be a * selection) - * @param sequence set to the tab stop position of the exit position, or - * LinkedPositionGroup.NO_STOP if there should be no tab stop. - * @throws BadLocationException if the position is not valid in the - * viewer's document + * @param sequence set to the tab stop position of the exit position, or + * LinkedPositionGroup.NO_STOP if there should be no + * tab stop. + * @throws BadLocationException if the position is not valid in the viewer's + * document */ public void setExitPosition(LinkedModeUITarget target, int offset, int length, int sequence) throws BadLocationException { // remove any existing exit position @@ -1120,8 +1133,6 @@ public class LinkedModeUI { return new Region(fFramePosition.getOffset(), fFramePosition.getLength()); } - - private String getCategory() { return toString(); } @@ -1131,7 +1142,8 @@ public class LinkedModeUI { * info will be invoked on the current target's viewer whenever a position * is switched. * - * @param doContextInfo The doContextInfo to set. + * @param doContextInfo true if context information should be + * displayed */ public void setDoContextInfo(boolean doContextInfo) { fDoContextInfo= doContextInfo; @@ -1139,9 +1151,10 @@ public class LinkedModeUI { /** * Sets the focus callback which will get informed when the focus of the - * linked mode ui changes. + * linked mode UI changes. *

- * If there is a listener installed already, it will be replaced.

+ * If there is a listener installed already, it will be replaced. + *

* * @param listener the new listener, never null. */ @@ -1151,12 +1164,12 @@ public class LinkedModeUI { } /** - * Sets the "simple" mode of the receiver. A linked mode ui in simple mode + * Sets the "simple" mode of the receiver. A linked mode UI in simple mode * merely draws the exit position, but not the target, focus, and slave * positions. Default is false. This method must be called * before it is entered. * - * @param simple true if the ui should be in simple mode. + * @param simple true if the UI should be in simple mode. */ public void setSimpleMode(boolean simple) { fSimple= simple; diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/link/LinkedPositionAnnotations.java b/org.eclipse.jface.text/src/org/eclipse/jface/text/link/LinkedPositionAnnotations.java index af2779586ae..30766fbced6 100644 --- a/org.eclipse.jface.text/src/org/eclipse/jface/text/link/LinkedPositionAnnotations.java +++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/link/LinkedPositionAnnotations.java @@ -28,6 +28,8 @@ import org.eclipse.jface.text.source.Annotation; import org.eclipse.jface.text.source.AnnotationModel; /** + * Internal class. + * * @since 3.0 */ final class LinkedPositionAnnotations extends AnnotationModel { diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/link/ProposalPosition.java b/org.eclipse.jface.text/src/org/eclipse/jface/text/link/ProposalPosition.java index d40448c5b8a..6f741b67d76 100644 --- a/org.eclipse.jface.text/src/org/eclipse/jface/text/link/ProposalPosition.java +++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/link/ProposalPosition.java @@ -17,28 +17,41 @@ import org.eclipse.jface.text.contentassist.ICompletionProposal; /** * LinkedPosition with added completion proposals. + *

+ * Clients may instantiate or extend this class. + *

* * @since 3.0 */ public class ProposalPosition extends LinkedPosition { /** - * Da proposals + * The proposals */ private ICompletionProposal[] fProposals; /** - * @param document - * @param offset - * @param length - * @param sequence - * @param proposals + * Creates a new instance. + * + * @param document the document + * @param offset the offset of the position + * @param length the length of the position + * @param sequence the iteration sequence rank + * @param proposals the proposals to be shown when entering this position */ public ProposalPosition(IDocument document, int offset, int length, int sequence, ICompletionProposal[] proposals) { super(document, offset, length, sequence); fProposals= proposals; } + /** + * Creates a new instance, with no sequence number. + * + * @param document the document + * @param offset the offset of the position + * @param length the length of the position + * @param proposals the proposals to be shown when entering this position + */ public ProposalPosition(IDocument document, int offset, int length, ICompletionProposal[] proposals) { super(document, offset, length, LinkedPositionGroup.NO_STOP); fProposals= proposals; @@ -57,7 +70,10 @@ public class ProposalPosition extends LinkedPosition { } /** - * @return an array of choices, including the initial one. Clients must not modify it. + * Returns the proposals attached to this position. + * + * @return an array of choices, including the initial one. Callers must not + * modify it. */ public ICompletionProposal[] getChoices() { return fProposals; diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/link/TabStopIterator.java b/org.eclipse.jface.text/src/org/eclipse/jface/text/link/TabStopIterator.java index ed2d521faa3..060bc54d9ce 100644 --- a/org.eclipse.jface.text/src/org/eclipse/jface/text/link/TabStopIterator.java +++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/link/TabStopIterator.java @@ -26,7 +26,9 @@ import org.eclipse.jface.text.link.LinkedPosition; /** * Iterator that leaps over the double occurrence of an element when switching from forward * to backward iteration that is shown by ListIterator. - * + *

+ * Package private, only for use by LinkedModeUI. + *

* @since 3.0 */ class TabStopIterator { diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/link/package.html b/org.eclipse.jface.text/src/org/eclipse/jface/text/link/package.html index c09d62d880b..153941b2c51 100644 --- a/org.eclipse.jface.text/src/org/eclipse/jface/text/link/package.html +++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/link/package.html @@ -22,9 +22,9 @@ of one linked position will be reflected in the others.

Classes

Example

-
	IDocument doc1, doc2;
ITextViewer viewer1, viewer2;

/* create groups - this step is independent of the linked mode */
LinkedPositionGroup group1= new LinkedPositionGroup();
group1.addPosition(new LinkedPosition(doc1, 3, 4));
group1.addPosition(new LinkedPosition(doc1, 7, 8));

LinkedPositionGroup group2= new LinkedPositionGroup();
group2.addPosition(new LinkedPosition(doc1, 15, 25));
group2.addPosition(new LinkedPosition(doc2, 0, 10));

/* set up linked mode */
LinkedModeModel model= new LinkedModeModel();
model.addGroup(group1);
model.addGroup(group2);
model.forceInstall();

/* create UI */
LinkedModeUI ui= new LinkedModeUI(model, new ITextViewer[] { viewer1, viewer2 });
ui.enter();
-

Todo

- +
	IDocument doc1, doc2;
ITextViewer viewer1, viewer2;

/* create groups - this step is independent of the linked mode */
LinkedPositionGroup group1= new LinkedPositionGroup();
group1.addPosition(new LinkedPosition(doc1, 3, 4));
group1.addPosition(new LinkedPosition(doc1, 7, 8));

LinkedPositionGroup group2= new LinkedPositionGroup();
group2.addPosition(new LinkedPosition(doc1, 15, 25));
group2.addPosition(new LinkedPosition(doc2, 0, 10));

/* set up linked mode */
LinkedModeModel model= new LinkedModeModel();
model.addGroup(group1);
model.addGroup(group2);
model.forceInstall();

/* create UI */
LinkedModeUI ui= new LinkedModeUI(model, new ITextViewer[] { viewer1, viewer2 });
ui.enter();

-- cgit v1.2.3