Java Code Examples for org.eclipse.core.resources.mapping.ModelProvider

The following are top voted examples for showing how to use org.eclipse.core.resources.mapping.ModelProvider. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: Eclipse-Postfix-Code-Completion   File: JavaModelAdapterFactory.java   Source Code and License 6 votes vote down vote up
/**
 * {@inheritDoc}
 */
public Object getAdapter(final Object adaptable, final Class adapter) {
	if (adaptable instanceof JavaModelProvider) {
		if (adapter == IResourceMappingMerger.class)
			return new JavaModelMerger((ModelProvider) adaptable);
		else if (adapter == ISynchronizationCompareAdapter.class)
			return new JavaSynchronizationCompareAdapter();
	} else if (adaptable instanceof RefactoringHistory) {
		if (adapter == ResourceMapping.class)
			return new JavaRefactoringHistoryResourceMapping((RefactoringHistory) adaptable);
		else if (adapter == IResource.class)
			return new JavaRefactoringHistoryResourceMapping((RefactoringHistory) adaptable).getResource();
	} else if (adaptable instanceof RefactoringDescriptorProxy) {
		if (adapter == ResourceMapping.class)
			return new JavaRefactoringDescriptorResourceMapping((RefactoringDescriptorProxy) adaptable);
	}
	return null;
}
 
Example 2
Project: Eclipse-Postfix-Code-Completion-Juno38   File: JavaModelAdapterFactory.java   Source Code and License 6 votes vote down vote up
/**
 * {@inheritDoc}
 */
public Object getAdapter(final Object adaptable, final Class adapter) {
	if (adaptable instanceof JavaModelProvider) {
		if (adapter == IResourceMappingMerger.class)
			return new JavaModelMerger((ModelProvider) adaptable);
		else if (adapter == ISynchronizationCompareAdapter.class)
			return new JavaSynchronizationCompareAdapter();
	} else if (adaptable instanceof RefactoringHistory) {
		if (adapter == ResourceMapping.class)
			return new JavaRefactoringHistoryResourceMapping((RefactoringHistory) adaptable);
		else if (adapter == IResource.class)
			return new JavaRefactoringHistoryResourceMapping((RefactoringHistory) adaptable).getResource();
	} else if (adaptable instanceof RefactoringDescriptorProxy) {
		if (adapter == ResourceMapping.class)
			return new JavaRefactoringDescriptorResourceMapping((RefactoringDescriptorProxy) adaptable);
	}
	return null;
}
 
Example 3
Project: che   File: ModelProviderManager.java   Source Code and License 4 votes vote down vote up
public ModelProvider getModelProvider(String modelProviderId) throws CoreException {
  IModelProviderDescriptor desc = getDescriptor(modelProviderId);
  if (desc == null) return null;
  return desc.getModelProvider();
}
 
Example 4
Project: Eclipse-Postfix-Code-Completion   File: JavaModelMerger.java   Source Code and License 2 votes vote down vote up
/**
 * Creates a new java model merger.
 *
 * @param provider
 *            the model provider
 */
public JavaModelMerger(final ModelProvider provider) {
	super(provider);
}
 
Example 5
Project: Eclipse-Postfix-Code-Completion-Juno38   File: JavaModelMerger.java   Source Code and License 2 votes vote down vote up
/**
 * Creates a new java model merger.
 *
 * @param provider
 *            the model provider
 */
public JavaModelMerger(final ModelProvider provider) {
	super(provider);
}