mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-04 23:05:47 +02:00
Bug 282495 - Add hotkey for "mouse hover" like tooltip
Patch by Marc-Andre Laperle
This commit is contained in:
parent
fa2d625b25
commit
6cd02fdd00
1 changed files with 16 additions and 3 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2000, 2008 IBM Corporation and others.
|
* Copyright (c) 2000, 2010 IBM Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -8,6 +8,7 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* IBM Corporation - initial API and implementation
|
* IBM Corporation - initial API and implementation
|
||||||
* Sergey Prigogin (Google)
|
* Sergey Prigogin (Google)
|
||||||
|
* Marc-Andre Laperle - bug 282495
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.ui.text.c.hover;
|
package org.eclipse.cdt.internal.ui.text.c.hover;
|
||||||
|
|
||||||
|
@ -28,6 +29,7 @@ import org.eclipse.cdt.ui.text.c.hover.ICEditorTextHover;
|
||||||
public class CTypeHover implements ICEditorTextHover, ITextHoverExtension, ITextHoverExtension2, IInformationProviderExtension2 {
|
public class CTypeHover implements ICEditorTextHover, ITextHoverExtension, ITextHoverExtension2, IInformationProviderExtension2 {
|
||||||
private AbstractCEditorTextHover fProblemHover;
|
private AbstractCEditorTextHover fProblemHover;
|
||||||
private AbstractCEditorTextHover fCDocHover;
|
private AbstractCEditorTextHover fCDocHover;
|
||||||
|
private AbstractCEditorTextHover fBestMatchHover;
|
||||||
|
|
||||||
private AbstractCEditorTextHover fCurrentHover;
|
private AbstractCEditorTextHover fCurrentHover;
|
||||||
|
|
||||||
|
@ -35,6 +37,7 @@ public class CTypeHover implements ICEditorTextHover, ITextHoverExtension, IText
|
||||||
fProblemHover= new ProblemHover();
|
fProblemHover= new ProblemHover();
|
||||||
fCDocHover= new CDocHover();
|
fCDocHover= new CDocHover();
|
||||||
fCurrentHover= null;
|
fCurrentHover= null;
|
||||||
|
fBestMatchHover = new BestMatchHover();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -43,6 +46,7 @@ public class CTypeHover implements ICEditorTextHover, ITextHoverExtension, IText
|
||||||
public void setEditor(IEditorPart editor) {
|
public void setEditor(IEditorPart editor) {
|
||||||
fProblemHover.setEditor(editor);
|
fProblemHover.setEditor(editor);
|
||||||
fCDocHover.setEditor(editor);
|
fCDocHover.setEditor(editor);
|
||||||
|
fBestMatchHover.setEditor(editor);
|
||||||
fCurrentHover= null;
|
fCurrentHover= null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -74,8 +78,17 @@ public class CTypeHover implements ICEditorTextHover, ITextHoverExtension, IText
|
||||||
return hoverInfo;
|
return hoverInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
fCurrentHover= fCDocHover;
|
hoverInfo = fCDocHover.getHoverInfo2(textViewer, hoverRegion);
|
||||||
return fCDocHover.getHoverInfo2(textViewer, hoverRegion);
|
if(hoverInfo != null){
|
||||||
|
fCurrentHover= fCDocHover;
|
||||||
|
}
|
||||||
|
|
||||||
|
hoverInfo = fBestMatchHover.getHoverInfo(textViewer, hoverRegion);
|
||||||
|
if(hoverInfo != null){
|
||||||
|
fCurrentHover = fBestMatchHover;
|
||||||
|
}
|
||||||
|
|
||||||
|
return hoverInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Add table
Reference in a new issue