/******************************************************************************* * Copyright (c) 2010 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: * Zhao Zhongwei *******************************************************************************/ package org.eclipse.php.internal.core.codeassist.strategies; import org.eclipse.dltk.core.ISourceRange; import org.eclipse.dltk.core.IType; import org.eclipse.jface.text.BadLocationException; import org.eclipse.php.core.codeassist.ICompletionContext; import org.eclipse.php.core.codeassist.ICompletionReporter; import org.eclipse.php.internal.core.codeassist.contexts.AbstractCompletionContext; public class ExceptionClassStrategy extends ExceptionClassInstantiationStrategy { public ExceptionClassStrategy(ICompletionContext context) { super(context); } public void apply(ICompletionReporter reporter) throws BadLocationException { ICompletionContext context = getContext(); AbstractCompletionContext abstractContext = (AbstractCompletionContext) context; ISourceRange replacementRange = getReplacementRange(abstractContext); IType[] types = getTypes(abstractContext); for (IType type : types) { reporter.reportType(type, "", replacementRange); //$NON-NLS-1$ } } }