This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 208713 - "SortableColumns" Property value being ignored in OutlineView
Summary: "SortableColumns" Property value being ignored in OutlineView
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Outline&TreeTable (show other bugs)
Version: 7.1
Hardware: PC Windows 7 x64
: P3 normal (vote)
Assignee: Martin Entlicher
URL:
Keywords: API, API_REVIEW_FAST
Depends on:
Blocks:
 
Reported: 2012-02-21 18:55 UTC by cappicard
Modified: 2012-04-05 09:41 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
an example Suite with Nodes containing non-sortable Properties (9.77 MB, application/x-sdlc)
2012-02-21 18:55 UTC, cappicard
Details
The proposed API change. (4.70 KB, patch)
2012-03-28 14:15 UTC, Martin Entlicher
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description cappicard 2012-02-21 18:55:33 UTC
Created attachment 115994 [details]
an example Suite with Nodes containing non-sortable Properties

If one sets the "SortableColumns" property value within a Property, it is completely ignored if the OutlineView has its columns set up via OutlineView.addPropertyColumn or OutlineView.setPropertyColumns().

This functions correctly if one creates a dummy node with the desired properies and then calls OutlineView.setProperties(properties).  However, OutlineView.setProperties(properties) is deprecated.

To reproduce:

1. Create a Node with at least one non-sortable Property

2. Set up columns via OutlineView.setPropertyColumns( .... ):

E.g. 

        outlineView1.addPropertyColumn(FakeEntity.PROP_PAGE_NUMBER, "Page Number");
        outlineView1.addPropertyColumn(FakeEntity.PROP_PAGE_LETTER, "Page Letter");

3. Set up an explorer view as normal.


In the attached FakeEntityNode class, the property PageLetterProperty will still sort in spite of having "SortableColumn" set.
Comment 1 Martin Entlicher 2012-03-28 13:36:19 UTC
Well, OutlineView.setProperties() was set as deprecated, but in cases when you need to provide a special instance of Node.Property, it needs to be used.

It's not much feasible to control sortability by Property objects attached to individual nodes. It's controled by Property objects passed as columns.
But when OutlineView.setProperties() is not used to set columns, there's no way how to change the Property attributes.

Therefore I'm proposing to add a new method:
OutlineView.setPropertyColumnAttribute(String columnName, String attributeName, Object value)

Then you could use this to change the sortability like:
OutlineView.setPropertyColumnAttribute("myColumn", "SortableColumn", Boolean.TRUE)
Comment 2 Martin Entlicher 2012-03-28 14:15:53 UTC
Created attachment 117412 [details]
The proposed API change.
Comment 3 Martin Entlicher 2012-03-28 14:16:56 UTC
Please review the proposed API change.
Comment 4 Martin Entlicher 2012-04-04 11:42:44 UTC
If there are no objections, I'm going to push this change today after COB. Thanks.
Comment 5 Martin Entlicher 2012-04-04 17:49:47 UTC
The API change is pushed as changeset:   217788:a07fe086ee8a
http://hg.netbeans.org/main/rev/a07fe086ee8a
Comment 6 Quality Engineering 2012-04-05 09:41:01 UTC
Integrated into 'main-golden', will be available in build *201204050400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/a07fe086ee8a
User: mentlicher@netbeans.org
Log: #208713: OutlineView.setPropertyColumnAttribute() method added.