Community
Participate
Working Groups
Build Identifier: M20080911-1700 Our project use Marker Support Framework to provide bookmark support for our special editor input. We have one numeric property for our marker, like "baseValue", and it is shown as a field in our custom bookmark view. Most of functions works well except that: (1) Sort all the bookmarks by the numeric field.(Escpecially when we want to format this field) (2) Right align the numeric field. We also try to close sort function for this field but find no relevant API or extension point. The workaround we use is to stuff spaces at preceding for each numeric but this has two limits: (1) Many spaces have to stuffed for minor value, especially when the numeric is "long" type. (2) This workaround can not work for negative values. Reproducible: Always Steps to Reproduce: 1. Define a numeric field for a marker 2. Add some markers 3. Sort the markers by the numeric field in the marker view.
By numeric field do you mean floating point numbers or integers? IMarker already supports integer attributes.
Created attachment 195294 [details] Incorrect sort and workaound "BaseValue" is an integer attribute of IMarker and is shown in the view with comma inserted. It seems the view uses String comparator to sort "BaseValue" column, so we obtain wrong order when we take them as integer. "StartTimeStamp" is also integer attribute of IMarker and is shown with spaces stuffed in the preceding. This is the workaround we used now.
We know IMarker support String, Integer, and Boolean as its attributes, but it seems the MarkerSupportView just sort the markers by the string values of each field, not by the attribute value. BTW, if the MarkerSupportView could sorted markers by attribute value, Long type attribute is needed for us.
(In reply to comment #3) > We know IMarker support String, Integer, and Boolean as its attributes, but it > seems the MarkerSupportView just sort the markers by the string values of each > field, not by the attribute value. > > BTW, if the MarkerSupportView could sorted markers by attribute value, Long > type attribute is needed for us. Would maybe a separate view for your custom markers make more sense?
(In reply to comment #4) > (In reply to comment #3) > > We know IMarker support String, Integer, and Boolean as its attributes, but it > > seems the MarkerSupportView just sort the markers by the string values of each > > field, not by the attribute value. > > > > BTW, if the MarkerSupportView could sorted markers by attribute value, Long > > type attribute is needed for us. > > Would maybe a separate view for your custom markers make more sense? Yes, we have a separate view for our custom markers, we just make our view extend MarkerSupportView. Today, I find compare(MarkerItem, MarkerItem) in the MarkerField, we can overwrite it to sort all markers by model, like by attribute, and this can resolve our problem. Although we have to save the attribute as String and parse it into Long when comparing. Thanks for your comments. BTW, can MarkerField expose API let users specify align ?
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. If the bug is still relevant, please remove the "stalebug" whiteboard tag.