]> git.argeo.org Git - lgpl/argeo-commons.git/blob - i18n/editors/SimpleMultitabEditorInput.java
Prepare next development cycle
[lgpl/argeo-commons.git] / i18n / editors / SimpleMultitabEditorInput.java
1 /*
2 * Copyright (C) 2007-2012 Mathieu Baudier
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16 package org.argeo.demo.i18n.editors;
17
18 import org.eclipse.jface.resource.ImageDescriptor;
19 import org.eclipse.ui.IEditorInput;
20 import org.eclipse.ui.IPersistableElement;
21
22 /**
23 * An editor input based the object name.
24 * */
25
26 public class SimpleMultitabEditorInput implements IEditorInput {
27
28 private final String name;
29
30 public SimpleMultitabEditorInput(String name) {
31 this.name = name;
32 }
33
34 public String getName() {
35 return name;
36 }
37
38 public Object getAdapter(@SuppressWarnings("rawtypes") Class adapter) {
39 return null;
40 }
41
42 public boolean exists() {
43 return true;
44 }
45
46 public ImageDescriptor getImageDescriptor() {
47 return null;
48 }
49
50 public IPersistableElement getPersistable() {
51 return null;
52 }
53
54 /**
55 * equals method based on the name
56 */
57 public boolean equals(Object obj) {
58 if (this == obj)
59 return true;
60 if (obj == null)
61 return false;
62 if (getClass() != obj.getClass())
63 return false;
64
65 SimpleMultitabEditorInput other = (SimpleMultitabEditorInput) obj;
66 if (!getName().equals(other.getName()))
67 return false;
68 return true;
69 }
70
71 @Override
72 public String getToolTipText() {
73 return name;
74 }
75 }