use of org.eclipse.tracecompass.tmf.ui.viewers.TmfAbstractToolTipHandler in project tracecompass by tracecompass.
the class TmfBaseProvider method register.
/**
* Method to register the provider to chart viewer.
*/
protected void register() {
IPlotArea plotArea = getChart().getPlotArea();
Control control = plotArea.getControl();
if (this instanceof MouseListener) {
control.addMouseListener((MouseListener) this);
}
if (this instanceof MouseMoveListener) {
control.addMouseMoveListener((MouseMoveListener) this);
}
if (this instanceof MouseWheelListener) {
control.addMouseWheelListener((MouseWheelListener) this);
}
if (this instanceof MouseTrackListener) {
control.addMouseTrackListener((MouseTrackListener) this);
}
if (this instanceof ICustomPaintListener) {
plotArea.addCustomPaintListener((ICustomPaintListener) this);
} else if (this instanceof PaintListener) {
control.addPaintListener((PaintListener) this);
}
TmfAbstractToolTipHandler tooltipHandler = getTooltipHandler();
if (tooltipHandler != null) {
tooltipHandler.activateHoverHelp(control);
}
}
use of org.eclipse.tracecompass.tmf.ui.viewers.TmfAbstractToolTipHandler in project tracecompass by tracecompass.
the class BaseMouseProvider method register.
/**
* Method to register the provider to chart viewer.
*/
protected void register() {
IPlotArea plotArea = getChart().getPlotArea();
Control control = plotArea.getControl();
if (this instanceof MouseListener) {
control.addMouseListener((MouseListener) this);
}
if (this instanceof MouseMoveListener) {
control.addMouseMoveListener((MouseMoveListener) this);
}
if (this instanceof MouseWheelListener) {
control.addMouseWheelListener((MouseWheelListener) this);
}
if (this instanceof MouseTrackListener) {
control.addMouseTrackListener((MouseTrackListener) this);
}
if (this instanceof ICustomPaintListener) {
plotArea.addCustomPaintListener((ICustomPaintListener) this);
} else if (this instanceof PaintListener) {
control.addPaintListener((PaintListener) this);
}
TmfAbstractToolTipHandler tooltipHandler = getTooltipHandler();
if (tooltipHandler != null) {
tooltipHandler.activateHoverHelp(control);
}
}
use of org.eclipse.tracecompass.tmf.ui.viewers.TmfAbstractToolTipHandler in project tracecompass by tracecompass.
the class BaseMouseProvider method deregister.
/**
* Method to deregister the provider from chart viewer.
*/
protected void deregister() {
IPlotArea plotArea = getChart().getPlotArea();
if (plotArea == null) {
return;
}
Control control = plotArea.getControl();
if (!control.isDisposed()) {
if (this instanceof MouseListener) {
control.removeMouseListener((MouseListener) this);
}
if (this instanceof MouseMoveListener) {
control.removeMouseMoveListener((MouseMoveListener) this);
}
if (this instanceof MouseWheelListener) {
control.removeMouseWheelListener((MouseWheelListener) this);
}
if (this instanceof MouseTrackListener) {
control.removeMouseTrackListener((MouseTrackListener) this);
}
if (this instanceof ICustomPaintListener) {
plotArea.removeCustomPaintListener((ICustomPaintListener) this);
} else if (this instanceof PaintListener) {
control.removePaintListener((PaintListener) this);
}
TmfAbstractToolTipHandler tooltipHandler = getTooltipHandler();
if (tooltipHandler != null) {
tooltipHandler.deactivateHoverHelp(control);
}
}
}
use of org.eclipse.tracecompass.tmf.ui.viewers.TmfAbstractToolTipHandler in project tracecompass by tracecompass.
the class TmfBaseProvider method deregister.
/**
* Method to deregister the provider from chart viewer.
*/
protected void deregister() {
IPlotArea plotArea = getChart().getPlotArea();
if (plotArea == null) {
return;
}
Control control = plotArea.getControl();
if (!control.isDisposed()) {
if (this instanceof MouseListener) {
control.removeMouseListener((MouseListener) this);
}
if (this instanceof MouseMoveListener) {
control.removeMouseMoveListener((MouseMoveListener) this);
}
if (this instanceof MouseWheelListener) {
control.removeMouseWheelListener((MouseWheelListener) this);
}
if (this instanceof MouseTrackListener) {
control.removeMouseTrackListener((MouseTrackListener) this);
}
if (this instanceof ICustomPaintListener) {
plotArea.removeCustomPaintListener((ICustomPaintListener) this);
} else if (this instanceof PaintListener) {
control.removePaintListener((PaintListener) this);
}
TmfAbstractToolTipHandler tooltipHandler = getTooltipHandler();
if (tooltipHandler != null) {
tooltipHandler.deactivateHoverHelp(control);
}
}
}
Aggregations