Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Nebula » GridItem events
GridItem events [message #598770] Fri, 18 December 2009 16:09 Go to next message
Eclipse UserFriend
Originally posted by: rodrigo.garcia.kotasoft.com

Hi,

I'm doing that:


for(WorkIndex wi : workSearchResponse.getInfo().getWorkIndex())
{
final GridItem workItem = new GridItem(grid,SWT.NONE);
workItem.setText(wi.getIswc());
workItem.setText(1,wi.getTitle());
workItem.setText(2,wi.getDch());

for(Node node : wi.getNodeList().getNode())
{
GridItem nodeInfoItem = new GridItem(workItem,SWT.NONE);
nodeInfoItem.setText(WPSMessages.node_table_label);
nodeInfoItem.setText(3,node.getAbvSoc());
nodeInfoItem.setText(4,node.getSociety());
nodeInfoItem.setText(5,node.getOwner());
nodeInfoItem.addListener(SWT.MouseDoubleClick, new Listener() {
@Override
public void handleEvent(Event event) {
MessageDialog.openInformation(workTableForm.getShell(), "Works",
workItem.getText());
}
});
}
}

As you can see I'm adding a listener to gridItems, the problem is that
the event isn't handled. any idea?

Thank you in advance.

Rodrigo
Re: GridItem events [message #598775 is a reply to message #598770] Fri, 18 December 2009 16:17 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6473
Registered: July 2009
Senior Member
GridItems like Table/TreeItems don't deliver events. You need to attach
the listener to the Grid and fetch the GridItem with the given coordinates

Tom


Am 18.12.09 17:09, schrieb Rodrigo García:
> Hi,
>
> I'm doing that:
>
>
> for(WorkIndex wi : workSearchResponse.getInfo().getWorkIndex())
> {
> final GridItem workItem = new GridItem(grid,SWT.NONE);
> workItem.setText(wi.getIswc());
> workItem.setText(1,wi.getTitle());
> workItem.setText(2,wi.getDch());
>
> for(Node node : wi.getNodeList().getNode())
> {
> GridItem nodeInfoItem = new
> GridItem(workItem,SWT.NONE);
> nodeInfoItem.setText(WPSMessages.node_table_label);
> nodeInfoItem.setText(3,node.getAbvSoc());
> nodeInfoItem.setText(4,node.getSociety());
> nodeInfoItem.setText(5,node.getOwner());
> nodeInfoItem.addListener(SWT.MouseDoubleClick, new
> Listener() {
> @Override
> public void handleEvent(Event event) {
>
> MessageDialog.openInformation(workTableForm.getShell(), "Works",
> workItem.getText());
> }
> });
> }
> }
>
> As you can see I'm adding a listener to gridItems, the problem is that
> the event isn't handled. any idea?
>
> Thank you in advance.
>
> Rodrigo
Re: GridItem events [message #598801 is a reply to message #598775] Thu, 31 December 2009 03:18 Go to previous message
Eclipse UserFriend
Originally posted by: rodrigo.garcia.kotasoft.com

Thank you for your response, it helped me.

Tom Schindl escribió:
> GridItems like Table/TreeItems don't deliver events. You need to attach
> the listener to the Grid and fetch the GridItem with the given coordinates
>
> Tom
>
>
> Am 18.12.09 17:09, schrieb Rodrigo García:
>> Hi,
>>
>> I'm doing that:
>>
>>
>> for(WorkIndex wi : workSearchResponse.getInfo().getWorkIndex())
>> {
>> final GridItem workItem = new GridItem(grid,SWT.NONE);
>> workItem.setText(wi.getIswc());
>> workItem.setText(1,wi.getTitle());
>> workItem.setText(2,wi.getDch());
>>
>> for(Node node : wi.getNodeList().getNode())
>> {
>> GridItem nodeInfoItem = new
>> GridItem(workItem,SWT.NONE);
>> nodeInfoItem.setText(WPSMessages.node_table_label);
>> nodeInfoItem.setText(3,node.getAbvSoc());
>> nodeInfoItem.setText(4,node.getSociety());
>> nodeInfoItem.setText(5,node.getOwner());
>> nodeInfoItem.addListener(SWT.MouseDoubleClick, new
>> Listener() {
>> @Override
>> public void handleEvent(Event event) {
>>
>> MessageDialog.openInformation(workTableForm.getShell(), "Works",
>> workItem.getText());
>> }
>> });
>> }
>> }
>>
>> As you can see I'm adding a listener to gridItems, the problem is that
>> the event isn't handled. any idea?
>>
>> Thank you in advance.
>>
>> Rodrigo
>
Previous Topic:GridItem events
Next Topic:Please help with a layout issue
Goto Forum:
  


Current Time: Mon Jun 17 14:47:28 GMT 2019

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

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

Back to the top