]>
git.argeo.org Git - gpl/argeo-slc.git/blob - UserEditorInput.java
840a6eb7712638c59d19e5aacaefe90b8d0b2b1a
1 package org
.argeo
.cms
.ui
.workbench
.internal
.useradmin
.parts
;
3 import org
.eclipse
.jface
.resource
.ImageDescriptor
;
4 import org
.eclipse
.ui
.IEditorInput
;
5 import org
.eclipse
.ui
.IPersistableElement
;
8 * Editor input for an user defined by unique name (usually a distinguished
11 public class UserEditorInput
implements IEditorInput
{
12 private final String username
;
14 public UserEditorInput(String username
) {
15 this.username
= username
;
18 @SuppressWarnings("unchecked")
19 public Object
getAdapter(@SuppressWarnings("rawtypes") Class adapter
) {
23 public boolean exists() {
24 return username
!= null;
27 public ImageDescriptor
getImageDescriptor() {
31 public String
getName() {
32 return username
!= null ? username
: "<new user>";
35 public IPersistableElement
getPersistable() {
39 public String
getToolTipText() {
40 return username
!= null ? username
: "<new user>";
43 public boolean equals(Object obj
) {
44 if (!(obj
instanceof UserEditorInput
))
46 if (((UserEditorInput
) obj
).getUsername() == null)
48 return ((UserEditorInput
) obj
).getUsername().equals(username
);
51 public String
getUsername() {