Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Removing items from TableTree
Removing items from TableTree [message #448397] Fri, 07 January 2005 19:33 Go to next message
Kalman Hazins is currently offline Kalman HazinsFriend
Messages: 76
Registered: July 2009
Member
Hi, group.

How do I remove items from TableTree? So, say I have a TableTree with 3
nodes, which themselves have 3 nodes each. I simply want to delete all nodes
under a "root" node when the particular "root" node is clicked.

Any ideas?

Also, if I am using TableTreeEditor is there a way to know which
TableTreeEditor is associated with which TableTreeItem (because when I
dispose() of the TableTreetem, the Editor still displays)

Any help is appreciated,
- Kalman
Re: Removing items from TableTree [message #448399 is a reply to message #448397] Fri, 07 January 2005 21:23 Go to previous messageGo to next message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
To remove a TableTreeItem just call dispose on the TableTreeItem.

You must clean up the TableTreeEditor yourself. If you want to keep the
same TableTreeEditor for other items, set the item to null
(TableTreeEditor.setItem(null)) before disposing the TableTreeItem.

You can get the TableTreeItem associated with a TableTreeEditor using
TableTreeEditor.getItem.


"Kalman" <kalman@zikal.com> wrote in message
news:crmo53$jqk$1@www.eclipse.org...
> Hi, group.
>
> How do I remove items from TableTree? So, say I have a TableTree with 3
> nodes, which themselves have 3 nodes each. I simply want to delete all
> nodes
> under a "root" node when the particular "root" node is clicked.
>
> Any ideas?
>
> Also, if I am using TableTreeEditor is there a way to know which
> TableTreeEditor is associated with which TableTreeItem (because when I
> dispose() of the TableTreetem, the Editor still displays)
>
> Any help is appreciated,
> - Kalman
>
>
Re: Removing items from TableTree [message #448454 is a reply to message #448399] Mon, 10 January 2005 16:26 Go to previous messageGo to next message
Kalman Hazins is currently offline Kalman HazinsFriend
Messages: 76
Registered: July 2009
Member
Veronika saves the day again ...

Let me restate the question.

I have a bunch of rows from the database, which I am displaying in my table.
I really wanted to display the primary key column (some id) as a hyperlink,
so that when a user clicks on it - he can go to a different screen and view
the row.

Now, my question was once I place a control (hyperlink in my case) into the
table, and then later decide to delete the row from the table, how would I
get to the editor (hyperlink) and delete it.

Are you saying that I would need to keep a reference to the
editors(hyperlinks) in some vector and then loop thru them to find out
which tabletreeitem they are part of and then delete them? There's got to be
a better way of doing this, no?

Thanx,
- Kalman

P.S. I checked out TableTreeViewer and I really like the MVC approach to
displaying and deleting things from the table, but I think I am still going
to have a problem with deleting hyperlinks ...



"Veronika Irvine" <veronika_irvine@oti.com> wrote in message
news:crmukj$aqr$1@www.eclipse.org...
> To remove a TableTreeItem just call dispose on the TableTreeItem.
>
> You must clean up the TableTreeEditor yourself. If you want to keep the
> same TableTreeEditor for other items, set the item to null
> (TableTreeEditor.setItem(null)) before disposing the TableTreeItem.
>
> You can get the TableTreeItem associated with a TableTreeEditor using
> TableTreeEditor.getItem.
>
>
> "Kalman" <kalman@zikal.com> wrote in message
> news:crmo53$jqk$1@www.eclipse.org...
> > Hi, group.
> >
> > How do I remove items from TableTree? So, say I have a TableTree with 3
> > nodes, which themselves have 3 nodes each. I simply want to delete all
> > nodes
> > under a "root" node when the particular "root" node is clicked.
> >
> > Any ideas?
> >
> > Also, if I am using TableTreeEditor is there a way to know which
> > TableTreeEditor is associated with which TableTreeItem (because when I
> > dispose() of the TableTreetem, the Editor still displays)
> >
> > Any help is appreciated,
> > - Kalman
> >
> >
>
>
Re: Removing items from TableTree [message #448542 is a reply to message #448454] Tue, 11 January 2005 20:29 Go to previous messageGo to next message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
You could use something like TableTreeItem.setData("TableTreeEditor",
editor) and TableTreeItem.getData("TableTreeEditor") to manage the
association.


"Kalman" <kalman@zikal.com> wrote in message
news:cruaak$i7o$1@www.eclipse.org...
> Veronika saves the day again ...
>
> Let me restate the question.
>
> I have a bunch of rows from the database, which I am displaying in my
> table.
> I really wanted to display the primary key column (some id) as a
> hyperlink,
> so that when a user clicks on it - he can go to a different screen and
> view
> the row.
>
> Now, my question was once I place a control (hyperlink in my case) into
> the
> table, and then later decide to delete the row from the table, how would I
> get to the editor (hyperlink) and delete it.
>
> Are you saying that I would need to keep a reference to the
> editors(hyperlinks) in some vector and then loop thru them to find out
> which tabletreeitem they are part of and then delete them? There's got to
> be
> a better way of doing this, no?
>
> Thanx,
> - Kalman
>
> P.S. I checked out TableTreeViewer and I really like the MVC approach to
> displaying and deleting things from the table, but I think I am still
> going
> to have a problem with deleting hyperlinks ...
>
>
>
> "Veronika Irvine" <veronika_irvine@oti.com> wrote in message
> news:crmukj$aqr$1@www.eclipse.org...
>> To remove a TableTreeItem just call dispose on the TableTreeItem.
>>
>> You must clean up the TableTreeEditor yourself. If you want to keep the
>> same TableTreeEditor for other items, set the item to null
>> (TableTreeEditor.setItem(null)) before disposing the TableTreeItem.
>>
>> You can get the TableTreeItem associated with a TableTreeEditor using
>> TableTreeEditor.getItem.
>>
>>
>> "Kalman" <kalman@zikal.com> wrote in message
>> news:crmo53$jqk$1@www.eclipse.org...
>> > Hi, group.
>> >
>> > How do I remove items from TableTree? So, say I have a TableTree with 3
>> > nodes, which themselves have 3 nodes each. I simply want to delete all
>> > nodes
>> > under a "root" node when the particular "root" node is clicked.
>> >
>> > Any ideas?
>> >
>> > Also, if I am using TableTreeEditor is there a way to know which
>> > TableTreeEditor is associated with which TableTreeItem (because when I
>> > dispose() of the TableTreetem, the Editor still displays)
>> >
>> > Any help is appreciated,
>> > - Kalman
>> >
>> >
>>
>>
>
>
Re: Removing items from TableTree [message #448607 is a reply to message #448542] Tue, 11 January 2005 22:04 Go to previous message
Kalman Hazins is currently offline Kalman HazinsFriend
Messages: 76
Registered: July 2009
Member
cute ... thanx, that should do it ...

"Veronika Irvine" <veronika_irvine@oti.com> wrote in message
news:cs1d0o$t3n$1@www.eclipse.org...
> You could use something like TableTreeItem.setData("TableTreeEditor",
> editor) and TableTreeItem.getData("TableTreeEditor") to manage the
> association.
>
>
> "Kalman" <kalman@zikal.com> wrote in message
> news:cruaak$i7o$1@www.eclipse.org...
> > Veronika saves the day again ...
> >
> > Let me restate the question.
> >
> > I have a bunch of rows from the database, which I am displaying in my
> > table.
> > I really wanted to display the primary key column (some id) as a
> > hyperlink,
> > so that when a user clicks on it - he can go to a different screen and
> > view
> > the row.
> >
> > Now, my question was once I place a control (hyperlink in my case) into
> > the
> > table, and then later decide to delete the row from the table, how would
I
> > get to the editor (hyperlink) and delete it.
> >
> > Are you saying that I would need to keep a reference to the
> > editors(hyperlinks) in some vector and then loop thru them to find out
> > which tabletreeitem they are part of and then delete them? There's got
to
> > be
> > a better way of doing this, no?
> >
> > Thanx,
> > - Kalman
> >
> > P.S. I checked out TableTreeViewer and I really like the MVC approach to
> > displaying and deleting things from the table, but I think I am still
> > going
> > to have a problem with deleting hyperlinks ...
> >
> >
> >
> > "Veronika Irvine" <veronika_irvine@oti.com> wrote in message
> > news:crmukj$aqr$1@www.eclipse.org...
> >> To remove a TableTreeItem just call dispose on the TableTreeItem.
> >>
> >> You must clean up the TableTreeEditor yourself. If you want to keep
the
> >> same TableTreeEditor for other items, set the item to null
> >> (TableTreeEditor.setItem(null)) before disposing the TableTreeItem.
> >>
> >> You can get the TableTreeItem associated with a TableTreeEditor using
> >> TableTreeEditor.getItem.
> >>
> >>
> >> "Kalman" <kalman@zikal.com> wrote in message
> >> news:crmo53$jqk$1@www.eclipse.org...
> >> > Hi, group.
> >> >
> >> > How do I remove items from TableTree? So, say I have a TableTree with
3
> >> > nodes, which themselves have 3 nodes each. I simply want to delete
all
> >> > nodes
> >> > under a "root" node when the particular "root" node is clicked.
> >> >
> >> > Any ideas?
> >> >
> >> > Also, if I am using TableTreeEditor is there a way to know which
> >> > TableTreeEditor is associated with which TableTreeItem (because when
I
> >> > dispose() of the TableTreetem, the Editor still displays)
> >> >
> >> > Any help is appreciated,
> >> > - Kalman
> >> >
> >> >
> >>
> >>
> >
> >
>
>
Previous Topic:Question concerning Tables and TableTrees
Next Topic:ProgressBar SWT.INDETERMINATE
Goto Forum:
  


Current Time: Mon Apr 19 10:38:23 GMT 2021

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

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

Back to the top