]>
git.argeo.org Git - gpl/argeo-slc.git/blob - dist/controllers/DistTreeLabelProvider.java
1 package org
.argeo
.slc
.client
.ui
.dist
.controllers
;
3 import org
.argeo
.slc
.client
.ui
.dist
.DistImages
;
4 import org
.argeo
.slc
.client
.ui
.dist
.model
.DistParentElem
;
5 import org
.argeo
.slc
.client
.ui
.dist
.model
.GroupElem
;
6 import org
.argeo
.slc
.client
.ui
.dist
.model
.RepoElem
;
7 import org
.argeo
.slc
.client
.ui
.dist
.model
.WorkspaceElem
;
8 import org
.eclipse
.jface
.viewers
.ColumnLabelProvider
;
9 import org
.eclipse
.swt
.graphics
.Image
;
12 * Manages icons and labels for the distributions browser
14 public class DistTreeLabelProvider
extends ColumnLabelProvider
{
16 public String
getText(Object element
) {
17 if (element
instanceof DistParentElem
)
18 return ((DistParentElem
) element
).getLabel();
20 return element
.toString();
24 public Image
getImage(Object element
) {
25 if (element
instanceof DistParentElem
) {
26 DistParentElem bElement
= (DistParentElem
) element
;
27 if (bElement
instanceof RepoElem
)
28 if (bElement
.inHome())
29 return DistImages
.IMG_HOME_REPO
;
30 else if (bElement
.isReadOnly())
31 return DistImages
.IMG_REPO_READONLY
;
33 return DistImages
.IMG_REPO
;
34 else if (bElement
instanceof GroupElem
)
35 return DistImages
.IMG_WKSP
;
36 else if (element
instanceof WorkspaceElem
)
37 if (((WorkspaceElem
) element
).isReadOnly())
38 return DistImages
.IMG_DISTGRP_READONLY
;
40 return DistImages
.IMG_DISTGRP
;