JBoss Tools SVN: r2442 - trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-07-16 07:59:25 -0400 (Mon, 16 Jul 2007)
New Revision: 2442
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/InnerModelHelper.java
Log:
EXIN-218 - removed dependency on jsfnature - null pointer prevented when accessing dynamic web project
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/InnerModelHelper.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/InnerModelHelper.java 2007-07-16 11:38:06 UTC (rev 2441)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/InnerModelHelper.java 2007-07-16 11:59:25 UTC (rev 2442)
@@ -21,8 +21,14 @@
XModelObject webinf = model.getByPath("FileSystems/WEB-INF");
if(webinf != null) return model;
- IPath webInfPath = J2EEUtils.getWebInfPath(project);
+ IPath webInfPath = null;
+ try {
+ webInfPath = J2EEUtils.getWebInfPath(project);
+ } catch (Exception e) {
+ //ignore
+ }
+
if(webInfPath == null) return model;
IFolder webInfFolder = ResourcesPlugin.getWorkspace().getRoot().getFolder(webInfPath);
17 years, 5 months
JBoss Tools SVN: r2441 - in trunk/seam/plugins/org.jboss.tools.seam.core: src/org/jboss/tools/seam/internal/core and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-07-16 07:38:06 -0400 (Mon, 16 Jul 2007)
New Revision: 2441
Added:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/InnerModelHelper.java
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/META-INF/MANIFEST.MF
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/ClassPath.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/LibraryScanner.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/xml/XMLScanner.java
Log:
EXIN-218 - removed dependency on jsfnature
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/META-INF/MANIFEST.MF 2007-07-16 11:37:27 UTC (rev 2440)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/META-INF/MANIFEST.MF 2007-07-16 11:38:06 UTC (rev 2441)
@@ -22,7 +22,8 @@
org.eclipse.ant.core,
org.eclipse.wst.validation,
org.eclipse.jst.j2ee.web,
- org.eclipse.jst.j2ee
+ org.eclipse.jst.j2ee,
+ org.eclipse.jst.ws
Provide-Package: org.jboss.tools.seam.core,
org.jboss.tools.seam.internal.core,
org.jboss.tools.seam.internal.core.scanner
Added: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/InnerModelHelper.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/InnerModelHelper.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/InnerModelHelper.java 2007-07-16 11:38:06 UTC (rev 2441)
@@ -0,0 +1,51 @@
+package org.jboss.tools.seam.internal.core;
+
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.jst.ws.internal.common.J2EEUtils;
+import org.jboss.tools.common.model.XModel;
+import org.jboss.tools.common.model.XModelConstants;
+import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.project.IModelNature;
+import org.jboss.tools.common.model.util.EclipseResourceUtil;
+
+public class InnerModelHelper {
+
+ public static XModel createXModel(IProject project) {
+ IModelNature n = EclipseResourceUtil.getModelNature(project.getProject());
+ if(n != null) return n.getModel();
+
+ XModel model = EclipseResourceUtil.createObjectForResource(project.getProject()).getModel();
+ XModelObject webinf = model.getByPath("FileSystems/WEB-INF");
+ if(webinf != null) return model;
+
+ IPath webInfPath = J2EEUtils.getWebInfPath(project);
+
+ if(webInfPath == null) return model;
+
+ IFolder webInfFolder = ResourcesPlugin.getWorkspace().getRoot().getFolder(webInfPath);
+
+ model.getProperties().setProperty(XModelConstants.WORKSPACE, webInfFolder.getLocation().toString());
+
+ XModelObject fs = model.getByPath("FileSystems");
+ webinf = model.createModelObject("FileSystemFolder", null);
+ webinf.setAttributeValue("name", "WEB-INF");
+ webinf.setAttributeValue("location", "%redhat.workspace%");
+ fs.addChild(webinf);
+
+ XModelObject webroot = model.createModelObject("FileSystemFolder", null);
+ webroot.setAttributeValue("name", "WEB-ROOT");
+ webroot.setAttributeValue("location", "%redhat.workspace%/..");
+ fs.addChild(webroot);
+
+ XModelObject lib = model.createModelObject("FileSystemFolder", null);
+ lib.setAttributeValue("name", "lib");
+ lib.setAttributeValue("location", "%redhat.workspace%/lib");
+ fs.addChild(lib);
+
+ return model;
+ }
+
+}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/ClassPath.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/ClassPath.java 2007-07-16 11:37:27 UTC (rev 2440)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/ClassPath.java 2007-07-16 11:38:06 UTC (rev 2441)
@@ -36,6 +36,7 @@
import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.common.model.util.XModelObjectUtil;
import org.jboss.tools.seam.core.SeamCorePlugin;
+import org.jboss.tools.seam.internal.core.InnerModelHelper;
import org.jboss.tools.seam.internal.core.SeamProject;
import org.jboss.tools.seam.internal.core.scanner.LoadedDeclarations;
@@ -73,8 +74,7 @@
* Initialization of inner model.
*/
public void init() {
- IModelNature n = EclipseResourceUtil.getModelNature(project.getProject());
- model = n == null ? EclipseResourceUtil.createObjectForResource(project.getProject()).getModel() : n.getModel();
+ model = InnerModelHelper.createXModel(project.getProject());
}
static String[] SYSTEM_JARS = {"rt.jar", "jsse.jar", "jce.jar", "charsets.jar"};
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/LibraryScanner.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/LibraryScanner.java 2007-07-16 11:37:27 UTC (rev 2440)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/LibraryScanner.java 2007-07-16 11:38:06 UTC (rev 2441)
@@ -28,12 +28,14 @@
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader;
import org.eclipse.jdt.internal.compiler.env.IBinaryAnnotation;
+import org.jboss.tools.common.model.XModel;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.filesystems.impl.FileSystemsImpl;
import org.jboss.tools.common.model.plugin.ModelPlugin;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.common.model.util.XModelObjectUtil;
import org.jboss.tools.seam.core.SeamCorePlugin;
+import org.jboss.tools.seam.internal.core.InnerModelHelper;
import org.jboss.tools.seam.internal.core.SeamPropertiesDeclaration;
import org.jboss.tools.seam.internal.core.scanner.IFileScanner;
import org.jboss.tools.seam.internal.core.scanner.LoadedDeclarations;
@@ -61,7 +63,9 @@
}
public boolean isLikelyComponentSource(IFile f) {
- XModelObject o = EclipseResourceUtil.getObjectByResource(f);
+ XModel model = InnerModelHelper.createXModel(f.getProject());
+ if(model == null) return false;
+ XModelObject o = EclipseResourceUtil.getObjectByResource(model, f);
if(o == null) return false;
if(!o.getModelEntity().getName().equals("FileSystemJar")) {
((FileSystemsImpl)o.getModel().getByPath("FileSystems")).updateOverlapped();
@@ -72,7 +76,9 @@
}
public LoadedDeclarations parse(IFile f) throws Exception {
- XModelObject o = EclipseResourceUtil.getObjectByResource(f);
+ XModel model = InnerModelHelper.createXModel(f.getProject());
+ if(model == null) return null;
+ XModelObject o = EclipseResourceUtil.getObjectByResource(model, f);
if(o == null) return null;
if(!o.getModelEntity().getName().equals("FileSystemJar")) {
((FileSystemsImpl)o.getModel().getByPath("FileSystems")).updateOverlapped();
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/xml/XMLScanner.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/xml/XMLScanner.java 2007-07-16 11:37:27 UTC (rev 2440)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/xml/XMLScanner.java 2007-07-16 11:38:06 UTC (rev 2441)
@@ -21,9 +21,11 @@
import org.eclipse.core.runtime.IPath;
import org.jboss.tools.common.meta.XAttribute;
import org.jboss.tools.common.meta.XModelEntity;
+import org.jboss.tools.common.model.XModel;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.seam.core.ISeamXmlComponentDeclaration;
+import org.jboss.tools.seam.internal.core.InnerModelHelper;
import org.jboss.tools.seam.internal.core.SeamProperty;
import org.jboss.tools.seam.internal.core.SeamXmlComponentDeclaration;
import org.jboss.tools.seam.internal.core.SeamXmlFactory;
@@ -54,7 +56,9 @@
*/
public boolean isLikelyComponentSource(IFile f) {
if(!f.isSynchronized(IFile.DEPTH_ZERO) || !f.exists()) return false;
- XModelObject o = EclipseResourceUtil.getObjectByResource(f);
+ XModel model = InnerModelHelper.createXModel(f.getProject());
+ if(model == null) return false;
+ XModelObject o = EclipseResourceUtil.getObjectByResource(model, f);
if(o == null) return false;
if(o.getModelEntity().getName().startsWith("FileSeamComponents")) return true;
//TODO Above does not include .component.xml with root element <component>
@@ -69,7 +73,9 @@
* @throws Exception
*/
public LoadedDeclarations parse(IFile f) throws Exception {
- XModelObject o = EclipseResourceUtil.getObjectByResource(f);
+ XModel model = InnerModelHelper.createXModel(f.getProject());
+ if(model == null) return null;
+ XModelObject o = EclipseResourceUtil.getObjectByResource(model, f);
return parse(o, f.getFullPath());
}
17 years, 5 months
JBoss Tools SVN: r2440 - trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-07-16 07:37:27 -0400 (Mon, 16 Jul 2007)
New Revision: 2440
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/RootContentProvider.java
Log:
EXIN-218 - removed dependency on jsfnature
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/RootContentProvider.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/RootContentProvider.java 2007-07-16 08:55:59 UTC (rev 2439)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/RootContentProvider.java 2007-07-16 11:37:27 UTC (rev 2440)
@@ -130,12 +130,12 @@
boolean isGoodProject(IProject project) {
if(project == null || !project.exists() || !project.isOpen()) return false;
- try {
- if(!project.hasNature("org.jboss.tools.jsf.jsfnature")) return false;
- } catch (CoreException e) {
- //ignore - all checks are done above
- return false;
- }
+// try {
+// if(!project.hasNature("org.jboss.tools.jsf.jsfnature")) return false;
+// } catch (CoreException e) {
+// //ignore - all checks are done above
+// return false;
+// }
return true;
}
17 years, 5 months
JBoss Tools SVN: r2439 - branches.
by jbosstools-commits@lists.jboss.org
Author: max.andersen(a)jboss.com
Date: 2007-07-16 04:55:59 -0400 (Mon, 16 Jul 2007)
New Revision: 2439
Added:
branches/jbosstools_xulrunner/
Log:
Creating branch for the work of moving vpe to xulrunner
Copied: branches/jbosstools_xulrunner (from rev 2438, trunk)
17 years, 5 months
JBoss Tools SVN: r2438 - trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2007-07-13 14:41:55 -0400 (Fri, 13 Jul 2007)
New Revision: 2438
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/SeamExpressionResolver.java
Log:
http://jira.jboss.org/jira/browse/EXIN-330
Empty proposals list return fixed
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 2007-07-13 18:17:19 UTC (rev 2437)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELProposalProcessor.java 2007-07-13 18:41:55 UTC (rev 2438)
@@ -249,6 +249,8 @@
result.add(createProposal(string, prefix, offset));
}
+ if (result == null || result.size() == 0)
+ return NO_PROPOSALS;
return (ICompletionProposal[]) result.toArray(new ICompletionProposal[uniqueSuggestions.size()]);
} catch (BadLocationException x) {
return NO_PROPOSALS;
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamExpressionResolver.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamExpressionResolver.java 2007-07-13 18:17:19 UTC (rev 2437)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamExpressionResolver.java 2007-07-13 18:41:55 UTC (rev 2438)
@@ -119,6 +119,12 @@
ISeamXmlFactory factory = (ISeamXmlFactory)variable;
String value = factory.getValue();
if (value != null && value.length() > 0) {
+ if (value.startsWith("#{") || value.startsWith("${"))
+ value = value.substring(2);
+ if (value.endsWith("}"))
+ value = value.substring(0, value.length() - 1);
+ }
+ if (value != null && value.length() > 0) {
// TODO: Need to make sure that it's correct way to get the project and
// the scope from the factory
ISeamProject project = ((ISeamElement)factory).getSeamProject();
17 years, 5 months
JBoss Tools SVN: r2437 - trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2007-07-13 14:17:19 -0400 (Fri, 13 Jul 2007)
New Revision: 2437
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELCompletionEngine.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELProposalComputer.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/text/java/SeamExpressionResolver.java
Log:
http://jira.jboss.org/jira/browse/EXIN-330
comments are added
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELCompletionEngine.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELCompletionEngine.java 2007-07-13 17:59:36 UTC (rev 2436)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELCompletionEngine.java 2007-07-13 18:17:19 UTC (rev 2437)
@@ -33,8 +33,16 @@
import org.jboss.tools.seam.core.ScopeType;
import org.jboss.tools.seam.ui.SeamGuiPlugin;
+/**
+ * Utility class used to find Seam Project content assist proposals
+ *
+ * @author Jeremy
+ */
public final class SeamELCompletionEngine {
+ /**
+ * Constructs SeamELCompletionEngine object
+ */
public SeamELCompletionEngine() {
}
@@ -206,6 +214,13 @@
return sb.toString();
}
+ /*
+ * Compares to tokenized expressions.
+ *
+ * @param first
+ * @param second
+ * @return boolean true if two expressions are equal
+ */
private boolean areEqualExpressions(List<ELToken>first, List<ELToken>second) {
if (first == null || second == null)
return (first == second);
@@ -220,6 +235,12 @@
return true;
}
+ /* Returns scope for the resource
+ *
+ * @param project
+ * @param resource
+ * @return
+ */
private ScopeType getScope(ISeamProject project, IResource resource) {
if (project == null || resource == null)
return null;
@@ -233,8 +254,17 @@
}
return null;
}
-
- List<ISeamContextVariable> resolveVariables(ISeamProject project, ScopeType scope, List<ELToken>part, List<ELToken> tokens) {
+
+ /*
+ * Tries to resolve variables by part of expression
+ *
+ * @param project
+ * @param scope
+ * @param part
+ * @param tokens
+ * @return
+ */
+ private List<ISeamContextVariable> resolveVariables(ISeamProject project, ScopeType scope, List<ELToken>part, List<ELToken> tokens) {
List<ISeamContextVariable>resolvedVars = new ArrayList<ISeamContextVariable>();
String varName = computeVariableName(part);
if (varName != null) {
@@ -258,6 +288,13 @@
return new ArrayList<ISeamContextVariable>();
}
+ /*
+ * Creates and returns list of possible variable name combinations from expression starting from the longest name
+ *
+ *
+ * @param prefix
+ * @return
+ */
private List<List<ELToken>> getPossibleVarsFromPrefix(List<ELToken>prefix) {
ArrayList<List<ELToken>> result = new ArrayList<List<ELToken>>();
for (int i = 0; prefix != null && i < prefix.size(); i++) {
@@ -274,7 +311,7 @@
}
/**
- * Removes duplicates
+ * Removes duplicates of completion strings
*
* @param suggestions a list of suggestions ({@link String}).
* @return a list of unique completion suggestions.
@@ -297,6 +334,12 @@
return unique;
}
+ /**
+ * EL string parser.
+ * Creates list of tokens for the name, method and separator parts
+ *
+ * @author Jeremy
+ */
public static class SeamELTokenizer {
static final int STATE_INITIAL = 0;
static final int STATE_VAR = 1;
@@ -306,7 +349,13 @@
IDocument fDocument;
List<ELToken> fTokens;
int index;
-
+
+ /**
+ * Constructs SeamELTokenizer object
+ *
+ * @param document
+ * @param offset
+ */
public SeamELTokenizer(IDocument document, int offset) {
fDocument = document;
index = (fDocument == null || fDocument.getLength() < offset? -1 : offset);
@@ -314,10 +363,18 @@
parseBackward();
}
+ /**
+ * Returns list of tokens for the expression parsed
+ *
+ * @return
+ */
public List<ELToken> getTokens() {
return fTokens;
}
+ /*
+ * Performs backward parsing of document text for expression
+ */
private void parseBackward() {
ELToken token;
fState = STATE_INITIAL;
@@ -334,7 +391,13 @@
int fState;
int fEndOfToken;
- ELToken getNextToken() {
+
+ /*
+ * Calculates and returns next token for expression
+ *
+ * @return
+ */
+ private ELToken getNextToken() {
switch (fState) {
case STATE_INITIAL: // Just started
{
@@ -400,6 +463,10 @@
return ELToken.EOF;
}
+ /* Reads and returns the method token from the expression
+ *
+ * @return
+ */
ELToken readMethodToken() {
fState = STATE_METHOD;
int endOfToken = index;
@@ -417,7 +484,14 @@
return (endOfToken - index > 0 ? new ELToken(index, endOfToken - index, getCharSequence(index, endOfToken - index), ELToken.EL_METHOD_TOKEN) : ELToken.EOF);
}
-
+
+ /*
+ * Returns the CharSequence object
+ *
+ * @param start
+ * @param length
+ * @return
+ */
private CharSequence getCharSequence(int start, int length) {
String text = "";
try {
@@ -428,6 +502,10 @@
return text.subSequence(0, text.length());
}
+
+ /*
+ * Skips the space characters in the document
+ */
boolean skipSpaceChars() {
int ch;
while ((ch = readCharBackward()) != -1) {
@@ -439,6 +517,11 @@
return true;
}
+ /*
+ * Skips the method name characters in the document
+ *
+ * @return boolean true if at least 1 character had been read
+ */
boolean skipMethodName() {
int endOfToken = index;
int ch;
@@ -451,6 +534,11 @@
return false;
}
+ /*
+ * Skips the method parameters characters in the document
+ *
+ * @return boolean true if complete parameters set had been read
+ */
boolean skipMethodParameters() {
int ch = readCharBackward();
if (ch != ')')
@@ -477,6 +565,10 @@
return true;
}
+ /*
+ * Skips the quoted characters
+ *
+ */
void skipQuotedChars(char pair) {
int ch = readCharBackward();
@@ -498,7 +590,11 @@
ch = readCharBackward();
}
}
-
+
+ /* Reads and returns the separator token from the expression
+ *
+ * @return
+ */
ELToken readSeparatorToken() {
fState = STATE_SEPARATOR;
int ch = readCharBackward();
@@ -507,6 +603,10 @@
ELToken.EOF);
}
+ /* Reads and returns the variable token from the expression
+ *
+ * @return
+ */
ELToken readVarToken() {
fState = STATE_VAR;
int endOfToken = index;
@@ -521,6 +621,10 @@
return (endOfToken - index > 0 ? new ELToken(index, endOfToken - index, getCharSequence(index, endOfToken - index), ELToken.EL_NAME_TOKEN) : ELToken.EOF);
}
+ /* Reads the next character in the document
+ *
+ * @return
+ */
int readCharBackward() {
if (--index < 0 ||
fDocument == null ||
@@ -534,12 +638,23 @@
}
}
+ /*
+ * returns the character to the document
+ */
void releaseChar() {
if (index < fDocument.getLength())
index++;
}
}
+ /**
+ * Calculates the EX expression operand string
+ *
+ * @param viewer
+ * @param offset
+ * @return
+ * @throws BadLocationException
+ */
public static String getPrefix(ITextViewer viewer, int offset) throws BadLocationException {
IDocument doc= viewer.getDocument();
if (doc == null || offset > doc.getLength())
@@ -553,9 +668,13 @@
return doc.get(tokens.get(0).start, offset - tokens.get(0).start);
}
+}
-
-}
+/**
+ * Token for the EX expression
+ *
+ * @author Jeremy
+ */
class ELToken implements IToken {
static final ELToken EOF = new ELToken(-1, -1, null, -1);
static final int EL_NAME_TOKEN = 1;
@@ -567,6 +686,14 @@
CharSequence chars;
int type;
+ /**
+ * Constructs the ELToken object
+ *
+ * @param start
+ * @param length
+ * @param chars
+ * @param type
+ */
public ELToken(int start, int length, CharSequence chars, int type) {
this.start = start;
this.length = length;
@@ -574,34 +701,58 @@
this.type = type;
}
+ /**
+ * Returns string representation for the token
+ */
public String toString() {
return "ELToken(" + start + ", " + length + ", " + type + ") [" + (chars == null ? "<Empty>" : chars.toString()) + "]";
}
+ /*
+ * @see org.eclipse.jface.text.rules.IToken#getData()
+ */
public Object getData() {
return (chars == null ? null : chars.subSequence(start, start+length).toString());
}
+ /*
+ * @see org.eclipse.jface.text.rules.IToken#isEOF()
+ */
public boolean isEOF() {
return (start == -1 && length == -1 && chars == null);
}
-
+
+ /*
+ * @see org.eclipse.jface.text.rules.IToken#isOther()
+ */
public boolean isOther() {
return false;
}
+ /*
+ * @see org.eclipse.jface.text.rules.IToken#isUndefined()
+ */
public boolean isUndefined() {
return false;
}
+ /*
+ * @see org.eclipse.jface.text.rules.IToken#isWhitespace()
+ */
public boolean isWhitespace() {
return false;
}
+ /*
+ * Returns the token type
+ */
public int getType(){
return type;
}
+ /*
+ * Returns the token text
+ */
public String getText() {
return chars.toString();
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELProposalComputer.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELProposalComputer.java 2007-07-13 17:59:36 UTC (rev 2436)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELProposalComputer.java 2007-07-13 18:17:19 UTC (rev 2437)
@@ -20,7 +20,11 @@
import org.eclipse.jface.text.contentassist.ICompletionProposal;
import org.eclipse.jface.text.contentassist.IContextInformation;
-
+/**
+ * Custom Java Completion Proposal computer
+ *
+ * @author Jeremy
+ */
public class SeamELProposalComputer implements IJavaCompletionProposalComputer {
/** The wrapped processor. */
private final SeamELProposalProcessor fProcessor= new SeamELProposalProcessor();
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 2007-07-13 17:59:36 UTC (rev 2436)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELProposalProcessor.java 2007-07-13 18:17:19 UTC (rev 2437)
@@ -45,7 +45,14 @@
import org.jboss.tools.common.text.ext.IEditorWrapper;
import org.jboss.tools.seam.core.ISeamProject;
import org.jboss.tools.seam.core.SeamCorePlugin;
+import org.jboss.tools.seam.ui.SeamGuiPlugin;
+/**
+ * Content assist proposal processor.
+ * Computes Seam EL proposals.
+ *
+ * @author Jeremy
+ */
public class SeamELProposalProcessor implements IContentAssistProcessor {
private static final ICompletionProposal[] NO_PROPOSALS= new ICompletionProposal[0];
@@ -63,62 +70,103 @@
fOffset= offset;
}
+ /*
+ * @see org.eclipse.jface.text.contentassist.ICompletionProposal#apply(IDocument)
+ */
public void apply(IDocument document) {
apply(null, '\0', 0, fOffset);
}
+ /*
+ * @see org.eclipse.jface.text.contentassist.ICompletionProposal#getSelection(IDocument)
+ */
public Point getSelection(IDocument document) {
return new Point(fOffset + fString.length(), 0);
}
+ /*
+ * @see org.eclipse.jface.text.contentassist.ICompletionProposal#getAdditionalProposalInfo()
+ */
public String getAdditionalProposalInfo() {
return null;
}
+ /*
+ * @see org.eclipse.jface.text.contentassist.ICompletionProposal#getDisplayString()
+ */
public String getDisplayString() {
return fPrefix + fString;
}
+ /*
+ * @see org.eclipse.jface.text.contentassist.ICompletionProposal#getImage()
+ */
public Image getImage() {
return SharedXMLEditorPluginImageHelper.getImage(SharedXMLEditorPluginImageHelper.IMG_OBJ_ATTRIBUTE);
}
+ /*
+ * @see org.eclipse.jface.text.contentassist.ICompletionProposal#getContextInformation()
+ */
public IContextInformation getContextInformation() {
return null;
}
+ /*
+ * @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension#apply(IDocument, char, int)
+ */
public void apply(IDocument document, char trigger, int offset) {
try {
String replacement= fString.substring(offset - fOffset);
document.replace(offset, 0, replacement);
} catch (BadLocationException x) {
- // TODO Auto-generated catch block
- x.printStackTrace();
+ SeamGuiPlugin.getPluginLog().logError(x);
}
}
+ /*
+ * @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension#isValidFor(IDocument, int)
+ */
public boolean isValidFor(IDocument document, int offset) {
return validate(document, offset, null);
}
+ /*
+ * @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension#getTriggerCharacters()
+ */
public char[] getTriggerCharacters() {
return null;
}
+ /*
+ * @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension#getContextInformationPosition()
+ */
public int getContextInformationPosition() {
return 0;
}
+ /*
+ * @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension2#apply(ITextViewer, char, int, int)
+ */
public void apply(ITextViewer viewer, char trigger, int stateMask, int offset) {
apply(viewer.getDocument(), trigger, offset);
}
+ /*
+ * @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension2#selected(ITextViewer, boolean)
+ */
public void selected(ITextViewer viewer, boolean smartToggle) {
}
+ /*
+ * @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension2#unselected(ITextViewer)
+ */
public void unselected(ITextViewer viewer) {
}
+ /*
+ * @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension2#validate(IDocument document, int offset, DocumentEvent event)
+ */
public boolean validate(IDocument document, int offset, DocumentEvent event) {
try {
int prefixStart= fOffset - fPrefix.length();
@@ -128,20 +176,32 @@
}
}
+ /*
+ * @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension3#getInformationControlCreator()
+ */
public IInformationControlCreator getInformationControlCreator() {
return null;
}
+ /*
+ * @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension3#getPrefixCompletionText(IDocument, int)
+ */
public CharSequence getPrefixCompletionText(IDocument document, int completionOffset) {
return fPrefix + fString;
}
+ /*
+ * @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension3#getPrefixCompletionStart(IDocument, int)
+ */
public int getPrefixCompletionStart(IDocument document, int completionOffset) {
return fOffset - fPrefix.length();
}
+ /*
+ * @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension4#isAutoInsertable()
+ */
public boolean isAutoInsertable() {
- return true;
+ return false;
}
}
@@ -195,6 +255,13 @@
}
}
+ /* Creates Proposal object
+ *
+ * @param string
+ * @param prefix
+ * @param offset
+ * @return
+ */
private ICompletionProposal createProposal(String string, String prefix, int offset) {
return new Proposal(string, prefix, offset);
}
@@ -252,6 +319,10 @@
return null; // no custom error message
}
+ /*
+ * Returns active text editor
+ * @return
+ */
private ITextEditor getActiveEditor() {
IWorkbenchWindow window= PlatformUI.getWorkbench().getActiveWorkbenchWindow();
if (window != null) {
@@ -270,6 +341,14 @@
return null;
}
+
+ /*
+ * Checks if the EL start starting characters are present
+ * @param viewer
+ * @param offset
+ * @return
+ * @throws BadLocationException
+ */
private boolean checkStartPositionInEL(ITextViewer viewer, int offset) throws BadLocationException {
IDocument doc= viewer.getDocument();
if (doc == null || offset > doc.getLength())
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamExpressionResolver.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamExpressionResolver.java 2007-07-13 17:59:36 UTC (rev 2436)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamExpressionResolver.java 2007-07-13 18:17:19 UTC (rev 2437)
@@ -34,14 +34,35 @@
import org.jboss.tools.seam.core.ISeamXmlFactory;
import org.jboss.tools.seam.core.ScopeType;
+/**
+ * Utility class used to resolve Seam project variables and to get the methods/properties and their presentation strings from type
+ *
+ * @author Jeremy
+ */
public class SeamExpressionResolver {
+ /**
+ * Returns Seam project variables which names start from specified value
+ *
+ * @param project
+ * @param scope
+ * @param name
+ * @return
+ */
public static List<ISeamContextVariable> resolveVariables(ISeamProject project, ScopeType scope, String name) {
if (project == null || name == null) return null;
return (scope == null ? internalResolveVariables(project, name) :
internalResolveVariablesByScope(project, scope, name));
}
+ /**
+ * Returns Seam project variables which names start from specified value
+ * No scope used
+ *
+ * @param project
+ * @param name
+ * @return
+ */
private static List<ISeamContextVariable> internalResolveVariables(ISeamProject project, String name) {
List<ISeamContextVariable> resolvedVariables = new ArrayList<ISeamContextVariable>();
Set<ISeamContextVariable> variables = project.getVariables();
@@ -53,6 +74,15 @@
return resolvedVariables;
}
+ /**
+ * Returns Seam project variables which names start from specified value
+ * Search is performed using scope
+ *
+ * @param project
+ * @param scope
+ * @param name
+ * @return
+ */
private static List<ISeamContextVariable> internalResolveVariablesByScope(ISeamProject project, ScopeType scope, String name) {
List<ISeamContextVariable> resolvedVariables = new ArrayList<ISeamContextVariable>();
Set<ISeamContextVariable> variables = project.getVariablesByScope(scope);
@@ -63,7 +93,13 @@
}
return resolvedVariables;
}
-
+
+ /**
+ * Returns the IMember for the variable specified
+ *
+ * @param variable
+ * @return
+ */
public static IMember getMemberByVariable(ISeamContextVariable variable) {
IMember member = null;
if (variable instanceof ISeamComponent) {
@@ -101,6 +137,12 @@
return member;
}
+ /**
+ * Returns the methods for the type specified
+ *
+ * @param type
+ * @return
+ */
public static Set<IMember> getMethods(IType type) {
Set<IMember> methods = new HashSet<IMember>();
if (type != null) {
@@ -120,6 +162,12 @@
return methods;
}
+ /**
+ * Returns the method presentation strings for the type specified
+ *
+ * @param type
+ * @return
+ */
public static Set<String> getMethodPresentations(IType type) {
Set<String> methods = new HashSet<String>();
if (type != null) {
@@ -151,6 +199,12 @@
return methods;
}
+ /**
+ * Returns the properties for the type specified
+ *
+ * @param type
+ * @return
+ */
public static Set<IMember> getProperties(IType type) {
Set<IMember> properties = new HashSet<IMember>();
if (type != null) {
@@ -180,6 +234,13 @@
}
return properties;
}
+
+ /**
+ * Returns the property presentation strings for the type specified
+ *
+ * @param type
+ * @return
+ */
public static Set<String> getPropertyPresentations(IType type) {
Set<String> properties = new TreeSet<String>(String.CASE_INSENSITIVE_ORDER);
if (type != null) {
@@ -214,5 +275,4 @@
}
return properties;
}
-
}
17 years, 5 months
JBoss Tools SVN: r2436 - trunk/common/plugins/org.jboss.tools.common.text.xml/META-INF.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2007-07-13 13:59:36 -0400 (Fri, 13 Jul 2007)
New Revision: 2436
Modified:
trunk/common/plugins/org.jboss.tools.common.text.xml/META-INF/MANIFEST.MF
Log:
http://jira.jboss.org/jira/browse/EXIN-330
The schema added due to allow the xml-editor configuration to load and use custom content assist processors dependig on the partition type.
Modified: trunk/common/plugins/org.jboss.tools.common.text.xml/META-INF/MANIFEST.MF
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.text.xml/META-INF/MANIFEST.MF 2007-07-13 16:16:01 UTC (rev 2435)
+++ trunk/common/plugins/org.jboss.tools.common.text.xml/META-INF/MANIFEST.MF 2007-07-13 17:59:36 UTC (rev 2436)
@@ -6,7 +6,9 @@
Bundle-Vendor: %providerName
Bundle-SymbolicName: org.jboss.tools.common.text.xml; singleton:=true
Bundle-Localization: plugin
-Provide-Package: org.jboss.tools.common.text.xml,
+Provide-Package: icons.xpl,
+ org.jboss.tools.common.text.xml,
+ org.jboss.tools.common.text.xml.contentassist,
org.jboss.tools.common.text.xml.internal.ui.preferencies,
org.jboss.tools.common.text.xml.internal.ui.xmleditor,
org.jboss.tools.common.text.xml.kb,
@@ -16,8 +18,7 @@
org.jboss.tools.jst.jsp.preferences,
org.jboss.tools.jst.jsp.preferences.xpl,
org.jboss.tools.jst.jsp.text,
- org.jboss.tools.jst.jsp.text.xpl,
- icons.xpl
+ org.jboss.tools.jst.jsp.text.xpl
Require-Bundle: org.jboss.tools.common,
org.eclipse.ui.ide,
org.eclipse.ui.editors,
17 years, 5 months
JBoss Tools SVN: r2435 - in trunk/seam/plugins/org.jboss.tools.seam.ui: META-INF and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2007-07-13 12:16:01 -0400 (Fri, 13 Jul 2007)
New Revision: 2435
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/META-INF/MANIFEST.MF
trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELCompletionEngine.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELProposalProcessor.java
Log:
http://jira.jboss.org/jira/browse/EXIN-330
Prompting Computer/Processor is added to be used in JSP Editor content assistants
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/META-INF/MANIFEST.MF 2007-07-13 16:14:23 UTC (rev 2434)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/META-INF/MANIFEST.MF 2007-07-13 16:16:01 UTC (rev 2435)
@@ -37,7 +37,8 @@
org.eclipse.jem.util,
org.eclipse.emf.ecore,
org.eclipse.jst.j2ee.ui,
- org.eclipse.jst.j2ee.web
+ org.eclipse.jst.j2ee.web,
+ org.eclipse.wst.xml.ui
Eclipse-LazyStart: true
Export-Package: org.jboss.tools.seam.ui,
org.jboss.tools.seam.ui.views,
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml 2007-07-13 16:14:23 UTC (rev 2434)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml 2007-07-13 16:16:01 UTC (rev 2435)
@@ -187,5 +187,24 @@
<partitiontype id="org.eclipse.wst.xml.XML_DEFAULT" />
</contentAssistProcessor>
</extension>
+
+ <extension
+ point="org.jboss.tools.common.text.xml.contentAssistProcessor"
+ id="org.jboss.tools.seam.ui.contentAssistProcessor"
+ name="org.jboss.tools.seam.ui.contentAssistProcessor">
+
+ <contentAssistProcessor
+ class="org.jboss.tools.seam.ui.text.java.SeamELProposalProcessor"
+ id="org.jboss.tools.seam.ui.text.java.SeamELProposalProcessor">
+ <partitiontype id="org.eclipse.wst.xml.XML_DEFAULT" />
+ <partitiontype id="org.eclipse.wst.html.HTML_DEFAULT" />
+ <partitiontype id="org.eclipse.jst.jsp.DEFAULT_JSP" />
+ <partitiontype id="org.eclipse.jst.jsp.JSP_DIRECTIVE" />
+ <partitiontype id="org.eclipse.jst.jsp.SCRIPT.DELIMITER" />
+ <partitiontype id="org.eclipse.jst.jsp.SCRIPT.JSP_EL" />
+ <partitiontype id="org.eclipse.jst.jsp.SCRIPT.JSP_EL2" />
+
+ </contentAssistProcessor>
+ </extension>
</plugin>
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELCompletionEngine.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELCompletionEngine.java 2007-07-13 16:14:23 UTC (rev 2434)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELCompletionEngine.java 2007-07-13 16:16:01 UTC (rev 2435)
@@ -58,7 +58,7 @@
List<ELToken> tokens = tokenizer.getTokens();
List<ELToken> resolvedExpressionPart = new ArrayList<ELToken>();
- List<ISeamContextVariable> resolvedVariables = null;
+ List<ISeamContextVariable> resolvedVariables = new ArrayList<ISeamContextVariable>();
ScopeType scope = getScope(project, file);
List<List<ELToken>> variations = getPossibleVarsFromPrefix(tokens);
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 2007-07-13 16:14:23 UTC (rev 2434)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELProposalProcessor.java 2007-07-13 16:16:01 UTC (rev 2435)
@@ -41,6 +41,7 @@
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.editors.text.EditorsUI;
import org.eclipse.ui.texteditor.ITextEditor;
+import org.eclipse.wst.xml.ui.internal.util.SharedXMLEditorPluginImageHelper;
import org.jboss.tools.common.text.ext.IEditorWrapper;
import org.jboss.tools.seam.core.ISeamProject;
import org.jboss.tools.seam.core.SeamCorePlugin;
@@ -79,7 +80,7 @@
}
public Image getImage() {
- return null;
+ return SharedXMLEditorPluginImageHelper.getImage(SharedXMLEditorPluginImageHelper.IMG_OBJ_ATTRIBUTE);
}
public IContextInformation getContextInformation() {
17 years, 5 months
JBoss Tools SVN: r2434 - trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2007-07-13 12:14:23 -0400 (Fri, 13 Jul 2007)
New Revision: 2434
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/ExtendedStructuredTextViewerConfigurationJSP.java
Log:
http://jira.jboss.org/jira/browse/EXIN-330
The schema added due to allow the jsp-editor configuration to load and use custom content assist processors dependig on the partition type.
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/ExtendedStructuredTextViewerConfigurationJSP.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/ExtendedStructuredTextViewerConfigurationJSP.java 2007-07-13 16:11:51 UTC (rev 2433)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/ExtendedStructuredTextViewerConfigurationJSP.java 2007-07-13 16:14:23 UTC (rev 2434)
@@ -29,6 +29,8 @@
import org.osgi.framework.Bundle;
import org.jboss.tools.common.model.plugin.ModelPlugin;
+import org.jboss.tools.common.text.xml.contentassist.ContentAssistProcessorBuilder;
+import org.jboss.tools.common.text.xml.contentassist.ContentAssistProcessorDefinition;
import org.jboss.tools.jst.jsp.contentassist.RedHatHtmlContentAssistProcessor;
import org.jboss.tools.jst.jsp.contentassist.RedHatJSPContentAssistProcessor;
@@ -42,15 +44,33 @@
}
protected IContentAssistProcessor[] getContentAssistProcessors(ISourceViewer sourceViewer, String partitionType) {
- if ((partitionType == IXMLPartitions.XML_DEFAULT) || (partitionType == IHTMLPartitions.HTML_DEFAULT) || (partitionType == IJSPPartitions.JSP_DEFAULT) || (partitionType == IJSPPartitions.JSP_DIRECTIVE) || (partitionType == IJSPPartitions.JSP_CONTENT_DELIMITER)) {
- return new RedHatJSPContentAssistProcessor[]{new RedHatJSPContentAssistProcessor()};
+ // if we have our own processors we need
+ // to define them in plugin.xml file of their
+ // plugins using extention point
+ // "org.jboss.tools.common.text.xml.contentAssistProcessor"
+
+ ContentAssistProcessorDefinition[] defs = ContentAssistProcessorBuilder.getInstance().getContentAssistProcessorDefinitions(partitionType);
+
+ if(defs==null) return null;
+
+ List processors = new ArrayList();
+ for(int i=0; i<defs.length; i++) {
+ IContentAssistProcessor processor = defs[i].createContentAssistProcessor();
+ if(!processors.contains(processor)) {
+ processors.add(processor);
+ }
}
- if(partitionType == IJSPPartitions.JSP_DEFAULT_EL) {
- return new RedHatJSPContentAssistProcessor[]{new RedHatJSPContentAssistProcessor()};
+
+ if ((partitionType == IXMLPartitions.XML_DEFAULT) ||
+ (partitionType == IHTMLPartitions.HTML_DEFAULT) ||
+ (partitionType == IJSPPartitions.JSP_DEFAULT) ||
+ (partitionType == IJSPPartitions.JSP_DIRECTIVE) ||
+ (partitionType == IJSPPartitions.JSP_CONTENT_DELIMITER) ||
+ (partitionType == IJSPPartitions.JSP_DEFAULT_EL) ||
+ (partitionType == IJSPPartitions.JSP_DEFAULT_EL2)) {
+ processors.add(new RedHatJSPContentAssistProcessor());
+ return (IContentAssistProcessor[])processors.toArray(new IContentAssistProcessor[0]);
}
- if(partitionType == IJSPPartitions.JSP_DEFAULT_EL2) {
- return new RedHatJSPContentAssistProcessor[]{new RedHatJSPContentAssistProcessor()};
- }
return super.getContentAssistProcessors(sourceViewer, partitionType);
}
17 years, 5 months