Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » [SOLVED]CheckedTreeSelectionDialog and ICheckStateProvider issue(cannot make the root element as "checked" when the dialog is opened)
icon5.gif  [SOLVED]CheckedTreeSelectionDialog and ICheckStateProvider issue [message #647569] Fri, 07 January 2011 05:57 Go to next message
Carusyte Missing name is currently offline Carusyte Missing nameFriend
Messages: 27
Registered: July 2009
Junior Member
I am making a dialog that mimics the DirectoryDialog functionality but limits the user selection within a certain folder (which the setFilterPath(String) method in DirectoryDialog cannot realize) and provides multiple selection capability. Besides, I want to display a certain directory as "checked" when the dialog is opened, and I am trying to realize this by injecting ICheckStateProvider in the viewer created by CheckedTreeSelectionDialog (overriding the createViewer() method).
Here comes the problem: while I am 100% assured that the isChecked(Object) returns true when this method is invoked with the root element as its parameter, the element in the viewer still appears as unchecked, and when I test with other elements they are displayed correctly. That's weird, is this a bug somehow? I can't google any results related to this issue elsewhere.

[Updated on: Wed, 26 January 2011 07:59]

Report message to a moderator

Re: CheckedTreeSelectionDialog and ICheckStateProvider issue [message #650575 is a reply to message #647569] Tue, 25 January 2011 15:10 Go to previous messageGo to next message
Carusyte Missing name is currently offline Carusyte Missing nameFriend
Messages: 27
Registered: July 2009
Junior Member
This problem has pested me for quite some time. I realized that the initial checked state can be set simply via setInitialElementSelections(List selectedElements), it works fine with all the elements provided in the argument except for the root node. As a result, my app appears really unnatural to the users...
I've been constantly searching for a solution, any help is appreciated.
Re: CheckedTreeSelectionDialog and ICheckStateProvider issue [message #650701 is a reply to message #647569] Wed, 26 January 2011 07:49 Go to previous message
Carusyte Missing name is currently offline Carusyte Missing nameFriend
Messages: 27
Registered: July 2009
Junior Member
It turns out that the problem is caused by the comparison of files:
File f1 = new File("F:/abc");
File f2 = new File("F:/abc", "/");
System.out.println(f1.equals(f2));

The output is false.
I created File instance for each initial selected elements using the second constructor, assuming the instance is equal to that created by the first...
Thanks for everyone who ever payed attention to these posts.

[Updated on: Wed, 26 January 2011 08:03]

Report message to a moderator

Previous Topic:Tableviewer column border/spacing problem
Next Topic:Testing RCP applications
Goto Forum:
  


Current Time: Wed Sep 25 22:49:42 GMT 2024

Powered by FUDForum. Page generated in 0.04098 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top