From 792dcd55f357f6f59bec86b6b160f82f4b92a281 Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Fri, 13 Oct 2017 09:36:44 +0200 Subject: [PATCH] Fixed rendering of integral transaction attributes and updated version numbers --- .../META-INF/MANIFEST.MF | 2 +- com.minres.scviewer.e4.application/pom.xml | 2 +- .../e4/application/parts/TransactionDetails.java | 9 ++++++++- com.minres.scviewer.e4.product/pom.xml | 2 +- com.minres.scviewer.e4.product/scviewer.product | 2 +- com.minres.scviewer.ui/META-INF/MANIFEST.MF | 2 +- com.minres.scviewer.ui/pom.xml | 3 ++- .../ui/views/sections/AttributeProperty.java | 12 +++++++----- 8 files changed, 22 insertions(+), 12 deletions(-) diff --git a/com.minres.scviewer.e4.application/META-INF/MANIFEST.MF b/com.minres.scviewer.e4.application/META-INF/MANIFEST.MF index 1a5628d..93b5bc6 100644 --- a/com.minres.scviewer.e4.application/META-INF/MANIFEST.MF +++ b/com.minres.scviewer.e4.application/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %Bundle-Name Bundle-SymbolicName: com.minres.scviewer.e4.application;singleton:=true -Bundle-Version: 1.1.0.qualifier +Bundle-Version: 1.1.1.qualifier Bundle-Vendor: %Bundle-Vendor Require-Bundle: javax.inject;bundle-version="1.0.0", org.eclipse.core.runtime;bundle-version="3.11.1", diff --git a/com.minres.scviewer.e4.application/pom.xml b/com.minres.scviewer.e4.application/pom.xml index 827f795..c337711 100644 --- a/com.minres.scviewer.e4.application/pom.xml +++ b/com.minres.scviewer.e4.application/pom.xml @@ -8,5 +8,5 @@ ../com.minres.scviewer.parent eclipse-plugin - 1.1.0-SNAPSHOT + 1.1.1-SNAPSHOT \ No newline at end of file diff --git a/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/TransactionDetails.java b/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/TransactionDetails.java index c4d8337..99b997e 100644 --- a/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/TransactionDetails.java +++ b/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/TransactionDetails.java @@ -55,6 +55,7 @@ import org.eclipse.swt.widgets.Tree; import com.minres.scviewer.database.ITx; import com.minres.scviewer.database.ITxAttribute; import com.minres.scviewer.database.ITxRelation; +import com.minres.scviewer.database.DataType; import com.minres.scviewer.e4.application.Messages; import com.minres.scviewer.e4.application.provider.TxPropertiesLabelProvider; @@ -579,7 +580,13 @@ PROPS, /** The attrs. */ default: if (element instanceof ITxAttribute) { ITxAttribute attribute = (ITxAttribute) element; - return new StyledString(attribute.getValue().toString()); + String value = attribute.getValue().toString(); + if((DataType.UNSIGNED == attribute.getDataType() || DataType.INTEGER==attribute.getDataType()) && !"0".equals(value)) { + try { + value = attribute.getValue().toString() + " [0x"+Long.toHexString(Long.parseLong(attribute.getValue().toString()))+"]"; + } catch(NumberFormatException e) { } + } + return new StyledString(value); }else if(element instanceof Object[]){ Object[] elements = (Object[]) element; return new StyledString(elements[field].toString()); diff --git a/com.minres.scviewer.e4.product/pom.xml b/com.minres.scviewer.e4.product/pom.xml index f66383a..9aaba3d 100644 --- a/com.minres.scviewer.e4.product/pom.xml +++ b/com.minres.scviewer.e4.product/pom.xml @@ -10,7 +10,7 @@ ../com.minres.scviewer.parent com.minres.scviewer.e4.product - 1.2.0-SNAPSHOT + 1.2.1-SNAPSHOT eclipse-repository com.minres.scviewer diff --git a/com.minres.scviewer.e4.product/scviewer.product b/com.minres.scviewer.e4.product/scviewer.product index 9abe6d5..423a65b 100644 --- a/com.minres.scviewer.e4.product/scviewer.product +++ b/com.minres.scviewer.e4.product/scviewer.product @@ -1,7 +1,7 @@ - + diff --git a/com.minres.scviewer.ui/META-INF/MANIFEST.MF b/com.minres.scviewer.ui/META-INF/MANIFEST.MF index 8af8bef..fc9a3e3 100644 --- a/com.minres.scviewer.ui/META-INF/MANIFEST.MF +++ b/com.minres.scviewer.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: SCViewer Bundle-SymbolicName: com.minres.scviewer.ui;singleton:=true -Bundle-Version: 1.0.0.qualifier +Bundle-Version: 1.0.1.qualifier Bundle-Activator: com.minres.scviewer.ui.TxEditorPlugin Bundle-Vendor: MINRES Technologies GmbH Require-Bundle: com.minres.scviewer.database;bundle-version="1.0.0", diff --git a/com.minres.scviewer.ui/pom.xml b/com.minres.scviewer.ui/pom.xml index 5c71fb2..11f1e01 100644 --- a/com.minres.scviewer.ui/pom.xml +++ b/com.minres.scviewer.ui/pom.xml @@ -8,4 +8,5 @@ ../com.minres.scviewer.parent eclipse-plugin - \ No newline at end of file + 1.0.1-SNAPSHOT + \ No newline at end of file diff --git a/com.minres.scviewer.ui/src/com/minres/scviewer/ui/views/sections/AttributeProperty.java b/com.minres.scviewer.ui/src/com/minres/scviewer/ui/views/sections/AttributeProperty.java index 23393fd..703ed20 100644 --- a/com.minres.scviewer.ui/src/com/minres/scviewer/ui/views/sections/AttributeProperty.java +++ b/com.minres.scviewer.ui/src/com/minres/scviewer/ui/views/sections/AttributeProperty.java @@ -44,6 +44,7 @@ import org.eclipse.ui.views.properties.tabbed.AbstractPropertySection; import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage; import com.minres.scviewer.database.AssociationType; +import com.minres.scviewer.database.DataType; import com.minres.scviewer.database.ITxAttribute; import com.minres.scviewer.database.ITx; @@ -199,12 +200,13 @@ public class AttributeProperty extends AbstractPropertySection implements ISelec else if (columnIndex == 2 ) return attr.getDataType().name(); else if (columnIndex == 3){ - if("UNSIGNED".equals(attr.getType()) && (attr.getName().contains("addr")||attr.getName().contains("data"))) + String value = attr.getValue().toString(); + if((DataType.UNSIGNED == attr.getDataType() || DataType.INTEGER==attr.getDataType()) && !"0".equals(value)) { try { - return "0x"+Long.toHexString(Long.parseLong(attr.getValue().toString())); - } catch(NumberFormatException e) { - } - return attr.getValue().toString(); + value = attr.getValue().toString() + "(0x"+Long.toHexString(Long.parseLong(attr.getValue().toString()))+")"; + } catch(NumberFormatException e) { } + } + return value; } } return null;