Author: akazakov
Date: 2009-04-30 06:08:45 -0400 (Thu, 30 Apr 2009)
New Revision: 14973
Added:
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELContext.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELResolver.java
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/text/
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/text/TextProposal.java
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/FaceletPageContext.java
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/KbQuery.java
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/PageContext.java
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/PageContextFactory.java
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/PageProcessor.java
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/ResourceBundle.java
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/internal/
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/internal/text/
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/internal/text/FaceletContextImpl.java
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/internal/text/JspContextImpl.java
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/taglib/
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/taglib/Attribute.java
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/taglib/Component.java
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/taglib/CustomTagLibrary.java
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/taglib/FaceletTagLibrary.java
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/taglib/FacesConfigTagLibrary.java
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/taglib/Facet.java
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/taglib/NameSpace.java
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/taglib/TLDLibrary.java
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/taglib/TagLibrary.java
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/taglib/TagLibriryManager.java
Modified:
trunk/common/plugins/org.jboss.tools.common.el.core/META-INF/MANIFEST.MF
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELOperandResolveStatus.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/Var.java
trunk/common/plugins/org.jboss.tools.common.kb/META-INF/MANIFEST.MF
trunk/common/plugins/org.jboss.tools.common/META-INF/MANIFEST.MF
trunk/jst/plugins/org.jboss.tools.jst.web/META-INF/MANIFEST.MF
Log:
https://jira.jboss.org/jira/browse/JBIDE-2808
Modified: trunk/common/plugins/org.jboss.tools.common/META-INF/MANIFEST.MF
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/META-INF/MANIFEST.MF 2009-04-30 09:59:49
UTC (rev 14972)
+++ trunk/common/plugins/org.jboss.tools.common/META-INF/MANIFEST.MF 2009-04-30 10:08:45
UTC (rev 14973)
@@ -138,11 +138,12 @@
org.eclipse.wst.common.uriresolver;visibility:=reexport,
org.eclipse.core.net
Bundle-Version: 2.0.0
-Eclipse-LazyStart: true
+Bundle-ActivationPolicy: lazy
Bundle-ManifestVersion: 2
Export-Package: org.jboss.tools.common,
org.jboss.tools.common.log,
org.jboss.tools.common.reporting,
+ org.jboss.tools.common.text,
org.jboss.tools.common.util,
org.jboss.tools.common.xml
Added:
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/text/TextProposal.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/text/TextProposal.java
(rev 0)
+++
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/text/TextProposal.java 2009-04-30
10:08:45 UTC (rev 14973)
@@ -0,0 +1,315 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.text;
+
+import java.util.Comparator;
+
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * Text Proposal for Content Assist.
+ * @author Alexey Kazakov
+ */
+public class TextProposal {
+
+ public interface PostProcessing {
+ public void process(TextProposal proposal, String value, int offset);
+ }
+
+ public static final int R_NONE = 0;
+ public static final int R_JSP_JSF_EL_VARIABLE_ATTRIBUTE_VALUE = 810;
+ public static final int R_JSP_ATTRIBUTE_VALUE = 830;
+ public static final int R_XML_ATTRIBUTE_VALUE = 850;
+ public static final int R_XML_ATTRIBUTE_NAME = 910;
+
+ private static final long serialVersionUID = 3257007635692926512L;
+
+ private String label;
+ private String contextInfo;
+ private Image image;
+ private boolean emptyImage = true;
+ private String replacementString;
+ private boolean emptyContextInfo = true;
+ private int relevance = R_NONE;
+ private int position = -1;
+ private boolean autoActivationContentAssistantAfterApplication = false;
+
+ private int start = -1;
+ private int end = -1;
+
+ PostProcessing postProcessing;
+
+ /**
+ *
+ * @return
+ */
+ public int getRelevance() {
+ return relevance;
+ }
+
+ /**
+ *
+ * @param relevance
+ */
+ public void setRelevance(int relevance) {
+ this.relevance = relevance;
+ }
+
+ /**
+ * @return
+ */
+ public String getContextInfo() {
+ return contextInfo;
+ }
+
+ /**
+ * @return
+ */
+ public Image getImage() {
+ return image;
+ }
+
+ /**
+ * @return
+ */
+ public String getLabel() {
+ return label;
+ }
+
+ /**
+ * @return
+ */
+ public String getReplacementString() {
+ return replacementString;
+ }
+
+ /**
+ * @param string
+ */
+ public void setContextInfo(String string) {
+ contextInfo = string;
+ if(contextInfo != null) {
+ emptyContextInfo = false;
+ }
+ }
+
+ /**
+ * @param string
+ */
+ public void setImage(Image img) {
+ this.image = img;
+ if(this.image != null) {
+ emptyImage = false;
+ }
+ }
+
+ /**
+ * @param string
+ */
+ public void setLabel(String string) {
+ label = string;
+ }
+
+ /**
+ * @param string
+ */
+ public void setReplacementString(String string) {
+ replacementString = string;
+ }
+
+ /**
+ * @return
+ */
+ public boolean hasContextInfo() {
+ return !emptyContextInfo;
+ }
+
+ /**
+ * @return
+ */
+ public boolean hasImage() {
+ return !emptyImage;
+ }
+
+ /**
+ * @return
+ */
+ public int getPosition() {
+ if(position==-1 && getReplacementString()!=null) {
+ return getReplacementString().length();
+ }
+ return position;
+ }
+
+ /**
+ * @param i
+ */
+ public void setPosition(int i) {
+ position = i;
+ }
+
+ /**
+ *
+ * @param lowerCase
+ */
+ public void changeCase(boolean lowerCase) {
+ if(lowerCase) {
+ if(label!=null) label = label.toLowerCase();
+ if(replacementString!=null) replacementString = replacementString.toLowerCase();
+ } else {
+ if(label!=null) label = label.toUpperCase();
+ if(replacementString!=null) replacementString = replacementString.toUpperCase();
+ }
+ }
+
+ /**
+ *
+ *
+ */
+ public void removeAutocompleteRequiredAttributes() {
+ int endAttr = replacementString.lastIndexOf('"');
+ if(endAttr!=-1) {
+ int startAttr = replacementString.substring(0,
replacementString.indexOf('"')).lastIndexOf(' ');
+ String newReplacementString = replacementString.substring(0, startAttr);
+ if(endAttr+1<replacementString.length()) {
+ newReplacementString = newReplacementString + replacementString.substring(endAttr +
1);
+ }
+ replacementString = newReplacementString;
+ }
+ }
+
+ /**
+ *
+ * @return
+ */
+ public boolean isCloseTag() {
+ return label != null && label.startsWith("/");
+ }
+
+ /**
+ * @see java.lang.Object#toString()
+ */
+ public String toString() {
+ StringBuffer buffer = new StringBuffer();
+ buffer.append("label: ");
+ buffer.append(label);
+ buffer.append("\ncontextInfo: ");
+ buffer.append(contextInfo);
+ buffer.append("\nreplacementString: ");
+ buffer.append(replacementString);
+
+ return buffer.toString();
+ }
+
+ /**
+ * @see java.lang.Comparable#compareTo(java.lang.Object)
+ */
+ public int compareTo(Object o) {
+ return label.compareTo(((TextProposal)o).getLabel());
+ }
+
+ /**
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ public boolean equals(Object obj) {
+ if(obj == this) {
+ return true;
+ }
+ if((!(obj instanceof TextProposal)) || (obj == null)) {
+ return false;
+ }
+ TextProposal anotherProposal = (TextProposal)obj;
+ boolean labelB = false;
+ boolean contextInfoB = false;
+ boolean replacementStringB = false;
+ if(this.label!=null) {
+ labelB = this.label.equals(anotherProposal.getLabel());
+ } else if(anotherProposal.getLabel()==null) {
+ labelB = true;
+ }
+ if(this.contextInfo!=null) {
+ contextInfoB = this.contextInfo.equals(anotherProposal.getContextInfo());
+ } else if(anotherProposal.getContextInfo()==null) {
+ contextInfoB = true;
+ }
+ if(this.replacementString!=null) {
+ replacementStringB =
this.replacementString.equals(anotherProposal.getReplacementString());
+ } else if(anotherProposal.getReplacementString()==null) {
+ replacementStringB = true;
+ }
+ return labelB&&contextInfoB&&replacementStringB;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public boolean autoActivationContentAssistantAfterApplication() {
+ return autoActivationContentAssistantAfterApplication;
+ }
+
+ /**
+ *
+ */
+ public void setAutoActivationContentAssistantAfterApplication(boolean
autoActivationContentAssistantAfterApplication) {
+ this.autoActivationContentAssistantAfterApplication =
autoActivationContentAssistantAfterApplication;
+ }
+
+ public void setStart(int n) {
+ start = n;
+ }
+
+ public void setEnd(int n) {
+ end = n;
+ }
+
+ public int getStart() {
+ return start;
+ }
+
+ public int getEnd() {
+ return end;
+ }
+
+ public void setPostProcessing(PostProcessing postProcessing) {
+ this.postProcessing = postProcessing;
+ }
+
+ public void postProcess(String value, int offset) {
+ if(postProcessing != null) postProcessing.process(this, value, offset);
+ }
+
+ public static final Comparator<TextProposal> KB_PROPOSAL_ORDER
+ = new TextProposalComparator();
+
+ private static class TextProposalComparator implements Comparator<TextProposal>
{
+
+ public int compare(TextProposal p1, TextProposal p2) {
+ int n1=p1.replacementString.length(), n2=p2.replacementString.length();
+ for (int i1=0, i2=0; i1<n1 && i2<n2; i1++, i2++) {
+ char c1 = p1.replacementString.charAt(i1);
+ char c2 = p2.replacementString.charAt(i2);
+ if (c1 != c2) {
+ c1 = Character.toUpperCase(c1);
+ c2 = Character.toUpperCase(c2);
+ if (c1 != c2) {
+ c1 = Character.toLowerCase(c1);
+ c2 = Character.toLowerCase(c2);
+ if (c1 != c2) {
+ return c1 - c2;
+ }
+ }
+ }
+ }
+ return n1 - n2;
+ }
+ }
+}
\ No newline at end of file
Property changes on:
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/text/TextProposal.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/common/plugins/org.jboss.tools.common.el.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/META-INF/MANIFEST.MF 2009-04-30
09:59:49 UTC (rev 14972)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/META-INF/MANIFEST.MF 2009-04-30
10:08:45 UTC (rev 14973)
@@ -19,5 +19,4 @@
org.eclipse.wst.sse.ui,
org.jboss.tools.common,
org.jboss.tools.common.model,
- org.jboss.tools.common.resref.core;reprovide=true,
- org.jboss.tools.common.kb;bundle-version="2.0.0"
+ org.jboss.tools.common.resref.core;reprovide=true
Added:
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELContext.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELContext.java
(rev 0)
+++
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELContext.java 2009-04-30
10:08:45 UTC (rev 14973)
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.el.core.resolver;
+
+import org.eclipse.core.resources.IFile;
+
+/**
+ * @author Alexey Kazakov
+ */
+public interface ELContext {
+
+ /**
+ * Returns Resource of the page
+ * @return
+ */
+ IFile getResource();
+
+ /**
+ * Returns "var" attributes which are available in particular offset.
+ * @param offset
+ * @return
+ */
+ Var[] getVars(int offset);
+}
\ No newline at end of file
Property changes on:
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELContext.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified:
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELOperandResolveStatus.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELOperandResolveStatus.java 2009-04-30
09:59:49 UTC (rev 14972)
+++
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELOperandResolveStatus.java 2009-04-30
10:08:45 UTC (rev 14973)
@@ -16,7 +16,7 @@
import java.util.TreeSet;
import org.jboss.tools.common.el.core.model.ELInvocationExpression;
-import org.jboss.tools.common.kb.KbProposal;
+import org.jboss.tools.common.text.TextProposal;
/**
* Status of EL resolving.
@@ -25,7 +25,7 @@
public class ELOperandResolveStatus {
private ELInvocationExpression tokens;
Map<String, TypeInfoCollector.MethodInfo> unpairedGettersOrSetters;
- Set<KbProposal> proposals;
+ Set<TextProposal> proposals;
private ELInvocationExpression lastResolvedToken;
private boolean isMapOrCollectionOrBundleAmoungTheTokens = false;
private TypeInfoCollector.MemberInfo memberOfResolvedOperand;
@@ -134,14 +134,14 @@
*
* @return Set of proposals for EL
*/
- public Set<KbProposal> getProposals() {
- return proposals == null ? new TreeSet<KbProposal>() : proposals;
+ public Set<TextProposal> getProposals() {
+ return proposals == null ? new TreeSet<TextProposal>() : proposals;
}
/**
- * @param proposals Set of KbProposal proposals.
+ * @param proposals Set of TextProposal proposals.
*/
- public void setProposals(Set<KbProposal> proposals) {
+ public void setProposals(Set<TextProposal> proposals) {
this.proposals = proposals;
}
Added:
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELResolver.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELResolver.java
(rev 0)
+++
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELResolver.java 2009-04-30
10:08:45 UTC (rev 14973)
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.el.core.resolver;
+
+import java.util.List;
+
+import org.jboss.tools.common.el.core.model.ELExpression;
+import org.jboss.tools.common.text.TextProposal;
+
+/**
+ * Represents EL Resolver
+ * @author Alexey Kazakov
+ */
+public interface ELResolver {
+
+ /**
+ *
+ * @param elString
+ * @param position
+ * @param context
+ * @return
+ */
+ List<TextProposal> getCompletions(String elString, int position, ELContext
context);
+
+ /**
+ *
+ * @param operand
+ * @param context
+ * @return
+ */
+ ELOperandResolveStatus resolveELOperand(ELExpression operand, ELContext context);
+}
\ No newline at end of file
Property changes on:
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELResolver.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified:
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/Var.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/Var.java 2009-04-30
09:59:49 UTC (rev 14972)
+++
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/Var.java 2009-04-30
10:08:45 UTC (rev 14973)
@@ -17,7 +17,6 @@
import org.jboss.tools.common.el.core.model.ELModel;
import org.jboss.tools.common.el.core.parser.ELParser;
import org.jboss.tools.common.el.core.parser.ELParserFactory;
-import org.jboss.tools.common.el.core.parser.ELParserUtil;
/**
* Represents "var"/"value" attributes.
@@ -32,7 +31,7 @@
int declOffset;
int declLength;
ELParserFactory factory;
-
+
/**
* Constructor
* @param name - value of "var" attribute.
@@ -111,14 +110,14 @@
public String getResolvedValue() {
return resolvedValue;
}
-
+
/**
* @return offset of the var declaration
*/
public int getDeclarationOffset() {
return declOffset;
}
-
+
/**
* @return length of the var declaration
*/
@@ -145,5 +144,4 @@
}
return false;
}
-
-}
+}
\ No newline at end of file
Modified: trunk/common/plugins/org.jboss.tools.common.kb/META-INF/MANIFEST.MF
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.kb/META-INF/MANIFEST.MF 2009-04-30
09:59:49 UTC (rev 14972)
+++ trunk/common/plugins/org.jboss.tools.common.kb/META-INF/MANIFEST.MF 2009-04-30
10:08:45 UTC (rev 14973)
@@ -1,5 +1,5 @@
Manifest-Version: 1.0
-Eclipse-LazyStart: true
+Bundle-ActivationPolicy: lazy
Bundle-Name: %pluginName
Bundle-ClassPath: kb.jar,
lib/dtdparser121.jar
@@ -7,11 +7,10 @@
Bundle-Vendor: %providerName
Bundle-SymbolicName: org.jboss.tools.common.kb;singleton:=true
Bundle-Localization: plugin
-Provide-Package: org.jboss.tools.common.kb,
+Export-Package: com.wutka.dtd,
+ org.jboss.tools.common.kb,
org.jboss.tools.common.kb.configuration,
- org.jboss.tools.common.kb.dtd,org.jboss.tools.common.kb.wtp,
- org.jboss.tools.common.kb.xml,
- com.wutka.dtd
+ org.jboss.tools.common.kb.wtp
Require-Bundle: org.jboss.tools.common,
org.junit,
org.eclipse.swt,
Modified: trunk/jst/plugins/org.jboss.tools.jst.web/META-INF/MANIFEST.MF
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/META-INF/MANIFEST.MF 2009-04-30 09:59:49 UTC
(rev 14972)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/META-INF/MANIFEST.MF 2009-04-30 10:08:45 UTC
(rev 14973)
@@ -34,13 +34,16 @@
org.eclipse.ant.ui,
org.eclipse.ui.externaltools,
org.jboss.tools.common.kb,
- org.eclipse.wst.common.project.facet.core
+ org.eclipse.wst.common.project.facet.core,
+ org.jboss.tools.common.el.core;bundle-version="2.0.0"
Bundle-Version: 2.0.0
Export-Package:
org.jboss.tools.jst.web,
org.jboss.tools.jst.web.browser,
org.jboss.tools.jst.web.browser.wtp,
org.jboss.tools.jst.web.context,
+ org.jboss.tools.jst.web.kb,
+ org.jboss.tools.jst.web.kb.taglib,
org.jboss.tools.jst.web.launching.sourcelookup,
org.jboss.tools.jst.web.launching.sourcelookup.xpl,
org.jboss.tools.jst.web.messages.xpl,
Added:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/FaceletPageContext.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/FaceletPageContext.java
(rev 0)
+++
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/FaceletPageContext.java 2009-04-30
10:08:45 UTC (rev 14973)
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.kb;
+
+import java.util.Map;
+
+/**
+ * @author Alexey Kazakov
+ */
+public interface FaceletPageContext extends PageContext {
+
+ /**
+ * Returns parent page context. For example if some this facelet page is used in a
template then
+ * this method will return a page context for that template.
+ * May return null.
+ * @return
+ */
+ FaceletPageContext getParentContext();
+
+ /**
+ * Returns parameters which are declared in the parent context and are available within
this page.
+ * Key - name of Parameter.
+ * Value - value of Parameter.
+ * @return
+ */
+ Map<String, String> getParams();
+}
\ No newline at end of file
Property changes on:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/FaceletPageContext.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/KbQuery.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/KbQuery.java
(rev 0)
+++
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/KbQuery.java 2009-04-30
10:08:45 UTC (rev 14973)
@@ -0,0 +1,110 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.kb;
+
+/**
+ * Query object is used to get info from Page Processors.
+ * @author Alexey Kazakov
+ */
+public class KbQuery {
+
+ private int offset;
+ private String uri;
+ private String[] parentTags;
+ private String value;
+ private boolean useAsMask;
+ private Type type;
+
+ /**
+ * Type of object for which we want to get info
+ * @author Alexey Kazakov
+ */
+ public static enum Type {
+ TEXT,
+ TAG_NAME,
+ ATTRIBUTE_NAME,
+ ATTRIBUTE_VALUE
+ }
+
+ public KbQuery() {
+ }
+
+ /**
+ * URI of tag library
+ * @return
+ */
+ public String getUri() {
+ return uri;
+ }
+
+ public void setUri(String uri) {
+ this.uri = uri;
+ }
+
+ /**
+ * The stack of parent tags
+ * @return
+ */
+ public String[] getParentTags() {
+ return parentTags;
+ }
+
+ public void setParentTags(String[] parentTags) {
+ this.parentTags = parentTags;
+ }
+
+ /**
+ * Value of query. For example in case of ATTRIBUTE_NAME type it is an attribute name.
+ * @return
+ */
+ public String getValue() {
+ return value;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+ /**
+ * True if the value is a mask. For example we ask all tags which start with
"<h:outputT" then the value "outputT" ia a mask.
+ * @return
+ */
+ public boolean isMask() {
+ return useAsMask;
+ }
+
+ public void setMask(boolean useAsMask) {
+ this.useAsMask = useAsMask;
+ }
+
+ /**
+ * Returns type of value
+ * @return
+ */
+ public Type getType() {
+ return type;
+ }
+
+ public void setType(Type type) {
+ this.type = type;
+ }
+
+ /**
+ * @return offset
+ */
+ public int getOffset() {
+ return offset;
+ }
+
+ public void setOffset(int offset) {
+ this.offset = offset;
+ }
+}
\ No newline at end of file
Property changes on:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/KbQuery.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/PageContext.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/PageContext.java
(rev 0)
+++
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/PageContext.java 2009-04-30
10:08:45 UTC (rev 14973)
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.kb;
+
+import org.jboss.tools.common.el.core.resolver.ELContext;
+import org.jboss.tools.common.el.core.resolver.ELResolver;
+import org.jboss.tools.jst.web.kb.taglib.TagLibrary;
+
+/**
+ * Page context
+ * @author Alexey Kazakov
+ */
+public interface PageContext extends ELContext {
+
+ /**
+ * Returns libraries which should be used in this context
+ * @return
+ */
+ TagLibrary[] getLibraries();
+
+ /**
+ * Returns EL Resolvers which are declared for this page
+ * @return
+ */
+ ELResolver[] getElResolvers();
+
+ /**
+ * Returns resource bundles
+ * @return
+ */
+ ResourceBundle[] getResourceBundles();
+}
\ No newline at end of file
Property changes on:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/PageContext.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/PageContextFactory.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/PageContextFactory.java
(rev 0)
+++
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/PageContextFactory.java 2009-04-30
10:08:45 UTC (rev 14973)
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.kb;
+
+import org.eclipse.core.resources.IFile;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class PageContextFactory {
+
+ /**
+ * Creates a page context for given resource and offset.
+ * @param file
+ * @param offset
+ * @return
+ */
+ public static PageContext createPageContext(IFile file, int offset) {
+ // TODO
+ return null;
+ }
+}
\ No newline at end of file
Property changes on:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/PageContextFactory.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/PageProcessor.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/PageProcessor.java
(rev 0)
+++
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/PageProcessor.java 2009-04-30
10:08:45 UTC (rev 14973)
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.kb;
+
+import org.jboss.tools.common.text.TextProposal;
+import org.jboss.tools.jst.web.kb.taglib.Component;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class PageProcessor {
+
+ public TextProposal[] getProposals(KbQuery query, PageContext context) {
+ //TODO
+ return null;
+ }
+
+ public Component[] getComponents(KbQuery query, PageContext context) {
+ //TODO
+ return null;
+ }
+}
\ No newline at end of file
Property changes on:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/PageProcessor.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/ResourceBundle.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/ResourceBundle.java
(rev 0)
+++
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/ResourceBundle.java 2009-04-30
10:08:45 UTC (rev 14973)
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.kb;
+
+/**
+ * @author Alexey Kazakov
+ */
+public interface ResourceBundle {
+
+ /**
+ * @return var attribute value
+ */
+ String getVar();
+
+ /**
+ * @return basename attribute value
+ */
+ String getBasename();
+}
\ No newline at end of file
Property changes on:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/ResourceBundle.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/internal/text/FaceletContextImpl.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/internal/text/FaceletContextImpl.java
(rev 0)
+++
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/internal/text/FaceletContextImpl.java 2009-04-30
10:08:45 UTC (rev 14973)
@@ -0,0 +1,49 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.kb.internal.text;
+
+import java.util.Map;
+
+import org.jboss.tools.jst.web.kb.FaceletPageContext;
+
+/**
+ * Facelet page context
+ * @author Alexey Kazakov
+ */
+public class FaceletContextImpl extends JspContextImpl implements FaceletPageContext {
+
+ private FaceletPageContext parentContext;
+ private Map<String, String> params;
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.kb.text.FaceletPageContext#getParentContext()
+ */
+ public FaceletPageContext getParentContext() {
+ return parentContext;
+ }
+
+ public void setParentContext(FaceletPageContext parentContext) {
+ this.parentContext = parentContext;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.kb.text.FaceletPageContext#getParams()
+ */
+ public Map<String, String> getParams() {
+ return params;
+ }
+
+ public void setParams(Map<String, String> params) {
+ this.params = params;
+ }
+}
\ No newline at end of file
Property changes on:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/internal/text/FaceletContextImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/internal/text/JspContextImpl.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/internal/text/JspContextImpl.java
(rev 0)
+++
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/internal/text/JspContextImpl.java 2009-04-30
10:08:45 UTC (rev 14973)
@@ -0,0 +1,94 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.kb.internal.text;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.jface.text.Region;
+import org.jboss.tools.common.el.core.resolver.ELResolver;
+import org.jboss.tools.common.el.core.resolver.Var;
+import org.jboss.tools.jst.web.kb.PageContext;
+import org.jboss.tools.jst.web.kb.ResourceBundle;
+import org.jboss.tools.jst.web.kb.taglib.TagLibrary;
+
+/**
+ * JSP page context
+ * @author Alexey Kazakov
+ */
+public class JspContextImpl implements PageContext {
+
+ private IFile resource;
+ private TagLibrary[] libs;
+ private ELResolver[] elResolvers;
+ private Map<Region, Var[]> vars = new HashMap<Region, Var[]>();
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.kb.text.PageContext#getResource()
+ */
+ public IFile getResource() {
+ return resource;
+ }
+
+ public void setResource(IFile resource) {
+ this.resource = resource;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.kb.text.PageContext#getLibraries()
+ */
+ public TagLibrary[] getLibraries() {
+ return libs;
+ }
+
+ public void setLibraries(TagLibrary[] libs) {
+ this.libs = libs;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.kb.text.PageContext#getElResolvers()
+ */
+ public ELResolver[] getElResolvers() {
+ return elResolvers;
+ }
+
+ public void setElResolvers(ELResolver[] elResolvers) {
+ this.elResolvers = elResolvers;
+ }
+
+ private final static Var[] EMPTY_VAR_ARRAY = new Var[0];
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.kb.text.PageContext#getVars(int)
+ */
+ public Var[] getVars(int offset) {
+ for (Region region : vars.keySet()) {
+ if(offset>=region.getOffset() && offset<=region.getOffset() +
region.getLength()) {
+ return vars.get(region);
+ }
+ }
+ return EMPTY_VAR_ARRAY;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.kb.text.PageContext#getResourceBundles()
+ */
+ public ResourceBundle[] getResourceBundles() {
+ // TODO
+ return null;
+ }
+}
\ No newline at end of file
Property changes on:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/internal/text/JspContextImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/taglib/Attribute.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/taglib/Attribute.java
(rev 0)
+++
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/taglib/Attribute.java 2009-04-30
10:08:45 UTC (rev 14973)
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.kb.taglib;
+
+/**
+ * @author Alexey Kazakov
+ */
+public interface Attribute {
+
+ /**
+ * @return name of attribute
+ */
+ String getName();
+
+ /**
+ * @return description
+ */
+ String getDesription();
+
+ /**
+ * @return true if the attribute is required.
+ */
+ boolean isRequired();
+
+ /**
+ * @return true if the attribute is preferable. E.g. <h:outputText
value=""/>
+ */
+ boolean isPreferable();
+}
\ No newline at end of file
Property changes on:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/taglib/Attribute.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/taglib/Component.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/taglib/Component.java
(rev 0)
+++
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/taglib/Component.java 2009-04-30
10:08:45 UTC (rev 14973)
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.kb.taglib;
+
+/**
+ * @author Alexey Kazakov
+ */
+public interface Component {
+
+ /**
+ * @return name space
+ */
+ NameSpace getNameSpace();
+
+ /**
+ * @return component name
+ */
+ String getName();
+
+ /**
+ * @return description
+ */
+ String getDesription();
+
+ /**
+ * @return true if the tag can have a body
+ */
+ boolean canHaveBody();
+
+ /**
+ * @return the component type
+ */
+ String getComponentType();
+
+ /**
+ * @return the component class name
+ */
+ String getComponentClass();
+
+ /**
+ * @return all attributes of this component
+ */
+ Attribute[] getAttributes();
+
+ /**
+ * @param nameTemplate
+ * @return attributes with names which start with given template.
+ */
+ Attribute[] getAttributes(String nameTemplate);
+
+ /**
+ * @param name
+ * @return attribute by name
+ */
+ Attribute getAttribute(String name);
+}
\ No newline at end of file
Property changes on:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/taglib/Component.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/taglib/CustomTagLibrary.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/taglib/CustomTagLibrary.java
(rev 0)
+++
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/taglib/CustomTagLibrary.java 2009-04-30
10:08:45 UTC (rev 14973)
@@ -0,0 +1,18 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.kb.taglib;
+
+/**
+ * @author Alexey Kazakov
+ */
+public interface CustomTagLibrary extends TagLibrary {
+
+}
\ No newline at end of file
Property changes on:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/taglib/CustomTagLibrary.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/taglib/FaceletTagLibrary.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/taglib/FaceletTagLibrary.java
(rev 0)
+++
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/taglib/FaceletTagLibrary.java 2009-04-30
10:08:45 UTC (rev 14973)
@@ -0,0 +1,18 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.kb.taglib;
+
+/**
+ * @author Alexey Kazakov
+ */
+public interface FaceletTagLibrary extends TagLibrary {
+
+}
\ No newline at end of file
Property changes on:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/taglib/FaceletTagLibrary.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/taglib/FacesConfigTagLibrary.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/taglib/FacesConfigTagLibrary.java
(rev 0)
+++
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/taglib/FacesConfigTagLibrary.java 2009-04-30
10:08:45 UTC (rev 14973)
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.kb.taglib;
+
+/**
+ * @author Alexey Kazakov
+ */
+public interface FacesConfigTagLibrary extends TagLibrary {
+
+ /**
+ * @param type
+ * @return component by type
+ */
+ Component getComponentByType(String type);
+
+ /**
+ * @return all facets of this component
+ */
+ Facet[] getFacets();
+
+ /**
+ * @param nameTemplate
+ * @return facets with names which start with given template.
+ */
+ Facet[] getFacets(String nameTemplate);
+
+ /**
+ * @param name
+ * @return facet by name
+ */
+ Facet getFacet(String name);
+}
\ No newline at end of file
Property changes on:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/taglib/FacesConfigTagLibrary.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/taglib/Facet.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/taglib/Facet.java
(rev 0)
+++
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/taglib/Facet.java 2009-04-30
10:08:45 UTC (rev 14973)
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.kb.taglib;
+
+/**
+ * JSF Facet Component
+ * @author Alexey Kazakov
+ */
+public class Facet {
+
+ private String description;
+ private String name;
+
+ /**
+ * @return the description
+ */
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ /**
+ * @return the name
+ */
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+}
\ No newline at end of file
Property changes on:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/taglib/Facet.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/taglib/NameSpace.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/taglib/NameSpace.java
(rev 0)
+++
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/taglib/NameSpace.java 2009-04-30
10:08:45 UTC (rev 14973)
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.kb.taglib;
+
+/**
+ * @author Alexey Kazakov
+ */
+public interface NameSpace {
+
+ /**
+ * @return URI
+ */
+ String getURI();
+
+ /**
+ * @return prefix
+ */
+ String getPrefix();
+}
\ No newline at end of file
Property changes on:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/taglib/NameSpace.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/taglib/TLDLibrary.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/taglib/TLDLibrary.java
(rev 0)
+++
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/taglib/TLDLibrary.java 2009-04-30
10:08:45 UTC (rev 14973)
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.kb.taglib;
+
+/**
+ * @author Alexey Kazakov
+ */
+public interface TLDLibrary extends TagLibrary {
+
+ /**
+ * @return version of TLD
+ */
+ String getVersion();
+
+ /**
+ * @return display name
+ */
+ String displayName();
+
+ /**
+ * @return short name
+ */
+ String getShortName();
+}
\ No newline at end of file
Property changes on:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/taglib/TLDLibrary.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/taglib/TagLibrary.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/taglib/TagLibrary.java
(rev 0)
+++
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/taglib/TagLibrary.java 2009-04-30
10:08:45 UTC (rev 14973)
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.kb.taglib;
+
+import org.eclipse.core.resources.IResource;
+
+/**
+ * Represents a tag library.
+ * @author Alexey Kazakov
+ */
+public interface TagLibrary {
+
+ /**
+ * @return URI of the tag lib.
+ */
+ String getURI();
+
+ /**
+ * @return resource of this tag lib.
+ */
+ IResource getResource();
+
+ /**
+ * @return all tags
+ */
+ Component[] getAllComponents();
+
+ /**
+ * @param nameTemplate
+ * @return tags with names which start with given template
+ */
+ Component[] getComponents(String nameTemplate);
+
+ /**
+ * @param name
+ * @return tag by name
+ */
+ Component getComponent(String name);
+}
\ No newline at end of file
Property changes on:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/taglib/TagLibrary.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/taglib/TagLibriryManager.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/taglib/TagLibriryManager.java
(rev 0)
+++
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/taglib/TagLibriryManager.java 2009-04-30
10:08:45 UTC (rev 14973)
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.kb.taglib;
+
+import org.eclipse.core.resources.IFile;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class TagLibriryManager {
+
+ /**
+ * Returns all tag libraries which are available in the page.
+ * @param page
+ * @return
+ */
+ public static TagLibrary[] getLibraries(IFile page) {
+ //TODO
+ return null;
+ }
+}
\ No newline at end of file
Property changes on:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/taglib/TagLibriryManager.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain