Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 208713 - "SortableColumns" Property value being ignored in OutlineView
"SortableColumns" Property value being ignored in OutlineView
Product: platform
Classification: Unclassified
Component: Outline&TreeTable
PC Windows 7 x64
: P3 (vote)
: 7.2
Assigned To: Martin Entlicher
Depends on:
  Show dependency treegraph
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

an example Suite with Nodes containing non-sortable Properties (9.77 MB, application/x-sdlc)
2012-02-21 18:55 UTC, cappicard
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( .... ):


        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
Comment 6 Quality Engineering 2012-04-05 09:41:01 UTC
Integrated into 'main-golden', will be available in build *201204050400* on (upload may still be in progress)
Log: #208713: OutlineView.setPropertyColumnAttribute() method added.

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo