blob: a68b0a682f8509cae77a29305a505a69001b313d (
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
|
/*
* Copyright (c) 2004 - 2012 Eike Stepper (Berlin, 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:
* Martin Fluegge - initial API and implementation
*/
package org.eclipse.emf.cdo.dawn.graphiti.editors;
import org.eclipse.emf.cdo.dawn.ui.DawnEditorInput;
import org.eclipse.emf.cdo.dawn.ui.IDawnEditorInput;
import org.eclipse.emf.cdo.eresource.CDOResource;
import org.eclipse.emf.cdo.view.CDOView;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.graphiti.ui.editor.DiagramEditorInput;
/**
* @author Martin Fluegge
*/
public class DawnGraphitiEditorInput extends DiagramEditorInput implements IDawnEditorInput
{
private DawnEditorInput input;
public DawnGraphitiEditorInput(URI uri, String providerId)
{
super(uri, providerId);
input = new DawnEditorInput(uri);
}
public DawnGraphitiEditorInput(URI uri, String providerId, Resource resource)
{
this(uri, providerId);
input.setResource((CDOResource)resource);
}
public CDOView getView()
{
return input.getView();
}
public boolean isViewOwned()
{
return input.isViewOwned();
}
public String getResourcePath()
{
return input.getResourcePath();
}
/**
* This id is needed to provide the correct IElementFactory to the framework and allow to create a
* DawnGraphitiEditorInput from the persisted state on restoring an editor. See extension point
* org.eclipse.ui.elementFactories.
*/
@Override
public String getFactoryId()
{
return DawnGraphitiDiagramEditorInputFactory.class.getName();
}
}
|