private static void configureJavaProcessor(ContentAssistant assistant, IPreferenceStore store) { JavaCompletionProcessor jcp= getJavaProcessor(assistant); if (jcp == null) return; String triggers= store.getString(AUTOACTIVATION_TRIGGERS_JAVA); if (triggers != null) jcp.setCompletionProposalAutoActivationCharacters(triggers.toCharArray()); boolean enabled= store.getBoolean(SHOW_VISIBLE_PROPOSALS); jcp.restrictProposalsToVisibility(enabled); enabled= store.getBoolean(CASE_SENSITIVITY); jcp.restrictProposalsToMatchingCases(enabled); }
protected List filterAndSortProposals(List proposals, IProgressMonitor monitor, ContentAssistInvocationContext context) { List newProposals = super.filterAndSortProposals(proposals, monitor, context); for (Iterator iter = newProposals.iterator(); iter.hasNext();) { ICompletionProposal proposal = (ICompletionProposal) iter.next(); if (proposal.getDisplayString().startsWith(intertypeMemberTag)) { iter.remove(); } } if (newProposals.size() > 0) { // only add limited message if there are any proposals newProposals.add(newProposals.size(), new CompletionProposal("", offset, 0, 0, null, UIMessages.codeAssist_limited_title, null, UIMessages.codeAssist_limited_message));//$NON-NLS-1$ ) } return newProposals; }
public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) { if (getEditor() != null) { ContentAssistant assistant= new ContentAssistant(); assistant.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer)); assistant.setRestoreCompletionProposalSize(getSettings("completion_proposal_size")); //$NON-NLS-1$ IContentAssistProcessor javaProcessor= new JavaCompletionProcessor(getEditor(), assistant, IDocument.DEFAULT_CONTENT_TYPE); assistant.setContentAssistProcessor(javaProcessor, IDocument.DEFAULT_CONTENT_TYPE); ContentAssistProcessor singleLineProcessor= new JavaCompletionProcessor(getEditor(), assistant, IJavaPartitions.JAVA_SINGLE_LINE_COMMENT); assistant.setContentAssistProcessor(singleLineProcessor, IJavaPartitions.JAVA_SINGLE_LINE_COMMENT); ContentAssistProcessor stringProcessor= new JavaCompletionProcessor(getEditor(), assistant, IJavaPartitions.JAVA_STRING); assistant.setContentAssistProcessor(stringProcessor, IJavaPartitions.JAVA_STRING); ContentAssistProcessor multiLineProcessor= new JavaCompletionProcessor(getEditor(), assistant, IJavaPartitions.JAVA_MULTI_LINE_COMMENT); assistant.setContentAssistProcessor(multiLineProcessor, IJavaPartitions.JAVA_MULTI_LINE_COMMENT); ContentAssistProcessor javadocProcessor= new JavadocCompletionProcessor(getEditor(), assistant); assistant.setContentAssistProcessor(javadocProcessor, IJavaPartitions.JAVA_DOC); ContentAssistPreference.configure(assistant, fPreferenceStore); assistant.setContextInformationPopupOrientation(IContentAssistant.CONTEXT_INFO_ABOVE); assistant.setInformationControlCreator(getInformationControlCreator(sourceViewer)); return assistant; } return null; }
@Override protected boolean checkSeparateEnablement(CompletionProposalCategory category) { return super.checkSeparateEnablement(category) && category.matches(getJavaProject()); }
@Override public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) { if (getEditor() != null) { ContentAssistant assistant= new ContentAssistant(); assistant.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer)); assistant.setRestoreCompletionProposalSize(getSettings("completion_proposal_size")); //$NON-NLS-1$ IContentAssistProcessor javaProcessor= new JavaCompletionProcessor(getEditor(), assistant, IDocument.DEFAULT_CONTENT_TYPE); assistant.setContentAssistProcessor(javaProcessor, IDocument.DEFAULT_CONTENT_TYPE); ContentAssistProcessor singleLineProcessor= new JavaCompletionProcessor(getEditor(), assistant, IJavaPartitions.JAVA_SINGLE_LINE_COMMENT); assistant.setContentAssistProcessor(singleLineProcessor, IJavaPartitions.JAVA_SINGLE_LINE_COMMENT); ContentAssistProcessor stringProcessor= new JavaCompletionProcessor(getEditor(), assistant, IJavaPartitions.JAVA_STRING); assistant.setContentAssistProcessor(stringProcessor, IJavaPartitions.JAVA_STRING); ContentAssistProcessor multiLineProcessor= new JavaCompletionProcessor(getEditor(), assistant, IJavaPartitions.JAVA_MULTI_LINE_COMMENT); assistant.setContentAssistProcessor(multiLineProcessor, IJavaPartitions.JAVA_MULTI_LINE_COMMENT); ContentAssistProcessor javadocProcessor= new JavadocCompletionProcessor(getEditor(), assistant); assistant.setContentAssistProcessor(javadocProcessor, IJavaPartitions.JAVA_DOC); ContentAssistPreference.configure(assistant, fPreferenceStore); assistant.setContextInformationPopupOrientation(IContentAssistant.CONTEXT_INFO_ABOVE); assistant.setInformationControlCreator(new IInformationControlCreator() { @Override public IInformationControl createInformationControl(Shell parent) { return new DefaultInformationControl(parent, JavaPlugin.getAdditionalInfoAffordanceString()); } }); return assistant; } return null; }
@Override protected boolean checkSeparateEnablement(CompletionProposalCategory category) { return super.checkSeparateEnablement(category) && category.matches(getJavaProject()); }
private static void configureJavaProcessor(ContentAssistant assistant, IPreferenceStore store) { JavaCompletionProcessor jcp= getJavaProcessor(assistant); if (jcp == null) return; String triggers= store.getString(AUTOACTIVATION_TRIGGERS_JAVA); if (triggers != null) jcp.setCompletionProposalAutoActivationCharacters(triggers.toCharArray()); boolean enabled= store.getBoolean(SHOW_VISIBLE_PROPOSALS); jcp.restrictProposalsToVisibility(enabled); enabled= store.getBoolean(CASE_SENSITIVITY); jcp.restrictProposalsToMatchingCases(enabled); }
@Override public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) { if (getEditor() != null) { ContentAssistant assistant= new ContentAssistant(); assistant.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer)); assistant.setRestoreCompletionProposalSize(getSettings("completion_proposal_size")); //$NON-NLS-1$ IContentAssistProcessor javaProcessor= new JavaCompletionProcessor(getEditor(), assistant, IDocument.DEFAULT_CONTENT_TYPE); assistant.setContentAssistProcessor(javaProcessor, IDocument.DEFAULT_CONTENT_TYPE); ContentAssistProcessor singleLineProcessor= new JavaCompletionProcessor(getEditor(), assistant, IJavaPartitions.JAVA_SINGLE_LINE_COMMENT); assistant.setContentAssistProcessor(singleLineProcessor, IJavaPartitions.JAVA_SINGLE_LINE_COMMENT); ContentAssistProcessor stringProcessor= new JavaCompletionProcessor(getEditor(), assistant, IJavaPartitions.JAVA_STRING); assistant.setContentAssistProcessor(stringProcessor, IJavaPartitions.JAVA_STRING); ContentAssistProcessor multiLineProcessor= new JavaCompletionProcessor(getEditor(), assistant, IJavaPartitions.JAVA_MULTI_LINE_COMMENT); assistant.setContentAssistProcessor(multiLineProcessor, IJavaPartitions.JAVA_MULTI_LINE_COMMENT); ContentAssistProcessor javadocProcessor= new JavadocCompletionProcessor(getEditor(), assistant); assistant.setContentAssistProcessor(javadocProcessor, IJavaPartitions.JAVA_DOC); ContentAssistPreference.configure(assistant, fPreferenceStore); assistant.setContextInformationPopupOrientation(IContentAssistant.CONTEXT_INFO_ABOVE); assistant.setInformationControlCreator(new IInformationControlCreator() { @Override public IInformationControl createInformationControl(Shell parent) { return new DefaultInformationControl(parent, JavaPlugin.getAdditionalInfoAffordanceString()); } }); return assistant; } return null; }
@Override protected boolean checkDefaultEnablement(CompletionProposalCategory category) { return super.checkDefaultEnablement(category) && category.matches(getJavaProject()); }
private static void configureJavaProcessor(ContentAssistant assistant, IPreferenceStore store) { JavaCompletionProcessor jcp= getJavaProcessor(assistant); if (jcp == null) return; String triggers= store.getString(AUTOACTIVATION_TRIGGERS_JAVA); if (triggers != null) jcp.setCompletionProposalAutoActivationCharacters(triggers.toCharArray()); boolean enabled= store.getBoolean(SHOW_VISIBLE_PROPOSALS); jcp.restrictProposalsToVisibility(enabled); enabled= store.getBoolean(CASE_SENSITIVITY); jcp.restrictProposalsToMatchingCases(enabled); }
@Override protected boolean checkDefaultEnablement(CompletionProposalCategory category) { return super.checkDefaultEnablement(category) && category.matches(getJavaProject()); }
private static void changeJavaProcessor(ContentAssistant assistant, IPreferenceStore store, String key) { JavaCompletionProcessor jcp= getJavaProcessor(assistant); if (jcp == null) return; if (AUTOACTIVATION_TRIGGERS_JAVA.equals(key)) { String triggers= store.getString(AUTOACTIVATION_TRIGGERS_JAVA); if (triggers != null) jcp.setCompletionProposalAutoActivationCharacters(triggers.toCharArray()); } else if (SHOW_VISIBLE_PROPOSALS.equals(key)) { boolean enabled= store.getBoolean(SHOW_VISIBLE_PROPOSALS); jcp.restrictProposalsToVisibility(enabled); } else if (CASE_SENSITIVITY.equals(key)) { boolean enabled= store.getBoolean(CASE_SENSITIVITY); jcp.restrictProposalsToMatchingCases(enabled); } }
private static void changeJavaProcessor(ContentAssistant assistant, IPreferenceStore store, String key) { JavaCompletionProcessor jcp= getJavaProcessor(assistant); if (jcp == null) return; if (AUTOACTIVATION_TRIGGERS_JAVA.equals(key)) { String triggers= store.getString(AUTOACTIVATION_TRIGGERS_JAVA); if (triggers != null) jcp.setCompletionProposalAutoActivationCharacters(triggers.toCharArray()); } else if (SHOW_VISIBLE_PROPOSALS.equals(key)) { boolean enabled= store.getBoolean(SHOW_VISIBLE_PROPOSALS); jcp.restrictProposalsToVisibility(enabled); } else if (CASE_SENSITIVITY.equals(key)) { boolean enabled= store.getBoolean(CASE_SENSITIVITY); jcp.restrictProposalsToMatchingCases(enabled); } }
private static void changeJavaProcessor(ContentAssistant assistant, IPreferenceStore store, String key) { JavaCompletionProcessor jcp= getJavaProcessor(assistant); if (jcp == null) return; if (AUTOACTIVATION_TRIGGERS_JAVA.equals(key)) { String triggers= store.getString(AUTOACTIVATION_TRIGGERS_JAVA); if (triggers != null) jcp.setCompletionProposalAutoActivationCharacters(triggers.toCharArray()); } else if (SHOW_VISIBLE_PROPOSALS.equals(key)) { boolean enabled= store.getBoolean(SHOW_VISIBLE_PROPOSALS); jcp.restrictProposalsToVisibility(enabled); } else if (CASE_SENSITIVITY.equals(key)) { boolean enabled= store.getBoolean(CASE_SENSITIVITY); jcp.restrictProposalsToMatchingCases(enabled); } }