Fixed rendering of integral transaction attributes and updated version

numbers
This commit is contained in:
2017-10-13 09:36:44 +02:00
parent ed0558afdf
commit 44b13c105d
8 changed files with 22 additions and 12 deletions

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;