Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: ef12055679f4d3e725a92d05d6b8703b7feda9c6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/*
 * Copyright (c) 2009-2012, 2014, 2015 Eike Stepper (Loehne, Germany) 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:
 *    Victor Roldan Betancort - initial API and implementation
 *    Eike Stepper - maintenance
 */
package org.eclipse.emf.cdo.view;

import org.eclipse.net4j.util.collection.Pair;
import org.eclipse.net4j.util.container.IContainer;

import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.resource.ResourceSet;

/**
 * A global registry of {@link CDOViewProvider view provider} implementations.
 *
 * @author Victor Roldan Betancort
 * @since 2.0
 * @noextend This interface is not intended to be extended by clients.
 * @noimplement This interface is not intended to be implemented by clients.
 * @apiviz.composedOf {@link org.eclipse.emf.cdo.view.CDOViewProvider}
 */
public interface CDOViewProviderRegistry extends IContainer<CDOViewProvider>
{
  public static final CDOViewProviderRegistry INSTANCE = org.eclipse.emf.internal.cdo.view.CDOViewProviderRegistryImpl.INSTANCE;

  /**
   * Returns a {@link CDOView view} that serves the given URI in the given {@link CDOViewSet view set}, or
   * <code>null</code> if no {@link CDOViewProvider view provider} in this registry can provide such a view.
   */
  public CDOView provideView(URI uri, ResourceSet viewSet);

  /**
   * Returns a {@link CDOView view} that serves the given URI in the given {@link CDOViewSet view set}, or
   * <code>null</code> if no {@link CDOViewProvider view provider} in this registry can provide such a view. The
   * returned {@link Pair pair} contains the provider that provided the view or null if the view was already present in
   * the {@link CDOViewSet view set} of the resource set.
   *
   * @since 4.0
   * @deprecated As of 4.4. use {@link #provideView(URI, ResourceSet)}.getProvider().
   */
  @Deprecated
  public Pair<CDOView, CDOViewProvider> provideViewWithInfo(URI uri, ResourceSet resourceSet);

  /**
   * Returns an array of <code>CDOViewProvider</code> instances, determined and ordered by certain criteria based on the
   * argument URI.
   */
  public CDOViewProvider[] getViewProviders(URI uri);

  /**
   * Returns <code>true</code> if the given view provider instance is registered with this registry, <code>false</code>
   * otherwise.
   *
   * @since 4.0
   */
  public boolean hasViewProvider(CDOViewProvider viewProvider);

  /**
   * Registers the given view provider instance with this registry.
   */
  public void addViewProvider(CDOViewProvider viewProvider);

  /**
   * Removes the given view provider instance from this registry.
   */
  public void removeViewProvider(CDOViewProvider viewProvider);
}

Back to the top