]> git.argeo.org Git - lgpl/argeo-commons.git/blob - demo/plugins/org.argeo.demo.i18n/src/main/java/org/argeo/demo/i18n/editors/SimpleMultitabEditorInput.java
6c30a1c453d38327089cf20ed04b568c95d9d10c
[lgpl/argeo-commons.git] / demo / plugins / org.argeo.demo.i18n / src / main / java / org / argeo / demo / i18n / editors / SimpleMultitabEditorInput.java
1 package org.argeo.demo.i18n.editors;
2
3 import org.eclipse.jface.resource.ImageDescriptor;
4 import org.eclipse.ui.IEditorInput;
5 import org.eclipse.ui.IPersistableElement;
6
7 /**
8 * An editor input based the object name.
9 * */
10
11 public class SimpleMultitabEditorInput implements IEditorInput {
12
13 private final String name;
14
15 public SimpleMultitabEditorInput(String name) {
16 this.name = name;
17 }
18
19 public String getName() {
20 return name;
21 }
22
23 public Object getAdapter(@SuppressWarnings("rawtypes") Class adapter) {
24 return null;
25 }
26
27 public boolean exists() {
28 return true;
29 }
30
31 public ImageDescriptor getImageDescriptor() {
32 return null;
33 }
34
35 public IPersistableElement getPersistable() {
36 return null;
37 }
38
39 /**
40 * equals method based on the name
41 */
42 public boolean equals(Object obj) {
43 if (this == obj)
44 return true;
45 if (obj == null)
46 return false;
47 if (getClass() != obj.getClass())
48 return false;
49
50 SimpleMultitabEditorInput other = (SimpleMultitabEditorInput) obj;
51 if (!getName().equals(other.getName()))
52 return false;
53 return true;
54 }
55
56 @Override
57 public String getToolTipText() {
58 return name;
59 }
60 }