Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 


Eclipse Platform
Release 3.5

org.eclipse.jface.fieldassist
Interface IControlContentAdapter

All Known Implementing Classes:
ComboContentAdapter, TextContentAdapter

public interface IControlContentAdapter

This interface is used to set and retrieve text content from an arbitrary control. Clients are expected to implement this interface when defining a ContentProposalAdapter, in order to specify how to retrieve and set the contents of the control being adapted.

Since:
3.2

Method Summary
  String getControlContents ( Control control)
          Get the text contents of the control.
 int getCursorPosition ( Control control)
          Get the current cursor position in the control.
  Rectangle getInsertionBounds ( Control control)
          Get the bounds (in pixels) of the insertion point for the control content.
 void insertControlContents ( Control control, String contents, int cursorPosition)
          Insert the specified contents into the control's current contents.
 void setControlContents ( Control control, String contents, int cursorPosition)
          Set the contents of the specified control to the specified text.
 void setCursorPosition ( Control control, int index)
          Set the current cursor position in the control.
 

Method Detail

setControlContents

void setControlContents(
Control control,
                        
String contents,
                        int cursorPosition)
Set the contents of the specified control to the specified text. Must not be null.

Parameters:
control - the control whose contents are to be set (replaced).
contents - the String specifying the new control content.
cursorPosition - the zero-based index representing the desired cursor position in the control's contents after the contents are set.

insertControlContents

void insertControlContents(
Control control,
                           
String contents,
                           int cursorPosition)
Insert the specified contents into the control's current contents. Must not be null.

Parameters:
control - the control whose contents are to be altered.
contents - the String to be inserted into the control contents.
cursorPosition - the zero-based index representing the desired cursor position within the inserted contents after the insertion is made.

getControlContents


String getControlContents(
Control control)
Get the text contents of the control.

Parameters:
control - the control whose contents are to be retrieved.
Returns:
the String contents of the control.

getCursorPosition

int getCursorPosition(
Control control)
Get the current cursor position in the control. The position is 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 cursor is at the end of the contents.

Parameters:
control - the control whose position is to be retrieved.
Returns:
the zero-based index representing the cursor position in the control's contents.

getInsertionBounds


Rectangle getInsertionBounds(
Control control)
Get the bounds (in pixels) of the insertion point for the control content. This is a rectangle, in coordinates relative to the control, where the insertion point is displayed. If the implementer does not have an insertion point, or cannot determine the location of the insertion point, it is appropriate to return the bounds of the entire control. This value may be used to position a content proposal popup.

Parameters:
control - the control whose offset is to be retrieved.
Returns:
the pixel width representing the distance between the edge of the control and the insertion point.

setCursorPosition

void setCursorPosition(
Control control,
                       int index)
Set the current cursor position in the control. The position is 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 cursor is at the end of the contents.

Parameters:
control - the control whose cursor position is to be set.
index - the zero-based index representing the cursor position in the control's contents.

Eclipse Platform
Release 3.5

Guidelines for using Eclipse APIs.

Copyright (c) Eclipse contributors and others 2000, 2008. All rights reserved.


 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire