Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / November 2007

Tip: Looking for answers? Try searching our database.

SWT change Tree Node behavior bug

Thread view: 
teschner@gmail.com - 21 Nov 2007 09:46 GMT
Hi

I have a problem with SWT if I exchange the default tree node
appearance with a customized one.
In my case i add a composite to the node which holds a combo box and
some additional textfields.

       TreeEditor editor = new TreeEditor(tree);

       editor.horizontalAlignment = SWT.LEFT;

       editor.grabHorizontal = true;

       FieldPanel fieldp = new FieldPanel(tree,0,field);
// FieldPanel is a composite and holds the combo box
       editor.setEditor (fieldp, item);

       item.setData(editor);

So far so good everything appears normal.
The problem is that the combo box displays only the first letter of
the holding value.
If selected it displays the complete value.

For example:
The values are 'ABC' and 'DEF' the display without selection is just
'A' or just 'D'.

// the code inside the Fieldpanel ...
CCombo    cbo = new CCombo(this, SWT.FLAT | SWT.DROP_DOWN);
cbo.setItems(new String [] {"ABC","DEF"});
cbo.setTextLimit(20);
cbo.setSize(30, 20);
cbo.setEditable(false);

I wonder what i am doing wrong here ...
in case this is a known bug, is there any work-around?

Thanks for your help
teschner@gmail.com - 21 Nov 2007 12:47 GMT
On Nov 21, 10:46 am, tesch...@gmail.com wrote:
> Hi
>
[quoted text clipped - 35 lines]
>
> Thanks for your help

I found the bug:

if I remove the cbo.setSize(..)  the complete data is displayed ...

really strange behavior in opinion but whatever, a set size shouldn't
have influence on the displayed content at all!


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.