Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[nebula-dev] nebula Grid + ISelectionProvider

In an RCP application I am using nebula grid widget .

It is a private member encapsulated in my class

I need to be able to capture the selection in the Grid make it into a StructuredSelection  which any view listening to a selectionChangeEvent can use it

I am unable to undertand how will MyGrid class know that it is selected

I implemented ISelectionProvider methods to it but I always got the empty selection

 

Any hints tips welcome

 

Pseudo code is something like this

 

Class MyGrid  implements ISelectionProvider

{

               Private Grid grid ;

 

    protected ISelection gridControlSelection = StructuredSelection.EMPTY;

 

 

      public void removeSelectionChangedListener(

                  ISelectionChangedListener listener)

      {

        selectionChangedListeners.remove(listener);

           

      }

 

      public void setSelection(ISelection selection)

      {

              gridControlSelection = selection;

 

              for (ISelectionChangedListener listeners : selectionChangedListeners)

              {

                  ISelectionChangedListener listener = listeners;

                  listener.selectionChanged(new SelectionChangedEvent(this, selection));

              }

           

      }

 

 

    public void addSelectionChangedListener(ISelectionChangedListener listener)

      {

     

            selectionChangedListeners.add(listener);

           

      }

 

      public ISelection getSelection()

      {

       return gridControlSelection;

      }

 

}

 


Back to the top