1 /*
2 * This file is a part of CAST project.
3 * (c) Copyright 2007, AGH University of Science & Technology
4 * https://caribou.iisg.agh.edu.pl/trac/cast
5 *
6 * Licensed under the Eclipse Public License, Version 1.0 (the "License").
7 * You may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 * http://www.eclipse.org/legal/epl-v10.html
10 */
11 /*
12 * File: DiagramEditorInput.java
13 * Created: 2007-03-08
14 * Author: fox
15 * $Id: DiagramEditorInput.java 3020 2009-07-17 14:41:19Z kpietak $
16 */
17
18 package pl.edu.agh.cast.backward.resources;
19
20 import org.eclipse.core.resources.IFile;
21
22 import pl.edu.agh.cast.model.visual.backward.IDiagram;
23
24 /**
25 * Editor input provider in form of a {@link IDiagram}.
26 *
27 * @author AGH CAST Team
28 */
29 public class DiagramEditorInput extends FileEditorInput implements IDiagramEditorInput {
30
31 private static final long serialVersionUID = -1262571419002357554L;
32
33 private final IDiagram diagram;
34
35 /**
36 * Constructor.
37 *
38 * @param diagram
39 * the diagram
40 * @param file
41 * input file
42 */
43 public DiagramEditorInput(IDiagram diagram, IFile file) {
44 super(file);
45 this.diagram = diagram;
46 }
47
48 /**
49 * {@inheritDoc}
50 *
51 * @see pl.edu.agh.cast.backward.resources.IDiagramEditorInput#getDiagram()
52 */
53 public IDiagram getDiagram() {
54 return diagram;
55 }
56
57 /**
58 * Two {@link DiagramEditorInput}s are equal if their files are equal. That basically means that
59 * {@link FileEditorInput}'s equals should be used.
60 *
61 * {@inheritDoc}
62 *
63 * @see pl.edu.agh.cast.backward.resources.FileEditorInput#equals(java.lang.Object)
64 */
65 @Override
66 public boolean equals(Object obj) {
67 return super.equals(obj);
68 }
69
70 /**
71 * {@inheritDoc}
72 *
73 * @see pl.edu.agh.cast.backward.resources.FileEditorInput#hashCode()
74 */
75 @Override
76 public int hashCode() {
77 return super.hashCode();
78 }
79
80 }