annotate dwtx/jface/fieldassist/IControlContentAdapter2.d @ 192:c3583c6ec027

Added missing default cases for switch statements
author Frank Benoit <benoit@tionex.de>
date Mon, 03 Nov 2008 22:52:26 +0100
parents 46a6e0e6ccd4
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
70
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1 /*******************************************************************************
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2 * Copyright (c) 2007 IBM Corporation and others.
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3 * All rights reserved. This program and the accompanying materials
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
4 * are made available under the terms of the Eclipse Public License v1.0
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
5 * which accompanies this distribution, and is available at
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
6 * http://www.eclipse.org/legal/epl-v10.html
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
7 *
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
8 * Contributors:
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
9 * IBM Corporation - initial API and implementation
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
10 * Port to the D programming language:
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
11 * Frank Benoit <benoit@tionex.de>
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
12 *******************************************************************************/
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
13 module dwtx.jface.fieldassist.IControlContentAdapter2;
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
14
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
15 import dwt.graphics.Point;
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
16 import dwt.widgets.Control;
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
17
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
18 /**
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
19 * This interface is used by a {@link ContentProposalAdapter} in order to
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
20 * retrieve and set the selection range in a control.
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
21 *
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
22 * @since 3.4
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
23 */
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
24 public interface IControlContentAdapter2 {
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
25 /**
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
26 * Get the current selection range in the control. The x coordinate of the
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
27 * returned point is the position of the first selected character and the y
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
28 * coordinate of the returned point is the position of the last selected
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
29 * character. The positions are specified as a zero-based index into the
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
30 * string. Valid ranges are from 0 to N, where N is the size of the contents
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
31 * string. A value of N indicates that the last character is in the
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
32 * selection.
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
33 *
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
34 * @param control
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
35 * the control whose position is to be retrieved.
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
36 * @return a point representing the selection start and end
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
37 */
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
38 public Point getSelection(Control control);
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
39
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
40 /**
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
41 * Set the current selection range in the control. The x coordinate of the
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
42 * provided point is the position of the first selected character and the y
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
43 * coordinate of the point is the position of the last selected character.
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
44 * The positions are specified as a zero-based index into the string. Valid
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
45 * ranges are from 0 to N, where N is the size of the contents string. A
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
46 * value of N indicates that the last character is in the selection. If the
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
47 * x and y coordinates are the same, then there is no selection.
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
48 *
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
49 * @param control
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
50 * the control whose position is to be retrieved.
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
51 * @param range
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
52 * a point representing the selection start and end
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
53 */
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
54 public void setSelection(Control control, Point range);
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
55
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
56 }