1 | /* |
2 | * Copyright 2007, SDQ, IPD, U KA |
3 | */ |
4 | package de.uka.ipd.sdq.pcm.gmf.allocation.part; |
5 | |
6 | import org.eclipse.emf.common.ui.URIEditorInput; |
7 | import org.eclipse.ui.IEditorInput; |
8 | import org.eclipse.ui.IEditorMatchingStrategy; |
9 | import org.eclipse.ui.IEditorReference; |
10 | import org.eclipse.ui.PartInitException; |
11 | |
12 | /** |
13 | * @generated |
14 | */ |
15 | public class PalladioComponentModelMatchingStrategy implements |
16 | IEditorMatchingStrategy { |
17 | |
18 | /** |
19 | * @generated |
20 | */ |
21 | public boolean matches(IEditorReference editorRef, IEditorInput input) { |
22 | IEditorInput editorInput; |
23 | try { |
24 | editorInput = editorRef.getEditorInput(); |
25 | } catch (PartInitException e) { |
26 | return false; |
27 | } |
28 | |
29 | if (editorInput.equals(input)) { |
30 | return true; |
31 | } |
32 | if (editorInput instanceof URIEditorInput |
33 | && input instanceof URIEditorInput) { |
34 | return ((URIEditorInput) editorInput).getURI().equals( |
35 | ((URIEditorInput) input).getURI()); |
36 | } |
37 | return false; |
38 | } |
39 | |
40 | } |