/
AccountsviewLabelProvider.java
65 lines (59 loc) · 1.73 KB
/
AccountsviewLabelProvider.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
package org.eclipse.emf.parsley.examples.mail.accountsview.ui.provider;
import com.google.common.base.Objects;
import com.google.inject.Inject;
import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
import org.eclipse.emf.parsley.examples.mail.Account;
import org.eclipse.emf.parsley.examples.mail.Folder;
import org.eclipse.emf.parsley.ui.provider.ViewerLabelProvider;
@SuppressWarnings("all")
public class AccountsviewLabelProvider extends ViewerLabelProvider {
@Inject
public AccountsviewLabelProvider(final AdapterFactoryLabelProvider delegate) {
super(delegate);
}
public String text(final Account it) {
String _email = it.getEmail();
return _email;
}
public String text(final Folder it) {
String _name = it.getName();
return _name;
}
public Object image(final Account it) {
return "account.gif";
}
public Object image(final Folder it) {
String _xblockexpression = null;
{
String _name = it.getName();
boolean _equals = Objects.equal(_name, null);
if (_equals) {
return "folder.gif";
}
String _switchResult = null;
String _name_1 = it.getName();
boolean _matched = false;
if (Objects.equal(_name_1, "Inbox")) {
_matched=true;
_switchResult = "inbox.gif";
}
if (!_matched) {
if (Objects.equal(_name_1, "Sent")) {
_matched=true;
_switchResult = "sent.gif";
}
}
if (!_matched) {
if (Objects.equal(_name_1, "Trash")) {
_matched=true;
_switchResult = "trash.gif";
}
}
if (!_matched) {
_switchResult = "folder.gif";
}
_xblockexpression = _switchResult;
}
return _xblockexpression;
}
}