View Javadoc

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: ModelEditorInput.java
13   * Created: 2007-00-00
14   * Author: fox
15   * $Id: ModelEditorInput.java 3020 2009-07-17 14:41:19Z kpietak $
16   */
17  
18  package pl.edu.agh.cast.backward.resources;
19  
20  import java.util.Collection;
21  
22  import org.eclipse.core.resources.IFile;
23  
24  import pl.edu.agh.cast.model.base.IDataSet;
25  
26  /**
27   * {@link org.eclipse.ui.IEditorInput} providing CAST data model and diagram {@link IFile}.
28   *
29   * @author AGH CAST Team
30   */
31  public class ModelEditorInput extends FileEditorInput {
32  
33  	private final Collection<IDataSet> model;
34  
35  	/**
36  	 * Creates new instance of model editor input.
37  	 *
38  	 * @param model
39  	 *            data model
40  	 * @param file
41  	 *            diagram file
42  	 */
43  	public ModelEditorInput(Collection<IDataSet> model, IFile file) {
44  		super(file);
45  		this.model = model;
46  	}
47  
48  	public Collection<IDataSet> getModel() {
49  		return model;
50  	}
51  
52  	/**
53  	 * Two {@link ModelEditorInput}s are equal if their files are equal. That basically means that
54  	 * {@link FileEditorInput}'s equals should be used.
55  	 *
56  	 * {@inheritDoc}
57  	 *
58  	 * @see pl.edu.agh.cast.backward.resources.FileEditorInput#equals(java.lang.Object)
59  	 */
60  	@Override
61  	public boolean equals(Object obj) {
62  		return super.equals(obj);
63  	}
64  
65  	/**
66  	 * {@inheritDoc}
67  	 *
68  	 * @see pl.edu.agh.cast.backward.resources.FileEditorInput#hashCode()
69  	 */
70  	@Override
71  	public int hashCode() {
72  		return super.hashCode();
73  	}
74  
75  }