Search in sources :

Example 1 with SelectionChangedEvent

use of org.rstudio.core.client.widget.events.SelectionChangedEvent in project rstudio by rstudio.

the class FastSelectTable method setSelected.

public void setSelected(TableRowElement row, boolean selected) {
    try {
        if (row.getParentElement().getParentElement() != table_)
            return;
    } catch (NullPointerException npe) {
        return;
    }
    boolean isCurrentlySelected = isSelected(row);
    if (isCurrentlySelected == selected)
        return;
    if (selected && !codec_.isValueRow(row))
        return;
    setStyleName(row, selectedClassName_, selected);
    if (selected)
        selectedRows_.add(row);
    else
        selectedRows_.remove(row);
    if (selected && !allowMultiSelect_) {
        Scheduler.get().scheduleDeferred(new ScheduledCommand() {

            public void execute() {
                fireEvent(new SelectionChangedEvent());
            }
        });
    }
}
Also used : ScheduledCommand(com.google.gwt.core.client.Scheduler.ScheduledCommand) SelectionChangedEvent(org.rstudio.core.client.widget.events.SelectionChangedEvent)

Aggregations

ScheduledCommand (com.google.gwt.core.client.Scheduler.ScheduledCommand)1 SelectionChangedEvent (org.rstudio.core.client.widget.events.SelectionChangedEvent)1