Java 类org.eclipse.jface.text.contentassist.ICompletionProposalExtension4 实例源码

项目:APICloud-Studio    文件:CompletionProposalPopup.java   
/**
 * Returns <code>true</code> if <code>proposal</code> should be auto-inserted, <code>false</code> otherwise.
 * 
 * @param proposal
 *            the single proposal that might be automatically inserted
 * @return <code>true</code> if <code>proposal</code> can be inserted automatically, <code>false</code> otherwise
 * @since 3.1
 */
private boolean canAutoInsert(ICompletionProposal proposal)
{
    if (fContentAssistant.isAutoInserting())
    {
        if (proposal instanceof ICompletionProposalExtension4)
        {
            ICompletionProposalExtension4 ext = (ICompletionProposalExtension4) proposal;
            return ext.isAutoInsertable();
        }
        return true; // default behavior before ICompletionProposalExtension4 was introduced
    }
    return false;
}