org.eclipse.xtext.common.types.ui.refactoring.participant.JdtRenameParticipant Java Examples

The following examples show how to use org.eclipse.xtext.common.types.ui.refactoring.participant.JdtRenameParticipant. 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: JvmModelJdtRenameParticipantContext.java    From xtext-eclipse with Eclipse Public License 2.0 6 votes vote down vote up
@Override
protected List<? extends IRenameElementContext> createJdtParticipantXtextSourceContexts(
		JdtRenameParticipant participant, 
		EObject indexedJvmElement) {
	if(operatorMappingUtil.isMappedOperator(indexedJvmElement))
		return Collections.emptyList();
	EObject jvmElement;
	if(indexedJvmElement instanceof JvmConstructor)
		jvmElement = ((JvmConstructor) indexedJvmElement).getDeclaringType();
	else 
		jvmElement = indexedJvmElement;
	EObject renameTargetElement = associations.getPrimarySourceElement(jvmElement);
	if (renameTargetElement != null) {
		return singletonList(new JvmModelJdtRenameParticipantContext(participant,
				EcoreUtil2.getPlatformResourceOrNormalizedURI(renameTargetElement), renameTargetElement.eClass()));
	}
	return super.createJdtParticipantXtextSourceContexts(participant, jvmElement);
}
 
Example #2
Source File: CombinedJvmJdtRenameProcessor.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public RefactoringParticipant[] loadParticipants(final RefactoringStatus status,
		final SharableParticipants sharedParticipants) throws CoreException {
	List<RefactoringParticipant> participants = newArrayList(super.loadParticipants(status, sharedParticipants));
	for (JavaRenameProcessor processor : jvmElements2jdtProcessors.values()) {
		for (RefactoringParticipant participant : processor.loadParticipants(status, sharedParticipants)) {
			if(participant instanceof JdtRenameParticipant) {
				((JdtRenameParticipant) participant).disableFor(getElements());
			}
			participants.add(participant);
		}
	}
	return toArray(participants, RefactoringParticipant.class);
}
 
Example #3
Source File: XtendJdtRenameParticipantProcessor.java    From xtext-xtend with Eclipse Public License 2.0 5 votes vote down vote up
/**
 * @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;
}
 
Example #4
Source File: AbstractDomainmodelUiModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends JdtRenameParticipant.ContextFactory> bindJdtRenameParticipant$ContextFactory() {
	return JvmModelJdtRenameParticipantContext.ContextFactory.class;
}
 
Example #5
Source File: AbstractRuleEngineUiModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends JdtRenameParticipant.ContextFactory> bindJdtRenameParticipant$ContextFactory() {
	return JvmModelJdtRenameParticipantContext.ContextFactory.class;
}
 
Example #6
Source File: JvmModelJdtRenameParticipantContext.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public JvmModelJdtRenameParticipantContext(JdtRenameParticipant participant, 
		URI targetElementURI, EClass targetElementEClass) {
	super(targetElementURI, targetElementEClass);
	this.participant = participant;
}
 
Example #7
Source File: JvmModelJdtRenameParticipantContext.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
/**
 * @since 2.4
 */
public JdtRenameParticipant getJdtRenameParticipant() {
	return participant;
}
 
Example #8
Source File: AbstractPureXbaseUiModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends JdtRenameParticipant.ContextFactory> bindJdtRenameParticipant$ContextFactory() {
	return JvmModelJdtRenameParticipantContext.ContextFactory.class;
}
 
Example #9
Source File: AbstractBug462047LangUiModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends JdtRenameParticipant.ContextFactory> bindJdtRenameParticipant$ContextFactory() {
	return JvmModelJdtRenameParticipantContext.ContextFactory.class;
}
 
Example #10
Source File: AbstractXImportSectionTestLangUiModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends JdtRenameParticipant.ContextFactory> bindJdtRenameParticipant$ContextFactory() {
	return JvmModelJdtRenameParticipantContext.ContextFactory.class;
}
 
Example #11
Source File: AbstractContentAssistFragmentTestLangUiModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends JdtRenameParticipant.ContextFactory> bindJdtRenameParticipant$ContextFactory() {
	return JvmModelJdtRenameParticipantContext.ContextFactory.class;
}
 
Example #12
Source File: AbstractXtendUiModule.java    From xtext-xtend with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends JdtRenameParticipant.ContextFactory> bindJdtRenameParticipant$ContextFactory() {
	return JvmModelJdtRenameParticipantContext.ContextFactory.class;
}
 
Example #13
Source File: AbstractSARLUiModule.java    From sarl with Apache License 2.0 4 votes vote down vote up
public Class<? extends JdtRenameParticipant.ContextFactory> bindJdtRenameParticipant$ContextFactory() {
	return JvmModelJdtRenameParticipantContext.ContextFactory.class;
}