Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-swt-dev] Help needed with TreeEditor

Please use the newsgroup for user questions.

Tom

Am 22.04.10 10:07, schrieb Tech Id:
> 
> Hi All,
> 
> I want to create a few fancy things on 2nd level tree items.
> (i.e. on every item which comes below the root level tree items).
> 
> However, the TreeEditor doesn't seem to work in the following small code.
> Please help.
> 
> (Note: I do not want the TreeEditor to come up only when some one clicks. 
> I want the fancy items (and hence the TreeEditor) to be there right when
> the user expands the root items).
> Also, the fancy items component should stretch horizontally and mask all
> the columns present in its own row.
> 
> Regards
> Techieeeee
> 
> 
> class test {
> public test () {
> Display display = new Display ();
> Shell shell = new Shell (display);
> shell.setLayout(new FillLayout());
> final Tree tree = new Tree (shell, SWT.BORDER);
> for (int i=0; i<4; i++) {
> TreeItem iItem = new TreeItem (tree, 0);
> iItem.setText ("TreeItem (I) -" + i);
> for (int j=0; j<4; j++) {
> TreeItem jItem = new TreeItem (iItem, 0);
> jItem.setText ("TreeItem (J) -" + j);
> TreeEditor editor = new TreeEditor (tree);
> Text text = new Text (tree, SWT.NONE);
> text.setText ("Junk.....");
> editor.setEditor (text, jItem);
> text.selectAll ();
> text.setFocus ();
> editor.layout ();
> }
> }
> shell.setSize (200, 200);
> shell.open ();
> while (!shell.isDisposed()) {
> if (!display.readAndDispatch ()) display.sleep ();
> }
> display.dispose ();
> }
> }
> 
> 
> 
> _______________________________________________
> platform-swt-dev mailing list
> platform-swt-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/platform-swt-dev


-- 
B e s t S o l u t i o n . a t                        EDV Systemhaus GmbH
------------------------------------------------------------------------
tom schindl                                        geschaeftsfuehrer/CEO
------------------------------------------------------------------------
eduard-bodem-gasse 5/1    A-6020 innsbruck      phone    ++43 512 935834


Back to the top