# Class ContentAssistCommandAdapter

java.lang.Object
org.eclipse.jface.fieldassist.ContentProposalAdapter
org.eclipse.ui.fieldassist.ContentAssistCommandAdapter

public class ContentAssistCommandAdapter extends ContentProposalAdapter
ContentAssistCommandAdapter extends `ContentProposalAdapter` to invoke content proposals using a specified `Command`. The ability to specify a `KeyStroke` that explicitly invokes content proposals is hidden by this class, and instead the String id of a command is used. If no command id is specified by the client, then the default workbench content assist command is used.

As of 3.3, ContentAssistCommandAdapter can be optionally configured to install the content assist decoration on its control.

This class is not intended to be subclassed.

Since:
  3.2

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`CONTENT_PROPOSAL_COMMAND`
Deprecated.
As of 3.5, replaced by `IWorkbenchCommandConstants.EDIT_CONTENT_ASSIST`

### Fields inherited from class ContentProposalAdapter

`DEBUG, FILTER_CHARACTER, FILTER_CUMULATIVE, FILTER_NONE, PROPOSAL_IGNORE, PROPOSAL_INSERT, PROPOSAL_REPLACE`

## Constructor Summary

Constructors
Constructor
Description
`ContentAssistCommandAdapter(Control control, IControlContentAdapter controlContentAdapter, IContentProposalProvider proposalProvider, String commandId, char[] autoActivationCharacters)`
Construct a content proposal adapter that can assist the user with choosing content for the field.
`ContentAssistCommandAdapter(Control control, IControlContentAdapter controlContentAdapter, IContentProposalProvider proposalProvider, String commandId, char[] autoActivationCharacters, boolean installDecoration)`
Construct a content proposal adapter that can assist the user with choosing content for the field.

## Method Summary

Modifier and Type
Method
Description
`String`
`getCommandId()`
Return the string command ID of the command used to invoke content assist.
`void`
`setEnabled(boolean enabled)`
Set the boolean flag that determines whether the adapter is enabled.

### Methods inherited from class ContentProposalAdapter

`addContentProposalListener, addContentProposalListener, closeProposalPopup, getAutoActivationCharacters, getAutoActivationDelay, getContentProposalProvider, getControl, getControlContentAdapter, getFilterStyle, getLabelProvider, getPopupSize, getPropagateKeys, getProposalAcceptanceStyle, hasProposalPopupFocus, isEnabled, isProposalPopupOpen, openProposalPopup, refresh, removeContentProposalListener, removeContentProposalListener, setAutoActivationCharacters, setAutoActivationDelay, setContentProposalProvider, setFilterStyle, setLabelProvider, setPopupSize, setPropagateKeys, setProposalAcceptanceStyle, setProposalPopupFocus`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### CONTENT_PROPOSAL_COMMAND

@Deprecated public static final String CONTENT_PROPOSAL_COMMAND
Deprecated.
As of 3.5, replaced by `IWorkbenchCommandConstants.EDIT_CONTENT_ASSIST`
The command id used for content assist. (value `"org.eclipse.ui.edit.text.contentAssist.proposals"`)

See Also:
  - Constant Field Values

## Constructor Details

### ContentAssistCommandAdapter

public ContentAssistCommandAdapter(Control control, IControlContentAdapter controlContentAdapter, IContentProposalProvider proposalProvider, String commandId, char[] autoActivationCharacters)
Construct a content proposal adapter that can assist the user with choosing content for the field. No visual indicator of content assist is shown.

Parameters:
  `control` - the control for which the adapter is providing content assist. May not be `null`.
  `controlContentAdapter` - the `IControlContentAdapter` used to obtain and update the control's contents as proposals are accepted. May not be `null`.
  `proposalProvider` - the `IContentProposalProvider` used to obtain content proposals for this control, or `null` if no content proposal is available.
  `commandId` - the String id of the command that will invoke the content assistant. If not supplied, the default value will be "org.eclipse.ui.edit.text.contentAssist.proposals".
  `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 the specified command id.

### ContentAssistCommandAdapter

public ContentAssistCommandAdapter(Control control, IControlContentAdapter controlContentAdapter, IContentProposalProvider proposalProvider, String commandId, char[] autoActivationCharacters, boolean installDecoration)
Construct a content proposal adapter that can assist the user with choosing content for the field.

Parameters:
  `control` - the control for which the adapter is providing content assist. May not be `null`.
  `controlContentAdapter` - the `IControlContentAdapter` used to obtain and update the control's contents as proposals are accepted. May not be `null`.
  `proposalProvider` - the `IContentProposalProvider` used to obtain content proposals for this control, or `null` if no content proposal is available.
  `commandId` - the String id of the command that will invoke the content assistant. If not supplied, the default value will be "org.eclipse.ui.edit.text.contentAssist.proposals".
  `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 the specified command id.
  `installDecoration` - A boolean that specifies whether a content assist control decoration should be installed. The client is responsible for ensuring that adequate space is reserved for the decoration. Clients that want more fine-grained control of the decoration's location or appearance should use `false` for this parameter, creating their own `ControlDecoration` and managing it directly.
Since:
  3.3

## Method Details

### getCommandId

public String getCommandId()
Return the string command ID of the command used to invoke content assist.

Returns:
  the command ID of the command that invokes content assist.

### setEnabled

public void setEnabled(boolean enabled)
Description copied from class: `ContentProposalAdapter`
Set the boolean flag that determines whether the adapter is enabled.

Overrides:
  `setEnabled` in class `ContentProposalAdapter`
Parameters:
  `enabled` - `true` if the adapter is enabled and responding to user input, `false` if it is ignoring user input.