private void createFilterContentAssist(Combo filterCombo, Label helpLabel) { // Create the find content assist field ComboContentAdapter contentAdapter= new ComboContentAdapter(); FindReplaceDocumentAdapterContentProposalProvider findProposer= new FindReplaceDocumentAdapterContentProposalProvider(true); mContentAssistFindField = new ContentAssistCommandAdapter( filterCombo, contentAdapter, findProposer, null, new char[] {'\\', '[', '('}, true); mContentAssistFindField.setEnabled(false); GridData gd= (GridData)filterCombo.getLayoutData(); FieldDecoration dec= FieldDecorationRegistry.getDefault().getFieldDecoration(FieldDecorationRegistry.DEC_CONTENT_PROPOSAL); Rectangle bounds = dec.getImage().getBounds(); gd.horizontalIndent= bounds.width; ((GridData)helpLabel.getLayoutData()).horizontalIndent = bounds.width; }
private void installPatternContentAssist() { ContentProposalAdapter contentAssist = new ContentAssistCommandAdapter( patternText, new TextContentAdapter(), new FindReplaceDocumentAdapterContentProposalProvider( true ), CONTENT_ASSIST_PROPOSALS, new char[]{ '\\', '[', '(' }, true ); contentAssist.setEnabled( true ); }
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; }
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; }
@Override protected void createControl(Composite parent) { super.createControl(parent); new ContentAssistCommandAdapter(getTextControl(), new TextContentAdapter(), this, null, null, true); }