本文整理汇总了Java中org.eclipse.jface.fieldassist.IControlContentAdapter类的典型用法代码示例。如果您正苦于以下问题:Java IControlContentAdapter类的具体用法?Java IControlContentAdapter怎么用?Java IControlContentAdapter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IControlContentAdapter类属于org.eclipse.jface.fieldassist包,在下文中一共展示了IControlContentAdapter类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: TrpAutoCompleteField
import org.eclipse.jface.fieldassist.IControlContentAdapter; //导入依赖的package包/类
public TrpAutoCompleteField(Control control, IControlContentAdapter controlContentAdapter, String[] proposals,
KeyStroke keyStroke, char[] autoActivationCharacters)
{
assert(proposals != null);
this.proposals = proposals;
proposalProvider = new SimpleContentProposalProvider(proposals);
proposalProvider.setFiltering(true);
adapter = new MyContentProposalAdapter(control, controlContentAdapter,
proposalProvider, keyStroke, autoActivationCharacters);
adapter.setPropagateKeys(false);
adapter.setProposalAcceptanceStyle(ContentProposalAdapter.PROPOSAL_REPLACE);
adapter.setAutoActivateOnLetter(true);
adapter.setAutoCloseOnSpace(true);
adapter.setPopupSize(new Point(300, 150));
}
示例2: recordCursorPosition
import org.eclipse.jface.fieldassist.IControlContentAdapter; //导入依赖的package包/类
private void recordCursorPosition() {
if (isValid()) {
IControlContentAdapter adapter = getControlContentAdapter();
insertionPos = adapter.getCursorPosition(control);
// see https://bugs.eclipse.org/bugs/show_bug.cgi?id=139063
if (adapter instanceof IControlContentAdapter2) {
selectionRange = ((IControlContentAdapter2) adapter)
.getSelection(control);
}
}
}
示例3: OpenableContentProposal
import org.eclipse.jface.fieldassist.IControlContentAdapter; //导入依赖的package包/类
public OpenableContentProposal(Control control,
IControlContentAdapter controlContentAdapter,
IContentProposalProvider proposalProvider, KeyStroke keyStroke,
char[] autoActivationCharacters) {
super(control, controlContentAdapter, proposalProvider, keyStroke,
autoActivationCharacters);
}
示例4: installContentProposalAdapter
import org.eclipse.jface.fieldassist.IControlContentAdapter; //导入依赖的package包/类
/**
* @param control
* @param contentAdapter
* @param values
*/
public void installContentProposalAdapter( Control control,
IControlContentAdapter contentAdapter, String[] values )
{
IPreferenceStore store = getPreferenceStore( );
boolean propagate = store.getBoolean( PreferenceConstants.PREF_CONTENTASSISTKEY_PROPAGATE );
KeyStroke keyStroke = null;
char[] autoActivationCharacters = null;
int autoActivationDelay = store.getInt( PreferenceConstants.PREF_CONTENTASSISTDELAY );
String triggerKey = getTriggerKey( );
if ( triggerKey == null )
{
keyStroke = null;
}
else
{
keyStroke = getKeyStroke( triggerKey );
}
ContentProposalAdapter adapter = new ContentProposalAdapter( control,
contentAdapter,
getContentProposalProvider( values ),
keyStroke,
autoActivationCharacters );
adapter.setAutoActivationDelay( autoActivationDelay );
adapter.setPropagateKeys( propagate );
adapter.setFilterStyle( getContentAssistFilterStyle( ) );
adapter.setProposalAcceptanceStyle( getContentAssistAcceptance( ) );
}
示例5: MyContentProposalAdapter
import org.eclipse.jface.fieldassist.IControlContentAdapter; //导入依赖的package包/类
/**
* Construct a content proposal adapter that can assist the user with
* choosing content for the field.
*
* @param control
* the control for which the adapter is providing content assist.
* May not be <code>null</code>.
* @param controlContentAdapter
* the <code>IControlContentAdapter</code> used to obtain and
* update the control's contents as proposals are accepted. May
* not be <code>null</code>.
* @param proposalProvider
* the <code>IContentProposalProvider</code> used to obtain
* content proposals for this control, or <code>null</code> if
* no content proposal is available.
* @param keyStroke
* the keystroke that will invoke the content proposal popup. If
* this value is <code>null</code>, then proposals will be
* activated automatically when any of the auto activation
* characters are typed.
* @param autoActivationCharacters
* An array of characters that trigger auto-activation of content
* proposal. If specified, these characters will trigger
* auto-activation of the proposal popup, regardless of whether
* an explicit invocation keyStroke was specified. If this
* parameter is <code>null</code>, then only a specified
* keyStroke will invoke content proposal. If this parameter is
* <code>null</code> and the keyStroke parameter is
* <code>null</code>, then all alphanumeric characters will
* auto-activate content proposal.
*/
public MyContentProposalAdapter(Control control,
IControlContentAdapter controlContentAdapter,
IContentProposalProvider proposalProvider, KeyStroke keyStroke,
char[] autoActivationCharacters) {
super();
// We always assume the control and content adapter are valid.
Assert.isNotNull(control);
Assert.isNotNull(controlContentAdapter);
this.control = control;
this.controlContentAdapter = controlContentAdapter;
// The rest of these may be null
this.proposalProvider = proposalProvider;
this.triggerKeyStroke = keyStroke;
if (autoActivationCharacters != null) {
this.autoActivateString = new String(autoActivationCharacters);
}
addControlListener(control);
}
示例6: VersionContentProposalAdapter
import org.eclipse.jface.fieldassist.IControlContentAdapter; //导入依赖的package包/类
public VersionContentProposalAdapter(Control control, IControlContentAdapter controlContentAdapter,
IContentProposalProvider proposalProvider, KeyStroke keyStroke, char[] autoActivationCharacters) {
super(control, controlContentAdapter, proposalProvider, keyStroke, autoActivationCharacters);
}
示例7: getProposalControlAdapter
import org.eclipse.jface.fieldassist.IControlContentAdapter; //导入依赖的package包/类
public IControlContentAdapter getProposalControlAdapter() {
return proposalControlAdapter;
}
示例8: PgStatementAutoCompleteField
import org.eclipse.jface.fieldassist.IControlContentAdapter; //导入依赖的package包/类
/**
* Construct an AutoComplete field on the specified control, whose
* completions are characterized by the specified array of Strings.
*
* @param control
* the control for which autocomplete is desired. May not be
* <code>null</code>.
* @param controlContentAdapter
* the <code>IControlContentAdapter</code> used to obtain and
* update the control's contents. May not be <code>null</code>.
* @param proposals
* the array of Strings representing valid content proposals for
* the field.
*/
public PgStatementAutoCompleteField(Control control,
IControlContentAdapter controlContentAdapter, List<IContentProposal> proposals) {
adapter = new ContentProposalAdapter(control, controlContentAdapter,
new PgStatementProposalProvider(proposals), null, null);
adapter.setPropagateKeys(true);
adapter.setProposalAcceptanceStyle(ContentProposalAdapter.PROPOSAL_REPLACE);
}
示例9: ManualyOpenedAutocomplete
import org.eclipse.jface.fieldassist.IControlContentAdapter; //导入依赖的package包/类
/**
* Construct an AutoComplete field on the specified control, whose
* completions are characterized by the specified array of Strings.
*
* @param control
* the control for which autocomplete is desired. May not be
* <code>null</code>.
* @param controlContentAdapter
* the <code>IControlContentAdapter</code> used to obtain and
* update the control's contents. May not be <code>null</code>.
* @param proposals
* the container with all the properties of the element
*/
public ManualyOpenedAutocomplete(Control control, IControlContentAdapter controlContentAdapter, PropertiesContainer proposals) {
proposalProvider = new PropertiesProposalProvider(proposals);
proposalProvider.setFiltering(true);
adapter = new OpenableContentProposal(control, controlContentAdapter, proposalProvider, null, null);
adapter.setPropagateKeys(true);
adapter.setProposalAcceptanceStyle(ContentProposalAdapter.PROPOSAL_REPLACE);
}
示例10: AssistField
import org.eclipse.jface.fieldassist.IControlContentAdapter; //导入依赖的package包/类
/**
* Constructor of the class.
*
* @param control
* the control to be decorated.
* @param composite
* The SWT composite within which the decoration should be
* rendered. The decoration will be clipped to this composite,
* but it may be rendered on a child of the composite. The
* decoration will not be visible if the specified composite or
* its child composites are not visible in the space relative to
* the control, where the decoration is to be rendered. If this
* value is null, then the decoration will be rendered on
* whichever composite (or composites) are located in the
* specified position.
* @param adapter
* a content adapter to be used to set and retrieve content from
* current control.
* @param values
* the available contents of current control.
*/
public AssistField( Control control, Composite composite,
IControlContentAdapter adapter, String[] values )
{
this.controlDecoration = FieldAssistHelper.getInstance( )
.createControlDecoration( control, composite );
this.contentAdapter = adapter;
this.control = control;
setContent( values );
initAssistListeners( );
}
示例11: getControlContentAdapter
import org.eclipse.jface.fieldassist.IControlContentAdapter; //导入依赖的package包/类
/**
* Return the content adapter that can get or retrieve the text contents
* from the adapter's control. This method is used when a client, such as a
* content proposal listener, needs to update the control's contents
* manually.
*
* @return the {@link IControlContentAdapter} which can update the control
* text.
*/
public IControlContentAdapter getControlContentAdapter() {
return controlContentAdapter;
}
示例12: getContentAdapter
import org.eclipse.jface.fieldassist.IControlContentAdapter; //导入依赖的package包/类
/**
* Returns content adapter.
*
* @return
*/
public IControlContentAdapter getContentAdapter( )
{
return contentAdapter;
}