blob: 912121ebf1a3fd283ad233efef554a2ee0e51836 [file] [log] [blame]
david_williams4da6ac012005-03-15 02:43:58 +00001/*******************************************************************************
amywu19526ad2007-04-10 17:03:52 +00002 * Copyright (c) 2005, 2006 IBM Corporation and others.
david_williams4da6ac012005-03-15 02:43:58 +00003 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
amywu19526ad2007-04-10 17:03:52 +00007 *
david_williams4da6ac012005-03-15 02:43:58 +00008 * Contributors:
9 * IBM Corporation - initial API and implementation
10 *
11 *******************************************************************************/
12package org.eclipse.jst.jsp.ui.internal.contentassist;
13
14import org.eclipse.jface.text.IRegion;
15import org.eclipse.jface.text.templates.Template;
16import org.eclipse.jface.text.templates.TemplateContext;
17import org.eclipse.jface.text.templates.TemplateProposal;
18import org.eclipse.swt.graphics.Image;
david_williamsb5d05632006-02-27 09:24:00 +000019import org.eclipse.wst.sse.core.utils.StringUtils;
paveryf918eb22005-03-29 18:26:53 +000020import org.eclipse.wst.sse.ui.internal.contentassist.IRelevanceCompletionProposal;
david_williams4da6ac012005-03-15 02:43:58 +000021
22/**
23 * Purpose of this class is to make the additional proposal info into content
24 * fit for an HTML viewer (by escaping characters)
paverydb9e4d42005-04-07 11:45:39 +000025 *
david_williams6cb26392005-06-24 20:13:29 +000026 * @plannedfor 1.0
david_williams4da6ac012005-03-15 02:43:58 +000027 */
28class CustomTemplateProposal extends TemplateProposal implements IRelevanceCompletionProposal {
29 // copies of this class exist in:
30 // org.eclipse.jst.jsp.ui.internal.contentassist
31 // org.eclipse.wst.html.ui.internal.contentassist
32 // org.eclipse.wst.xml.ui.internal.contentassist
33
34 public CustomTemplateProposal(Template template, TemplateContext context, IRegion region, Image image, int relevance) {
35 super(template, context, region, image, relevance);
36 }
37
38 public String getAdditionalProposalInfo() {
39 String additionalInfo = super.getAdditionalProposalInfo();
40 return StringUtils.convertToHTMLContent(additionalInfo);
41 }
42}