Skip to content

Commit 60359ef

Browse files
committed
[#362] Show version date in Packs View
1 parent a90aeb0 commit 60359ef

File tree

1 file changed

+19
-4
lines changed
  • bundles/ilg.gnumcueclipse.packs.ui/src/ilg/gnumcueclipse/packs/ui/views

1 file changed

+19
-4
lines changed

bundles/ilg.gnumcueclipse.packs.ui/src/ilg/gnumcueclipse/packs/ui/views/PacksView.java

+19-4
Original file line numberDiff line numberDiff line change
@@ -149,25 +149,40 @@ public String getColumnText(Object obj, int columnIndex) {
149149
switch (columnIndex) {
150150
case 0:
151151
String name = node.getName();
152+
String extra = "";
152153
if (node.isBooleanProperty(Property.INSTALLED)) {
153-
name += " (installed)";
154+
extra = "installed";
154155
} else {
155156
if (node.isType(Type.VERSION)) {
156157
String size = node.getProperty(Property.ARCHIVE_SIZE);
157-
if (size.length() > 0) {
158+
if (!size.isEmpty()) {
159+
if (!extra.isEmpty()) {
160+
extra += ", ";
161+
}
158162
try {
159163
int n = Integer.parseInt(size);
160164
if (n <= 0) {
161-
name += " (n/a)";
165+
extra += "n/a";
162166
} else {
163-
name += " (" + StringUtils.convertSizeToString(n) + ")";
167+
extra += StringUtils.convertSizeToString(n);
164168
}
165169
} catch (NumberFormatException e) {
166170
;
167171
}
168172
}
173+
String date = node.getProperty(Property.DATE);
174+
if (!date.isEmpty()) {
175+
if (!extra.isEmpty()) {
176+
extra += ", ";
177+
}
178+
extra += date;
179+
}
180+
169181
}
170182
}
183+
if (!extra.isEmpty()) {
184+
name += " (" + extra + ")";
185+
}
171186
return " " + name;
172187

173188
case 1:

0 commit comments

Comments
 (0)