Fixed rendering of integral transaction attributes and updated version

numbers
This commit is contained in:
Eyck Jentzsch 2017-10-13 09:36:44 +02:00 committed by Brita Keller
parent 2b33ea0c85
commit 792dcd55f3
8 changed files with 22 additions and 12 deletions

View File

@ -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",

View File

@ -8,5 +8,5 @@
<relativePath>../com.minres.scviewer.parent</relativePath>
</parent>
<packaging>eclipse-plugin</packaging>
<version>1.1.0-SNAPSHOT</version>
<version>1.1.1-SNAPSHOT</version>
</project>

View File

@ -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());

View File

@ -10,7 +10,7 @@
<relativePath>../com.minres.scviewer.parent</relativePath>
</parent>
<artifactId>com.minres.scviewer.e4.product</artifactId>
<version>1.2.0-SNAPSHOT</version>
<version>1.2.1-SNAPSHOT</version>
<packaging>eclipse-repository</packaging>
<groupId>com.minres.scviewer</groupId>
<build>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<?pde version="3.5"?>
<product name="SCViewer" uid="scviewer" id="com.minres.scviewer.e4.application.product" application="org.eclipse.e4.ui.workbench.swt.E4Application" version="1.2.0.qualifier" useFeatures="false" includeLaunchers="true">
<product name="SCViewer" uid="scviewer" id="com.minres.scviewer.e4.application.product" application="org.eclipse.e4.ui.workbench.swt.E4Application" version="1.2.1.qualifier" useFeatures="false" includeLaunchers="true">
<configIni use="default">
</configIni>

View File

@ -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",

View File

@ -8,4 +8,5 @@
<relativePath>../com.minres.scviewer.parent</relativePath>
</parent>
<packaging>eclipse-plugin</packaging>
</project>
<version>1.0.1-SNAPSHOT</version>
</project>

View File

@ -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;