Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Nebula » GridItem events
GridItem events [message #504391] Fri, 18 December 2009 11:22 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 #504392 is a reply to message #504391] Fri, 18 December 2009 11:22 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
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 #505464 is a reply to message #504392] 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:Gantt Chart - Drag event to section
Next Topic:GridItem events
Goto Forum:
  


Current Time: Fri Apr 19 07:12:58 GMT 2024

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

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

Back to the top