org.eclipse.jface.text.FindReplaceDocumentAdapterContentProposalProvider Java Examples

The following examples show how to use org.eclipse.jface.text.FindReplaceDocumentAdapterContentProposalProvider. 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 );
}