comparison org.eclipse.jface/src/org/eclipse/jface/fieldassist/IControlContentAdapter2.d @ 12:bc29606a740c

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