From ac858eec7c7ce704c59acb599661a2d1c2534e69 Mon Sep 17 00:00:00 2001 From: Alain Magloire Date: Wed, 9 Feb 2005 23:17:43 +0000 Subject: [PATCH] 2005-02-09 Alain Magloire PR 84841: Description of the template in the hover was incorrect. * src/org/eclipse/cdt/internal/ui/text/TemplateEngine.java --- core/org.eclipse.cdt.ui/ChangeLog | 6 +++++- .../ui/text/template/TemplateEngine.java | 19 ++++++++++++++++++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/core/org.eclipse.cdt.ui/ChangeLog b/core/org.eclipse.cdt.ui/ChangeLog index e037b1365fe..c610d68b382 100644 --- a/core/org.eclipse.cdt.ui/ChangeLog +++ b/core/org.eclipse.cdt.ui/ChangeLog @@ -1,4 +1,8 @@ -2005-02-016 Alain Magloire +2005-02-09 Alain Magloire + PR 84841: Description of the template in the hover was incorrect. + * src/org/eclipse/cdt/internal/ui/text/TemplateEngine.java + +2005-02-06 Alain Magloire PR 84423, Patch from : Tomaszewski Przemek Added keybinding next/previous(CTRL-SHIFT-UP/DOWN) to from member to member in the CEditor(PR 84423). diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/template/TemplateEngine.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/template/TemplateEngine.java index ac72517cca8..f6d7ac5ae5e 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/template/TemplateEngine.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/template/TemplateEngine.java @@ -13,10 +13,13 @@ import org.eclipse.cdt.core.model.ITranslationUnit; import org.eclipse.cdt.internal.corext.template.c.TranslationUnitContext; import org.eclipse.cdt.internal.corext.template.c.TranslationUnitContextType; import org.eclipse.cdt.internal.ui.CPluginImages; +import org.eclipse.cdt.internal.ui.text.c.hover.SourceViewerInformationControl; import org.eclipse.cdt.ui.CUIPlugin; import org.eclipse.cdt.ui.text.ICCompletionProposal; import org.eclipse.jface.text.BadLocationException; import org.eclipse.jface.text.IDocument; +import org.eclipse.jface.text.IInformationControl; +import org.eclipse.jface.text.IInformationControlCreator; import org.eclipse.jface.text.IRegion; import org.eclipse.jface.text.ITextViewer; import org.eclipse.jface.text.Region; @@ -25,8 +28,10 @@ import org.eclipse.jface.text.templates.TemplateContext; import org.eclipse.jface.text.templates.TemplateContextType; import org.eclipse.jface.text.templates.TemplateProposal; import org.eclipse.jface.util.Assert; +import org.eclipse.swt.SWT; import org.eclipse.swt.graphics.Image; import org.eclipse.swt.graphics.Point; +import org.eclipse.swt.widgets.Shell; public class TemplateEngine { @@ -35,6 +40,18 @@ public class TemplateEngine { public class CTemplateProposal extends TemplateProposal implements ICCompletionProposal { + /* (non-Javadoc) + * @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension3#getInformationControlCreator() + */ + public IInformationControlCreator getInformationControlCreator() { + return new IInformationControlCreator() { + public IInformationControl createInformationControl(Shell parent) { + int shellStyle= SWT.RESIZE; + int style= SWT.V_SCROLL | SWT.H_SCROLL; + return new SourceViewerInformationControl(parent, shellStyle, style); + } + }; + } /** * @param template * @param context @@ -114,6 +131,6 @@ public class TemplateEngine { if (context.canEvaluate(templates[i])) fProposals.add(new CTemplateProposal(templates[i], context, region, CPluginImages.get(CPluginImages.IMG_OBJS_TEMPLATE))); } - + }