From: Sylvestre Ledru Date: Tue, 12 Nov 2013 13:22:04 +0000 (+0100) Subject: * Bug #8060 fixed - Improve the display of a list in the variable browser. X-Git-Tag: 5.5.0~1125 X-Git-Url: http://gitweb.scilab.org/?p=scilab.git;a=commitdiff_plain;h=4cdd834fb60bd3a7b3dc67e7e4e8ebe31fcfdd54 * Bug #8060 fixed - Improve the display of a list in the variable browser. Change-Id: Icedb4a9d3d8ff01422b792718e3f6b1f389afd91 --- diff --git a/scilab/CHANGES_5.5.X b/scilab/CHANGES_5.5.X index d76a1e5..38712f6 100644 --- a/scilab/CHANGES_5.5.X +++ b/scilab/CHANGES_5.5.X @@ -43,6 +43,8 @@ Scilab Bug Fixes * Bug #8031 fixed - cdfgam error message fixed. +* Bug #8060 fixed - Display of a list improved in the variable browser. + * Bug #8231 fixed - xrect help page did not say that clipping property was inherited. * Bug #8337 fixed - mtlb_rand now uses the "uniform" rule, whatever the random rule set is. diff --git a/scilab/modules/types/src/java/org/scilab/modules/types/ScilabTypeEnumDescription.java b/scilab/modules/types/src/java/org/scilab/modules/types/ScilabTypeEnumDescription.java index cf68571..11cec11 100644 --- a/scilab/modules/types/src/java/org/scilab/modules/types/ScilabTypeEnumDescription.java +++ b/scilab/modules/types/src/java/org/scilab/modules/types/ScilabTypeEnumDescription.java @@ -63,4 +63,25 @@ public class ScilabTypeEnumDescription { return Messages.gettext("Unknown datatype"); } } + + /* + * Return the description of the mlist code ('ce' => 'cell', 'st => 'struct', etc) + * @param shortCode the short code + * @return the full description + */ + public static String getListTypeDescription (String shortCode) { + // Once we switch to Java 7, we can replace that by a String switch + if (shortCode.equals("ce")) { + shortCode = "cell"; + } else { + if (shortCode.equals("st")) { + shortCode = "struct"; + } else { + if (shortCode.equals("fptr")) { + shortCode = "built-in"; + } + } + } + return shortCode; + } } \ No newline at end of file diff --git a/scilab/modules/ui_data/src/java/org/scilab/modules/ui_data/BrowseVar.java b/scilab/modules/ui_data/src/java/org/scilab/modules/ui_data/BrowseVar.java index 54da814..b86e307 100644 --- a/scilab/modules/ui_data/src/java/org/scilab/modules/ui_data/BrowseVar.java +++ b/scilab/modules/ui_data/src/java/org/scilab/modules/ui_data/BrowseVar.java @@ -140,13 +140,18 @@ public class BrowseVar { data[i][NAME_COLUMN_INDEX] = dataNames[i]; data[i][SIZE_COLUMN_INDEX] = dataSizes[i]; data[i][TYPE_DESC_COLUMN_INDEX] = ScilabTypeEnumDescription.getTypeDescriptionFromId(dataTypes[i]); + if (dataTypes[i] == ScilabTypeEnum.sci_ints.swigValue() && dataIntegerTypes[i] != 0) { // It is an integer. We want to detail the precision of the int data[i][TYPE_DESC_COLUMN_INDEX] = data[i][TYPE_DESC_COLUMN_INDEX] + " " + dataIntegerTypes[i]; } + if ((dataTypes[i] == ScilabTypeEnum.sci_tlist.swigValue() || dataTypes[i] == ScilabTypeEnum.sci_mlist.swigValue()) && !variableListTypes[i].equals("")) { + // Improve the display of the list + String varType = ScilabTypeEnumDescription.getListTypeDescription(variableListTypes[i]); + // It is a tlist and we want to display the user datatype - data[i][TYPE_DESC_COLUMN_INDEX] = variableListTypes[i] + " (" + data[i][TYPE_DESC_COLUMN_INDEX] + ")"; + data[i][TYPE_DESC_COLUMN_INDEX] = varType + " (" + data[i][TYPE_DESC_COLUMN_INDEX] + ")"; } data[i][VISIBILITY_COLUMN_INDEX] = dataVisibility[i]; data[i][BYTES_COLUMN_INDEX] = dataBytes[i];