📄 mycompletionprocessor.java
字号:
package edit4.Myedit;import org.eclipse.jface.text.ITextViewer;import org.eclipse.jface.text.contentassist.CompletionProposal;import org.eclipse.jface.text.contentassist.ICompletionProposal;import org.eclipse.jface.text.contentassist.IContentAssistProcessor;import org.eclipse.jface.text.contentassist.IContextInformation;import org.eclipse.jface.text.contentassist.IContextInformationValidator;public class MyCompletionProcessor implements IContentAssistProcessor { protected final static String[] myProposals = { "Line1", "Line2","Line3" ,"Line4"}; /* (non-Javadoc) * Method declared on IContentAssistProcessor */ public ICompletionProposal[] computeCompletionProposals( ITextViewer viewer, int documentOffset) { ICompletionProposal[] result = new ICompletionProposal[myProposals.length]; for (int i = 0; i < myProposals.length; i++) { result[i] = new CompletionProposal(myProposals[i], documentOffset, 0, myProposals[i].length()); } return result; } /* (non-Javadoc) * Method declared on IContentAssistProcessor */ public char[] getCompletionProposalAutoActivationCharacters() { return new char[] { '<' }; } /* (non-Javadoc) * Method declared on IContentAssistProcessor */ public char[] getContextInformationAutoActivationCharacters() { return null; } // For Context information /* (non-Javadoc) * Method declared on IContentAssistProcessor */ public IContextInformationValidator getContextInformationValidator() { return null; } /* (non-Javadoc) * Method declared on IContentAssistProcessor */ public IContextInformation[] computeContextInformation( ITextViewer viewer, int documentOffset) { return null; } /* (non-Javadoc) * Method declared on IContentAssistProcessor */ public String getErrorMessage() { return null; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -