david_williams | 4da6ac01 | 2005-03-15 02:43:58 +0000 | [diff] [blame] | 1 | /******************************************************************************* |
amywu | 19526ad | 2007-04-10 17:03:52 +0000 | [diff] [blame] | 2 | * Copyright (c) 2005, 2006 IBM Corporation and others. |
david_williams | 4da6ac01 | 2005-03-15 02:43:58 +0000 | [diff] [blame] | 3 | * 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 |
amywu | 19526ad | 2007-04-10 17:03:52 +0000 | [diff] [blame] | 7 | * |
david_williams | 4da6ac01 | 2005-03-15 02:43:58 +0000 | [diff] [blame] | 8 | * Contributors: |
| 9 | * IBM Corporation - initial API and implementation |
| 10 | * |
| 11 | *******************************************************************************/ |
| 12 | package org.eclipse.jst.jsp.ui.internal.contentassist; |
| 13 | |
| 14 | import org.eclipse.jface.text.IRegion; |
| 15 | import org.eclipse.jface.text.templates.Template; |
| 16 | import org.eclipse.jface.text.templates.TemplateContext; |
| 17 | import org.eclipse.jface.text.templates.TemplateProposal; |
| 18 | import org.eclipse.swt.graphics.Image; |
david_williams | b5d0563 | 2006-02-27 09:24:00 +0000 | [diff] [blame] | 19 | import org.eclipse.wst.sse.core.utils.StringUtils; |
pavery | f918eb2 | 2005-03-29 18:26:53 +0000 | [diff] [blame] | 20 | import org.eclipse.wst.sse.ui.internal.contentassist.IRelevanceCompletionProposal; |
david_williams | 4da6ac01 | 2005-03-15 02:43:58 +0000 | [diff] [blame] | 21 | |
| 22 | /** |
| 23 | * Purpose of this class is to make the additional proposal info into content |
| 24 | * fit for an HTML viewer (by escaping characters) |
pavery | db9e4d4 | 2005-04-07 11:45:39 +0000 | [diff] [blame] | 25 | * |
david_williams | 6cb2639 | 2005-06-24 20:13:29 +0000 | [diff] [blame] | 26 | * @plannedfor 1.0 |
david_williams | 4da6ac01 | 2005-03-15 02:43:58 +0000 | [diff] [blame] | 27 | */ |
| 28 | class 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 | } |