📄 javadoccompletionprocessor.java
字号:
/*******************************************************************************
* Copyright (c) 2000, 2005 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.ui.examples.javaeditor.javadoc;
import org.eclipse.jface.text.ITextViewer;
import org.eclipse.jface.text.contentassist.*;
/**
* Example Java doc completion processor.
*/
public class JavaDocCompletionProcessor implements IContentAssistProcessor {
protected final static String[] fgProposals= { "@author", "@deprecated", "@exception", "@param", "@return", "@see", "@serial", "@serialData", "@serialField", "@since", "@throws", "@version" }; //$NON-NLS-12$ //$NON-NLS-11$ //$NON-NLS-10$ //$NON-NLS-7$ //$NON-NLS-9$ //$NON-NLS-8$ //$NON-NLS-6$ //$NON-NLS-5$ //$NON-NLS-4$ //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$
/* (non-Javadoc)
* Method declared on IContentAssistProcessor
*/
public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int documentOffset) {
ICompletionProposal[] result= new ICompletionProposal[fgProposals.length];
for (int i= 0; i < fgProposals.length; i++)
result[i]= new CompletionProposal(fgProposals[i], documentOffset, 0, fgProposals[i].length());
return result;
}
/* (non-Javadoc)
* Method declared on IContentAssistProcessor
*/
public IContextInformation[] computeContextInformation(ITextViewer viewer, int documentOffset) {
return null;
}
/* (non-Javadoc)
* Method declared on IContentAssistProcessor
*/
public char[] getCompletionProposalAutoActivationCharacters() {
return null;
}
/* (non-Javadoc)
* Method declared on IContentAssistProcessor
*/
public char[] getContextInformationAutoActivationCharacters() {
return null;
}
/* (non-Javadoc)
* Method declared on IContentAssistProcessor
*/
public IContextInformationValidator getContextInformationValidator() {
return null;
}
/* (non-Javadoc)
* Method declared on IContentAssistProcessor
*/
public String getErrorMessage() {
return null;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -