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 00:57 Go to next message
Carusyte Missing name is currently offline Carusyte Missing name
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 02:59]

Report message to a moderator

Re: CheckedTreeSelectionDialog and ICheckStateProvider issue [message #650575 is a reply to message #647569] Tue, 25 January 2011 10:10 Go to previous messageGo to next message
Carusyte Missing name is currently offline Carusyte Missing name
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 02:49 Go to previous message
Carusyte Missing name is currently offline Carusyte Missing name
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 03:03]

Report message to a moderator

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


Current Time: Thu Jul 24 09:07:15 EDT 2014

Powered by FUDForum. Page generated in 0.03792 seconds