Mercurial > projects > dwt2
view 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 |
line wrap: on
line source
/******************************************************************************* * Copyright (c) 2007 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 * Port to the D programming language: * Frank Benoit <benoit@tionex.de> *******************************************************************************/ module org.eclipse.jface.fieldassist.IControlContentAdapter2; import java.lang.all; import org.eclipse.swt.graphics.Point; import org.eclipse.swt.widgets.Control; /** * This interface is used by a {@link ContentProposalAdapter} in order to * retrieve and set the selection range in a control. * * @since 3.4 */ public interface IControlContentAdapter2 { /** * Get the current selection range in the control. The x coordinate of the * returned point is the position of the first selected character and the y * coordinate of the returned point is the position of the last selected * character. The positions are specified as a zero-based index into the * string. Valid ranges are from 0 to N, where N is the size of the contents * string. A value of N indicates that the last character is in the * selection. * * @param control * the control whose position is to be retrieved. * @return a point representing the selection start and end */ public Point getSelection(Control control); /** * Set the current selection range in the control. The x coordinate of the * provided point is the position of the first selected character and the y * coordinate of the point is the position of the last selected character. * The positions are specified as a zero-based index into the string. Valid * ranges are from 0 to N, where N is the size of the contents string. A * value of N indicates that the last character is in the selection. If the * x and y coordinates are the same, then there is no selection. * * @param control * the control whose position is to be retrieved. * @param range * a point representing the selection start and end */ public void setSelection(Control control, Point range); }