Search in sources :

Example 6 with ObserverEvent

use of org.talend.dataprofiler.core.ui.grid.utils.events.ObserverEvent in project tdq-studio-se by Talend.

the class ColumnPreviewGrid method notifyObservers.

/*
     * (non-Javadoc)
     * 
     * @see
     * org.talend.dataprofiler.core.ui.grid.AbstractIndicatorSelectGrid#notifyObservers(org.eclipse.nebula.widgets.grid
     * .GridColumn)
     */
@Override
protected void notifyObservers(Event event) {
    if (observers == null) {
        return;
    }
    GridColumn sourceColumn = null;
    if (GridColumn.class.isInstance(event.item)) {
        sourceColumn = (GridColumn) event.item;
    } else {
        return;
    }
    for (TDQObserver<ObserverEvent> observer : observers) {
        ObserverEvent observerEvent = null;
        if (SWT.Resize == event.type) {
            observerEvent = new ObserverEvent(ObserverEventEnum.ColumnResize);
            observerEvent.putData(ObserverEvent.COLUMN_HEADER_RESIZE, sourceColumn);
        } else if (SWT.Move == event.type) {
            observerEvent = new ObserverEvent(ObserverEventEnum.MoveColumn);
            observerEvent.putData(ObserverEvent.COLUMN_HEADER_MOVE, this.getColumnOrder());
        } else {
            continue;
        }
        observer.update(observerEvent);
    }
}
Also used : GridColumn(org.eclipse.nebula.widgets.grid.GridColumn) ObserverEvent(org.talend.dataprofiler.core.ui.grid.utils.events.ObserverEvent)

Example 7 with ObserverEvent

use of org.talend.dataprofiler.core.ui.grid.utils.events.ObserverEvent in project tdq-studio-se by Talend.

the class ColumnPreviewGrid method notifyVerticalBarShown.

/**
 * DOC talend Comment method "notifyVerticalBarVisible".
 *
 * @param observer
 */
@Override
protected void notifyVerticalBarShown(boolean show) {
    if (observers == null) {
        return;
    }
    for (TDQObserver<ObserverEvent> observer : observers) {
        ObserverEvent observerEvent = new ObserverEvent(ObserverEventEnum.VSrcollVisible);
        observerEvent.putData(ObserverEvent.VERTICAL_SRCOLL_VISABLE, show);
        observer.update(observerEvent);
    }
}
Also used : ObserverEvent(org.talend.dataprofiler.core.ui.grid.utils.events.ObserverEvent)

Example 8 with ObserverEvent

use of org.talend.dataprofiler.core.ui.grid.utils.events.ObserverEvent in project tdq-studio-se by Talend.

the class IndicatorSelectGrid method notifyObservers.

/*
     * (non-Javadoc)
     * 
     * @see org.talend.dataprofiler.core.ui.grid.utils.Observerable#notifyObservers()
     */
public void notifyObservers() {
    if (observers == null) {
        return;
    }
    for (TDQObserver<ObserverEvent> observer : observers) {
        ObserverEvent observerEvent = new ObserverEvent(ObserverEventEnum.ItemHeaderWidth);
        observerEvent.putData(ObserverEvent.ITEM_HEADER_WIDTH, this.getItemHeaderWidth());
        observer.update(observerEvent);
    }
}
Also used : ObserverEvent(org.talend.dataprofiler.core.ui.grid.utils.events.ObserverEvent)

Aggregations

ObserverEvent (org.talend.dataprofiler.core.ui.grid.utils.events.ObserverEvent)8 GridColumn (org.eclipse.nebula.widgets.grid.GridColumn)3 Point (org.eclipse.swt.graphics.Point)2