Java Code Examples for org.eclipse.jdt.core.dom.TypeDeclaration#SUPERCLASS_TYPE_PROPERTY

The following examples show how to use org.eclipse.jdt.core.dom.TypeDeclaration#SUPERCLASS_TYPE_PROPERTY . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ImplementOccurrencesFinder.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
public String initialize(CompilationUnit root, ASTNode node) {
	if (!(node instanceof Name))
		return SearchMessages.ImplementOccurrencesFinder_invalidTarget;

	fSelectedNode= ASTNodes.getNormalizedNode(node);
	if (!(fSelectedNode instanceof Type))
		return SearchMessages.ImplementOccurrencesFinder_invalidTarget;

	StructuralPropertyDescriptor location= fSelectedNode.getLocationInParent();
	if (location != TypeDeclaration.SUPERCLASS_TYPE_PROPERTY && location != TypeDeclaration.SUPER_INTERFACE_TYPES_PROPERTY && location != EnumDeclaration.SUPER_INTERFACE_TYPES_PROPERTY)
		return SearchMessages.ImplementOccurrencesFinder_invalidTarget;

	fSelectedType= ((Type)fSelectedNode).resolveBinding();
	if (fSelectedType == null)
		return SearchMessages.ImplementOccurrencesFinder_invalidTarget;

	fStart= fSelectedNode.getParent(); // type declaration
	fASTRoot= root;
	fDescription= Messages.format(SearchMessages.ImplementOccurrencesFinder_occurrence_description, BasicElementLabels.getJavaElementName(fSelectedType.getName()));

	return null;
}