JBoss Tools SVN: r14975 - in trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core: scanner/java and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-04-30 07:46:26 -0400 (Thu, 30 Apr 2009)
New Revision: 14975
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/AbstractSeamDeclaration.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ComponentBuilder.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-1077
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/AbstractSeamDeclaration.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/AbstractSeamDeclaration.java 2009-04-30 10:11:01 UTC (rev 14974)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/AbstractSeamDeclaration.java 2009-04-30 11:46:26 UTC (rev 14975)
@@ -78,7 +78,11 @@
};
return reference;
}
-
+
+ public void addAttribute(String path, IValueInfo value) {
+ attributes.put(path, value);
+ }
+
public void setName(IValueInfo value) {
attributes.put(ISeamXmlComponentDeclaration.NAME, value);
name = value == null ? null : value.getValue();
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ComponentBuilder.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ComponentBuilder.java 2009-04-30 10:11:01 UTC (rev 14974)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ComponentBuilder.java 2009-04-30 11:46:26 UTC (rev 14975)
@@ -142,6 +142,13 @@
if(scope != null) {
factory.setScope(scope);
}
+
+ ValueInfo _a = new ValueInfo();
+ _a.value = FACTORY_ANNOTATION_TYPE;
+ _a.valueStartPosition = a.getStartPosition();
+ _a.valueLength = a.getLength();
+ factory.addAttribute(FACTORY_ANNOTATION_TYPE, _a);
+
ds.getFactories().add(factory);
}
}
@@ -171,9 +178,19 @@
BijectedAttribute att = createBijectedAttribute(types);
+ Annotation in = as.get(BijectedAttributeType.IN);
+ if(in != null) {
+ ValueInfo _in = new ValueInfo();
+ _in.value = IN_ANNOTATION_TYPE;
+ _in.valueStartPosition = in.getStartPosition();
+ _in.valueLength = in.getLength();
+ att.addAttribute(IN_ANNOTATION_TYPE, _in);
+ }
+
ValueInfo name = ValueInfo.getValueInfo(main, null);
att.setValue(name);
- if(name == null || isDataModelSelectionType) {
+ if(name == null || isDataModelSelectionType
+ || name.value == null || name.value.length() == 0) {
name = new ValueInfo();
name.valueStartPosition = m.getStartPosition();
name.valueLength = m.getLength();
@@ -200,9 +217,19 @@
BijectedAttribute att = createBijectedAttribute(types);
+ Annotation in = as.get(BijectedAttributeType.IN);
+ if(in != null) {
+ ValueInfo _in = new ValueInfo();
+ _in.value = IN_ANNOTATION_TYPE;
+ _in.valueStartPosition = in.getStartPosition();
+ _in.valueLength = in.getLength();
+ att.addAttribute(IN_ANNOTATION_TYPE, _in);
+ }
+
ValueInfo name = ValueInfo.getValueInfo(main, null);
att.setValue(name);
- if(name == null || isDataModelSelectionType) {
+ if(name == null || isDataModelSelectionType
+ || name.value == null || name.value.length() == 0) {
name = new ValueInfo();
name.valueStartPosition = m.getStartPosition();
name.valueLength = m.getLength();
15 years, 8 months
JBoss Tools SVN: r14974 - in trunk/seam/plugins: org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2009-04-30 06:11:01 -0400 (Thu, 30 Apr 2009)
New Revision: 14974
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELProposalProcessor.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/properties/SeamELAttributeContentProposalProvider.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2808
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java 2009-04-30 10:08:45 UTC (rev 14973)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java 2009-04-30 10:11:01 UTC (rev 14974)
@@ -52,8 +52,8 @@
import org.jboss.tools.common.el.core.resolver.TypeInfoCollector;
import org.jboss.tools.common.el.core.resolver.Var;
import org.jboss.tools.common.el.core.resolver.TypeInfoCollector.MemberInfo;
-import org.jboss.tools.common.kb.KbProposal;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
+import org.jboss.tools.common.text.TextProposal;
import org.jboss.tools.seam.core.IBijectedAttribute;
import org.jboss.tools.seam.core.ISeamComponent;
import org.jboss.tools.seam.core.ISeamContextShortVariable;
@@ -120,9 +120,9 @@
* @throws BadLocationException if accessing the current document fails
* @throws StringIndexOutOfBoundsException
*/
- public List<KbProposal> getCompletions(IFile file, IDocument document, CharSequence prefix,
+ public List<TextProposal> getCompletions(IFile file, IDocument document, CharSequence prefix,
int position, boolean returnEqualedVariablesOnly, List<Var> vars, int start, int end) throws BadLocationException, StringIndexOutOfBoundsException {
- List<KbProposal> completions = new ArrayList<KbProposal>();
+ List<TextProposal> completions = new ArrayList<TextProposal>();
ELOperandResolveStatus status = resolveELOperand(file, parseOperand("" + prefix), returnEqualedVariablesOnly, vars, new ElVarSearcher(file, this));
if (status.isOK()) {
@@ -224,7 +224,7 @@
List<String> varNameProposals = getVarNameProposals(vars, operand.toString());
if (varNameProposals != null) {
for (String varNameProposal : varNameProposals) {
- KbProposal proposal = new KbProposal();
+ TextProposal proposal = new TextProposal();
proposal.setReplacementString(varNameProposal);
proposal.setImage(SEAM_EL_PROPOSAL_IMAGE);
status.getProposals().add(proposal);
@@ -361,11 +361,11 @@
// no vars are resolved
// the tokens are the part of var name ended with a separator (.)
resolvedVariables = resolveVariables(scope, expr, true, returnEqualedVariablesOnly);
- Set<KbProposal> proposals = new TreeSet<KbProposal>(KbProposal.KB_PROPOSAL_ORDER);
+ Set<TextProposal> proposals = new TreeSet<TextProposal>(TextProposal.KB_PROPOSAL_ORDER);
for (ISeamContextVariable var : resolvedVariables) {
String varName = var.getName();
if(varName.startsWith(operand.getText())) {
- KbProposal proposal = new KbProposal();
+ TextProposal proposal = new TextProposal();
proposal.setReplacementString(varName.substring(operand.getLength()));
if (isSeamMessagesComponentVariable(var)) {
proposal.setImage(SEAM_MESSAGES_PROPOSAL_IMAGE);
@@ -383,7 +383,7 @@
// OK. we'll proceed with members of these vars
if (status.getResolvedTokens() == status.getTokens()) {
// First segment is the last one
- Set<KbProposal> proposals = new TreeSet<KbProposal>(KbProposal.KB_PROPOSAL_ORDER);
+ Set<TextProposal> proposals = new TreeSet<TextProposal>(TextProposal.KB_PROPOSAL_ORDER);
// In some cases there may be a few references to the same variable name.
// For example @Factory and @DataModel. We should use @DataModel instead of @Factory
// method which returns null.
@@ -395,7 +395,7 @@
}
String varName = var.getName();
if(operand.getLength()<=varName.length()) {
- KbProposal proposal = new KbProposal();
+ TextProposal proposal = new TextProposal();
proposal.setReplacementString(varName.substring(operand.getLength()));
if (isSeamMessagesComponentVariable(var)) {
proposal.setImage(SEAM_MESSAGES_PROPOSAL_IMAGE);
@@ -404,7 +404,7 @@
}
proposals.add(proposal);
} else if(returnEqualedVariablesOnly) {
- KbProposal proposal = new KbProposal();
+ TextProposal proposal = new TextProposal();
proposal.setReplacementString(varName);
if (isSeamMessagesComponentVariable(var)) {
proposal.setImage(SEAM_MESSAGES_PROPOSAL_IMAGE);
@@ -520,7 +520,7 @@
List<TypeInfoCollector.MemberInfo> members,
ELOperandResolveStatus status,
boolean returnEqualedVariablesOnly, boolean varIsUsed) {
- Set<KbProposal> kbProposals = new TreeSet<KbProposal>(KbProposal.KB_PROPOSAL_ORDER);
+ Set<TextProposal> kbProposals = new TreeSet<TextProposal>(TextProposal.KB_PROPOSAL_ORDER);
if (expr.getType() == ELObjectType.EL_PROPERTY_INVOCATION && ((ELPropertyInvocation)expr).getName() == null) {
// return all the methods + properties
@@ -535,13 +535,13 @@
if (key == null || key.length() == 0)
continue;
if (key.indexOf('.') != -1) {
- KbProposal proposal = new KbProposal();
+ TextProposal proposal = new TextProposal();
proposal.setReplacementString("['" + key + "']");
proposal.setImage(SEAM_MESSAGES_PROPOSAL_IMAGE);
kbProposals.add(proposal);
} else {
- KbProposal proposal = new KbProposal();
+ TextProposal proposal = new TextProposal();
proposal.setReplacementString(key);
proposal.setImage(SEAM_MESSAGES_PROPOSAL_IMAGE);
@@ -562,7 +562,7 @@
infos.getMethodPresentationStrings();
if (methodPresentations != null) {
for (String presentation : methodPresentations) {
- KbProposal proposal = new KbProposal();
+ TextProposal proposal = new TextProposal();
proposal.setReplacementString(presentation);
proposal.setImage(SEAM_EL_PROPOSAL_IMAGE);
@@ -573,7 +573,7 @@
infos.getPropertyPresentationStrings(status.getUnpairedGettersOrSetters());
if (propertyPresentations != null) {
for (String presentation : propertyPresentations) {
- KbProposal proposal = new KbProposal();
+ TextProposal proposal = new TextProposal();
proposal.setReplacementString(presentation);
proposal.setImage(SEAM_EL_PROPOSAL_IMAGE);
@@ -614,7 +614,7 @@
if(returnEqualedVariablesOnly) {
// This is used for validation.
if (proposal.getPresentation().equals(filter)) {
- KbProposal kbProposal = new KbProposal();
+ TextProposal kbProposal = new TextProposal();
kbProposal.setReplacementString(proposal.getPresentation());
if (proposal.getMember() instanceof MessagesInfo) {
@@ -637,7 +637,7 @@
}
} else if (proposal.getPresentation().startsWith(filter)) {
// This is used for CA.
- KbProposal kbProposal = new KbProposal();
+ TextProposal kbProposal = new TextProposal();
kbProposal.setReplacementString(proposal.getPresentation().substring(filter.length()));
kbProposal.setImage(SEAM_EL_PROPOSAL_IMAGE);
@@ -684,7 +684,7 @@
if(returnEqualedVariablesOnly) {
// This is used for validation.
if (proposal.getPresentation().equals(filter)) {
- KbProposal kbProposal = new KbProposal();
+ TextProposal kbProposal = new TextProposal();
kbProposal.setReplacementString(proposal.getPresentation());
if (proposal.getMember() instanceof MessagesInfo) {
@@ -707,7 +707,7 @@
}
} else if (proposal.getPresentation().startsWith(filter)) {
// This is used for CA.
- KbProposal kbProposal = new KbProposal();
+ TextProposal kbProposal = new TextProposal();
kbProposal.setReplacementString(proposal.getPresentation().substring(filter.length()));
kbProposal.setImage(SEAM_EL_PROPOSAL_IMAGE);
@@ -825,14 +825,14 @@
* @param suggestions a list of suggestions ({@link String}).
* @return a list of unique completion suggestions.
*/
- public List<KbProposal> makeKbUnique(List<KbProposal> suggestions) {
+ public List<TextProposal> makeKbUnique(List<TextProposal> suggestions) {
HashSet<String> present = new HashSet<String>();
- ArrayList<KbProposal> unique= new ArrayList<KbProposal>();
+ ArrayList<TextProposal> unique= new ArrayList<TextProposal>();
if (suggestions == null)
return unique;
- for (KbProposal item : suggestions) {
+ for (TextProposal item : suggestions) {
if (!present.contains(item.getReplacementString())) {
present.add(item.getReplacementString());
unique.add(item);
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELProposalProcessor.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELProposalProcessor.java 2009-04-30 10:08:45 UTC (rev 14973)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELProposalProcessor.java 2009-04-30 10:11:01 UTC (rev 14974)
@@ -54,16 +54,14 @@
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
import org.eclipse.wst.xml.ui.internal.contentassist.AbstractContentAssistProcessor;
-import org.eclipse.wst.xml.ui.internal.contentassist.XMLRelevanceConstants;
import org.eclipse.wst.xml.ui.internal.util.SharedXMLEditorPluginImageHelper;
import org.jboss.tools.common.el.core.model.ELInvocationExpression;
import org.jboss.tools.common.el.core.model.ELModel;
import org.jboss.tools.common.el.core.model.ELUtil;
-import org.jboss.tools.common.el.core.parser.LexicalToken;
import org.jboss.tools.common.el.core.resolver.ElVarSearcher;
import org.jboss.tools.common.el.core.resolver.Var;
-import org.jboss.tools.common.kb.KbProposal;
import org.jboss.tools.common.model.ui.texteditors.xmleditor.XMLTextEditor;
+import org.jboss.tools.common.text.TextProposal;
import org.jboss.tools.common.text.ext.IEditorWrapper;
import org.jboss.tools.common.text.ext.util.Utils;
import org.jboss.tools.seam.core.ISeamProject;
@@ -285,7 +283,7 @@
* Returns the relevance of the proposal
*/
public int getRelevance() {
- return KbProposal.R_JSP_JSF_EL_VARIABLE_ATTRIBUTE_VALUE+10;
+ return TextProposal.R_JSP_JSF_EL_VARIABLE_ATTRIBUTE_VALUE+10;
}
}
@@ -438,11 +436,11 @@
List<Var> vars = varSearcher.findAllVars(viewer, offset);
SeamELCompletionEngine fEngine= new SeamELCompletionEngine(seamProject);
- List<KbProposal> suggestions = fEngine.getCompletions(file, document, prefix, offset + proposalPrefix.length() - prefix.length(), false, vars, start, end);
- List<KbProposal> uniqueSuggestions = fEngine.makeKbUnique(suggestions);
+ List<TextProposal> suggestions = fEngine.getCompletions(file, document, prefix, offset + proposalPrefix.length() - prefix.length(), false, vars, start, end);
+ List<TextProposal> uniqueSuggestions = fEngine.makeKbUnique(suggestions);
List<ICompletionProposal> result= new ArrayList<ICompletionProposal>();
- for (KbProposal kbProposal : uniqueSuggestions) {
+ for (TextProposal kbProposal : uniqueSuggestions) {
String string = kbProposal.getReplacementString();
Image image = kbProposal.hasImage() ?
kbProposal.getImage() :
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/properties/SeamELAttributeContentProposalProvider.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/properties/SeamELAttributeContentProposalProvider.java 2009-04-30 10:08:45 UTC (rev 14973)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/properties/SeamELAttributeContentProposalProvider.java 2009-04-30 10:11:01 UTC (rev 14974)
@@ -25,10 +25,10 @@
import org.jboss.tools.common.el.core.model.ELInvocationExpression;
import org.jboss.tools.common.el.core.model.ELModel;
import org.jboss.tools.common.el.core.model.ELUtil;
-import org.jboss.tools.common.kb.KbProposal;
import org.jboss.tools.common.meta.XAttribute;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.ui.attribute.IAttributeContentProposalProvider;
+import org.jboss.tools.common.text.TextProposal;
import org.jboss.tools.seam.core.ISeamProject;
import org.jboss.tools.seam.core.SeamCorePlugin;
import org.jboss.tools.seam.internal.core.el.SeamELCompletionEngine;
@@ -108,7 +108,7 @@
if(prefix == null) prefix = "";
- List<KbProposal> suggestions = null;
+ List<TextProposal> suggestions = null;
try {
suggestions = engine.getCompletions(file, null, prefix, position, false, null, 0, contents.length());
} catch (BadLocationException e) {
@@ -117,10 +117,10 @@
if(suggestions == null) {
return EMPTY;
}
- List<KbProposal> uniqueSuggestions = engine.makeKbUnique(suggestions);
+ List<TextProposal> uniqueSuggestions = engine.makeKbUnique(suggestions);
List<IContentProposal> list = new ArrayList<IContentProposal>();
- for (KbProposal p: uniqueSuggestions) {
+ for (TextProposal p: uniqueSuggestions) {
String label = prefix + p.getReplacementString();
IContentProposal cp = makeContentProposal(p.getReplacementString(), label);
list.add(cp);
15 years, 8 months
JBoss Tools SVN: r14973 - in trunk: common/plugins/org.jboss.tools.common/src/org/jboss/tools/common and 10 other directories.
by jbosstools-commits@lists.jboss.org
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
15 years, 8 months
JBoss Tools SVN: r14972 - trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2009-04-30 05:59:49 -0400 (Thu, 30 Apr 2009)
New Revision: 14972
Modified:
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JstJspJbide1759Test.java
Log:
test renamed to get rid of two look the same records in JUnit Tests execution report
Modified: trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JstJspJbide1759Test.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JstJspJbide1759Test.java 2009-04-30 09:39:01 UTC (rev 14971)
+++ trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JstJspJbide1759Test.java 2009-04-30 09:59:49 UTC (rev 14972)
@@ -39,7 +39,7 @@
}
}
- public void testJstJspJbide1641() {
+ public void testJstJspJbide1759() {
try {
JobUtils.waitForIdle();
} catch (Exception e) {
@@ -48,11 +48,11 @@
assertTrue("Test project \"" + PROJECT_NAME + "\" is not loaded", (project != null));
for (int i = 0; i < PAGE_EXTS.length; i++) {
- testJstJspJbide1641(PAGE_NAME + PAGE_EXTS[i]);
+ testJstJspJbide1759(PAGE_NAME + PAGE_EXTS[i]);
}
}
- private void testJstJspJbide1641(String pageName) {
+ private void testJstJspJbide1759(String pageName) {
openEditor(pageName);
15 years, 8 months
JBoss Tools SVN: r14971 - trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2009-04-30 05:39:01 -0400 (Thu, 30 Apr 2009)
New Revision: 14971
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/PackageNamesTest.java
Log:
fix SeamUiTestErrors to get build green
Modified: trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/PackageNamesTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/PackageNamesTest.java 2009-04-30 06:38:23 UTC (rev 14970)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/PackageNamesTest.java 2009-04-30 09:39:01 UTC (rev 14971)
@@ -19,6 +19,7 @@
import org.eclipse.wst.web.ui.internal.wizards.NewProjectDataModelFacetWizard;
import org.jboss.tools.common.util.WorkbenchUtils;
import org.jboss.tools.seam.ui.ISeamUiConstants;
+import org.jboss.tools.seam.ui.SeamUIMessages;
import org.jboss.tools.seam.ui.internal.project.facet.SeamInstallWizardPage;
import org.jboss.tools.test.util.JobUtils;
@@ -68,7 +69,7 @@
// delay is needed to wait for dialog initialization is finished
// such as default runtime and configuration for seam wizard
JobUtils.delay(2000);
- seamWizPg = (SeamInstallWizardPage)wizard.getPages()[3];
+ seamWizPg = (SeamInstallWizardPage)wizard.getPage(SeamUIMessages.SEAM_INSTALL_WIZARD_PAGE_SEAM_FACET);
}
public void testProjectNameWithUnderlines() {
15 years, 8 months
JBoss Tools SVN: r14969 - in trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4: src/org/jboss/tools/flow/jpdl4/editor and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2009-04-29 18:10:48 -0400 (Wed, 29 Apr 2009)
New Revision: 14969
Modified:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/plugin.xml
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlDeserializer.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlSerializer.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/handler/AddSwimlaneHandler.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/AssignmentSection.java
Log:
serialization/deserialization of swimlanes
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/plugin.xml
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/plugin.xml 2009-04-29 22:07:49 UTC (rev 14968)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/plugin.xml 2009-04-29 22:10:48 UTC (rev 14969)
@@ -210,6 +210,13 @@
language="org.jboss.tools.flow.jpdl4">
<connection></connection>
</element>
+ <element
+ class="org.jboss.tools.flow.jpdl4.model.Swimlane"
+ figure="icons/16/swimlane.gif"
+ id="org.jboss.tools.flow.jpdl4.swimlane"
+ label="swimlane"
+ language="org.jboss.tools.flow.jpdl4">
+ </element>
</extension>
<extension
point="org.eclipse.ui.newWizards">
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlDeserializer.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlDeserializer.java 2009-04-29 22:07:49 UTC (rev 14968)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlDeserializer.java 2009-04-29 22:10:48 UTC (rev 14969)
@@ -12,6 +12,7 @@
import org.jboss.tools.flow.common.properties.IPropertyId;
import org.jboss.tools.flow.common.registry.ElementRegistry;
import org.jboss.tools.flow.common.wrapper.ConnectionWrapper;
+import org.jboss.tools.flow.common.wrapper.DefaultWrapper;
import org.jboss.tools.flow.common.wrapper.FlowWrapper;
import org.jboss.tools.flow.common.wrapper.NodeWrapper;
import org.jboss.tools.flow.common.wrapper.Wrapper;
@@ -19,6 +20,7 @@
import org.jboss.tools.flow.jpdl4.model.Assignment;
import org.jboss.tools.flow.jpdl4.model.AssignmentPropertySource;
import org.jboss.tools.flow.jpdl4.model.HumanTask;
+import org.jboss.tools.flow.jpdl4.model.Swimlane;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -64,22 +66,42 @@
}
class HumanTaskAttributeHandler extends NodeAttributeHandler {
+ AssignmentAttributeHandler assignmentAttributeHandler = new AssignmentAttributeHandler();
public void deserializeAttributes(Wrapper wrapper, Element element) {
super.deserializeAttributes(wrapper, element);
- String assignee = element.getAttribute(HumanTask.ASSIGNEE);
+ assignmentAttributeHandler.deserializeAttributes(wrapper, element);
+ }
+
+ }
+
+ class SwimlaneAttributeHandler extends DefaultAttributeDeserializer {
+ AssignmentAttributeHandler assignmentAttributeHandler = new AssignmentAttributeHandler();
+ public void deserializeAttributes(Wrapper wrapper, Element element) {
+ super.deserializeAttributes(wrapper, element);
+ String name = element.getAttribute("name");
+ if (!"".equals(name) && name != null) {
+ wrapper.setPropertyValue(IPropertyId.NAME, name);
+ }
+ assignmentAttributeHandler.deserializeAttributes(wrapper, element);
+ }
+ }
+
+ class AssignmentAttributeHandler implements AttributeDeserializer {
+ public void deserializeAttributes(Wrapper wrapper, Element element) {
+ String assignee = element.getAttribute(Assignment.ASSIGNEE);
if (!"".equals(assignee)) {
wrapper.setPropertyValue(
Assignment.ASSIGNMENT_TYPE,
- AssignmentPropertySource.getAssignmentTypesIndex(HumanTask.ASSIGNEE));
- wrapper.setPropertyValue(HumanTask.ASSIGNMENT_EXPRESSION, assignee);
+ AssignmentPropertySource.getAssignmentTypesIndex(Assignment.ASSIGNEE));
+ wrapper.setPropertyValue(Assignment.ASSIGNMENT_EXPRESSION, assignee);
return;
}
- String candidateGroups = element.getAttribute(HumanTask.CANDIDATE_GROUPS);
+ String candidateGroups = element.getAttribute(Assignment.CANDIDATE_GROUPS);
if (!"".equals(candidateGroups)) {
wrapper.setPropertyValue(
Assignment.ASSIGNMENT_TYPE,
- AssignmentPropertySource.getAssignmentTypesIndex(HumanTask.CANDIDATE_GROUPS));
- wrapper.setPropertyValue(HumanTask.ASSIGNMENT_EXPRESSION, candidateGroups);
+ AssignmentPropertySource.getAssignmentTypesIndex(Assignment.CANDIDATE_GROUPS));
+ wrapper.setPropertyValue(Assignment.ASSIGNMENT_EXPRESSION, candidateGroups);
return;
}
String swimlane = element.getAttribute(HumanTask.SWIMLANE);
@@ -111,8 +133,11 @@
FlowWrapper flowWrapper = (FlowWrapper)parent;
if (node instanceof Element) {
result = createWrapper((Element)node);
- if (result != null && result instanceof NodeWrapper) {
+ if (result == null) return null;
+ if (result instanceof NodeWrapper) {
flowWrapper.addElement((NodeWrapper)result);
+ } else if (result.getElement() instanceof Swimlane) {
+ flowWrapper.addChild("swimlane", result);
}
}
return result;
@@ -223,10 +248,20 @@
return getNodeAttributeHandler(wrapper);
} else if (wrapper instanceof ConnectionWrapper) {
return new ConnectionAttributeHandler();
+ } else if (wrapper instanceof DefaultWrapper) {
+ return getDefaultAttributeHandler(wrapper);
}
return null;
}
+ private AttributeDeserializer getDefaultAttributeHandler(Wrapper wrapper) {
+ Object element = wrapper.getElement();
+ if (element instanceof Swimlane) {
+ return new SwimlaneAttributeHandler();
+ }
+ return null;
+ }
+
private AttributeDeserializer getNodeAttributeHandler(Wrapper wrapper) {
Object element = wrapper.getElement();
if (element instanceof HumanTask) {
@@ -262,6 +297,7 @@
else if ("join".equals(nodeName)) return "org.jboss.tools.flow.jpdl4.parallelJoinGateway";
else if ("fork".equals(nodeName)) return "org.jboss.tools.flow.jpdl4.parallelForkGateway";
else if ("transition".equals(nodeName)) return "org.jboss.tools.flow.jpdl4.sequenceFlow";
+ else if ("swimlane".equals(nodeName)) return "org.jboss.tools.flow.jpdl4.swimlane";
else return null;
}
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlSerializer.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlSerializer.java 2009-04-29 22:07:49 UTC (rev 14968)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlSerializer.java 2009-04-29 22:10:48 UTC (rev 14969)
@@ -21,6 +21,7 @@
import org.eclipse.draw2d.geometry.Point;
import org.eclipse.draw2d.geometry.Rectangle;
import org.jboss.tools.flow.common.model.Element;
+import org.jboss.tools.flow.common.properties.IPropertyId;
import org.jboss.tools.flow.common.wrapper.ConnectionWrapper;
import org.jboss.tools.flow.common.wrapper.ContainerWrapper;
import org.jboss.tools.flow.common.wrapper.FlowWrapper;
@@ -28,6 +29,7 @@
import org.jboss.tools.flow.common.wrapper.NodeWrapper;
import org.jboss.tools.flow.common.wrapper.Wrapper;
import org.jboss.tools.flow.jpdl4.Logger;
+import org.jboss.tools.flow.jpdl4.model.Assignment;
import org.jboss.tools.flow.jpdl4.model.CancelEndEvent;
import org.jboss.tools.flow.jpdl4.model.ErrorEndEvent;
import org.jboss.tools.flow.jpdl4.model.ExclusiveGateway;
@@ -44,6 +46,7 @@
import org.jboss.tools.flow.jpdl4.model.SqlTask;
import org.jboss.tools.flow.jpdl4.model.StartEvent;
import org.jboss.tools.flow.jpdl4.model.SuperState;
+import org.jboss.tools.flow.jpdl4.model.Swimlane;
import org.jboss.tools.flow.jpdl4.model.TerminateEndEvent;
import org.jboss.tools.flow.jpdl4.model.WaitTask;
import org.w3c.dom.NamedNodeMap;
@@ -179,6 +182,7 @@
else if ("org.jboss.tools.flow.jpdl4.parallelJoinGateway".equals(elementId)) return "join";
else if ("org.jboss.tools.flow.jpdl4.parallelForkGateway".equals(elementId)) return "fork";
else if ("org.jboss.tools.flow.jpdl4.sequenceFlow".equals(elementId)) return "transition";
+ else if ("org.jboss.tools.flow.jpdl4.swimlane".equals(elementId)) return "swimlane";
else return null;
}
@@ -283,9 +287,9 @@
class HumanTaskSerializer extends ProcessNodeWrapperSerializer {
protected List<String> getAttributesToSave() {
List<String> result = super.getAttributesToSave();
- result.add(HumanTask.ASSIGNEE);
- result.add(HumanTask.CANDIDATE_GROUPS);
- result.add(HumanTask.SWIMLANE);
+ result.add(Assignment.ASSIGNEE);
+ result.add(Assignment.CANDIDATE_GROUPS);
+ result.add(Assignment.SWIMLANE);
return result;
}
protected void appendAttributeToSave(String attributeName, StringBuffer buffer, Wrapper wrapper) {
@@ -313,6 +317,49 @@
}
}
+ class SwimlaneWrapperSerializer extends AbstractWrapperSerializer {
+ protected List<String> getAttributesToSave() {
+ ArrayList<String> result = new ArrayList<String>();
+ result.add("name");
+ result.add(Assignment.ASSIGNEE);
+ result.add(Assignment.CANDIDATE_GROUPS);
+ result.add(Assignment.SWIMLANE);
+ return result;
+ }
+ protected void appendAttributeToSave(String attributeName, StringBuffer buffer, Wrapper wrapper) {
+ Element element = wrapper.getElement();
+ if (!(element instanceof Swimlane)) return;
+ if (Assignment.ASSIGNEE.equals(attributeName)) {
+ appendExpression(Assignment.ASSIGNEE, buffer, wrapper);
+ } else if (Assignment.CANDIDATE_GROUPS.equals(attributeName)) {
+ appendExpression(Assignment.CANDIDATE_GROUPS, buffer, wrapper);
+ } else if (Assignment.SWIMLANE.equals(attributeName)) {
+ appendExpression(Assignment.SWIMLANE, buffer, wrapper);
+ } else if ("name".equals(attributeName)){
+ appendName(buffer, wrapper);
+ }
+ }
+ protected void appendName(StringBuffer buffer, Wrapper wrapper) {
+ String value = (String)wrapper.getPropertyValue(IPropertyId.NAME);
+ if (value == null || "".equals(value)) return;
+ buffer.append(" name=\"" + value + "\"");
+ }
+ protected void appendExpression(String type, StringBuffer buffer, Wrapper wrapper) {
+ Object assignmentType = wrapper.getPropertyValue(HumanTask.ASSIGNMENT_TYPE);
+ if (!(assignmentType instanceof Integer)) return;
+ if (type.equals(HumanTask.ASSIGNMENT_TYPES[(Integer)assignmentType])) {
+ Object value = wrapper.getPropertyValue(HumanTask.ASSIGNMENT_EXPRESSION);
+ if (value == null || "".equals(value)) return;
+ buffer.append(" " + type + "=\"" + value + "\"");
+ }
+ }
+ public void appendOpening(StringBuffer buffer, Wrapper wrapper, int level) {
+ appendLeadingNodes(buffer, wrapper, level);
+ buffer.append("<swimlane");
+ appendAttributes(buffer, wrapper, level);
+ }
+ }
+
class ProcessWrapperSerializer extends AbstractWrapperSerializer {
public void appendOpening(StringBuffer buffer, Wrapper wrapper, int level) {
buffer.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\n");
@@ -387,12 +434,24 @@
new ProcessNodeWrapperSerializer().appendOpening(buffer, wrapper, level);
} else if (element instanceof Process) {
new ProcessWrapperSerializer().appendOpening(buffer, wrapper, level);
+ } else if (element instanceof Swimlane) {
+ new SwimlaneWrapperSerializer().appendOpening(buffer, wrapper, level);
}
}
@SuppressWarnings("unchecked")
private void appendBody(StringBuffer buffer, Wrapper wrapper, int level) {
+ if (wrapper instanceof FlowWrapper) {
+ FlowWrapper flowWrapper = (FlowWrapper)wrapper;
+ List<Element> swimlanes = flowWrapper.getChildren("swimlane");
+ if (swimlanes != null) {
+ for (Element swimlane : swimlanes) {
+ if (!(swimlane instanceof Wrapper)) continue;
+ appendToBuffer(buffer, (Wrapper)swimlane, level+1);
+ }
+ }
+ }
if (wrapper instanceof ContainerWrapper) {
ContainerWrapper containerWrapper = (ContainerWrapper)wrapper;
List<NodeWrapper> children = containerWrapper.getNodeWrappers();
@@ -460,7 +519,9 @@
buffer.append("</join>");
} else if (element instanceof Process) {
buffer.append("</process>");
- }
+ } else if (element instanceof Swimlane) {
+ buffer.append("</swimlane>");
+ }
}
private boolean isEmpty(String str) {
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/handler/AddSwimlaneHandler.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/handler/AddSwimlaneHandler.java 2009-04-29 22:07:49 UTC (rev 14968)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/handler/AddSwimlaneHandler.java 2009-04-29 22:10:48 UTC (rev 14969)
@@ -12,9 +12,8 @@
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.handlers.HandlerUtil;
import org.jboss.tools.flow.common.command.AddChildCommand;
-import org.jboss.tools.flow.common.wrapper.DefaultWrapper;
+import org.jboss.tools.flow.common.registry.ElementRegistry;
import org.jboss.tools.flow.common.wrapper.Wrapper;
-import org.jboss.tools.flow.jpdl4.model.Swimlane;
public class AddSwimlaneHandler extends AbstractHandler implements IHandler {
@@ -36,8 +35,7 @@
if (object == null || !(object instanceof CommandStack)) return null;
CommandStack commandStack = (CommandStack)object;
AddChildCommand addChildCommand = new AddChildCommand();
- Wrapper child = new DefaultWrapper();
- child.setElement(new Swimlane());
+ Wrapper child = ElementRegistry.createWrapper("org.jboss.tools.flow.jpdl4.swimlane");
addChildCommand.setChild(child);
addChildCommand.setType("swimlane");
addChildCommand.setParent(parent);
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/AssignmentSection.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/AssignmentSection.java 2009-04-29 22:07:49 UTC (rev 14968)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/AssignmentSection.java 2009-04-29 22:10:48 UTC (rev 14969)
@@ -13,6 +13,7 @@
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.views.properties.IPropertySource;
import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
+import org.jboss.tools.flow.jpdl4.model.Assignment;
import org.jboss.tools.flow.jpdl4.model.HumanTask;
public class AssignmentSection extends JpdlPropertySection {
@@ -25,13 +26,13 @@
private SelectionListener typeComboSelectionListener = new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
changeProperty(HumanTask.ASSIGNMENT_TYPE, typeCombo.getSelectionIndex());
- expressionText.setEnabled(!HumanTask.NONE.equals(typeCombo.getText()));
+ expressionText.setEnabled(!Assignment.NONE.equals(typeCombo.getText()));
}
};
private ModifyListener expressionTextModifyListener = new ModifyListener() {
public void modifyText(ModifyEvent e) {
- changeProperty(HumanTask.ASSIGNMENT_EXPRESSION, expressionText.getText());
+ changeProperty(Assignment.ASSIGNMENT_EXPRESSION, expressionText.getText());
}
};
15 years, 8 months
JBoss Tools SVN: r14968 - in trunk/flow/plugins/org.jboss.tools.flow.common: src/org/jboss/tools/flow/common/registry and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2009-04-29 18:07:49 -0400 (Wed, 29 Apr 2009)
New Revision: 14968
Modified:
trunk/flow/plugins/org.jboss.tools.flow.common/schema/elements.exsd
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/registry/ElementRegistry.java
Log:
- support creation of DefaultWrapper in ElementRegistry
- type of element wrapper is now optional
Modified: trunk/flow/plugins/org.jboss.tools.flow.common/schema/elements.exsd
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/schema/elements.exsd 2009-04-29 19:42:03 UTC (rev 14967)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/schema/elements.exsd 2009-04-29 22:07:49 UTC (rev 14968)
@@ -2,9 +2,9 @@
<!-- Schema file written by PDE -->
<schema targetNamespace="org.jboss.tools.flow.common" xmlns="http://www.w3.org/2001/XMLSchema">
<annotation>
- <appinfo>
+ <appInfo>
<meta.schema plugin="org.jboss.tools.flow.common" id="elements" name="Flow Language Elements"/>
- </appinfo>
+ </appInfo>
<documentation>
This extension point provides a way to contribute language elements to a target flow language.
</documentation>
@@ -12,9 +12,9 @@
<element name="extension">
<annotation>
- <appinfo>
+ <appInfo>
<meta.element />
- </appinfo>
+ </appInfo>
</annotation>
<complexType>
<sequence>
@@ -39,9 +39,9 @@
<documentation>
</documentation>
- <appinfo>
+ <appInfo>
<meta.attribute translatable="true"/>
- </appinfo>
+ </appInfo>
</annotation>
</attribute>
</complexType>
@@ -49,7 +49,7 @@
<element name="element">
<complexType>
- <choice>
+ <choice minOccurs="0" maxOccurs="1">
<element ref="flow"/>
<element ref="container"/>
<element ref="node"/>
@@ -67,9 +67,9 @@
<documentation>
</documentation>
- <appinfo>
+ <appInfo>
<meta.attribute kind="java"/>
- </appinfo>
+ </appInfo>
</annotation>
</attribute>
<attribute name="language" type="string" use="required">
@@ -91,9 +91,9 @@
<documentation>
</documentation>
- <appinfo>
+ <appInfo>
<meta.attribute kind="resource"/>
- </appinfo>
+ </appInfo>
</annotation>
</attribute>
</complexType>
@@ -106,9 +106,9 @@
<documentation>
</documentation>
- <appinfo>
+ <appInfo>
<meta.attribute kind="java" basedOn=":org.jboss.tools.flow.common.strategy.AcceptsElementStrategy"/>
- </appinfo>
+ </appInfo>
</annotation>
</attribute>
</complexType>
@@ -124,9 +124,9 @@
<documentation>
</documentation>
- <appinfo>
+ <appInfo>
<meta.attribute kind="java" basedOn=":org.jboss.tools.flow.common.strategy.AcceptsIncomingConnectionStrategy"/>
- </appinfo>
+ </appInfo>
</annotation>
</attribute>
<attribute name="acceptsOutgoingConnectionStrategy" type="string">
@@ -134,9 +134,9 @@
<documentation>
</documentation>
- <appinfo>
+ <appInfo>
<meta.attribute kind="java" basedOn=":org.jboss.tools.flow.common.strategy.AcceptsOutgoingConnectionStrategy"/>
- </appinfo>
+ </appInfo>
</annotation>
</attribute>
</complexType>
@@ -149,9 +149,9 @@
<documentation>
</documentation>
- <appinfo>
+ <appInfo>
<meta.attribute kind="java" basedOn=":org.jboss.tools.flow.common.strategy.AcceptsElementStrategy"/>
- </appinfo>
+ </appInfo>
</annotation>
</attribute>
<attribute name="acceptsIncomingConnectionStrategy" type="string">
@@ -159,9 +159,9 @@
<documentation>
</documentation>
- <appinfo>
+ <appInfo>
<meta.attribute kind="java" basedOn=":org.jboss.tools.flow.common.strategy.AcceptsIncomingConnectionStrategy"/>
- </appinfo>
+ </appInfo>
</annotation>
</attribute>
<attribute name="acceptsOutgoingConnectionStrategy" type="string">
@@ -169,9 +169,9 @@
<documentation>
</documentation>
- <appinfo>
+ <appInfo>
<meta.attribute kind="java" basedOn=":org.jboss.tools.flow.common.strategy.AcceptsOutgoingConnectionStrategy"/>
- </appinfo>
+ </appInfo>
</annotation>
</attribute>
</complexType>
@@ -192,9 +192,9 @@
<documentation>
</documentation>
- <appinfo>
+ <appInfo>
<meta.attribute kind="java" basedOn=":org.jboss.tools.flow.common.figure.ElementFigure"/>
- </appinfo>
+ </appInfo>
</annotation>
</attribute>
<attribute name="color" type="string">
@@ -209,9 +209,9 @@
<documentation>
</documentation>
- <appinfo>
+ <appInfo>
<meta.attribute kind="resource"/>
- </appinfo>
+ </appInfo>
</annotation>
</attribute>
</complexType>
@@ -227,36 +227,36 @@
</element>
<annotation>
- <appinfo>
+ <appInfo>
<meta.section type="since"/>
- </appinfo>
+ </appInfo>
<documentation>
[Enter the first release in which this extension point appears.]
</documentation>
</annotation>
<annotation>
- <appinfo>
+ <appInfo>
<meta.section type="examples"/>
- </appinfo>
+ </appInfo>
<documentation>
[Enter extension point usage example here.]
</documentation>
</annotation>
<annotation>
- <appinfo>
+ <appInfo>
<meta.section type="apiinfo"/>
- </appinfo>
+ </appInfo>
<documentation>
[Enter API information here.]
</documentation>
</annotation>
<annotation>
- <appinfo>
+ <appInfo>
<meta.section type="implementation"/>
- </appinfo>
+ </appInfo>
<documentation>
[Enter information about supplied implementation of this extension point.]
</documentation>
Modified: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/registry/ElementRegistry.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/registry/ElementRegistry.java 2009-04-29 19:42:03 UTC (rev 14967)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/registry/ElementRegistry.java 2009-04-29 22:07:49 UTC (rev 14968)
@@ -21,6 +21,7 @@
import org.jboss.tools.flow.common.wrapper.DefaultFlowWrapper;
import org.jboss.tools.flow.common.wrapper.DefaultLabelWrapper;
import org.jboss.tools.flow.common.wrapper.DefaultNodeWrapper;
+import org.jboss.tools.flow.common.wrapper.DefaultWrapper;
import org.jboss.tools.flow.common.wrapper.Wrapper;
public class ElementRegistry {
@@ -41,7 +42,10 @@
private static Wrapper createWrapper(IConfigurationElement configurationElement)
throws CoreException {
IConfigurationElement[] children = configurationElement.getChildren();
- if (children.length != 1) return null;
+ if (children.length > 1) return null;
+ if (children.length == 0) {
+ return createDefault(configurationElement);
+ }
String type = children[0].getName();
if ("flow".equals(type)) {
return createFlow(configurationElement);
@@ -56,6 +60,20 @@
}
}
+ private static Wrapper createDefault(IConfigurationElement configurationElement)
+ throws CoreException {
+ Object element = configurationElement.createExecutableExtension("class");
+ if (!(element instanceof Element)) {
+ String message = "Expecting to instantiate a org.jboss.tools.flow.common.model.Element instance.";
+ Logger.logError(message, new RuntimeException(message));
+ return null;
+ }
+ ((Element)element).setMetaData("configurationElement", configurationElement);
+ DefaultWrapper result = new DefaultWrapper();
+ result.setElement((Element)element);
+ return result;
+ }
+
private static Wrapper createConnection(IConfigurationElement configurationElement)
throws CoreException {
Object element = configurationElement.createExecutableExtension("class");
15 years, 8 months
JBoss Tools SVN: r14967 - in workspace: snjeza/seam-examples and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2009-04-29 15:42:03 -0400 (Wed, 29 Apr 2009)
New Revision: 14967
Added:
workspace/snjeza/seam-examples/registration.zip
Modified:
workspace/examples/project-examples-3.0.xml
Log:
https://jira.jboss.org/jira/browse/JBIDE-4180 We should have the projects featured in Seam tutorials available in Project Examples
Modified: workspace/examples/project-examples-3.0.xml
===================================================================
--- workspace/examples/project-examples-3.0.xml 2009-04-29 19:31:49 UTC (rev 14966)
+++ workspace/examples/project-examples-3.0.xml 2009-04-29 19:42:03 UTC (rev 14967)
@@ -135,6 +135,22 @@
</project>
<project>
+ <category>Seam</category>
+ <name>registration</name>
+ <included-projects>
+ registration,registration-ejb,registration-ear,registration-test
+ </included-projects>
+ <shortDescription>Seam Registration Example - EAR (including a test project)</shortDescription>
+ <description>This is a trivial example for the Seam tutorial. It runs on both JBoss AS and Tomcat.
+It includes the registration,registration-ejb,registration-ear,registration-test projects.
+</description>
+ <size>31657984</size>
+ <url>
+ http://anonsvn.jboss.org/repos/jbosstools/workspace/snjeza/seam-examples/...
+ </url>
+ </project>
+
+ <project>
<category>Portlet</category>
<name>testjavaportlet</name>
<shortDescription>JBoss Java Portlet Example</shortDescription>
Added: workspace/snjeza/seam-examples/registration.zip
===================================================================
(Binary files differ)
Property changes on: workspace/snjeza/seam-examples/registration.zip
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
15 years, 8 months
JBoss Tools SVN: r14966 - in trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner: editor and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2009-04-29 15:31:49 -0400 (Wed, 29 Apr 2009)
New Revision: 14966
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/browser/XulRunnerBrowser.java
trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerEditor.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-3155, fixing errors in junit tests for vpe under linux x86_64 platform
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/browser/XulRunnerBrowser.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/browser/XulRunnerBrowser.java 2009-04-29 17:34:26 UTC (rev 14965)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/browser/XulRunnerBrowser.java 2009-04-29 19:31:49 UTC (rev 14966)
@@ -12,10 +12,8 @@
package org.jboss.tools.vpe.xulrunner.browser;
import java.io.File;
-import java.io.FileNotFoundException;
import java.io.IOException;
import java.net.URL;
-
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.Platform;
import org.eclipse.swt.SWT;
@@ -41,6 +39,7 @@
import org.mozilla.interfaces.nsIWebProgressListener;
import org.mozilla.xpcom.GREVersionRange;
import org.mozilla.xpcom.Mozilla;
+import org.mozilla.xpcom.XPCOMException;
import org.osgi.framework.Bundle;
/**
@@ -70,6 +69,7 @@
private Browser browser = null;
private nsIWebBrowser webBrowser = null;
private long chrome_flags = nsIWebBrowserChrome.CHROME_ALL;
+ protected static final long NS_ERROR_FAILURE = 0x80004005L;
static {
XULRUNNER_BUNDLE = (new StringBuffer("org.mozilla.xulrunner")) // $NON-NLS-1$
@@ -103,7 +103,7 @@
// nsIWebProgressListener.NS_IWEBPROGRESSLISTENER_IID);
nsIServiceManager serviceManager = mozilla.getServiceManager();
nsIWebProgress webProgress = (nsIWebProgress) serviceManager
- .getServiceByContractID("@mozilla.org/docloaderservice;1", // $NON-NLS-1$
+ .getServiceByContractID("@mozilla.org/docloaderservice;1", //$NON-NLS-1$
nsIWebProgress.NS_IWEBPROGRESS_IID);
webProgress.addProgressListener(this, nsIWebProgress.NOTIFY_STATE_ALL);
webBrowser.addWebBrowserListener(this,
@@ -168,10 +168,18 @@
//if we hasn't do it, listener will be continue work even after close browser
nsIServiceManager serviceManager = mozilla.getServiceManager();
nsIWebProgress webProgress = (nsIWebProgress) serviceManager
- .getServiceByContractID("@mozilla.org/docloaderservice;1", // $NON-NLS-1$
+ .getServiceByContractID("@mozilla.org/docloaderservice;1", //$NON-NLS-1$
nsIWebProgress.NS_IWEBPROGRESS_IID);
- webProgress.removeProgressListener(this);
-
+ try {
+ webProgress.removeProgressListener(this);
+ } catch(XPCOMException xpcomException) {
+
+ //this exception throws when progress listener already has been deleted,
+ //so just ignore if error code NS_ERROR_FAILURE
+ if(xpcomException.errorcode!=XulRunnerBrowser.NS_ERROR_FAILURE) {
+ throw xpcomException;
+ }
+ }
browser.dispose();
browser = null;
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerEditor.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerEditor.java 2009-04-29 17:34:26 UTC (rev 14965)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerEditor.java 2009-04-29 19:31:49 UTC (rev 14966)
@@ -609,9 +609,18 @@
if (this.selectionListener != null) {
nsISelection selection = getSelection();
nsISelectionPrivate selectionPrivate = (nsISelectionPrivate) selection.queryInterface(nsISelectionPrivate.NS_ISELECTIONPRIVATE_IID);
- selectionPrivate.removeSelectionListener(selectionListener);
+ try {
+ selectionPrivate.removeSelectionListener(this.selectionListener);
+ } catch (XPCOMException xpcomException) {
+ //this exception throws when progress listener already has been deleted,
+ //so just ignore if error code NS_ERROR_FAILURE
+ //mareshkau fix for jbide-3155
+ if(xpcomException.errorcode!=XulRunnerBrowser.NS_ERROR_FAILURE) {
+ throw xpcomException;
+ }
+ }
}
- selectionListener=null;
+ this.selectionListener=null;
}
/**
* get nsIDomElement from nsIDomNode
15 years, 8 months
JBoss Tools SVN: r14965 - trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2009-04-29 13:34:26 -0400 (Wed, 29 Apr 2009)
New Revision: 14965
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/HQLScratchpadAction.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4252
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/HQLScratchpadAction.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/HQLScratchpadAction.java 2009-04-29 17:04:11 UTC (rev 14964)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/HQLScratchpadAction.java 2009-04-29 17:34:26 UTC (rev 14965)
@@ -24,6 +24,7 @@
import org.eclipse.jface.viewers.TreePath;
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.ImageConstants;
+import org.hibernate.console.node.BaseNode;
import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.eclipse.console.utils.EclipseImages;
@@ -70,6 +71,13 @@
}
return "select o." + prName + " from " + enName + " o"; //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
}
+ else if (node instanceof BaseNode) {
+ BaseNode baseNode = (BaseNode)node;
+ ConsoleConfiguration consoleConfiguration = baseNode.getConsoleConfiguration();
+ if (consoleConfiguration.isSessionFactoryCreated()) {
+ return baseNode.getHQL();
+ }
+ }
return ""; //$NON-NLS-1$
}
}
\ No newline at end of file
15 years, 8 months