org.eclipse.ui.fieldassist.ContentAssistCommandAdapter Java Examples

The following examples show how to use org.eclipse.ui.fieldassist.ContentAssistCommandAdapter. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TimeGraphFindDialog.java    From tracecompass with Eclipse Public License 2.0 5 votes vote down vote up
/**
 * Creates the panel where the user specifies the text to search for
 *
 * @param parent
 *            the parent composite
 * @return the input panel
 */
private Composite createInputPanel(Composite parent) {
    Composite panel = new Composite(parent, SWT.NULL);
    GridLayout layout = new GridLayout();
    layout.numColumns = 2;
    panel.setLayout(layout);

    Label findLabel = new Label(panel, SWT.LEFT);
    findLabel.setText(Messages.TimeGraphFindDialog_FindLabel);
    setGridData(findLabel, SWT.LEFT, false, SWT.CENTER, false);

    // Create the find content assist field
    ComboContentAdapter contentAdapter = new ComboContentAdapter();
    FindReplaceDocumentAdapterContentProposalProvider findProposer = new FindReplaceDocumentAdapterContentProposalProvider(true);
    fFindField = new Combo(panel, SWT.DROP_DOWN | SWT.BORDER);
    fContentAssistFindField = new ContentAssistCommandAdapter(
            fFindField,
            contentAdapter,
            findProposer,
            ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS,
            new char[0],
            true);
    setGridData(fFindField, SWT.FILL, true, SWT.CENTER, false);
    fFindField.addModifyListener(fFindModifyListener);

    return panel;
}
 
Example #2
Source File: DynamicWorkingSetPage.java    From eclipse-extras with Eclipse Public License 1.0 5 votes vote down vote up
private void installPatternContentAssist() {
  ContentProposalAdapter contentAssist = new ContentAssistCommandAdapter(
    patternText,
    new TextContentAdapter(),
    new FindReplaceDocumentAdapterContentProposalProvider( true ),
    CONTENT_ASSIST_PROPOSALS,
    new char[]{ '\\', '[', '(' },
    true );
  contentAssist.setEnabled( true );
}
 
Example #3
Source File: CommandDataDialog.java    From EasyShell with Eclipse Public License 2.0 5 votes vote down vote up
private ContentProposalAdapter addContentAssistExtended(Text textControl) {
    char[] autoActivationCharacters = new char[] { '$', '{' };
    Map<String, String> proposals = new LinkedHashMap<String, String>();
    // add own variables
    proposals.putAll(Variable.getVariableInfoMap());
    // add eclipse variables
    proposals.putAll(Variable.getEclipseVariableInfoMap());
    ContentAssistCommandAdapter adapter = new ContentAssistCommandAdapter(textControl, new CommandVariableContentAdapter(),
            new CommandVariableContentProposalProvider(proposals), null,
            autoActivationCharacters, true);
    adapter.setPropagateKeys(false);
    adapter.setFilterStyle(ContentProposalAdapter.FILTER_NONE);
    return adapter;
}
 
Example #4
Source File: MenuDataDialog.java    From EasyShell with Eclipse Public License 2.0 5 votes vote down vote up
private ContentProposalAdapter addContentAssistExtended(Text textControl) {
    char[] autoActivationCharacters = new char[] { '$', '{' };
    Map<String, String> proposals = new LinkedHashMap<String, String>();
    // add internal variables
    proposals.putAll(Variable.getInternalVariableInfoMap());
    ContentAssistCommandAdapter adapter = new ContentAssistCommandAdapter(textControl, new CommandVariableContentAdapter(),
            new CommandVariableContentProposalProvider(proposals), null,
            autoActivationCharacters, true);
    adapter.setPropagateKeys(false);
    adapter.setFilterStyle(ContentProposalAdapter.FILTER_NONE);
    return adapter;
}