Search in sources :

Example 1 with JvmModelJdtRenameParticipantContext

use of org.eclipse.xtext.xbase.ui.jvmmodel.refactoring.JvmModelJdtRenameParticipantContext in project xtext-xtend by eclipse.

the class XtendJdtRenameParticipantProcessor method isXtendRename.

/**
 * @return true, if the triggering refactoring targets an Xtend element.
 */
protected boolean isXtendRename() {
    JdtRenameParticipant jdtRenameParticipant = ((JvmModelJdtRenameParticipantContext) getRenameElementContext()).getJdtRenameParticipant();
    RefactoringProcessor triggeringProcessor = jdtRenameParticipant.getProcessor().getRefactoring().getProcessor();
    if (triggeringProcessor instanceof RenameElementProcessor) {
        EClass targetElementEClass = ((RenameElementProcessor) triggeringProcessor).getRenameElementContext().getTargetElementEClass();
        return targetElementEClass.getEPackage() == XtendPackage.eINSTANCE;
    }
    return false;
}
Also used : EClass(org.eclipse.emf.ecore.EClass) JdtRenameParticipant(org.eclipse.xtext.common.types.ui.refactoring.participant.JdtRenameParticipant) JvmModelJdtRenameParticipantContext(org.eclipse.xtext.xbase.ui.jvmmodel.refactoring.JvmModelJdtRenameParticipantContext) RefactoringProcessor(org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor) RenameElementProcessor(org.eclipse.xtext.ui.refactoring.impl.RenameElementProcessor)

Aggregations

EClass (org.eclipse.emf.ecore.EClass)1 RefactoringProcessor (org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor)1 JdtRenameParticipant (org.eclipse.xtext.common.types.ui.refactoring.participant.JdtRenameParticipant)1 RenameElementProcessor (org.eclipse.xtext.ui.refactoring.impl.RenameElementProcessor)1 JvmModelJdtRenameParticipantContext (org.eclipse.xtext.xbase.ui.jvmmodel.refactoring.JvmModelJdtRenameParticipantContext)1