[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[ews.eclipse.technology.rap] Re: Selection Listener Problem

Kathiravan,

from the first point of view everything looks ok.

Best,
Ivan

Kathiravan wrote:
I dont think i understand it clearly. I have the ControlLCAUtil.processSelection(widget, null, false); in the readData method.
The Design widget implements ISelectionProvider and designWidget.setSelectedPart basically calls the setSelection on the design widget.


 DesignWidget designWidget = (DesignWidget) widget;
       String location = WidgetLCAUtil.readPropertyValue(designWidget,
               PARAM_SELECTED);
       designWidget.setSelectedPart(location);

Am i doing it right?. or the way i implemented the ISelectionProvider is wrong?


public void addSelectionChangedListener(ISelectionChangedListener listener) {
listeners.add(listener);
}


    public ISelection getSelection() {
        return _selection;
    }

    public void removeSelectionChangedListener(
            ISelectionChangedListener listener) {
        listeners.remove(listener);
    }

    public void setSelection(ISelection selection) {
        _selection = selection;
        Object[] list = listeners.getListeners();
        for (int i = 0; i < list.length; i++) {
            ((ISelectionChangedListener) list[i])
                    .selectionChanged(new SelectionChangedEvent(this,
                            _selection));
        }

    }

Is there anything special i should do on the DesignWidget.js to get the selection stuff work right?