blob: 6a5d97d359a3a761f5c40a35dbf4bb18c41184a5 [file] [log] [blame]
rsrinivasancf824322008-05-02 19:51:19 +00001/*******************************************************************************
2 * Copyright (c) 2001, 2008 Oracle Corporation and others.
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
7 *
8 * Contributors:
9 * Oracle Corporation - initial API and implementation
10 *******************************************************************************/
cbateman0954b952008-01-22 02:02:11 +000011package org.eclipse.jst.jsf.designtime.internal.view.model.jsp;
12
13import org.eclipse.core.resources.IProject;
14import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.ITagElement;
rsrinivasanccd5a742008-06-06 18:45:15 +000015import org.eclipse.jst.jsf.designtime.internal.Messages;
cbateman0954b952008-01-22 02:02:11 +000016import org.eclipse.jst.jsf.designtime.internal.view.model.jsp.analyzer.TagAnalyzer;
17import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.TLDElementDeclaration;
18
19/**
20 * A resolving strategy that uses tag introspection.
21 *
22 * @author cbateman
23 *
24 */
25public final class TagIntrospectingStrategy extends JSPTagResolvingStrategy
26{
27 /**
28 * the identifier of this strategy
29 */
rsrinivasanccd5a742008-06-06 18:45:15 +000030 public final static String ID = "org.eclipse.jst.jsf.designtime.TagIntrospectingStrategy"; //$NON-NLS-1$
cbateman61e45ed2008-03-10 02:37:35 +000031 /**
32 * the display name
33 */
rsrinivasanccd5a742008-06-06 18:45:15 +000034 public final static String DISPLAY_NAME = Messages.TagIntrospectingStrategy_DisplayName;
cbateman0954b952008-01-22 02:02:11 +000035
36 private final IProject _project;
37
38 /**
cbatemanc0f9ea12008-11-04 00:04:15 +000039 * @return the descriptor for this resolver strategy
40 */
41 public static StrategyDescriptor createDescriptor()
42 {
43 return new StrategyDescriptor(ID, DISPLAY_NAME);
44 }
45
46 /**
cbateman0954b952008-01-22 02:02:11 +000047 * @param project
48 */
49 public TagIntrospectingStrategy(final IProject project)
50 {
51 // TODO: would it be better to have a model context on the resolve?
52 _project = project;
53 }
54
55 @Override
56 public String getId()
57 {
58 return ID;
59 }
60
cbateman61e45ed2008-03-10 02:37:35 +000061 public String getDisplayName()
62 {
63 return DISPLAY_NAME;
64 }
65
cbateman0954b952008-01-22 02:02:11 +000066 @Override
67 public ITagElement resolve(TLDElementDeclaration element)
68 {
69 return TagAnalyzer.createTLDTagElement(element, _project);
70 }
71
72}