rename interfaces
This commit is contained in:
parent
916215c0c2
commit
1ebc6eb03a
|
@ -3,7 +3,7 @@ package com.minres.scviewer.database.ui.swt;
|
||||||
import org.eclipse.swt.graphics.Point;
|
import org.eclipse.swt.graphics.Point;
|
||||||
import org.eclipse.swt.widgets.Composite;
|
import org.eclipse.swt.widgets.Composite;
|
||||||
|
|
||||||
public interface ToolTipContentProvider {
|
public interface IToolTipContentProvider {
|
||||||
|
|
||||||
public boolean createContent(Composite parent, Point pt);
|
public boolean createContent(Composite parent, Point pt);
|
||||||
|
|
|
@ -2,7 +2,7 @@ package com.minres.scviewer.database.ui.swt;
|
||||||
|
|
||||||
import org.eclipse.swt.widgets.Widget;
|
import org.eclipse.swt.widgets.Widget;
|
||||||
|
|
||||||
public interface ToolTipHelpTextProvider {
|
public interface IToolTipHelpTextProvider {
|
||||||
/**
|
/**
|
||||||
* Get help text
|
* Get help text
|
||||||
* @param widget the widget that is under help
|
* @param widget the widget that is under help
|
|
@ -14,8 +14,8 @@ import org.eclipse.swt.widgets.Shell;
|
||||||
import org.eclipse.swt.widgets.Widget;
|
import org.eclipse.swt.widgets.Widget;
|
||||||
|
|
||||||
import com.minres.scviewer.database.ui.swt.Constants;
|
import com.minres.scviewer.database.ui.swt.Constants;
|
||||||
import com.minres.scviewer.database.ui.swt.ToolTipContentProvider;
|
import com.minres.scviewer.database.ui.swt.IToolTipContentProvider;
|
||||||
import com.minres.scviewer.database.ui.swt.ToolTipHelpTextProvider;
|
import com.minres.scviewer.database.ui.swt.IToolTipHelpTextProvider;
|
||||||
|
|
||||||
class ToolTipHandler {
|
class ToolTipHandler {
|
||||||
|
|
||||||
|
@ -71,8 +71,8 @@ class ToolTipHandler {
|
||||||
}
|
}
|
||||||
private void createHoverWindow(final Control control, Event event) {
|
private void createHoverWindow(final Control control, Event event) {
|
||||||
Object o = control.getData(Constants.CONTENT_PROVIDER_TAG);
|
Object o = control.getData(Constants.CONTENT_PROVIDER_TAG);
|
||||||
if(o instanceof ToolTipContentProvider) {
|
if(o instanceof IToolTipContentProvider) {
|
||||||
ToolTipContentProvider provider = ((ToolTipContentProvider)o);
|
IToolTipContentProvider provider = ((IToolTipContentProvider)o);
|
||||||
Point pt = new Point (event.x, event.y);
|
Point pt = new Point (event.x, event.y);
|
||||||
tipPosition = control.toDisplay(pt);
|
tipPosition = control.toDisplay(pt);
|
||||||
if (shell != null && !shell.isDisposed ()) shell.dispose ();
|
if (shell != null && !shell.isDisposed ()) shell.dispose ();
|
||||||
|
@ -104,7 +104,7 @@ class ToolTipHandler {
|
||||||
*/
|
*/
|
||||||
control.addHelpListener(event -> {
|
control.addHelpListener(event -> {
|
||||||
if (tipWidget == null) return;
|
if (tipWidget == null) return;
|
||||||
ToolTipHelpTextProvider handler = (ToolTipHelpTextProvider)tipWidget.getData(Constants.HELP_PROVIDER_TAG);
|
IToolTipHelpTextProvider handler = (IToolTipHelpTextProvider)tipWidget.getData(Constants.HELP_PROVIDER_TAG);
|
||||||
if (handler == null) return;
|
if (handler == null) return;
|
||||||
String text = handler.getHelpText(tipWidget);
|
String text = handler.getHelpText(tipWidget);
|
||||||
if (text == null) return;
|
if (text == null) return;
|
||||||
|
|
|
@ -93,8 +93,8 @@ import com.minres.scviewer.database.ui.TrackEntry;
|
||||||
import com.minres.scviewer.database.ui.TrackEntry.ValueDisplay;
|
import com.minres.scviewer.database.ui.TrackEntry.ValueDisplay;
|
||||||
import com.minres.scviewer.database.ui.TrackEntry.WaveDisplay;
|
import com.minres.scviewer.database.ui.TrackEntry.WaveDisplay;
|
||||||
import com.minres.scviewer.database.ui.swt.Constants;
|
import com.minres.scviewer.database.ui.swt.Constants;
|
||||||
import com.minres.scviewer.database.ui.swt.ToolTipContentProvider;
|
import com.minres.scviewer.database.ui.swt.IToolTipContentProvider;
|
||||||
import com.minres.scviewer.database.ui.swt.ToolTipHelpTextProvider;
|
import com.minres.scviewer.database.ui.swt.IToolTipHelpTextProvider;
|
||||||
import com.minres.scviewer.database.ui.swt.WaveformViewFactory;
|
import com.minres.scviewer.database.ui.swt.WaveformViewFactory;
|
||||||
import com.minres.scviewer.e4.application.Messages;
|
import com.minres.scviewer.e4.application.Messages;
|
||||||
import com.minres.scviewer.e4.application.internal.status.WaveStatusBarControl;
|
import com.minres.scviewer.e4.application.internal.status.WaveStatusBarControl;
|
||||||
|
@ -393,13 +393,13 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
||||||
});
|
});
|
||||||
waveformPane.addDisposeListener(this);
|
waveformPane.addDisposeListener(this);
|
||||||
|
|
||||||
waveformPane.getWaveformControl().setData(Constants.HELP_PROVIDER_TAG, new ToolTipHelpTextProvider() {
|
waveformPane.getWaveformControl().setData(Constants.HELP_PROVIDER_TAG, new IToolTipHelpTextProvider() {
|
||||||
@Override
|
@Override
|
||||||
public String getHelpText(Widget widget) {
|
public String getHelpText(Widget widget) {
|
||||||
return "Waveform pane: press F2 to set the focus to the tooltip";
|
return "Waveform pane: press F2 to set the focus to the tooltip";
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
waveformPane.getWaveformControl().setData(Constants.CONTENT_PROVIDER_TAG, new ToolTipContentProvider() {
|
waveformPane.getWaveformControl().setData(Constants.CONTENT_PROVIDER_TAG, new IToolTipContentProvider() {
|
||||||
@Override
|
@Override
|
||||||
public boolean createContent(Composite parent, Point pt) {
|
public boolean createContent(Composite parent, Point pt) {
|
||||||
if(!showHover) return false;
|
if(!showHover) return false;
|
||||||
|
|
Loading…
Reference in New Issue