JBoss Tools SVN: r17612 - in trunk/common/plugins/org.jboss.tools.common.model: schema and 6 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-09-16 09:10:17 -0400 (Wed, 16 Sep 2009)
New Revision: 17612
Added:
trunk/common/plugins/org.jboss.tools.common.model/schema/modelnatures.exsd
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ModelNatureExtension.java
Removed:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/help/HelpPaletteHandler.java
Modified:
trunk/common/plugins/org.jboss.tools.common.model/plugin.xml
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/help/HelpUtil.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileSystemsTreeConstraint.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/handlers/RemoveModelNatureHandler.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ClassPathUpdate.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ModelNature.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/Watcher.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/EclipseResourceUtil.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/jst/web/tld/FilePathEncoderFactory.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4893
Modified: trunk/common/plugins/org.jboss.tools.common.model/plugin.xml
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/plugin.xml 2009-09-16 12:21:18 UTC (rev 17611)
+++ trunk/common/plugins/org.jboss.tools.common.model/plugin.xml 2009-09-16 13:10:17 UTC (rev 17612)
@@ -11,6 +11,7 @@
<extension-point id="resourceMapping" name="resourceMapping" schema="schema/resourceMapping.exsd"/>
<extension-point id="classes" name="Model Classes" schema="schema/classes.exsd"/>
<extension-point id="preferences" name="preferences" schema="schema/preferences.exsd"/>
+ <extension-point id="modelnatures" name="Model Natures" schema="schema/modelnatures.exsd"/>
<extension point="org.eclipse.wst.xml.core.catalogContributions">
<catalogContribution id="default">
Added: trunk/common/plugins/org.jboss.tools.common.model/schema/modelnatures.exsd
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/schema/modelnatures.exsd (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.model/schema/modelnatures.exsd 2009-09-16 13:10:17 UTC (rev 17612)
@@ -0,0 +1,126 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.jboss.tools.common.model" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appInfo>
+ <meta.schema plugin="org.jboss.tools.common.model" id="modelnatures" name="Model Natures"/>
+ </appInfo>
+ <documentation>
+ [Enter description of this extension point.]
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appInfo>
+ <meta.element />
+ </appInfo>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="modelnature"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute translatable="true"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="modelnature">
+ <complexType>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="displayName" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="pathEncoder" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ <attribute name="watcherContributor" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="since"/>
+ </appInfo>
+ <documentation>
+ [Enter the first release in which this extension point appears.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="examples"/>
+ </appInfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="apiinfo"/>
+ </appInfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="implementation"/>
+ </appInfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+
+</schema>
Property changes on: trunk/common/plugins/org.jboss.tools.common.model/schema/modelnatures.exsd
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/help/HelpPaletteHandler.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/help/HelpPaletteHandler.java 2009-09-16 12:21:18 UTC (rev 17611)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/help/HelpPaletteHandler.java 2009-09-16 13:10:17 UTC (rev 17612)
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and 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:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.common.meta.help;
-
-import java.util.*;
-import org.jboss.tools.common.model.*;
-
-public class HelpPaletteHandler extends HelpHandler {
-
- public HelpPaletteHandler() {}
-
- public void executeHandler(XModelObject object, Properties prop) throws XModelException {
- if(!isEnabled(object)) return;
- XModelObject tab = getTabObject(object);
- String key = (tab == null) ? null : tab.getModelEntity().getName() + "_" + tab.getPathPart().replace(' ', '_'); //$NON-NLS-1$
- if(key == null || !HelpUtil.hasHelp(key)) {
- super.executeHandler(object, prop);
- } else {
- HelpUtil.callHelp(object.getModel(), key);
- }
- }
-
- private XModelObject getTabObject(XModelObject object) {
- XModelObject tab = object;
- while(tab != null && !tab.getModelEntity().getName().startsWith("SharablePageTab")) //$NON-NLS-1$
- tab = tab.getParent();
- return tab;
- }
-
-}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/help/HelpUtil.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/help/HelpUtil.java 2009-09-16 12:21:18 UTC (rev 17611)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/help/HelpUtil.java 2009-09-16 13:10:17 UTC (rev 17612)
@@ -39,16 +39,6 @@
return path != null && path.length() > 0;
}
- public static void callHelp(XModel model, String key) throws XModelException {
- String u = (key == null) ? null : keys.getProperty(key);
- if(u == null) return;
- //if(u.endsWith("noHelpYet.html")) ModelPlugin.log("Help for key " + key + " is not available.");
- XModelObject editor = model.getByPath("%Options%/External Programs/Internet Browser"); //$NON-NLS-1$
- if(editor == null) throw new XModelException("External Program 'Internet Browser' is not set in Options.");
- String f = "" + model.getProperties().getProperty(XModelConstants.HOME) + "/doc/help" + u; //$NON-NLS-1$
- OpenWithExternalHandler.start("Help", f, editor); //$NON-NLS-1$
- }
-
public static boolean isHelpPluginInstalled() {
for (int i = 0; i < PLUGINS.length; i++)
if(Platform.getBundle(PLUGINS[i]) != null) return true;
@@ -76,22 +66,6 @@
return p;
}
- public static void help(XModel model, String key) {
- ServiceDialog d = model.getService();
- if(!hasHelp(key)) {
- d.showDialog(ModelMessages.WARNING,
- MessageFormat.format("Help for key {0} is not available.", key),
- new String[]{"Close"}, null, ServiceDialog.WARNING);
- } else {
- try {
- HelpUtil.callHelp(model, key);
- } catch (XModelException e) {
- d.showDialog(ModelMessages.WARNING, e.getMessage(),
- new String[]{"Close"}, null, ServiceDialog.WARNING);
- }
- }
- }
-
public static void helpEclipse(XModel model, String key) {
ServiceDialog d = model.getService();
if(!isHelpPluginInstalled()) {
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileSystemsTreeConstraint.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileSystemsTreeConstraint.java 2009-09-16 12:21:18 UTC (rev 17611)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileSystemsTreeConstraint.java 2009-09-16 13:10:17 UTC (rev 17612)
@@ -19,7 +19,7 @@
public void update(XModel model) {}
- String excludeExtensions = ".project.struts.classpath."; //$NON-NLS-1$
+ String excludeExtensions = ".project.classpath."; //$NON-NLS-1$
public boolean accepts(XModelObject object) {
String entity = object.getModelEntity().getName();
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/handlers/RemoveModelNatureHandler.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/handlers/RemoveModelNatureHandler.java 2009-09-16 12:21:18 UTC (rev 17611)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/handlers/RemoveModelNatureHandler.java 2009-09-16 13:10:17 UTC (rev 17612)
@@ -27,6 +27,7 @@
import org.jboss.tools.common.model.*;
import org.jboss.tools.common.model.filesystems.FileSystemsHelper;
import org.jboss.tools.common.model.project.IModelNature;
+import org.jboss.tools.common.model.project.ModelNatureExtension;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.common.util.FileUtil;
@@ -37,16 +38,24 @@
String nature = getNature(object);
if(nature == null) return false;
XActionImpl i = (XActionImpl)action;
- String n = (nature.indexOf("struts") > 0) ? "Struts" : //$NON-NLS-1$ //$NON-NLS-2$
- (nature.indexOf("jsf") > 0) ? "JSF" : "Model"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- i.setDisplayName(MessageFormat.format("Remove {0} Capabilities", n));
+ i.setDisplayName(MessageFormat.format("Remove {0} Capabilities", nature));
return true;
}
private String getNature(XModelObject object) {
IProject p = EclipseResourceUtil.getProject(object);
- IModelNature n = EclipseResourceUtil.getModelNature(p);
- return n == null ? null : n.getID();
+ ModelNatureExtension[] es = ModelNatureExtension.getInstances();
+ for (ModelNatureExtension ext: es) {
+ String name = ext.getName();
+ if(p != null && p.isAccessible()) try {
+ if(p.hasNature(name)) {
+ return ext.getDisplayName();
+ }
+ } catch (CoreException e) {
+
+ }
+ }
+ return null;
}
public void executeHandler(XModelObject object, Properties p) throws XModelException {
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ClassPathUpdate.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ClassPathUpdate.java 2009-09-16 12:21:18 UTC (rev 17611)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ClassPathUpdate.java 2009-09-16 13:10:17 UTC (rev 17612)
@@ -39,7 +39,7 @@
String entity = model.getRoot().getModelEntity().getName();
if("RootDummy".equals(entity)) { //$NON-NLS-1$
String pn = (project == null) ? "?" : project.getName(); //$NON-NLS-1$
- throw new IllegalArgumentException("Struts Project " + pn + " is corrupted."); //$NON-NLS-1$ //$NON-NLS-2$
+ throw new IllegalArgumentException("Project " + pn + " is corrupted."); //$NON-NLS-1$ //$NON-NLS-2$
}
this.model = model;
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ModelNature.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ModelNature.java 2009-09-16 12:21:18 UTC (rev 17611)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ModelNature.java 2009-09-16 13:10:17 UTC (rev 17612)
@@ -201,11 +201,13 @@
public static boolean checkModelNature(IProject project) {
if(project == null || !project.isOpen()) return false;
String nature = null;
+ ModelNatureExtension[] es = ModelNatureExtension.getInstances();
try {
- if(project.hasNature("org.jboss.tools.jsf.jsfnature")) { //$NON-NLS-1$
- nature = "org.jboss.tools.jsf.jsfnature"; //$NON-NLS-1$
- } else if(project.hasNature("org.jboss.tools.struts.strutsnature")) { //$NON-NLS-1$
- nature = "org.jboss.tools.struts.strutsnature"; //$NON-NLS-1$
+ for (ModelNatureExtension ext: es) {
+ if(project.hasNature(ext.getName())) {
+ nature = ext.getName();
+ break;
+ }
}
} catch (CoreException e) {
ModelPlugin.getPluginLog().logError(e);
Added: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ModelNatureExtension.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ModelNatureExtension.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ModelNatureExtension.java 2009-09-16 13:10:17 UTC (rev 17612)
@@ -0,0 +1,74 @@
+package org.jboss.tools.common.model.project;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtensionPoint;
+import org.eclipse.core.runtime.Platform;
+import org.jboss.tools.common.model.plugin.ModelPlugin;
+import org.jboss.tools.common.model.util.ModelFeatureFactory;
+import org.jboss.tools.jst.web.tld.IFilePathEncoder;
+
+public class ModelNatureExtension {
+ public static String EXTENSION_POINT = "org.jboss.tools.common.model.modelnatures"; //$NON-NLS-1$
+
+ String name;
+ String displayName;
+ String pathEncoder;
+ String watcherContributor;
+ IFilePathEncoder pathEncoderInstance;
+
+ public ModelNatureExtension() {}
+
+ public String getName() {
+ return name;
+ }
+
+ public String getDisplayName() {
+ return displayName;
+ }
+
+ public IFilePathEncoder getPathEncoder () {
+ if(pathEncoderInstance != null) {
+ return pathEncoderInstance;
+ }
+ if(pathEncoder == null) {
+ return null;
+ }
+ if(pathEncoder.length() == 0) {
+ pathEncoder = null;
+ return null;
+ }
+ try {
+ pathEncoderInstance = (IFilePathEncoder)ModelFeatureFactory.getInstance().createFeatureInstance(pathEncoder);
+ } catch (ClassCastException e) {
+ ModelPlugin.getPluginLog().logError(e);
+ } finally {
+ pathEncoder = null;
+ }
+ return pathEncoderInstance;
+ }
+
+ public String getWatcherContributor() {
+ return watcherContributor;
+ }
+
+ static ModelNatureExtension[] INSTANCES;
+
+ public static ModelNatureExtension[] getInstances() {
+ if(INSTANCES != null) return INSTANCES;
+ List<ModelNatureExtension> list = new ArrayList<ModelNatureExtension>();
+ IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint(EXTENSION_POINT);
+ IConfigurationElement[] es = point.getConfigurationElements();
+ for (IConfigurationElement e: es) {
+ ModelNatureExtension n = new ModelNatureExtension();
+ n.name = e.getAttribute("name"); //$NON-NLS-1$
+ n.displayName = e.getAttribute("displayName"); //$NON-NLS-1$
+ n.pathEncoder = e.getAttribute("pathEncoder"); //$NON-NLS-1$
+ n.watcherContributor = e.getAttribute("watcherContributor"); //$NON-NLS-1$
+ list.add(n);
+ }
+ return INSTANCES = list.toArray(new ModelNatureExtension[0]);
+ }
+}
Property changes on: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ModelNatureExtension.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/Watcher.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/Watcher.java 2009-09-16 12:21:18 UTC (rev 17611)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/Watcher.java 2009-09-16 13:10:17 UTC (rev 17612)
@@ -21,11 +21,6 @@
import org.jboss.tools.common.model.util.ModelFeatureFactory;
public class Watcher implements XModelTreeListener {
- static String[][] CONTRIBUTORS = new String[][]{
- {"org.jboss.tools.struts.webprj.model.helpers.sync.SyncProjectContext", "org.jboss.tools.struts.strutsnature"}, //$NON-NLS-1$ //$NON-NLS-2$
- {"org.jboss.tools.jsf.web.JSFWatcherContributor", "org.jboss.tools.jsf.jsfnature"} //$NON-NLS-1$ //$NON-NLS-2$
- };
-
public static Watcher getInstance(XModel model) {
Watcher instance = (Watcher)model.getManager("Watcher"); //$NON-NLS-1$
if(instance == null) {
@@ -59,13 +54,15 @@
void updateContributors() {
if(model == null) return;
- for (int i = 0; i < CONTRIBUTORS.length; i++) {
- String nature = CONTRIBUTORS[i][1];
+ ModelNatureExtension[] es = ModelNatureExtension.getInstances();
+ for (int i = 0; i < es.length; i++) {
+ String nature = es[i].getName();
if(EclipseResourceUtil.hasNature(model, nature)) {
if(contributors.containsKey(nature)) {
continue;
} else {
- Object watcher = ModelFeatureFactory.getInstance().createFeatureInstance(CONTRIBUTORS[i][0]);
+ String contributorName = es[i].getWatcherContributor();
+ Object watcher = ModelFeatureFactory.getInstance().createFeatureInstance(contributorName);
if(watcher instanceof IWatcherContributor) {
IWatcherContributor c = (IWatcherContributor)watcher;
c.init(model);
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/EclipseResourceUtil.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/EclipseResourceUtil.java 2009-09-16 12:21:18 UTC (rev 17611)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/EclipseResourceUtil.java 2009-09-16 13:10:17 UTC (rev 17612)
@@ -20,7 +20,6 @@
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Plugin;
import org.eclipse.jdt.core.*;
import org.eclipse.jdt.ui.PreferenceConstants;
@@ -41,6 +40,7 @@
import org.jboss.tools.common.model.plugin.ModelPlugin;
import org.jboss.tools.common.model.project.IModelNature;
import org.jboss.tools.common.model.project.ModelNature;
+import org.jboss.tools.common.model.project.ModelNatureExtension;
public class EclipseResourceUtil {
@@ -185,14 +185,11 @@
private static String[] MODEL_NATURES = new String[0];
static {
- List<String> natures = new ArrayList<String>();
- if(Platform.getBundle("org.jboss.tools.struts") != null) { //$NON-NLS-1$
- natures.add("org.jboss.tools.struts.strutsnature"); //$NON-NLS-1$
+ ModelNatureExtension[] es = ModelNatureExtension.getInstances();
+ MODEL_NATURES = new String[es.length];
+ for (int i = 0; i < es.length; i++) {
+ MODEL_NATURES[i] = es[i].getName();
}
- if(Platform.getBundle("org.jboss.tools.jsf") != null) { //$NON-NLS-1$
- natures.add("org.jboss.tools.jsf.jsfnature"); //$NON-NLS-1$
- }
- MODEL_NATURES = natures.toArray(new String[0]);
}
public static String[] getModelNatureNames() {
@@ -275,7 +272,7 @@
static Map<IProject,XModel> models = new HashMap<IProject,XModel>();
/**
- * If project has no struts nature, the method creates new instance of model
+ * If project has no model nature, the method creates new instance of model
* populates it with a filesystems corresponding to the project root
* and links, and returns model object for the resource.
* The model created is not complete project, so it has property
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/jst/web/tld/FilePathEncoderFactory.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/jst/web/tld/FilePathEncoderFactory.java 2009-09-16 12:21:18 UTC (rev 17611)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/jst/web/tld/FilePathEncoderFactory.java 2009-09-16 13:10:17 UTC (rev 17612)
@@ -12,26 +12,22 @@
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
-import org.jboss.tools.common.model.plugin.ModelPlugin;
-import org.jboss.tools.common.model.util.ModelFeatureFactory;
+import org.jboss.tools.common.model.project.ModelNatureExtension;
public class FilePathEncoderFactory {
- static IFilePathEncoder jsfEncoder = null;
- static {
- try {
- jsfEncoder = (IFilePathEncoder)ModelFeatureFactory.getInstance().createFeatureInstance("org.jboss.tools.jsf.model.helpers.pages.FilePathEncoder"); //$NON-NLS-1$
- } catch (ClassCastException e) {
- ModelPlugin.getPluginLog().logError(e);
- }
- }
-
public static IFilePathEncoder getEncoder(IProject project) {
if(project == null || !project.isOpen()) return null;
- try {
- if(project.hasNature("org.jboss.tools.jsf.jsfnature")) return jsfEncoder; //$NON-NLS-1$
- } catch (CoreException e) {
- //ignore - all checks are done above
+ ModelNatureExtension[] es = ModelNatureExtension.getInstances();
+ for (int i = 0; i < es.length; i++) {
+ try {
+ if(project.hasNature(es[i].getName())) {
+ IFilePathEncoder encoder = es[i].getPathEncoder();
+ if(encoder != null) return encoder;
+ }
+ } catch (CoreException e) {
+ //ignore - all checks are done above
+ }
}
return null;
}
15 years, 4 months
JBoss Tools SVN: r17611 - trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/refactoring.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2009-09-16 08:21:18 -0400 (Wed, 16 Sep 2009)
New Revision: 17611
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/refactoring/SeamRefactorContributionFactory.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4771
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/refactoring/SeamRefactorContributionFactory.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/refactoring/SeamRefactorContributionFactory.java 2009-09-16 11:56:53 UTC (rev 17610)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/refactoring/SeamRefactorContributionFactory.java 2009-09-16 12:21:18 UTC (rev 17611)
@@ -195,7 +195,7 @@
//
// additions.addContributionItem(mm, null);
// }
- checkPropertyName(selection, mm, additions);
+ //checkPropertyName(selection, mm, additions);
status = checkContextVariableInJava(editorFile, fileContent, selection);
} else if(XML_EXT.equalsIgnoreCase(ext) || XHTML_EXT.equalsIgnoreCase(ext) || JSP_EXT.equalsIgnoreCase(ext))
status = checkContextVariableInDOM(editorFile, fileContent, selection);
15 years, 4 months
JBoss Tools SVN: r17610 - trunk/smooks/plugins/org.jboss.tools.smooks.core/model.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2009-09-16 07:56:53 -0400 (Wed, 16 Sep 2009)
New Revision: 17610
Added:
trunk/smooks/plugins/org.jboss.tools.smooks.core/model/smooks-graphics-ext.xsd
Removed:
trunk/smooks/plugins/org.jboss.tools.smooks.core/model/smooks-graphics-ext.xsd
Log:
JBIDE-4878
Change the unit test case
Deleted: trunk/smooks/plugins/org.jboss.tools.smooks.core/model/smooks-graphics-ext.xsd
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.core/model/smooks-graphics-ext.xsd 2009-09-16 10:46:37 UTC (rev 17609)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.core/model/smooks-graphics-ext.xsd 2009-09-16 11:56:53 UTC (rev 17610)
@@ -1,92 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xs:schema
- targetNamespace="http://www.jboss.org/jbosstools/smooks/smooks-graphics-ext.xsd"
- elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"
- xmlns:ext="http://www.jboss.org/jbosstools/smooks/smooks-graphics-ext.xsd">
-
-
- <xs:annotation>
- <xs:documentation xml:lang="en">Smooks Graphics
- Editor Extention File Schema
-</xs:documentation>
- </xs:annotation>
-
- <xs:element name="smooks-graphics-ext">
- <xs:complexType>
- <xs:sequence>
- <xs:element ref="ext:input" minOccurs="0"
- maxOccurs="unbounded">
- </xs:element>
- <xs:element ref="ext:graph" minOccurs="0"
- maxOccurs="1">
- </xs:element>
- </xs:sequence>
- <xs:attribute name="inputType" type="xs:string"></xs:attribute>
- <xs:attribute name="outputType" type="xs:string"></xs:attribute>
- <xs:attribute name="platformVersion" type="xs:string"></xs:attribute>
- <xs:attribute name="name" type="xs:string"></xs:attribute>
- <xs:attribute name="author" type="xs:string"></xs:attribute>
- </xs:complexType>
- </xs:element>
-
- <xs:element name="input">
- <xs:complexType>
- <xs:sequence>
- <xs:element ref="ext:param" minOccurs="0"
- maxOccurs="unbounded">
- </xs:element>
- </xs:sequence>
- <xs:attribute name="type" type="xs:string"></xs:attribute>
- </xs:complexType>
- </xs:element>
-
- <xs:element name="param">
-
- <xs:complexType>
- <xs:simpleContent>
- <xs:extension base="xs:string">
- <xs:attribute name="type" type="xs:string" />
- <xs:attribute name="name" type="xs:string">
- </xs:attribute>
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
- </xs:element>
-
-
- <xs:element name="graph">
- <xs:complexType>
- <xs:sequence>
- <xs:element ref="ext:figure" maxOccurs="unbounded"
- minOccurs="0">
- </xs:element>
- <xs:element ref="ext:connection" minOccurs="0" maxOccurs="unbounded"></xs:element>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
-
- <xs:element name="figure">
- <xs:complexType>
- <xs:attribute name="id" type="xs:string"></xs:attribute>
- <xs:attribute name="x" type="xs:string"></xs:attribute>
- <xs:attribute name="y" type="xs:string"></xs:attribute>
- <xs:attribute name="width" type="xs:string"></xs:attribute>
- <xs:attribute name="height" type="xs:string"></xs:attribute>
- <xs:attribute name="parentFigureId" type="xs:string"></xs:attribute>
- </xs:complexType>
- </xs:element>
-
- <xs:element name="connection">
- <xs:complexType>
- <xs:sequence>
- <xs:element ref="ext:source" minOccurs="1" maxOccurs="1"></xs:element>
- <xs:element ref="ext:target" minOccurs="1" maxOccurs="1"></xs:element>
- </xs:sequence>
- <xs:attribute name="id" type="xs:string"></xs:attribute>
- </xs:complexType>
- </xs:element>
-
- <xs:element name="source" type="xs:string"></xs:element>
-
- <xs:element name="target" type="xs:string"></xs:element>
-</xs:schema>
\ No newline at end of file
Added: trunk/smooks/plugins/org.jboss.tools.smooks.core/model/smooks-graphics-ext.xsd
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.core/model/smooks-graphics-ext.xsd (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.core/model/smooks-graphics-ext.xsd 2009-09-16 11:56:53 UTC (rev 17610)
@@ -0,0 +1,102 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema
+ targetNamespace="http://www.jboss.org/jbosstools/smooks/smooks-graphics-ext.xsd"
+ elementFormDefault="qualified"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:ext="http://www.jboss.org/jbosstools/smooks/smooks-graphics-ext.xsd" xmlns:smooks="http://www.milyn.org/xsd/smooks-1.1.xsd">
+
+
+ <xs:import schemaLocation="smooks-1.1.xsd" namespace="http://www.milyn.org/xsd/smooks-1.1.xsd"></xs:import>
+ <xs:annotation>
+ <xs:documentation xml:lang="en">
+ Smooks Graphics Editor Extention File Schema
+ </xs:documentation>
+ </xs:annotation>
+
+ <xs:element name="smooks-graphics-ext" substitutionGroup="smooks:abstract-resource-config">
+ <xs:complexType>
+ <xs:complexContent>
+ <xs:extension base="smooks:abstract-resource-config">
+ <xs:sequence>
+ <xs:element ref="ext:input" minOccurs="0" maxOccurs="unbounded"></xs:element>
+ <xs:element ref="ext:graph" minOccurs="0" maxOccurs="1"></xs:element>
+ </xs:sequence>
+ <xs:attribute name="inputType" type="xs:string"></xs:attribute>
+ <xs:attribute name="outputType" type="xs:string"></xs:attribute>
+ <xs:attribute name="platformVersion"
+ type="xs:string">
+ </xs:attribute>
+ <xs:attribute name="name" type="xs:string"></xs:attribute>
+ <xs:attribute name="author" type="xs:string"></xs:attribute>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="input">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="ext:param" minOccurs="0"
+ maxOccurs="unbounded">
+ </xs:element>
+ </xs:sequence>
+ <xs:attribute name="type" type="xs:string"></xs:attribute>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="param">
+
+ <xs:complexType>
+ <xs:simpleContent>
+ <xs:extension base="xs:string">
+ <xs:attribute name="type" type="xs:string" />
+ <xs:attribute name="name" type="xs:string">
+ </xs:attribute>
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+ </xs:element>
+
+
+ <xs:element name="graph">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="ext:figure" maxOccurs="unbounded"
+ minOccurs="0">
+ </xs:element>
+ <xs:element ref="ext:connection" minOccurs="0"
+ maxOccurs="unbounded">
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="figure">
+ <xs:complexType>
+ <xs:attribute name="id" type="xs:string"></xs:attribute>
+ <xs:attribute name="x" type="xs:string"></xs:attribute>
+ <xs:attribute name="y" type="xs:string"></xs:attribute>
+ <xs:attribute name="width" type="xs:string"></xs:attribute>
+ <xs:attribute name="height" type="xs:string"></xs:attribute>
+ <xs:attribute name="parentFigureId" type="xs:string"></xs:attribute>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="connection">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="ext:source" minOccurs="1"
+ maxOccurs="1">
+ </xs:element>
+ <xs:element ref="ext:target" minOccurs="1"
+ maxOccurs="1">
+ </xs:element>
+ </xs:sequence>
+ <xs:attribute name="id" type="xs:string"></xs:attribute>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="source" type="xs:string"></xs:element>
+
+ <xs:element name="target" type="xs:string"></xs:element>
+</xs:schema>
\ No newline at end of file
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.core/model/smooks-graphics-ext.xsd
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15 years, 4 months
JBoss Tools SVN: r17609 - trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2009-09-16 06:46:37 -0400 (Wed, 16 Sep 2009)
New Revision: 17609
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRefactorSearcher.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameMethodParticipant.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4856
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRefactorSearcher.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRefactorSearcher.java 2009-09-16 07:55:52 UTC (rev 17608)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRefactorSearcher.java 2009-09-16 10:46:37 UTC (rev 17609)
@@ -337,4 +337,10 @@
return methodName;
}
+
+ public static boolean isSetter(String methodName){
+ if(methodName.startsWith(SET))
+ return true;
+ return false;
+ }
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameMethodParticipant.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameMethodParticipant.java 2009-09-16 07:55:52 UTC (rev 17608)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameMethodParticipant.java 2009-09-16 10:46:37 UTC (rev 17609)
@@ -47,7 +47,8 @@
@Override
public RefactoringStatus checkConditions(IProgressMonitor pm,
CheckConditionsContext context) throws OperationCanceledException {
- searcher.findELReferences();
+ if(searcher != null)
+ searcher.findELReferences();
return status;
}
@@ -71,7 +72,11 @@
rootChange = new CompositeChange("");
method = (IMethod)element;
+ if(!SeamRenameMethodSearcher.isSetter(method.getElementName()))
+ return false;
+
oldName = SeamRenameMethodSearcher.getPropertyName(method.getElementName());
+
newName = SeamRenameMethodSearcher.getPropertyName(getArguments().getNewName());
searcher = new SeamRenameMethodSearcher((IFile)method.getResource(), oldName);
return true;
@@ -104,7 +109,7 @@
if(!keys.contains(key)){
TextFileChange change = getChange(file);
TextEdit edit = new ReplaceEdit(offset, length, text);
- //change.addEdit(edit);
+ change.addEdit(edit);
keys.add(key);
}
}
15 years, 4 months
JBoss Tools SVN: r17608 - trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2009-09-16 03:55:52 -0400 (Wed, 16 Sep 2009)
New Revision: 17608
Modified:
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/MethodNotImplementedException.java
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/messages.properties
Log:
fix JUnit test error in CommonAllTests.testMethodNotImplementedException
Modified: trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/MethodNotImplementedException.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/MethodNotImplementedException.java 2009-09-16 06:50:46 UTC (rev 17607)
+++ trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/MethodNotImplementedException.java 2009-09-16 07:55:52 UTC (rev 17608)
@@ -17,7 +17,7 @@
public class MethodNotImplementedException extends RuntimeException {
public MethodNotImplementedException() {
- super("Method is not implemented yet"); //$NON-NLS-1$
+ super(Messages.MethodNotImplementedException_MethodIsNotImplementedYet); //$NON-NLS-1$
}
public MethodNotImplementedException(String message, Throwable cause) {
Modified: trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/messages.properties
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/messages.properties 2009-09-16 06:50:46 UTC (rev 17607)
+++ trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/messages.properties 2009-09-16 07:55:52 UTC (rev 17608)
@@ -4,4 +4,4 @@
SAXValidator_UnableToInstantiateMessage=error: Unable to instantiate parser ({0})
XMLUtilities_IOExceptionMessage=Unexpected parser error
XMLUtilities_SAXExceptionMessage=Unexpected parser error
-MethodNotImplementedException_MethodIsNotImplementedYet=Method is not implemented yet
+MethodNotImplementedException_MethodIsNotImplementedYet=Method is not implemented yet
15 years, 4 months
JBoss Tools SVN: r17607 - trunk/hibernatetools/plugins.
by jbosstools-commits@lists.jboss.org
Author: max.andersen(a)jboss.com
Date: 2009-09-16 02:50:46 -0400 (Wed, 16 Sep 2009)
New Revision: 17607
Removed:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.hblibs/
Log:
Delete non used plugin
15 years, 4 months
JBoss Tools SVN: r17606 - in trunk: common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver and 10 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2009-09-16 02:45:26 -0400 (Wed, 16 Sep 2009)
New Revision: 17606
Added:
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/IVariable.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/JavaMemberELSegment.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/ContextVariableELSegment.java
Removed:
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/ELResolver2.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELOperandResolveStatus.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/ELCompletionEngine.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELResolution.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELResolutionImpl.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.el.core/src/org/jboss/tools/common/el/core/resolver/ELSegment.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELSegmentImpl.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/JavaMemberELSegmentImpl.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSFELCompletionEngine.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSFImplicitObjectELResolver.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSFMessageELCompletionEngine.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/XmlContentAssistProcessor.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageProcessor.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/el/AbstractELCompletionEngine.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamContextVariable.java
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/SeamExpressionResolver.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamPromptingProvider.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamELValidator.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
trunk/seam/tests/org.jboss.tools.seam.ui.test/META-INF/MANIFEST.MF
Log:
https://jira.jboss.org/jira/browse/JBIDE-4860
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-09-16 06:09:18 UTC (rev 17605)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/META-INF/MANIFEST.MF 2009-09-16 06:45:26 UTC (rev 17606)
@@ -9,7 +9,9 @@
Export-Package: org.jboss.tools.common.el.core,
org.jboss.tools.common.el.core.model,
org.jboss.tools.common.el.core.parser,
- org.jboss.tools.common.el.core.resolver
+ org.jboss.tools.common.el.core.resolver,
+ org.jboss.tools.common.el.internal.core.parser,
+ org.jboss.tools.common.el.internal.core.parser.token
Bundle-Activator: org.jboss.tools.common.el.core.Activator
Require-Bundle: org.eclipse.jface.text,
org.eclipse.wst.sse.core,
Modified: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELCompletionEngine.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELCompletionEngine.java 2009-09-16 06:09:18 UTC (rev 17605)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELCompletionEngine.java 2009-09-16 06:45:26 UTC (rev 17606)
@@ -19,8 +19,8 @@
public interface ELCompletionEngine {
- public ELOperandResolveStatus resolveELOperand(IFile file, ELExpression operand,
+ public ELResolution resolveELOperand(IFile file, ELExpression operand,
boolean returnEqualedVariablesOnly, List<Var> vars, ElVarSearcher varSearcher) throws BadLocationException, StringIndexOutOfBoundsException;
public ELParserFactory getParserFactory();
-}
+}
\ No newline at end of file
Deleted: 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-09-16 06:09:18 UTC (rev 17605)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELOperandResolveStatus.java 2009-09-16 06:45:26 UTC (rev 17606)
@@ -1,166 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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.HashMap;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeSet;
-
-import org.jboss.tools.common.el.core.model.ELInvocationExpression;
-import org.jboss.tools.common.text.TextProposal;
-
-/**
- * Status of EL resolving.
- * @author Jeremy
- */
-public class ELOperandResolveStatus {
- private ELInvocationExpression tokens;
- Map<String, TypeInfoCollector.MethodInfo> unpairedGettersOrSetters;
- Set<TextProposal> proposals;
- private ELInvocationExpression lastResolvedToken;
- private boolean isMapOrCollectionOrBundleAmoungTheTokens = false;
- private TypeInfoCollector.MemberInfo memberOfResolvedOperand;
-
- /**
- * @return MemberInfo of last segment of EL operand. Null if El is not resolved.
- */
- public TypeInfoCollector.MemberInfo getMemberOfResolvedOperand() {
- return memberOfResolvedOperand;
- }
-
- /**
- * Sets MemberInfo for last segment of EL operand.
- * @param lastResolvedMember
- */
- public void setMemberOfResolvedOperand(
- TypeInfoCollector.MemberInfo lastResolvedMember) {
- this.memberOfResolvedOperand = lastResolvedMember;
- }
-
- /**
- * Constructor
- * @param tokens Tokens of EL
- */
- public ELOperandResolveStatus(ELInvocationExpression tokens) {
- this.tokens = tokens;
- }
-
- /**
- * @return true if EL contains any not parametrized Collection or ResourceBundle.
- */
- public boolean isMapOrCollectionOrBundleAmoungTheTokens() {
- return this.isMapOrCollectionOrBundleAmoungTheTokens;
- }
-
- public void setMapOrCollectionOrBundleAmoungTheTokens() {
- this.isMapOrCollectionOrBundleAmoungTheTokens = true;
- }
-
- /**
- * @return true if EL is resolved.
- */
- public boolean isOK() {
- return !getProposals().isEmpty() || isMapOrCollectionOrBundleAmoungTheTokens();
- }
-
- /**
- * @return false if El is not resolved.
- */
- public boolean isError() {
- return !isOK();
- }
-
- /**
- * @return List of resolved tokens of EL. Includes separators "."
- */
- public ELInvocationExpression getResolvedTokens() {
- return lastResolvedToken;
- }
-
- /**
- * @return List of unresolved tokens of EL.
- */
- public ELInvocationExpression getUnresolvedTokens() {
- if(lastResolvedToken == tokens) return null;
- if(lastResolvedToken != null && (lastResolvedToken.getParent() instanceof ELInvocationExpression)) {
- return (ELInvocationExpression)lastResolvedToken.getParent();
- }
- ELInvocationExpression l = tokens;
- while(l != null && l.getLeft() != lastResolvedToken) {
- l = l.getLeft();
- }
- return l;
- }
-
- /**
- * @return Last resolved token of EL. Can be separator "." // no, change it
- */
- public ELInvocationExpression getLastResolvedToken() {
- return lastResolvedToken;
- }
-
- /**
- * @param lastResolvedToken Last resolved token of EL. Can be separator "."
- */
- public void setLastResolvedToken(ELInvocationExpression lastResolvedToken) {
- this.lastResolvedToken = lastResolvedToken;
- }
-
- /**
- * @return Tokens of EL.
- */
- public ELInvocationExpression getTokens() {
- return tokens;
- }
-
- /**
- * @param tokens Tokens of EL.
- */
- public void setTokens(ELInvocationExpression tokens) {
- this.tokens = tokens;
- }
-
- /**
- *
- * @return Set of proposals for EL
- */
- public Set<TextProposal> getProposals() {
- return proposals == null ? new TreeSet<TextProposal>() : proposals;
- }
-
- /**
- * @param proposals Set of TextProposal proposals.
- */
- public void setProposals(Set<TextProposal> proposals) {
- this.proposals = proposals;
- }
-
- /**
- * @return Map of unpaired getters and setters (getters/setters without proper setters/getters).
- * of all properties used in EL.
- * Key - name of property.
- * Value - MethodInfo of existed getter/setter.
- */
- public Map<String, TypeInfoCollector.MethodInfo> getUnpairedGettersOrSetters() {
- if (unpairedGettersOrSetters == null) {
- unpairedGettersOrSetters = new HashMap<String, TypeInfoCollector.MethodInfo>();
- }
- return unpairedGettersOrSetters;
- }
-
- /**
- * Clear Map of unpaired getters and setters.
- */
- public void clearUnpairedGettersOrSetters() {
- getUnpairedGettersOrSetters().clear();
- }
-}
\ No newline at end of file
Modified: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELResolution.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELResolution.java 2009-09-16 06:09:18 UTC (rev 17605)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELResolution.java 2009-09-16 06:45:26 UTC (rev 17606)
@@ -58,5 +58,10 @@
/**
* @return true if there is any unresolved segment.
*/
- boolean hasUnresolvedSegment();
+ boolean isResolved();
+
+ /**
+ * @return last segment. May return null.
+ */
+ ELSegment getLastSegment();
}
\ No newline at end of file
Modified: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELResolutionImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELResolutionImpl.java 2009-09-16 06:09:18 UTC (rev 17605)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELResolutionImpl.java 2009-09-16 06:45:26 UTC (rev 17606)
@@ -11,10 +11,14 @@
package org.jboss.tools.common.el.core.resolver;
import java.util.ArrayList;
+import java.util.HashSet;
import java.util.List;
+import java.util.Set;
import org.eclipse.jdt.core.IJavaElement;
import org.jboss.tools.common.el.core.model.ELExpression;
+import org.jboss.tools.common.el.core.model.ELInvocationExpression;
+import org.jboss.tools.common.text.TextProposal;
/**
* @author Alexey Kazakov
@@ -24,6 +28,9 @@
protected ELContext context;
protected List<ELSegment> segments = new ArrayList<ELSegment>();
protected ELExpression operand;
+ protected Set<TextProposal> proposals = new HashSet<TextProposal>();
+ protected ELInvocationExpression lastResolvedToken;
+ protected boolean mapOrCollectionOrBundleAmoungTheTokens;
/* (non-Javadoc)
* @see org.jboss.tools.common.el.core.resolver.ELResolution#findSegmentByJavaElement(org.eclipse.jdt.core.IJavaElement)
@@ -74,15 +81,107 @@
* @see org.jboss.tools.common.el.core.resolver.ELResolution#getUnresolvedSegment()
*/
public ELSegment getUnresolvedSegment() {
- // TODO
+ for (ELSegment segment : segments) {
+ if(!segment.isResolved()) {
+ return segment;
+ }
+ }
return null;
}
/* (non-Javadoc)
- * @see org.jboss.tools.common.el.core.resolver.ELResolution#hasUnresolvedSegment()
+ * @see org.jboss.tools.common.el.core.resolver.ELResolution#isResolved()
*/
- public boolean hasUnresolvedSegment() {
- // TODO
- return false;
+ public boolean isResolved() {
+ return !segments.isEmpty() && getUnresolvedSegment()==null;
}
+
+ /**
+ * @return the proposals
+ */
+ public Set<TextProposal> getProposals() {
+ return proposals;
+ }
+
+ /**
+ * @param proposals the proposals to set
+ */
+ public void setProposals(Set<TextProposal> proposals) {
+ this.proposals = proposals;
+ }
+
+ /**
+ * @param operand the operand to set
+ */
+ public void setSourceOperand(ELExpression operand) {
+ this.operand = operand;
+ }
+
+ /**
+ * @param context the context to set
+ */
+ public void setContext(ELContext context) {
+ this.context = context;
+ }
+
+ /**
+ * @param segments the segments to set
+ */
+ public void setSegments(List<ELSegment> segments) {
+ this.segments = segments;
+ }
+
+ /**
+ * @return the lastResolvedToken
+ */
+ public ELInvocationExpression getLastResolvedToken() {
+ return lastResolvedToken;
+ }
+
+ /**
+ * @param lastResolvedToken the lastResolvedToken to set
+ */
+ public void setLastResolvedToken(ELInvocationExpression lastResolvedToken) {
+ this.lastResolvedToken = lastResolvedToken;
+ }
+
+ /**
+ * @return the operand
+ */
+ public ELExpression getOperand() {
+ return operand;
+ }
+
+ /**
+ * @param operand the operand to set
+ */
+ public void setOperand(ELExpression operand) {
+ this.operand = operand;
+ }
+
+ /**
+ * @return the mapOrCollectionOrBundleAmoungTheTokens
+ */
+ public boolean isMapOrCollectionOrBundleAmoungTheTokens() {
+ return mapOrCollectionOrBundleAmoungTheTokens;
+ }
+
+ /**
+ * @param mapOrCollectionOrBundleAmoungTheTokens the mapOrCollectionOrBundleAmoungTheTokens to set
+ */
+ public void setMapOrCollectionOrBundleAmoungTheTokens(
+ boolean mapOrCollectionOrBundleAmoungTheTokens) {
+ this.mapOrCollectionOrBundleAmoungTheTokens = mapOrCollectionOrBundleAmoungTheTokens;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.el.core.resolver.ELResolution#getLastSegment()
+ */
+ public ELSegment getLastSegment() {
+ if(!getSegments().isEmpty()) {
+ return getSegments().get(getSegments().size()-1);
+ }
+ return null;
+ }
}
\ No newline at end of file
Modified: 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 2009-09-16 06:09:18 UTC (rev 17605)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELResolver.java 2009-09-16 06:45:26 UTC (rev 17606)
@@ -16,25 +16,24 @@
import org.jboss.tools.common.text.TextProposal;
/**
- * Represents EL Resolver
+ * Represents EL Resolver.
+ * TODO replace old ELResolver interface with this one.
* @author Alexey Kazakov
*/
public interface ELResolver {
/**
- * @param elString
- * @param position
* @param context
- * @param returnEqualedVariablesOnly
- * @return
+ * @param el
+ * @return proposal list
*/
- List<TextProposal> getCompletions(String elString, boolean returnEqualedVariablesOnly, int position, ELContext context);
+ List<TextProposal> getProposals(ELContext context, String el);
/**
- *
- * @param operand
+ * Resolves EL operand.
* @param context
+ * @param operand
* @return
*/
- ELOperandResolveStatus resolveELOperand(ELExpression operand, ELContext context, boolean returnEqualedVariablesOnly);
+ ELResolution resolve(ELContext context, ELExpression operand);
}
\ No newline at end of file
Deleted: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELResolver2.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELResolver2.java 2009-09-16 06:09:18 UTC (rev 17605)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELResolver2.java 2009-09-16 06:45:26 UTC (rev 17606)
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * 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.
- * TODO replace old ELResolver interface with this one.
- * @author Alexey Kazakov
- */
-public interface ELResolver2 {
-
- /**
- * @param context
- * @param el
- * @return proposal list
- */
- List<TextProposal> getProposals(ELContext context, String el);
-
- /**
- * Resolves EL operand.
- * @param context
- * @param operand
- * @return
- */
- ELResolution resolve(ELContext context, ELExpression operand);
-}
\ No newline at end of file
Modified: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELSegment.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELSegment.java 2009-09-16 06:09:18 UTC (rev 17605)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELSegment.java 2009-09-16 06:45:26 UTC (rev 17606)
@@ -10,8 +10,10 @@
******************************************************************************/
package org.jboss.tools.common.el.core.resolver;
+import java.util.List;
+
import org.eclipse.core.resources.IResource;
-import org.jboss.tools.common.el.core.model.ELInvocationExpression;
+import org.jboss.tools.common.el.core.parser.LexicalToken;
import org.jboss.tools.common.model.project.ext.ITextSourceReference;
/**
@@ -23,7 +25,7 @@
/**
* @return source EL token.
*/
- ELInvocationExpression getToken();
+ LexicalToken getToken();
/**
* @return true if the segment has been resolved.
@@ -39,4 +41,9 @@
* @return source reference of underlying object.
*/
ITextSourceReference getSourceReference();
+
+ /**
+ * @return underlying variables.
+ */
+ List<IVariable> getVariables();
}
\ No newline at end of file
Modified: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELSegmentImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELSegmentImpl.java 2009-09-16 06:09:18 UTC (rev 17605)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELSegmentImpl.java 2009-09-16 06:45:26 UTC (rev 17606)
@@ -10,8 +10,11 @@
******************************************************************************/
package org.jboss.tools.common.el.core.resolver;
+import java.util.ArrayList;
+import java.util.List;
+
import org.eclipse.core.resources.IResource;
-import org.jboss.tools.common.el.core.model.ELInvocationExpression;
+import org.jboss.tools.common.el.core.parser.LexicalToken;
import org.jboss.tools.common.model.project.ext.ITextSourceReference;
/**
@@ -21,8 +24,9 @@
protected IResource resource;
protected ITextSourceReference sourceReference;
- protected ELInvocationExpression token;
+ protected LexicalToken token;
protected boolean resolved = false;
+ protected List<IVariable> variables = new ArrayList<IVariable>();
/* (non-Javadoc)
* @see org.jboss.tools.common.el.core.resolver.ELSegment#getResource()
@@ -41,7 +45,7 @@
/* (non-Javadoc)
* @see org.jboss.tools.common.el.core.resolver.ELSegment#getToken()
*/
- public ELInvocationExpression getToken() {
+ public LexicalToken getToken() {
return token;
}
@@ -69,7 +73,7 @@
/**
* @param token the token to set
*/
- public void setToken(ELInvocationExpression token) {
+ public void setToken(LexicalToken token) {
this.token = token;
}
@@ -79,4 +83,18 @@
public void setResolved(boolean resolved) {
this.resolved = resolved;
}
+
+ /**
+ * @return the variables
+ */
+ public List<IVariable> getVariables() {
+ return variables;
+ }
+
+ /**
+ * @param variable the variables to set
+ */
+ public void setVariables(List<IVariable> variables) {
+ this.variables = variables;
+ }
}
\ No newline at end of file
Added: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/IVariable.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/IVariable.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/IVariable.java 2009-09-16 06:45:26 UTC (rev 17606)
@@ -0,0 +1,22 @@
+/*******************************************************************************
+ * 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;
+
+/**
+ * @author Alexey Kazakov
+ */
+public interface IVariable {
+
+ /**
+ * @return name of the variable
+ */
+ String getName();
+}
\ 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/IVariable.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/JavaMemberELSegment.java (from rev 17567, trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/JavaMemberElSegment.java)
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/JavaMemberELSegment.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/JavaMemberELSegment.java 2009-09-16 06:45:26 UTC (rev 17606)
@@ -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 org.eclipse.jdt.core.IJavaElement;
+
+/**
+ * Describes a segment of EL operand which is a Java Element.
+ * @author Alexey Kazakov
+ */
+public interface JavaMemberELSegment extends ELSegment {
+
+ /**
+ * @return member info object of resolved segment. May return null.
+ */
+ TypeInfoCollector.MemberInfo getMemberInfo();
+
+ /**
+ * @return Java Element which represent this resolve segment. May return null.
+ */
+ IJavaElement getJavaElement();
+
+ /**
+ * @return true if an underlying object is field and this field has getter.
+ */
+ boolean hasGetter();
+
+ /**
+ * @return true if an underlying object is field and this field has setter.
+ */
+ boolean hasSetter();
+}
\ No newline at end of file
Modified: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/JavaMemberELSegmentImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/JavaMemberELSegmentImpl.java 2009-09-16 06:09:18 UTC (rev 17605)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/JavaMemberELSegmentImpl.java 2009-09-16 06:45:26 UTC (rev 17606)
@@ -10,18 +10,22 @@
******************************************************************************/
package org.jboss.tools.common.el.core.resolver;
+import java.util.HashMap;
+import java.util.Map;
+
import org.eclipse.jdt.core.IJavaElement;
import org.jboss.tools.common.el.core.resolver.TypeInfoCollector.MemberInfo;
/**
* @author Alexey Kazakov
*/
-public class JavaMemberELSegmentImpl extends ELSegmentImpl implements JavaMemberElSegment {
+public class JavaMemberELSegmentImpl extends ELSegmentImpl implements JavaMemberELSegment {
protected IJavaElement element;
protected MemberInfo memberInfo;
protected boolean hasSetter;
protected boolean hasGetter;
+ protected Map<String, TypeInfoCollector.MethodInfo> unpairedGettersOrSetters;
/* (non-Javadoc)
* @see org.jboss.tools.common.el.core.resolver.JavaMemberElSegment#getJavaElement()
@@ -55,6 +59,9 @@
* @return the element
*/
public IJavaElement getElement() {
+ if(element==null && memberInfo!=null) {
+ element = memberInfo.getJavaElement();
+ }
return element;
}
@@ -99,4 +106,24 @@
public void setMemberInfo(MemberInfo memberInfo) {
this.memberInfo = memberInfo;
}
+
+ /**
+ * @return Map of unpaired getters and setters (getters/setters without proper setters/getters).
+ * of all properties used in EL.
+ * Key - name of property.
+ * Value - MethodInfo of existed getter/setter.
+ */
+ public Map<String, TypeInfoCollector.MethodInfo> getUnpairedGettersOrSetters() {
+ if (unpairedGettersOrSetters == null) {
+ unpairedGettersOrSetters = new HashMap<String, TypeInfoCollector.MethodInfo>();
+ }
+ return unpairedGettersOrSetters;
+ }
+
+ /**
+ * Clear Map of unpaired getters and setters.
+ */
+ public void clearUnpairedGettersOrSetters() {
+ getUnpairedGettersOrSetters().clear();
+ }
}
\ No newline at end of file
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSFELCompletionEngine.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSFELCompletionEngine.java 2009-09-16 06:09:18 UTC (rev 17605)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSFELCompletionEngine.java 2009-09-16 06:45:26 UTC (rev 17606)
@@ -19,7 +19,7 @@
import org.jboss.tools.common.el.core.model.ELInvocationExpression;
import org.jboss.tools.common.el.core.parser.ELParserFactory;
import org.jboss.tools.common.el.core.parser.ELParserUtil;
-import org.jboss.tools.common.el.core.resolver.ELOperandResolveStatus;
+import org.jboss.tools.common.el.core.resolver.IVariable;
import org.jboss.tools.common.el.core.resolver.TypeInfoCollector;
import org.jboss.tools.common.model.project.IModelNature;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
@@ -65,15 +65,6 @@
/*
* (non-Javadoc)
- * @see org.jboss.tools.jst.web.kb.el.AbstractELCompletionEngine#newELOperandResolveStatus(org.jboss.tools.common.el.core.model.ELInvocationExpression)
- */
- @Override
- protected ELOperandResolveStatus newELOperandResolveStatus(ELInvocationExpression tokens) {
- return new ELOperandResolveStatus(tokens);
- }
-
- /*
- * (non-Javadoc)
* @see org.jboss.tools.jst.web.kb.el.AbstractELCompletionEngine#resolveVariables(org.eclipse.core.resources.IFile, org.jboss.tools.common.el.core.model.ELInvocationExpression, boolean, boolean)
*/
public List<IJSFVariable> resolveVariables(IFile file, ELInvocationExpression expr, boolean isFinal, boolean onlyEqualNames) {
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSFImplicitObjectELResolver.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSFImplicitObjectELResolver.java 2009-09-16 06:09:18 UTC (rev 17605)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSFImplicitObjectELResolver.java 2009-09-16 06:45:26 UTC (rev 17606)
@@ -28,6 +28,9 @@
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.ELParserUtil;
+import org.jboss.tools.common.el.core.resolver.ELResolution;
+import org.jboss.tools.common.el.core.resolver.ELSegment;
+import org.jboss.tools.common.el.core.resolver.JavaMemberELSegment;
import org.jboss.tools.common.el.core.resolver.TypeInfoCollector;
import org.jboss.tools.common.model.project.IModelNature;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
@@ -101,11 +104,17 @@
for (String var : elVars) {
try {
- TypeInfoCollector.MemberInfo info = resolveEL(file, IMPLICT_OBJECTS_ELS.get(var), false);
- if(info!=null) {
- IType type = info.getMemberType();
- if(type!=null) {
- resolvedVariables.add(new Variable(var, type));
+ ELResolution resolution = resolveEL(file, IMPLICT_OBJECTS_ELS.get(var), false);
+ if(resolution.isResolved()) {
+ ELSegment segment = resolution.getLastSegment();
+ if(segment instanceof JavaMemberELSegment) {
+ TypeInfoCollector.MemberInfo info = ((JavaMemberELSegment)segment).getMemberInfo();
+ if(info!=null) {
+ IType type = info.getMemberType();
+ if(type!=null) {
+ resolvedVariables.add(new Variable(var, type));
+ }
+ }
}
}
} catch (StringIndexOutOfBoundsException e) {
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSFMessageELCompletionEngine.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSFMessageELCompletionEngine.java 2009-09-16 06:09:18 UTC (rev 17605)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSFMessageELCompletionEngine.java 2009-09-16 06:45:26 UTC (rev 17606)
@@ -32,8 +32,11 @@
import org.jboss.tools.common.el.core.parser.ELParserFactory;
import org.jboss.tools.common.el.core.parser.ELParserUtil;
import org.jboss.tools.common.el.core.resolver.ELContext;
-import org.jboss.tools.common.el.core.resolver.ELOperandResolveStatus;
+import org.jboss.tools.common.el.core.resolver.ELResolution;
+import org.jboss.tools.common.el.core.resolver.ELResolutionImpl;
import org.jboss.tools.common.el.core.resolver.ELResolver;
+import org.jboss.tools.common.el.core.resolver.ELSegmentImpl;
+import org.jboss.tools.common.el.core.resolver.IVariable;
import org.jboss.tools.common.model.XModel;
import org.jboss.tools.common.model.project.IModelNature;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
@@ -62,8 +65,12 @@
JSFModelPlugin.getPluginLog().logError(e);
}
- protected ELOperandResolveStatus newELOperandResolveStatus(ELInvocationExpression tokens) {
- return new ELOperandResolveStatus(tokens);
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.el.core.resolver.ELResolver2#getProposals(org.jboss.tools.common.el.core.resolver.ELContext, java.lang.String)
+ */
+ public List<TextProposal> getProposals(ELContext context, String el) {
+ return getCompletions(el, false, 0, context);
}
public List<TextProposal> getCompletions(String elString,
@@ -87,30 +94,39 @@
return proposals;
}
- public ELOperandResolveStatus resolveELOperand(ELExpression operand,
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.el.core.resolver.ELResolver2#resolve(org.jboss.tools.common.el.core.resolver.ELContext, org.jboss.tools.common.el.core.model.ELExpression)
+ */
+ public ELResolution resolve(ELContext context, ELExpression operand) {
+ ELResolutionImpl resolution = resolveELOperand(operand, context, true);
+ resolution.setContext(context);
+ return resolution;
+ }
+
+ public ELResolutionImpl resolveELOperand(ELExpression operand,
ELContext context, boolean returnEqualedVariablesOnly) {
- ELOperandResolveStatus status = null;
IResourceBundle[] bundles = new IResourceBundle[0];
if(context instanceof IPageContext) {
IPageContext pageContext = (IPageContext)context;
bundles = pageContext.getResourceBundles();
}
try {
- status = resolveELOperand(context.getResource(), operand, returnEqualedVariablesOnly, bundles);
+ return resolveELOperand(context.getResource(), operand, returnEqualedVariablesOnly, bundles);
} catch (StringIndexOutOfBoundsException e) {
log(e);
} catch (BadLocationException e) {
log(e);
}
- return status;
+ return null;
}
public List<TextProposal> getCompletions(IFile file, IDocument document, CharSequence prefix,
int position, boolean returnEqualedVariablesOnly, IResourceBundle[] bundles) throws BadLocationException, StringIndexOutOfBoundsException {
List<TextProposal> completions = new ArrayList<TextProposal>();
-
- ELOperandResolveStatus status = resolveELOperand(file, parseOperand("" + prefix), returnEqualedVariablesOnly, bundles); //$NON-NLS-1$
- if (status.isOK()) {
+
+ ELResolutionImpl status = resolveELOperand(file, parseOperand("" + prefix), returnEqualedVariablesOnly, bundles); //$NON-NLS-1$
+ if (status.isResolved()) {
completions.addAll(status.getProposals());
}
@@ -127,11 +143,11 @@
return is.get(0).getExpression();
}
- public ELOperandResolveStatus resolveELOperand(IFile file,
+ public ELResolutionImpl resolveELOperand(IFile file,
ELExpression operand, boolean returnEqualedVariablesOnly, IResourceBundle[] bundles)
throws BadLocationException, StringIndexOutOfBoundsException {
if(!(operand instanceof ELInvocationExpression) || file == null) {
- return newELOperandResolveStatus(null);
+ return null;
}
ELInvocationExpression expr = (ELInvocationExpression)operand;
@@ -139,7 +155,8 @@
&& ((ELPropertyInvocation)expr).getName() == null;
boolean isArgument = expr.getType() == ELObjectType.EL_ARGUMENT_INVOCATION;
- ELOperandResolveStatus status = newELOperandResolveStatus(expr);
+ ELResolutionImpl resolution = new ELResolutionImpl();
+ resolution.setOperand(expr);
ELInvocationExpression left = expr;
List<Variable> resolvedVariables = new ArrayList<Variable>();
@@ -161,14 +178,14 @@
returnEqualedVariablesOnly);
if (resolvedVars != null && !resolvedVars.isEmpty()) {
resolvedVariables = resolvedVars;
- status.setLastResolvedToken(left);
+ resolution.setLastResolvedToken(left);
break;
}
left = (ELInvocationExpression)left.getLeft();
}
}
- if (status.getResolvedTokens() == null &&
+ if (resolution.getLastResolvedToken() == null &&
!returnEqualedVariablesOnly &&
expr != null &&
isIncomplete) {
@@ -176,6 +193,12 @@
// the tokens are the part of var name ended with a separator (.)
resolvedVariables = resolveVariables(file, expr, bundles, true, returnEqualedVariablesOnly);
Set<TextProposal> proposals = new TreeSet<TextProposal>(TextProposal.KB_PROPOSAL_ORDER);
+
+ ELSegmentImpl segment = new ELSegmentImpl();
+ segment.setToken(expr.getFirstToken());
+ segment.setResolved(false);
+ resolution.addSegment(segment);
+
for (Variable var : resolvedVariables) {
String varName = var.getName();
if(varName.startsWith(operand.getText())) {
@@ -185,15 +208,20 @@
proposals.add(proposal);
}
}
- status.setProposals(proposals);
- return status;
+ resolution.setProposals(proposals);
+ return resolution;
}
// Here we have a list of vars for some part of expression
// OK. we'll proceed with members of these vars
- if (status.getResolvedTokens() == status.getTokens()) {
+ if (resolution.getLastResolvedToken() == operand) {
// First segment is the last one
Set<TextProposal> proposals = new TreeSet<TextProposal>(TextProposal.KB_PROPOSAL_ORDER);
+ ELSegmentImpl segment = new ELSegmentImpl();
+ segment.setToken(operand.getFirstToken());
+ segment.setResolved(true);
+ resolution.addSegment(segment);
+
for (Variable var : resolvedVariables) {
String varName = var.getName();
if(operand.getLength()<=varName.length()) {
@@ -207,24 +235,28 @@
setImage(proposal);
proposals.add(proposal);
}
+ segment.getVariables().add(var);
}
- status.setLastResolvedToken(expr);
- status.setProposals(proposals);
- return status;
+ resolution.setLastResolvedToken(expr);
+ resolution.setProposals(proposals);
+ return resolution;
}
//process segments one by one
if(left != null) while(left != expr) {
left = (ELInvocationExpression)left.getParent();
if (left != expr) { // inside expression
- return status;
+ ELSegmentImpl segment = new ELSegmentImpl();
+ segment.setResolved(false);
+ resolution.addSegment(segment);
+ return resolution;
} else { // Last segment
- resolveLastSegment((ELInvocationExpression)operand, resolvedVariables, status, returnEqualedVariablesOnly);
+ resolveLastSegment((ELInvocationExpression)operand, resolvedVariables, resolution, returnEqualedVariablesOnly);
break;
}
}
- return status;
+ return resolution;
}
public List<Variable> resolveVariables(IFile file, ELInvocationExpression expr, IResourceBundle[] bundles, boolean isFinal, boolean onlyEqualNames) {
@@ -267,10 +299,19 @@
protected void resolveLastSegment(ELInvocationExpression expr,
List<Variable> members,
- ELOperandResolveStatus status,
+ ELResolutionImpl resolution,
boolean returnEqualedVariablesOnly) {
Set<TextProposal> kbProposals = new TreeSet<TextProposal>(TextProposal.KB_PROPOSAL_ORDER);
-
+
+ ELSegmentImpl segment = new ELSegmentImpl();
+ resolution.setProposals(kbProposals);
+ if(expr instanceof ELPropertyInvocation) {
+ segment.setToken(((ELPropertyInvocation)expr).getName());
+ }
+ if(segment.getToken()!=null) {
+ resolution.addSegment(segment);
+ }
+
if (expr.getType() == ELObjectType.EL_PROPERTY_INVOCATION && ((ELPropertyInvocation)expr).getName() == null) {
// return all the methods + properties
for (Variable mbr : members) {
@@ -293,7 +334,7 @@
kbProposal.setReplacementString(proposal);
setImage(kbProposal);
-
+
kbProposals.add(kbProposal);
break;
@@ -311,8 +352,8 @@
Set<String> proposalsToFilter = new TreeSet<String>();
boolean isMessages = false;
for (Variable mbr : members) {
- isMessages = true;
- filterSingularMember(mbr, proposalsToFilter);
+ isMessages = true;
+ filterSingularMember(mbr, proposalsToFilter);
}
String filter = expr.getMemberName();
@@ -329,20 +370,22 @@
filter = filter.substring(1);
} else {
//Value is set as expression itself, we cannot compute it
- if(isMessages) status.setMapOrCollectionOrBundleAmoungTheTokens();
+ if(isMessages) {
+ resolution.setMapOrCollectionOrBundleAmoungTheTokens(true);
+ }
return;
}
}
-
+
for (String proposal : proposalsToFilter) {
if(returnEqualedVariablesOnly) {
// This is used for validation.
if (proposal.equals(filter)) {
TextProposal kbProposal = new TextProposal();
kbProposal.setReplacementString(proposal);
-
+
setImage(kbProposal);
-
+
kbProposals.add(kbProposal);
break;
@@ -350,48 +393,48 @@
} else if (proposal.startsWith(filter)) {
// This is used for CA.
TextProposal kbProposal = new TextProposal();
-
+
String replacementString = proposal.substring(filter.length());
if (bSurroundWithQuotes) {
replacementString = "'" + replacementString + "']"; //$NON-NLS-1$ //$NON-NLS-2$
}
-
+
kbProposal.setReplacementString(replacementString);
kbProposal.setImage(getELProposalImage());
-
+
kbProposals.add(kbProposal);
}
}
}
- status.setProposals(kbProposals);
- if (status.isOK()){
- status.setLastResolvedToken(expr);
+ segment.setResolved(!kbProposals.isEmpty());
+ if (resolution.isResolved()){
+ resolution.setLastResolvedToken(expr);
}
}
protected void processSingularMember(Variable mbr, Set<TextProposal> kbProposals) {
- // Surround the "long" keys containing the dots with [' ']
- TreeSet<String> keys = new TreeSet<String>(String.CASE_INSENSITIVE_ORDER);
- keys.addAll(mbr.getKeys());
- Iterator<String> sortedKeys = keys.iterator();
- while(sortedKeys.hasNext()) {
- String key = sortedKeys.next();
- if (key == null || key.length() == 0)
- continue;
- if (key.indexOf('.') != -1) {
- TextProposal proposal = new TextProposal();
- proposal.setReplacementString("['" + key + "']"); //$NON-NLS-1$ //$NON-NLS-2$
- setImage(proposal);
-
- kbProposals.add(proposal);
- } else {
- TextProposal proposal = new TextProposal();
- proposal.setReplacementString(key);
- setImage(proposal);
-
- kbProposals.add(proposal);
- }
+ // Surround the "long" keys containing the dots with [' ']
+ TreeSet<String> keys = new TreeSet<String>(String.CASE_INSENSITIVE_ORDER);
+ keys.addAll(mbr.getKeys());
+ Iterator<String> sortedKeys = keys.iterator();
+ while(sortedKeys.hasNext()) {
+ String key = sortedKeys.next();
+ if (key == null || key.length() == 0)
+ continue;
+ if (key.indexOf('.') != -1) {
+ TextProposal proposal = new TextProposal();
+ proposal.setReplacementString("['" + key + "']"); //$NON-NLS-1$ //$NON-NLS-2$
+ setImage(proposal);
+
+ kbProposals.add(proposal);
+ } else {
+ TextProposal proposal = new TextProposal();
+ proposal.setReplacementString(key);
+ setImage(proposal);
+
+ kbProposals.add(proposal);
}
+ }
}
protected void filterSingularMember(Variable mbr, Set<String> proposalsToFilter) {
@@ -401,11 +444,11 @@
}
}
- static class Variable {
+ static class Variable implements IVariable {
IFile f;
String name;
String basename;
-
+
public Variable(String name, String basename, IFile f) {
this.name = name;
this.basename = basename;
@@ -415,11 +458,11 @@
public String getName() {
return name;
}
-
+
public String getBasename() {
return basename;
}
-
+
public Collection<String> getKeys() {
TreeSet<String> result = new TreeSet<String>();
IModelNature n = EclipseResourceUtil.getModelNature(f.getProject());
@@ -433,5 +476,4 @@
return result;
}
}
-
-}
+}
\ No newline at end of file
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/XmlContentAssistProcessor.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/XmlContentAssistProcessor.java 2009-09-16 06:09:18 UTC (rev 17605)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/XmlContentAssistProcessor.java 2009-09-16 06:45:26 UTC (rev 17606)
@@ -22,7 +22,7 @@
import org.jboss.tools.common.el.core.resolver.ELCompletionEngine;
import org.jboss.tools.common.el.core.resolver.ELContext;
import org.jboss.tools.common.el.core.resolver.ELContextImpl;
-import org.jboss.tools.common.el.core.resolver.ELOperandResolveStatus;
+import org.jboss.tools.common.el.core.resolver.ELResolution;
import org.jboss.tools.common.el.core.resolver.ELResolver;
import org.jboss.tools.common.el.core.resolver.ElVarSearcher;
import org.jboss.tools.common.el.core.resolver.Var;
@@ -55,15 +55,15 @@
}
protected void setVars(ELContextImpl context, IFile file) {
- ELCompletionEngine fakeEngine = new ELCompletionEngine(){
-
- public ELOperandResolveStatus resolveELOperand(IFile file,
+ ELCompletionEngine fakeEngine = new ELCompletionEngine() {
+
+ public ELResolution resolveELOperand(IFile file,
ELExpression operand, boolean returnEqualedVariablesOnly,
List<Var> vars, ElVarSearcher varSearcher)
throws BadLocationException, StringIndexOutOfBoundsException {
return null;
}
-
+
public ELParserFactory getParserFactory() {
return ELParserUtil.getJbossFactory();
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageProcessor.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageProcessor.java 2009-09-16 06:09:18 UTC (rev 17605)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageProcessor.java 2009-09-16 06:45:26 UTC (rev 17606)
@@ -95,7 +95,7 @@
String elString = value;
ELResolver[] resolvers = context.getElResolvers();
for (int i = 0; resolvers != null && i < resolvers.length; i++) {
- proposals.addAll(resolvers[i].getCompletions(elString, !query.isMask(), query.getOffset(), context));
+ proposals.addAll(resolvers[i].getProposals(context, elString));
}
}
return proposals.toArray(new TextProposal[proposals.size()]);
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/el/AbstractELCompletionEngine.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/el/AbstractELCompletionEngine.java 2009-09-16 06:09:18 UTC (rev 17605)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/el/AbstractELCompletionEngine.java 2009-09-16 06:45:26 UTC (rev 17606)
@@ -17,12 +17,10 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IMember;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.core.Signature;
import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
import org.eclipse.swt.graphics.Image;
import org.jboss.tools.common.el.core.model.ELArgumentInvocation;
import org.jboss.tools.common.el.core.model.ELExpression;
@@ -38,22 +36,25 @@
import org.jboss.tools.common.el.core.parser.LexicalToken;
import org.jboss.tools.common.el.core.resolver.ELCompletionEngine;
import org.jboss.tools.common.el.core.resolver.ELContext;
-import org.jboss.tools.common.el.core.resolver.ELOperandResolveStatus;
+import org.jboss.tools.common.el.core.resolver.ELResolution;
+import org.jboss.tools.common.el.core.resolver.ELResolutionImpl;
import org.jboss.tools.common.el.core.resolver.ELResolver;
+import org.jboss.tools.common.el.core.resolver.ELSegment;
+import org.jboss.tools.common.el.core.resolver.ELSegmentImpl;
import org.jboss.tools.common.el.core.resolver.ElVarSearcher;
+import org.jboss.tools.common.el.core.resolver.IVariable;
+import org.jboss.tools.common.el.core.resolver.JavaMemberELSegment;
+import org.jboss.tools.common.el.core.resolver.JavaMemberELSegmentImpl;
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.el.core.resolver.TypeInfoCollector.MemberPresentation;
+import org.jboss.tools.common.el.internal.core.parser.token.JavaNameTokenDescription;
import org.jboss.tools.common.text.TextProposal;
-import org.jboss.tools.jst.web.kb.IPageContext;
+import org.jboss.tools.jst.web.kb.WebKbPlugin;
-public abstract class AbstractELCompletionEngine<V extends AbstractELCompletionEngine.IVariable> implements ELResolver, ELCompletionEngine {
+public abstract class AbstractELCompletionEngine<V extends IVariable> implements ELResolver, ELCompletionEngine {
- public static interface IVariable {
- public String getName();
- }
-
public AbstractELCompletionEngine() {}
public abstract Image getELProposalImage();
@@ -62,14 +63,35 @@
/*
* (non-Javadoc)
- * @see org.jboss.tools.common.el.core.resolver.ELResolver#getCompletions(java.lang.String, boolean, int, org.jboss.tools.common.el.core.resolver.ELContext)
+ * @see org.jboss.tools.common.el.core.resolver.ELResolver2#getProposals(org.jboss.tools.common.el.core.resolver.ELContext, java.lang.String)
*/
- public List<TextProposal> getCompletions(String elString, boolean returnEqualedVariablesOnly, int position, ELContext context) {
- IDocument document = null;
- if(context instanceof IPageContext) {
- IPageContext pageContext = (IPageContext)context;
- document = pageContext.getDocument();
+ public List<TextProposal> getProposals(ELContext context, String el) {
+ return getCompletions(el, false, 0, context);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.el.core.resolver.ELResolver2#resolve(org.jboss.tools.common.el.core.resolver.ELContext, org.jboss.tools.common.el.core.model.ELExpression)
+ */
+ public ELResolution resolve(ELContext context, ELExpression operand) {
+ List<Var> vars = new ArrayList<Var>();
+ Var[] array = context.getVars();
+ for (int i = 0; i < array.length; i++) {
+ vars.add(array[i]);
}
+ ELResolutionImpl resolution = null;
+ try {
+ resolution = resolveELOperand(context.getResource(), operand, true, vars, new ElVarSearcher(context.getResource(), this));
+ resolution.setContext(context);
+ } catch (StringIndexOutOfBoundsException e) {
+ log(e);
+ } catch (BadLocationException e) {
+ log(e);
+ }
+ return resolution;
+ }
+
+ private List<TextProposal> getCompletions(String elString, boolean returnEqualedVariablesOnly, int position, ELContext context) {
List<Var> vars = new ArrayList<Var>();
Var[] array = context.getVars();
for (int i = 0; i < array.length; i++) {
@@ -77,7 +99,7 @@
}
List<TextProposal> proposals = null;
try {
- proposals = getCompletions(context.getResource(), document, elString.subSequence(0, elString.length()), position, returnEqualedVariablesOnly, vars);
+ proposals = getCompletions(context.getResource(), elString.subSequence(0, elString.length()), position, returnEqualedVariablesOnly, vars);
} catch (StringIndexOutOfBoundsException e) {
log(e);
} catch (BadLocationException e) {
@@ -108,37 +130,30 @@
* @throws BadLocationException if accessing the current document fails
* @throws StringIndexOutOfBoundsException
*/
- public List<TextProposal> getCompletions(IFile file, IDocument document, CharSequence prefix,
+ public List<TextProposal> getCompletions(IFile file, CharSequence prefix,
int position, boolean returnEqualedVariablesOnly, List<Var> vars) throws BadLocationException, StringIndexOutOfBoundsException {
List<TextProposal> completions = new ArrayList<TextProposal>();
-
- ELOperandResolveStatus status = resolveELOperand(file, parseOperand("" + prefix), returnEqualedVariablesOnly, vars, new ElVarSearcher(file, this)); //$NON-NLS-1$
- if (status.isOK()) {
- completions.addAll(status.getProposals());
- }
+ ELResolutionImpl resolution = resolveELOperand(file, parseOperand("" + prefix), returnEqualedVariablesOnly, vars, new ElVarSearcher(file, this)); //$NON-NLS-1$
+ completions.addAll(resolution.getProposals());
+
return completions;
}
- /*
- * (non-Javadoc)
- * @see org.jboss.tools.common.el.core.resolver.ELResolver#resolveELOperand(org.jboss.tools.common.el.core.model.ELExpression, org.jboss.tools.common.el.core.resolver.ELContext, boolean)
- */
- public ELOperandResolveStatus resolveELOperand(ELExpression operand, ELContext context, boolean returnEqualedVariablesOnly) {
+ public ELResolution resolveELOperand(ELExpression operand, ELContext context, boolean returnEqualedVariablesOnly) {
List<Var> vars = new ArrayList<Var>();
Var[] array = context.getVars();
for (int i = 0; i < array.length; i++) {
vars.add(array[i]);
}
- ELOperandResolveStatus status = null;
try {
- status = resolveELOperand(context.getResource(), operand, returnEqualedVariablesOnly, vars, new ElVarSearcher(context.getResource(), this));
+ return resolveELOperand(context.getResource(), operand, returnEqualedVariablesOnly, vars, new ElVarSearcher(context.getResource(), this));
} catch (StringIndexOutOfBoundsException e) {
log(e);
} catch (BadLocationException e) {
log(e);
}
- return status;
+ return null;
}
public ELExpression parseOperand(String operand) {
@@ -169,17 +184,13 @@
return proposals;
}
- protected ELOperandResolveStatus newELOperandResolveStatus(ELInvocationExpression tokens) {
- return new ELOperandResolveStatus(tokens);
- }
-
- public ELOperandResolveStatus resolveELOperand(IFile file,
+ public ELResolutionImpl resolveELOperand(IFile file,
ELExpression operand, boolean returnEqualedVariablesOnly,
List<Var> vars, ElVarSearcher varSearcher)
throws BadLocationException, StringIndexOutOfBoundsException {
if(operand == null) {
//TODO
- return newELOperandResolveStatus(null);
+ return null;
}
String oldEl = operand.getText();
Var var = varSearcher.findVarForEl(oldEl, vars, true);
@@ -187,8 +198,15 @@
String newEl = oldEl;
TypeInfoCollector.MemberInfo member = null;
boolean isArray = false;
+ ELResolution varELResolution = null;
if(var!=null) {
- member = resolveEL(file, var.getElToken(), true);
+ varELResolution = resolveEL(file, var.getElToken(), true);
+ if(varELResolution!=null && varELResolution.isResolved()) {
+ ELSegment segment = varELResolution.getLastSegment();
+ if(segment instanceof JavaMemberELSegment) {
+ member = ((JavaMemberELSegment)segment).getMemberInfo();
+ }
+ }
if(member!=null) {
if(!member.getType().isArray()) {
IType type = member.getMemberType();
@@ -221,62 +239,84 @@
: parseOperand(newEl))
: operand;
- ELOperandResolveStatus status = resolveELOperand(file, newOperand, returnEqualedVariablesOnly, prefixWasChanged);
+ ELResolutionImpl resolution = resolveELOperand(file, newOperand, returnEqualedVariablesOnly, prefixWasChanged);
if(prefixWasChanged) {
- ELInvocationExpression newLastResolvedToken = status.getLastResolvedToken();
- status.setTokens((ELInvocationExpression)operand);
- if(newLastResolvedToken != null) {
- if(status.getUnresolvedTokens() != null
- && status.getUnresolvedTokens().getInvocationStartPosition() - status.getUnresolvedTokens().getStartPosition() < var.getElToken().getLength() + suffix.length()) {
- // Last resolved token is token from "var". Set first token of original EL as last resolved one.
- status.setLastResolvedToken(null);
+ resolution.setSourceOperand(operand);
+
+ // Replace segment which came from var resolution to original first segment.
+ LexicalToken firstOriginalToken = operand.getFirstToken();
+ LexicalToken nextOriginalToken = firstOriginalToken;
+ List<ELSegment> newSegments = resolution.getSegments();
+ List<ELSegment> resultSegments = new ArrayList<ELSegment>();
+ int startSuffix = var.getElToken().getText().length();
+ int endSuffix = startSuffix + suffix.length();
+ ELSegment firstSegment = null;
+ for (ELSegment segment : newSegments) {
+ int startPosition = segment.getToken().getStart();
+ if(startPosition>=endSuffix) {
+ resultSegments.add(segment);
+ nextOriginalToken = nextOriginalToken.findTokenForward(JavaNameTokenDescription.JAVA_NAME);
+ ((ELSegmentImpl)segment).setToken(nextOriginalToken);
} else {
- // Last resolved token is token outside "var" prefix. Correct last resolved token.
- int oldLastResolvedTokenStart = newLastResolvedToken.getInvocationStartPosition() - var.getElToken().getText().length() - suffix.length() + var.getName().length();
- if(newLastResolvedToken.getLeft() == null) {
- //In this case we do not need to take into account difference in length of var and its expression.
- oldLastResolvedTokenStart = newLastResolvedToken.getInvocationStartPosition();
- }
- ELInvocationExpression l = (ELInvocationExpression)operand;
- while(l != null) {
- if(l.getInvocationStartPosition() - l.getStartPosition() <= oldLastResolvedTokenStart) {
- status.setLastResolvedToken(l);
- break;
- }
- l = l.getLeft();
- }
+ firstSegment = segment;
+ ((ELSegmentImpl)firstSegment).setToken(firstOriginalToken);
+// if(firstSegment instanceof JavaMemberELSegmentImpl) {
+// JavaMemberELSegmentImpl javaSegment = (JavaMemberELSegmentImpl) firstSegment;
+// MemberInfo m = javaSegment.getMemberInfo();
+// if(m!=null) {
+// TypeInfoCollector.Type t = m.getType();
+// if(t!=null) {
+// javaSegment.setElement(t.getSource());
+// }
+// }
+// }
}
+ }
+
+ if(firstSegment!=null && firstSegment.isResolved()) {
+ resultSegments.add(0, firstSegment);
+ resolution.setSegments(resultSegments);
var.resolveValue("#{" + var.getElToken().getText() + suffix + "}"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ ELResolutionImpl oldElResolution = resolveELOperand(file, operand, returnEqualedVariablesOnly, false);
+ resolution.getProposals().addAll(oldElResolution.getProposals());
+ } else {
+ resolution = resolveELOperand(file, operand, returnEqualedVariablesOnly, false);
}
+ }
- ELOperandResolveStatus oldElStatus = resolveELOperand(file, operand, returnEqualedVariablesOnly, false);
- status.getProposals().addAll(oldElStatus.getProposals());
- }
-
// JBIDE-512, JBIDE-2541 related changes ===>>>
if(!returnEqualedVariablesOnly && vars!=null) {
for (Var v : vars) {
String prefix = operand.toString();
if(v.getName().startsWith(prefix)) {
- MemberInfo memberInfo = resolveEL(file, v.getElToken(), true, vars, varSearcher);
+ ELResolution r = resolveEL(file, v.getElToken(), true, vars, varSearcher);
+ ELSegment lastSegment = r.getLastSegment();
+ MemberInfo memberInfo = null;
+ if(lastSegment instanceof JavaMemberELSegment) {
+ memberInfo = ((JavaMemberELSegment)lastSegment).getMemberInfo();
+ }
+
String sourceTypeName = memberInfo == null ? null : memberInfo.getDeclaringTypeQualifiedName();
- if (sourceTypeName != null && sourceTypeName.indexOf('.') != -1)
+ if (sourceTypeName != null && sourceTypeName.indexOf('.') != -1) {
sourceTypeName = Signature.getSimpleName(sourceTypeName);
+ }
String typeName = memberInfo == null ? null : memberInfo.getType().getName();
- if (typeName != null && typeName.indexOf('.') != -1)
+ if (typeName != null && typeName.indexOf('.') != -1) {
typeName = Signature.getSimpleName(typeName);
-
+ }
+
IJavaElement element = memberInfo == null ? null : memberInfo.getJavaElement();
String attachedJavaDoc = null;
-
+
try {
- attachedJavaDoc = element == null ? null : element.getAttachedJavadoc(null);
+ attachedJavaDoc = element == null ? null : element.getAttachedJavadoc(null);
} catch (JavaModelException e) {
- // Ignore
+ WebKbPlugin.getDefault().logError(e);
}
-
+
String varNameProposal = v.getName().substring(prefix.length());
TextProposal proposal = new TextProposal();
proposal.setLabel(v.getName());
@@ -286,58 +326,57 @@
proposal.setType(typeName);
proposal.setSourceType(sourceTypeName);
proposal.setContextInfo(attachedJavaDoc);
- status.getProposals().add(proposal);
+ resolution.getProposals().add(proposal);
}
}
}
// <<<=== JBIDE-512, JBIDE-2541 related changes
-
- return status;
+ return resolution;
}
/**
- * Returns MemberInfo for last segment of EL. Null if El is not resolved.
+ * Returns ELResolution for EL.
* @param seamProject
* @param file
* @param operand EL without #{}
- * @return MemberInfo for last segment of EL. Null if El is not resolved.
+ * Returns ELResolution for EL.
* @throws BadLocationException
* @throws StringIndexOutOfBoundsException
*/
- public TypeInfoCollector.MemberInfo resolveEL(IFile file, ELExpression operand, boolean varIsUsed) throws BadLocationException, StringIndexOutOfBoundsException {
+ public ELResolution resolveEL(IFile file, ELExpression operand, boolean varIsUsed) throws BadLocationException, StringIndexOutOfBoundsException {
if(!(operand instanceof ELInvocationExpression)) return null;
- ELOperandResolveStatus status = resolveELOperand(file, operand, true, varIsUsed);
- return status.getMemberOfResolvedOperand();
+ return resolveELOperand(file, operand, true, varIsUsed);
}
/**
- * Returns MemberInfo for last segment of EL. Null if El is not resolved.
+ * Returns ELResolution for EL.
* @param seamProject
* @param file
* @param operand EL without #{}
- * @return MemberInfo for last segment of EL. Null if El is not resolved.
+ * @return ELResolution for EL.
* @throws BadLocationException
* @throws StringIndexOutOfBoundsException
*/
- public TypeInfoCollector.MemberInfo resolveEL(IFile file, ELExpression operand, boolean returnEqualedVariablesOnly, List<Var> vars, ElVarSearcher varSearcher) throws BadLocationException, StringIndexOutOfBoundsException {
+ public ELResolution resolveEL(IFile file, ELExpression operand, boolean returnEqualedVariablesOnly, List<Var> vars, ElVarSearcher varSearcher) throws BadLocationException, StringIndexOutOfBoundsException {
if(!(operand instanceof ELInvocationExpression)) return null;
- ELOperandResolveStatus status = resolveELOperand(file, operand, returnEqualedVariablesOnly, vars, varSearcher);
- return status.getMemberOfResolvedOperand();
+ return resolveELOperand(file, operand, returnEqualedVariablesOnly, vars, varSearcher);
}
-
- public ELOperandResolveStatus resolveELOperand(IFile file, ELExpression operand,
+
+ public ELResolutionImpl resolveELOperand(IFile file, ELExpression operand,
boolean returnEqualedVariablesOnly, boolean varIsUsed) throws BadLocationException, StringIndexOutOfBoundsException {
if(!(operand instanceof ELInvocationExpression) || file == null) {
- return newELOperandResolveStatus(null);
+ return null;
}
+ ELResolutionImpl resolution = new ELResolutionImpl();
+ resolution.setSourceOperand(operand);
+
ELInvocationExpression expr = (ELInvocationExpression)operand;
boolean isIncomplete = expr.getType() == ELObjectType.EL_PROPERTY_INVOCATION
&& ((ELPropertyInvocation)expr).getName() == null;
boolean isArgument = expr.getType() == ELObjectType.EL_ARGUMENT_INVOCATION;
- ELOperandResolveStatus status = newELOperandResolveStatus(expr);
ELInvocationExpression left = expr;
List<V> resolvedVariables = new ArrayList<V>();
@@ -359,19 +398,14 @@
returnEqualedVariablesOnly);
if (resolvedVars != null && !resolvedVars.isEmpty()) {
resolvedVariables = resolvedVars;
- status.setLastResolvedToken(left);
+ resolution.setLastResolvedToken(left);
break;
}
left = (ELInvocationExpression)left.getLeft();
}
}
- // Save all resolved variables. It's useful for incremental validation.
- if(resolvedVariables != null && !resolvedVariables.isEmpty()) {
- setUsedVariables(status, resolvedVariables);
- }
-
- if (status.getResolvedTokens() == null &&
+ if (resolution.getLastResolvedToken() == null &&
!returnEqualedVariablesOnly &&
expr != null &&
isIncomplete) {
@@ -380,26 +414,31 @@
resolvedVariables = resolveVariables(file, expr, true, returnEqualedVariablesOnly);
Set<TextProposal> proposals = new TreeSet<TextProposal>(TextProposal.KB_PROPOSAL_ORDER);
+ JavaMemberELSegmentImpl segment = new JavaMemberELSegmentImpl();
+ segment.setToken(expr.getFirstToken());
+ segment.setResolved(false);
+ resolution.addSegment(segment);
for (V var : resolvedVariables) {
String varName = var.getName();
if(varName.startsWith(operand.getText())) {
// JBIDE-512, JBIDE-2541 related changes ===>>>
+
MemberInfo member = getMemberInfoByVariable(var, true);
-
+
String sourceTypeName = member == null ? null : member.getDeclaringTypeQualifiedName();
if (sourceTypeName != null && sourceTypeName.indexOf('.') != -1)
sourceTypeName = Signature.getSimpleName(sourceTypeName);
String typeName = member == null ? null : member.getType().getName();
if (typeName != null && typeName.indexOf('.') != -1)
typeName = Signature.getSimpleName(typeName);
-
+
IJavaElement element = member == null ? null : member.getJavaElement();
String attachedJavaDoc = null;
-
+
try {
- attachedJavaDoc = element == null ? null : element.getAttachedJavadoc(null);
+ attachedJavaDoc = element == null ? null : element.getAttachedJavadoc(null);
} catch (JavaModelException e) {
- // Ignore
+ WebKbPlugin.getDefault().logError(e);
}
TextProposal proposal = new TextProposal();
@@ -409,27 +448,33 @@
proposal.setType(typeName);
proposal.setSourceType(sourceTypeName);
proposal.setContextInfo(attachedJavaDoc);
-
+
proposals.add(proposal);
// <<<=== JBIDE-512, JBIDE-2541 related changes
}
}
- status.setProposals(proposals);
- return status;
+ resolution.setProposals(proposals);
+ return resolution;
}
// Here we have a list of vars for some part of expression
// OK. we'll proceed with members of these vars
- if (status.getResolvedTokens() == status.getTokens()) {
+ if (resolution.getLastResolvedToken() == operand) {
// First segment is the last one
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.
// See https://jira.jboss.org/jira/browse/JBIDE-3694
-
+
// JBIDE-512, JBIDE-2541 related changes ===>>>
TypeInfoCollector.MemberInfo bijectedAttribute = null;
+
+ JavaMemberELSegmentImpl segment = new JavaMemberELSegmentImpl();
+ segment.setToken(operand.getFirstToken());
+ segment.setResolved(true);
+ resolution.addSegment(segment);
+
for (V var : resolvedVariables) {
if(isSingularAttribute(var)) {
bijectedAttribute = getMemberInfoByVariable(var, true);
@@ -443,11 +488,11 @@
typeName = Signature.getSimpleName(typeName);
IJavaElement element = member == null ? null : member.getJavaElement();
String attachedJavaDoc = null;
-
+
try {
attachedJavaDoc = element == null ? null : element.getAttachedJavadoc(null);
} catch (JavaModelException e) {
- // Ignore
+ WebKbPlugin.getDefault().logError(e);
}
String varName = var.getName();
@@ -470,71 +515,89 @@
proposal.setContextInfo(attachedJavaDoc);
proposals.add(proposal);
}
- status.setMemberOfResolvedOperand(bijectedAttribute!=null?bijectedAttribute:getMemberInfoByVariable(var, true));
+ segment.setMemberInfo(bijectedAttribute!=null?bijectedAttribute:getMemberInfoByVariable(var, true));
+ segment.getVariables().add(var);
}
// <<<=== JBIDE-512, JBIDE-2541 related changes
- status.setLastResolvedToken(expr);
- status.setProposals(proposals);
- return status;
+ resolution.setLastResolvedToken(expr);
+ resolution.setProposals(proposals);
+ return resolution;
}
// First segment is found - proceed with next tokens
List<TypeInfoCollector.MemberInfo> members = new ArrayList<TypeInfoCollector.MemberInfo>();
+ JavaMemberELSegmentImpl segment = new JavaMemberELSegmentImpl();
+ segment.setToken(expr.getFirstToken());
for (V var : resolvedVariables) {
TypeInfoCollector.MemberInfo member = getMemberInfoByVariable(var, returnEqualedVariablesOnly);
- if (member != null && !members.contains(member))
+ if (member != null && !members.contains(member)) {
members.add(member);
+ segment.setMemberInfo(member);
+ segment.getVariables().add(var);
+ segment.setResolved(true);
+ }
}
+ resolution.addSegment(segment);
//process segments one by one
- if(left != null) while(left != expr) {
- left = (ELInvocationExpression)left.getParent();
- if (left != expr) { // inside expression
- if(left instanceof ELArgumentInvocation) {
- String s = "#{" + left.getLeft().toString() + collectionAdditionForCollectionDataModel + "}"; //$NON-NLS-1$ //$NON-NLS-2$
- ELParser p = getParserFactory().createParser();
- ELInvocationExpression expr1 = (ELInvocationExpression)p.parse(s).getInstances().get(0).getExpression();
- members = resolveSegment(expr1.getLeft(), members, status, returnEqualedVariablesOnly, varIsUsed);
- members = resolveSegment(expr1, members, status, returnEqualedVariablesOnly, varIsUsed);
- if(status.getLastResolvedToken() == expr1) {
- status.setLastResolvedToken(left);
+ if(left != null) {
+ while(left != expr) {
+ left = (ELInvocationExpression)left.getParent();
+ if (left != expr) { // inside expression
+ segment = new JavaMemberELSegmentImpl();
+ segment.setResolved(true);
+ if(left instanceof ELArgumentInvocation) {
+ String s = "#{" + left.getLeft().toString() + collectionAdditionForCollectionDataModel + "}"; //$NON-NLS-1$ //$NON-NLS-2$
+ ELParser p = getParserFactory().createParser();
+ ELInvocationExpression expr1 = (ELInvocationExpression)p.parse(s).getInstances().get(0).getExpression();
+ members = resolveSegment(expr1.getLeft(), members, resolution, returnEqualedVariablesOnly, varIsUsed, segment);
+ members = resolveSegment(expr1, members, resolution, returnEqualedVariablesOnly, varIsUsed, segment);
+ if(resolution.getLastResolvedToken() == expr1) {
+ resolution.setLastResolvedToken(left);
+ }
+ } else {
+ members = resolveSegment(left, members, resolution, returnEqualedVariablesOnly, varIsUsed, segment);
}
- } else {
- members = resolveSegment(left, members, status, returnEqualedVariablesOnly, varIsUsed);
+ if(!members.isEmpty()) {
+ segment.setMemberInfo(members.get(0));
+ }
+ resolution.addSegment(segment);
+ } else { // Last segment
+ resolveLastSegment((ELInvocationExpression)operand, members, resolution, returnEqualedVariablesOnly, varIsUsed);
+ break;
}
- } else { // Last segment
- resolveLastSegment((ELInvocationExpression)operand, members, status, returnEqualedVariablesOnly, varIsUsed);
- break;
}
}
- if(status.getProposals().isEmpty() && status.getUnpairedGettersOrSetters()!=null) {
- status.clearUnpairedGettersOrSetters();
+ if(resolution.getProposals().isEmpty() && !resolution.getSegments().isEmpty()) {
+// && status.getUnpairedGettersOrSetters()!=null) {
+ ELSegment lastSegment = resolution.getSegments().get(resolution.getSegments().size()-1);
+ if(lastSegment instanceof JavaMemberELSegmentImpl) {
+ ((JavaMemberELSegmentImpl)lastSegment).clearUnpairedGettersOrSetters();
+ }
}
- return status;
+ return resolution;
}
abstract public List<V> resolveVariables(IFile file, ELInvocationExpression expr, boolean isFinal, boolean onlyEqualNames);
abstract protected TypeInfoCollector.MemberInfo getMemberInfoByVariable(V var, boolean onlyEqualNames);
- protected void setUsedVariables(ELOperandResolveStatus status, List<V> resolvedVariables) {
- }
-
protected boolean isSingularAttribute(V var) {
return false;
}
protected List<TypeInfoCollector.MemberInfo> resolveSegment(ELInvocationExpression expr,
List<TypeInfoCollector.MemberInfo> members,
- ELOperandResolveStatus status,
- boolean returnEqualedVariablesOnly, boolean varIsUsed) {
+ ELResolutionImpl resolution,
+ boolean returnEqualedVariablesOnly, boolean varIsUsed, JavaMemberELSegmentImpl segment) {
LexicalToken lt = (expr instanceof ELPropertyInvocation)
? ((ELPropertyInvocation)expr).getName()
- : (expr instanceof ELMethodInvocation)
+ : (expr instanceof ELMethodInvocation)
? ((ELMethodInvocation)expr).getName()
: null;
String name = lt != null ? lt.getText() : ""; // token.getText(); //$NON-NLS-1$
+ segment.setToken(lt);
if (expr.getType() == ELObjectType.EL_PROPERTY_INVOCATION) {
// Find properties for the token
List<TypeInfoCollector.MemberInfo> newMembers = new ArrayList<TypeInfoCollector.MemberInfo>();
@@ -542,7 +605,7 @@
if (mbr.getMemberType() == null) continue;
TypeInfoCollector infos = mbr.getTypeCollector(varIsUsed);
if (TypeInfoCollector.isNotParameterizedCollection(mbr) || TypeInfoCollector.isResourceBundle(mbr.getMemberType())) {
- status.setMapOrCollectionOrBundleAmoungTheTokens();
+ resolution.setMapOrCollectionOrBundleAmoungTheTokens(true);
}
List<TypeInfoCollector.MemberInfo> properties = infos.getProperties();
for (TypeInfoCollector.MemberInfo property : properties) {
@@ -558,7 +621,7 @@
}
members = newMembers;
if (members != null && !members.isEmpty())
- status.setLastResolvedToken(expr);
+ resolution.setLastResolvedToken(expr);
}
if (expr.getType() == ELObjectType.EL_METHOD_INVOCATION) {
// Find methods for the token
@@ -570,7 +633,7 @@
if (mbr.getMemberType() == null) continue;
TypeInfoCollector infos = mbr.getTypeCollector();
if (TypeInfoCollector.isNotParameterizedCollection(mbr) || TypeInfoCollector.isResourceBundle(mbr.getMemberType())) {
- status.setMapOrCollectionOrBundleAmoungTheTokens();
+ resolution.setMapOrCollectionOrBundleAmoungTheTokens(true);
}
List<TypeInfoCollector.MemberInfo> methods = infos.getMethods();
for (TypeInfoCollector.MemberInfo method : methods) {
@@ -581,17 +644,27 @@
}
members = newMembers;
if (members != null && !members.isEmpty())
- status.setLastResolvedToken(expr);
+ resolution.setLastResolvedToken(expr);
}
return members;
}
protected void resolveLastSegment(ELInvocationExpression expr,
List<TypeInfoCollector.MemberInfo> members,
- ELOperandResolveStatus status,
+ ELResolutionImpl resolution,
boolean returnEqualedVariablesOnly, boolean varIsUsed) {
Set<TextProposal> kbProposals = new TreeSet<TextProposal>(TextProposal.KB_PROPOSAL_ORDER);
-
+
+ JavaMemberELSegmentImpl segment = new JavaMemberELSegmentImpl();
+ if(expr instanceof ELPropertyInvocation) {
+ segment.setToken(((ELPropertyInvocation)expr).getName());
+ }
+// segment.setToken(expr.getLastToken());
+ if(segment.getToken()!=null) {
+ resolution.addSegment(segment);
+ }
+ resolution.setProposals(kbProposals);
+
if (expr.getType() == ELObjectType.EL_PROPERTY_INVOCATION && ((ELPropertyInvocation)expr).getName() == null) {
// return all the methods + properties
for (TypeInfoCollector.MemberInfo mbr : members) {
@@ -604,10 +677,9 @@
}
TypeInfoCollector infos = mbr.getTypeCollector(varIsUsed);
if (TypeInfoCollector.isNotParameterizedCollection(mbr) || TypeInfoCollector.isResourceBundle(mbr.getMemberType())) {
- status.setMapOrCollectionOrBundleAmoungTheTokens();
+ resolution.setMapOrCollectionOrBundleAmoungTheTokens(true);
}
-
-
+
// JBIDE-512, JBIDE-2541 related changes ===>>>
/*
Set<String> methodPresentations =
@@ -625,7 +697,7 @@
Set<MemberPresentation> methodPresentations =
infos.getMethodPresentations();
-
+
if (methodPresentations != null) {
for (MemberPresentation presentation : methodPresentations) {
String presentationString = presentation.getPresentation();
@@ -638,11 +710,11 @@
typeName = Signature.getSimpleName(typeName);
IJavaElement element = member == null ? null : member.getJavaElement();
String attachedJavaDoc = null;
-
+
try {
attachedJavaDoc = element == null ? null : element.getAttachedJavadoc(null);
} catch (JavaModelException e) {
- // Ignore
+ WebKbPlugin.getDefault().logError(e);
}
TextProposal proposal = new TextProposal();
@@ -652,7 +724,7 @@
proposal.setType(typeName);
proposal.setSourceType(sourceTypeName);
proposal.setContextInfo(attachedJavaDoc);
-
+
kbProposals.add(proposal);
}
}
@@ -672,8 +744,8 @@
*/
Set<MemberPresentation> propertyPresentations =
- infos.getPropertyPresentations(status.getUnpairedGettersOrSetters());
-
+ infos.getPropertyPresentations(segment.getUnpairedGettersOrSetters());
+
if (propertyPresentations != null) {
for (MemberPresentation presentation : propertyPresentations) {
String presentationString = presentation.getPresentation();
@@ -686,11 +758,11 @@
typeName = Signature.getSimpleName(typeName);
IJavaElement element = member == null ? null : member.getJavaElement();
String attachedJavaDoc = null;
-
+
try {
attachedJavaDoc = element == null ? null : element.getAttachedJavadoc(null);
} catch (JavaModelException e) {
- // Ignore
+ WebKbPlugin.getDefault().logError(e);
}
TextProposal proposal = new TextProposal();
@@ -700,12 +772,11 @@
proposal.setType(typeName);
proposal.setSourceType(sourceTypeName);
proposal.setContextInfo(attachedJavaDoc);
-
+
kbProposals.add(proposal);
}
}
// <<<=== JBIDE-512, JBIDE-2541 related changes
-
}
} else
if(expr.getType() != ELObjectType.EL_ARGUMENT_INVOCATION)
@@ -724,11 +795,11 @@
if (mbr.getMemberType() == null) continue;
TypeInfoCollector infos = mbr.getTypeCollector();
if (TypeInfoCollector.isNotParameterizedCollection(mbr) || TypeInfoCollector.isResourceBundle(mbr.getMemberType())) {
- status.setMapOrCollectionOrBundleAmoungTheTokens();
+ resolution.setMapOrCollectionOrBundleAmoungTheTokens(true);
}
proposalsToFilter.addAll(infos.getMethodPresentations());
- proposalsToFilter.addAll(infos.getPropertyPresentations(status.getUnpairedGettersOrSetters()));
- status.setMemberOfResolvedOperand(mbr);
+ proposalsToFilter.addAll(infos.getPropertyPresentations(segment.getUnpairedGettersOrSetters()));
+ segment.setMemberInfo(mbr);
}
for (TypeInfoCollector.MemberPresentation proposal : proposalsToFilter) {
// We do expect nothing but name for method tokens (No round brackets)
@@ -741,15 +812,15 @@
kbProposal.setReplacementString(proposal.getPresentation());
setImage(kbProposal, proposal);
-
+
kbProposals.add(kbProposal);
- status.setMemberOfResolvedOperand(proposal.getMember());
- if(status.getUnpairedGettersOrSetters()!=null) {
- TypeInfoCollector.MethodInfo unpirMethod = status.getUnpairedGettersOrSetters().get(filter);
- status.clearUnpairedGettersOrSetters();
+ segment.setMemberInfo(proposal.getMember());
+ if(segment.getUnpairedGettersOrSetters()!=null) {
+ TypeInfoCollector.MethodInfo unpirMethod = segment.getUnpairedGettersOrSetters().get(filter);
+ segment.clearUnpairedGettersOrSetters();
if(unpirMethod!=null) {
- status.getUnpairedGettersOrSetters().put(filter, unpirMethod);
+ segment.getUnpairedGettersOrSetters().put(filter, unpirMethod);
}
}
break;
@@ -771,7 +842,7 @@
try {
attachedJavaDoc = element == null ? null : element.getAttachedJavadoc(null);
} catch (JavaModelException e) {
- // Ignore
+ WebKbPlugin.getDefault().logError(e);
}
TextProposal kbProposal = new TextProposal();
@@ -781,7 +852,7 @@
kbProposal.setType(typeName);
kbProposal.setSourceType(sourceTypeName);
kbProposal.setContextInfo(attachedJavaDoc);
-
+
kbProposals.add(kbProposal);
// <<<=== JBIDE-512, JBIDE-2541 related changes
}
@@ -798,14 +869,14 @@
if (mbr.getMemberType() == null) continue;
try {
if(TypeInfoCollector.isInstanceofType(mbr.getMemberType(), "java.util.Map")) { //$NON-NLS-1$
- status.setMapOrCollectionOrBundleAmoungTheTokens();
+ resolution.setMapOrCollectionOrBundleAmoungTheTokens(true);
//if map/collection is parameterized, we might return member info for value type.
return;
}
} catch (JavaModelException jme) {
- //ignore
+ WebKbPlugin.getDefault().logError(jme);
}
- status.setMemberOfResolvedOperand(mbr);
+ segment.setMemberInfo(mbr);
}
String filter = expr.getMemberName();
@@ -819,28 +890,30 @@
filter = filter.length() == 1 ? "" : filter.substring(1, filter.length() - 1); //$NON-NLS-1$
} else {
//Value is set as expression itself, we cannot compute it
- if(isMessages) status.setMapOrCollectionOrBundleAmoungTheTokens();
+ if(isMessages) {
+ resolution.setMapOrCollectionOrBundleAmoungTheTokens(true);
+ }
return;
}
}
-
+
for (TypeInfoCollector.MemberPresentation proposal : proposalsToFilter) {
if(returnEqualedVariablesOnly) {
// This is used for validation.
if (proposal.getPresentation().equals(filter)) {
TextProposal kbProposal = new TextProposal();
kbProposal.setReplacementString(proposal.getPresentation());
-
+
setImage(kbProposal, proposal);
-
+
kbProposals.add(kbProposal);
- status.setMemberOfResolvedOperand(proposal.getMember());
- if(status.getUnpairedGettersOrSetters()!=null) {
- TypeInfoCollector.MethodInfo unpirMethod = status.getUnpairedGettersOrSetters().get(filter);
- status.clearUnpairedGettersOrSetters();
+ segment.setMemberInfo(proposal.getMember());
+ if(segment.getUnpairedGettersOrSetters()!=null) {
+ TypeInfoCollector.MethodInfo unpirMethod = segment.getUnpairedGettersOrSetters().get(filter);
+ segment.clearUnpairedGettersOrSetters();
if(unpirMethod!=null) {
- status.getUnpairedGettersOrSetters().put(filter, unpirMethod);
+ segment.getUnpairedGettersOrSetters().put(filter, unpirMethod);
}
}
break;
@@ -858,35 +931,32 @@
typeName = Signature.getSimpleName(typeName);
IJavaElement element = member == null ? null : member.getJavaElement();
String attachedJavaDoc = null;
-
+
try {
attachedJavaDoc = element == null ? null : element.getAttachedJavadoc(null);
} catch (JavaModelException e) {
- // Ignore
+ WebKbPlugin.getDefault().logError(e);
}
TextProposal kbProposal = new TextProposal();
-
+
String replacementString = proposal.getPresentation().substring(filter.length());
if (bSurroundWithQuotes) {
replacementString = "'" + replacementString + "']"; //$NON-NLS-1$ //$NON-NLS-2$
}
-
+
kbProposal.setReplacementString(replacementString);
kbProposal.setImage(getELProposalImage());
kbProposal.setType(typeName);
kbProposal.setSourceType(sourceTypeName);
kbProposal.setContextInfo(attachedJavaDoc);
-
+
kbProposals.add(kbProposal);
// <<<=== JBIDE-512, JBIDE-2541 related changes
}
}
}
- status.setProposals(kbProposals);
- if (status.isOK()){
- status.setLastResolvedToken(expr);
- }
+ segment.setResolved(!resolution.getProposals().isEmpty() || resolution.isMapOrCollectionOrBundleAmoungTheTokens());
}
protected boolean isSingularMember(TypeInfoCollector.MemberInfo mbr) {
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamContextVariable.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamContextVariable.java 2009-09-16 06:09:18 UTC (rev 17605)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamContextVariable.java 2009-09-16 06:45:26 UTC (rev 17606)
@@ -10,7 +10,7 @@
******************************************************************************/
package org.jboss.tools.seam.core;
-import org.jboss.tools.jst.web.kb.el.AbstractELCompletionEngine.IVariable;
+import org.jboss.tools.common.el.core.resolver.IVariable;
/**
* Represents Seam Context Variable.
Added: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/ContextVariableELSegment.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/ContextVariableELSegment.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/ContextVariableELSegment.java 2009-09-16 06:45:26 UTC (rev 17606)
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * 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.seam.internal.core.el;
+
+import org.jboss.tools.common.el.core.resolver.ELSegment;
+import org.jboss.tools.seam.core.ISeamContextVariable;
+
+/**
+ * @author Alexey Kazakov
+ */
+public interface ContextVariableELSegment extends ELSegment {
+
+ /**
+ * @return Seam context variable
+ */
+ ISeamContextVariable getVariable();
+}
\ No newline at end of file
Property changes on: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/ContextVariableELSegment.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
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-09-16 06:09:18 UTC (rev 17605)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java 2009-09-16 06:45:26 UTC (rev 17606)
@@ -43,13 +43,12 @@
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;
-import org.jboss.tools.common.el.core.resolver.ELCompletionEngine;
-import org.jboss.tools.common.el.core.resolver.ELOperandResolveStatus;
-import org.jboss.tools.common.el.core.resolver.ELResolver;
+import org.jboss.tools.common.el.core.resolver.ELResolution;
+import org.jboss.tools.common.el.core.resolver.ELSegment;
import org.jboss.tools.common.el.core.resolver.ElVarSearcher;
+import org.jboss.tools.common.el.core.resolver.JavaMemberELSegment;
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.model.project.ext.ITextSourceReference;
import org.jboss.tools.common.model.project.ext.event.Change;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
@@ -74,7 +73,7 @@
*
* @author Jeremy
*/
-public final class SeamELCompletionEngine extends AbstractELCompletionEngine<ISeamContextVariable> implements ELCompletionEngine, ELResolver {
+public final class SeamELCompletionEngine extends AbstractELCompletionEngine<ISeamContextVariable> {
private static final Image SEAM_EL_PROPOSAL_IMAGE =
SeamCorePlugin.getDefault().getImage(SeamCorePlugin.CA_SEAM_EL_IMAGE_PATH);
@@ -106,10 +105,6 @@
SeamCorePlugin.getPluginLog().logError(e);
}
- protected ELOperandResolveStatus newELOperandResolveStatus(ELInvocationExpression tokens) {
- return new SeamELOperandResolveStatus(tokens);
- }
-
/**
* Returns a list of Seam Context Variables that is represented by EL. Null if El is not resolved.
* @param project
@@ -138,7 +133,6 @@
boolean isIncomplete = expr.getType() == ELObjectType.EL_PROPERTY_INVOCATION
&& ((ELPropertyInvocation) expr).getName() == null;
- ELOperandResolveStatus status = new ELOperandResolveStatus(expr);
ELInvocationExpression left = expr;
ScopeType scope = getScope(project, file);
@@ -152,7 +146,6 @@
left == expr, true);
if (resolvedVars != null && !resolvedVars.isEmpty()) {
resolvedVariables = resolvedVars;
- status.setLastResolvedToken(left);
break;
}
left = (ELInvocationExpression) left.getLeft();
@@ -166,6 +159,7 @@
return resolvedVariables;
}
+ @Override
public List<ISeamContextVariable> resolveVariables(IFile file, ELInvocationExpression expr, boolean isFinal, boolean onlyEqualNames) {
ISeamProject project = SeamCorePlugin.getSeamProject(file.getProject(), false);
ScopeType scope = getScope(project, file);
@@ -184,10 +178,6 @@
}
}
- protected void setUsedVariables(ELOperandResolveStatus status, List<ISeamContextVariable> variables) {
- ((SeamELOperandResolveStatus)status).setUsedVariables(variables);
- }
-
protected boolean isSingularAttribute(ISeamContextVariable var) {
return var instanceof IBijectedAttribute;
}
@@ -238,41 +228,8 @@
}
}
-/**
- private String computeVariableName(List<ELOperandToken> tokens){
- if (tokens == null)
- tokens = new ArrayList<ELOperandToken>();
- StringBuffer sb = new StringBuffer();
- for (ELOperandToken token : tokens) {
- if (token.getType() == ELOperandToken.EL_VARIABLE_NAME_TOKEN ||
- token.getType() == ELOperandToken.EL_PROPERTY_NAME_TOKEN ||
- token.getType() == ELOperandToken.EL_METHOD_TOKEN ||
- token.getType() == ELOperandToken.EL_SEPARATOR_TOKEN) {
- sb.append(token.getText());
- }
- }
- return sb.toString();
- }
-*/
-
-/**
- private boolean areEqualExpressions(List<ELOperandToken>first, List<ELOperandToken>second) {
- if (first == null || second == null)
- return (first == second);
-
- if (first.size() != second.size())
- return false;
-
- for (int i = 0; i < first.size(); i++) {
- if (!first.get(i).equals(second.get(i)))
- return false;
- }
- return true;
- }
-*/
-
- /* Returns scope for the resource
- *
+ /**
+ * Returns scope for the resource
* @param project
* @param resource
* @return
@@ -293,9 +250,6 @@
return null;
}
-
-
-
public List<ISeamContextVariable> resolveVariables(ISeamProject project, ScopeType scope, ELInvocationExpression expr, boolean isFinal, boolean onlyEqualNames) {
List<ISeamContextVariable>resolvedVars = new ArrayList<ISeamContextVariable>();
@@ -466,15 +420,15 @@
ISeamProject project, IFile file,
ELInvocationExpression expr) throws BadLocationException, StringIndexOutOfBoundsException {
List<IJavaElement> res = new ArrayList<IJavaElement>();
-
+
ElVarSearcher varSearcher = new ElVarSearcher(file, this);
List<Var> vars = varSearcher.findAllVars(file, expr.getStartPosition());
- ELOperandResolveStatus status = resolveELOperand(file, expr, true, vars, varSearcher);
- if (status.isOK()) {
- MemberInfo member = status.getMemberOfResolvedOperand();
- if (member != null) {
- IJavaElement el = member.getJavaElement();
+ ELResolution resolution = resolveELOperand(file, expr, true, vars, varSearcher);
+ if (resolution.isResolved()) {
+ ELSegment segment = resolution.getLastSegment();
+ if(segment instanceof JavaMemberELSegment) {
+ IJavaElement el = ((JavaMemberELSegment)segment).getJavaElement();
if (el != null) {
res.add(el);
return res;
Deleted: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELOperandResolveStatus.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELOperandResolveStatus.java 2009-09-16 06:09:18 UTC (rev 17605)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELOperandResolveStatus.java 2009-09-16 06:45:26 UTC (rev 17606)
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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
- *
- * Contributor:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.seam.internal.core.el;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.jboss.tools.common.el.core.model.ELInvocationExpression;
-import org.jboss.tools.common.el.core.resolver.ELOperandResolveStatus;
-import org.jboss.tools.seam.core.ISeamContextVariable;
-
-public class SeamELOperandResolveStatus extends ELOperandResolveStatus {
- public List<ISeamContextVariable> usedVariables;
-
- public SeamELOperandResolveStatus(ELInvocationExpression tokens) {
- super(tokens);
- }
-
- /**
- * @return List of Seam Context Variables used in EL.
- */
- public List<ISeamContextVariable> getUsedVariables() {
- return (usedVariables == null ? new ArrayList<ISeamContextVariable>() : usedVariables);
- }
-
- /**
- * @param usedVariables List of Seam Context Variables used in EL.
- */
- public void setUsedVariables(List<ISeamContextVariable> usedVariables) {
- this.usedVariables = usedVariables;
- }
-}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamExpressionResolver.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamExpressionResolver.java 2009-09-16 06:09:18 UTC (rev 17605)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamExpressionResolver.java 2009-09-16 06:45:26 UTC (rev 17606)
@@ -28,6 +28,9 @@
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.ELParserUtil;
+import org.jboss.tools.common.el.core.resolver.ELResolution;
+import org.jboss.tools.common.el.core.resolver.ELSegment;
+import org.jboss.tools.common.el.core.resolver.JavaMemberELSegmentImpl;
import org.jboss.tools.common.el.core.resolver.TypeInfoCollector;
import org.jboss.tools.common.el.core.resolver.TypeInfoCollector.MemberInfo;
import org.jboss.tools.common.el.core.resolver.TypeInfoCollector.Type;
@@ -93,20 +96,6 @@
return internalResolveVariables(project, name, onlyEqualNames, variables);
}
- /**
- * 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, boolean onlyEqualNames) {
- Set<ISeamContextVariable> variables = project.getVariablesByScope(scope, true);
- return internalResolveVariables(project, name, onlyEqualNames, variables);
- }
-
private static List<ISeamContextVariable> internalResolveVariables(ISeamProject project, String name, boolean onlyEqualNames, Set<ISeamContextVariable> variables) {
List<ISeamContextVariable> resolvedVariables = new ArrayList<ISeamContextVariable>();
if(onlyEqualNames) {
@@ -352,11 +341,17 @@
if(ex instanceof ELInvocationExpression) {
ELInvocationExpression expr = (ELInvocationExpression)ex;
try {
- member = engine.resolveEL(null, expr, false);
+ ELResolution resolution = engine.resolveEL(null, expr, false);
+ if(resolution.isResolved()) {
+ ELSegment segment = resolution.getLastSegment();
+ if(segment instanceof JavaMemberELSegmentImpl) {
+ member = ((JavaMemberELSegmentImpl)segment).getMemberInfo();
+ }
+ }
} catch (StringIndexOutOfBoundsException e) {
- e.printStackTrace();
+ SeamCorePlugin.getDefault().logError(e);
} catch (BadLocationException e) {
- e.printStackTrace();
+ SeamCorePlugin.getDefault().logError(e);
}
}
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamPromptingProvider.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamPromptingProvider.java 2009-09-16 06:09:18 UTC (rev 17605)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamPromptingProvider.java 2009-09-16 06:45:26 UTC (rev 17606)
@@ -59,7 +59,7 @@
return list;
} else if(MEMBERS.equals(id)) {
try {
- List<TextProposal> proposals = engine.getCompletions(f, null, prefix, prefix.length(), false, new ArrayList<Var>());
+ List<TextProposal> proposals = engine.getCompletions(f, prefix, prefix.length(), false, new ArrayList<Var>());
List<String> suggestions = new ArrayList<String>();
if(proposals != null) for (TextProposal proposal: proposals) {
suggestions.add(proposal.getReplacementString());
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamELValidator.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamELValidator.java 2009-09-16 06:09:18 UTC (rev 17605)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamELValidator.java 2009-09-16 06:45:26 UTC (rev 17606)
@@ -58,19 +58,22 @@
import org.jboss.tools.common.el.core.model.ELPropertyInvocation;
import org.jboss.tools.common.el.core.parser.ELParser;
import org.jboss.tools.common.el.core.parser.ELParserUtil;
+import org.jboss.tools.common.el.core.parser.LexicalToken;
import org.jboss.tools.common.el.core.parser.SyntaxError;
+import org.jboss.tools.common.el.core.resolver.ELResolution;
+import org.jboss.tools.common.el.core.resolver.ELSegment;
import org.jboss.tools.common.el.core.resolver.ElVarSearcher;
+import org.jboss.tools.common.el.core.resolver.IVariable;
+import org.jboss.tools.common.el.core.resolver.JavaMemberELSegmentImpl;
import org.jboss.tools.common.el.core.resolver.TypeInfoCollector;
import org.jboss.tools.common.el.core.resolver.Var;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.common.util.FileUtil;
-import org.jboss.tools.seam.core.ISeamContextVariable;
import org.jboss.tools.seam.core.ISeamProject;
import org.jboss.tools.seam.core.SeamCoreMessages;
import org.jboss.tools.seam.core.SeamCorePlugin;
import org.jboss.tools.seam.core.SeamPreferences;
import org.jboss.tools.seam.internal.core.el.SeamELCompletionEngine;
-import org.jboss.tools.seam.internal.core.el.SeamELOperandResolveStatus;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
@@ -409,58 +412,67 @@
boolean unresolvedTokenIsVariable = false;
try {
if (!operand.endsWith(".")) { //$NON-NLS-1$
- SeamELOperandResolveStatus status =
- (SeamELOperandResolveStatus)engine.resolveELOperand(file, operandToken, true, varListForCurentValidatedNode, elVarSearcher);
+ ELResolution resolution = engine.resolveELOperand(file, operandToken, true, varListForCurentValidatedNode, elVarSearcher);
- if(status.isError()) {
+ if(!resolution.isResolved()) {
Set<String> names = findVariableNames(operandToken);
for (String name : names) {
validationContext.addLinkedEl(name, elReference);
}
}
+ List<ELSegment> segments = resolution.getSegments();
+ List<IVariable> usedVariables = new ArrayList<IVariable>();
+ for (ELSegment segment : segments) {
+ if(!segment.getVariables().isEmpty()) {
+ usedVariables.addAll(segment.getVariables());
+ }
+ // Check pair for getter/setter
+ if(segment instanceof JavaMemberELSegmentImpl) {
+ JavaMemberELSegmentImpl javaSegment = (JavaMemberELSegmentImpl)segment;
+ if(!javaSegment.getUnpairedGettersOrSetters().isEmpty()) {
+ TypeInfoCollector.MethodInfo unpairedMethod = javaSegment.getUnpairedGettersOrSetters().values().iterator().next();
+ String methodName = unpairedMethod.getName();
+ String propertyName = javaSegment.getUnpairedGettersOrSetters().keySet().iterator().next();
+ String missingMethodName = SeamCoreMessages.SEAM_EL_VALIDATOR_SETTER;
+ String existedMethodName = SeamCoreMessages.SEAM_EL_VALIDATOR_GETTER;
+ if(methodName.startsWith("s")) { //$NON-NLS-1$
+ missingMethodName = existedMethodName;
+ existedMethodName = SeamCoreMessages.SEAM_EL_VALIDATOR_SETTER;
+ }
+ int startPosition = documnetOffset + operandToken.getStartPosition();
+ int length = operandToken.getLength();
+ int startPr = operand.indexOf(propertyName);
+ if(startPr>-1) {
+ startPosition = startPosition + startPr;
+ length = propertyName.length();
+ }
+ IMarker marker = addError(UNPAIRED_GETTER_OR_SETTER_MESSAGE_ID, SeamPreferences.UNPAIRED_GETTER_OR_SETTER, new String[]{propertyName, existedMethodName, missingMethodName}, length, startPosition, file);
+ elReference.addMarker(marker);
+ }
+ }
+ }
// Save links between resource and used variables names
- for(ISeamContextVariable variable: status.getUsedVariables()) {
+ for(IVariable variable: usedVariables) {
validationContext.addLinkedEl(variable.getName(), elReference);
}
- // Check pair for getter/setter
- if(!status.getUnpairedGettersOrSetters().isEmpty()) {
- TypeInfoCollector.MethodInfo unpairedMethod = status.getUnpairedGettersOrSetters().values().iterator().next();
- String methodName = unpairedMethod.getName();
- String propertyName = status.getUnpairedGettersOrSetters().keySet().iterator().next();
- String missingMethodName = SeamCoreMessages.SEAM_EL_VALIDATOR_SETTER;
- String existedMethodName = SeamCoreMessages.SEAM_EL_VALIDATOR_GETTER;
- if(methodName.startsWith("s")) { //$NON-NLS-1$
- missingMethodName = existedMethodName;
- existedMethodName = SeamCoreMessages.SEAM_EL_VALIDATOR_SETTER;
- }
- int startPosition = documnetOffset + operandToken.getStartPosition();
- int length = operandToken.getLength();
- int startPr = operand.indexOf(propertyName);
- if(startPr>-1) {
- startPosition = startPosition + startPr;
- length = propertyName.length();
- }
- IMarker marker = addError(UNPAIRED_GETTER_OR_SETTER_MESSAGE_ID, SeamPreferences.UNPAIRED_GETTER_OR_SETTER, new String[]{propertyName, existedMethodName, missingMethodName}, length, startPosition, file);
- elReference.addMarker(marker);
- }
-
- if (status.isOK()) {
+ if (resolution.isResolved()) {
// It's valid EL.
return;
}
-
- ELInvocationExpression ts = status.getUnresolvedTokens();
-
- varName = ts.getMemberName();
+
+ ELSegment segment = resolution.getUnresolvedSegment();
+ LexicalToken token = segment.getToken();
+
+ varName = token.getText();
if(varName == null) {
//This is syntax error case. Reported by parser.
return;
}
- offsetOfVarName = documnetOffset + ts.getInvocationStartPosition();
+ offsetOfVarName = documnetOffset + token.getStart();
lengthOfVarName = varName == null ? 0 : varName.length();
- if(status.getUsedVariables().isEmpty()) {
+ if(usedVariables.isEmpty()) {
unresolvedTokenIsVariable = true;
}
}
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-09-16 06:09:18 UTC (rev 17605)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELProposalProcessor.java 2009-09-16 06:45:26 UTC (rev 17606)
@@ -436,7 +436,7 @@
List<Var> vars = varSearcher.findAllVars(viewer, offset);
SeamELCompletionEngine fEngine= new SeamELCompletionEngine();
- List<TextProposal> suggestions = fEngine.getCompletions(file, document, prefix, offset + proposalPrefix.length() - prefix.length(), false, vars);
+ List<TextProposal> suggestions = fEngine.getCompletions(file, prefix, offset + proposalPrefix.length() - prefix.length(), false, vars);
List<TextProposal> uniqueSuggestions = fEngine.makeKbUnique(suggestions);
List<ICompletionProposal> result= new ArrayList<ICompletionProposal>();
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-09-16 06:09:18 UTC (rev 17605)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/properties/SeamELAttributeContentProposalProvider.java 2009-09-16 06:45:26 UTC (rev 17606)
@@ -110,7 +110,7 @@
List<TextProposal> suggestions = null;
try {
- suggestions = engine.getCompletions(file, null, prefix, position, false, null);
+ suggestions = engine.getCompletions(file, prefix, position, false, null);
} catch (BadLocationException e) {
SeamGuiPlugin.getPluginLog().logError(e);
}
Modified: trunk/seam/tests/org.jboss.tools.seam.ui.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/META-INF/MANIFEST.MF 2009-09-16 06:09:18 UTC (rev 17605)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/META-INF/MANIFEST.MF 2009-09-16 06:45:26 UTC (rev 17606)
@@ -37,7 +37,8 @@
org.jboss.tools.jst.jsp,
org.jboss.tools.jst.jsp.test,
org.eclipse.jdt.ui,
- org.jboss.tools.vpe.ui.test
+ org.jboss.tools.vpe.ui.test,
+ org.jboss.tools.common.el.core;bundle-version="2.0.0"
Export-Package: org.jboss.tools.seam.ui.test,
org.jboss.tools.seam.ui.test.ca,
org.jboss.tools.seam.ui.test.hyperlink,
15 years, 4 months
JBoss Tools SVN: r17605 - trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/JBIDE3247/WebContent/WEB-INF/lib.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2009-09-16 02:09:18 -0400 (Wed, 16 Sep 2009)
New Revision: 17605
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/JBIDE3247/WebContent/WEB-INF/lib/jsf-facelets.jar
Log:
fix JUnit test error in JsfAllTests.testOpenOnForJavaElementFromDeclarationInJar
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/JBIDE3247/WebContent/WEB-INF/lib/jsf-facelets.jar
===================================================================
(Binary files differ)
15 years, 4 months
JBoss Tools SVN: r17604 - trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2009-09-15 21:06:57 -0400 (Tue, 15 Sep 2009)
New Revision: 17604
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/DiagramBaseAction.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/ExportImageAction.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/OpenMappingAction.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/OpenSourceAction.java
Log:
exception handling was cleaned up in o.j.t.hibernate.ui.diagram.editors.actions
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/DiagramBaseAction.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/DiagramBaseAction.java 2009-09-16 01:02:19 UTC (rev 17603)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/DiagramBaseAction.java 2009-09-16 01:06:57 UTC (rev 17604)
@@ -30,22 +30,16 @@
protected DiagramViewer getDiagramViewer() {
DiagramViewer res = editor;
- if (res == null && PlatformUI.getWorkbench() != null &&
- PlatformUI.getWorkbench().getActiveWorkbenchWindow() != null &&
- PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage() != null &&
- PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart() != null) {
- IWorkbenchPart part = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart();
- if (part instanceof DiagramViewer) {
- res = (DiagramViewer)part;
- } else if (part instanceof ContentOutline) {
- ContentOutline co = (ContentOutline)part;
- if (co.getCurrentPage() instanceof DiagramContentOutlinePage) {
- DiagramContentOutlinePage dcop = (DiagramContentOutlinePage)co.getCurrentPage();
- res = dcop.getEditor();
- }
+ IWorkbenchPart part = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart();
+ if (part instanceof DiagramViewer) {
+ res = (DiagramViewer)part;
+ } else if (part instanceof ContentOutline) {
+ ContentOutline co = (ContentOutline)part;
+ if (co.getCurrentPage() instanceof DiagramContentOutlinePage) {
+ DiagramContentOutlinePage dcop = (DiagramContentOutlinePage)co.getCurrentPage();
+ res = dcop.getEditor();
}
}
return res;
}
-
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/ExportImageAction.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/ExportImageAction.java 2009-09-16 01:02:19 UTC (rev 17603)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/ExportImageAction.java 2009-09-16 01:06:57 UTC (rev 17604)
@@ -96,7 +96,7 @@
outStream = new FileOutputStream(filePath);
outStream.write(imageData);
outStream.flush();
- } catch (Exception e) {
+ } catch (IOException e) {
HibernateConsolePlugin.getDefault().logErrorMessage("ExportImageAction", e); //$NON-NLS-1$
if (showErrDialog) {
MessageDialog.openInformation(getDiagramViewer().getSite().getShell(),
@@ -123,7 +123,7 @@
* SWT.IMAGE_ICO, SWT.IMAGE_JPEG, or SWT.IMAGE_PNG
* @return the bytes of an encoded image for the specified Figure
*/
- private byte[] createImage(IFigure figure, int format) throws Exception {
+ private byte[] createImage(IFigure figure, int format) {
Device device = getDiagramViewer().getEditPartViewer().getControl()
.getDisplay();
@@ -134,7 +134,6 @@
Image image = null;
GC gc = null;
Graphics g = null;
- Exception error = null;
try {
image = new Image(device, r.width, r.height);
gc = new GC(image);
@@ -146,8 +145,6 @@
ImageLoader imageLoader = new ImageLoader();
imageLoader.data = new ImageData[] { image.getImageData() };
imageLoader.save(result, format);
- } catch (Exception ex) {
- error = ex;
} finally {
if (g != null) {
g.dispose();
@@ -159,9 +156,6 @@
image.dispose();
}
}
- if (error != null) {
- throw error;
- }
return result.toByteArray();
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/OpenMappingAction.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/OpenMappingAction.java 2009-09-16 01:02:19 UTC (rev 17603)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/OpenMappingAction.java 2009-09-16 01:06:57 UTC (rev 17604)
@@ -14,6 +14,7 @@
import java.util.Iterator;
import java.util.Set;
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.gef.ui.actions.SelectionAction;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jface.resource.ImageDescriptor;
@@ -66,10 +67,8 @@
Property parentProperty = ((SpecialRootClass)compositSel.getPersistentClass()).getProperty();
try {
editorPart = org.hibernate.eclipse.console.actions.OpenMappingAction.run(consoleConfig, compositSel, parentProperty);
- } catch (PartInitException e) {
+ } catch (CoreException e) {
HibernateConsolePlugin.getDefault().logErrorMessage(DiagramViewerMessages.OpenMappingAction_canot_find_or_open_mapping_file, e);
- } catch (JavaModelException e) {
- HibernateConsolePlugin.getDefault().logErrorMessage(DiagramViewerMessages.OpenMappingAction_canot_find_or_open_mapping_file, e);
} catch (FileNotFoundException e) {
HibernateConsolePlugin.getDefault().logErrorMessage(DiagramViewerMessages.OpenMappingAction_canot_find_or_open_mapping_file, e);
}
@@ -86,10 +85,8 @@
}
try {
editorPart = org.hibernate.eclipse.console.actions.OpenMappingAction.run(consoleConfig, selection, selectionParent);
- } catch (PartInitException e) {
+ } catch (CoreException e) {
HibernateConsolePlugin.getDefault().logErrorMessage(DiagramViewerMessages.OpenMappingAction_open_mapping_file, e);
- } catch (JavaModelException e) {
- HibernateConsolePlugin.getDefault().logErrorMessage(DiagramViewerMessages.OpenMappingAction_open_mapping_file, e);
} catch (FileNotFoundException e) {
HibernateConsolePlugin.getDefault().logErrorMessage(DiagramViewerMessages.OpenMappingAction_open_mapping_file, e);
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/OpenSourceAction.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/OpenSourceAction.java 2009-09-16 01:02:19 UTC (rev 17603)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/OpenSourceAction.java 2009-09-16 01:06:57 UTC (rev 17604)
@@ -14,6 +14,7 @@
import java.util.Iterator;
import java.util.Set;
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.gef.ui.actions.SelectionAction;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jface.resource.ImageDescriptor;
@@ -93,10 +94,8 @@
}*/
try {
editorPart = org.hibernate.eclipse.console.actions.OpenSourceAction.run(consoleConfig, selection, fullyQualifiedName);
- } catch (PartInitException e) {
+ } catch (CoreException e) {
HibernateConsolePlugin.getDefault().logErrorMessage(DiagramViewerMessages.OpenSourceAction_canot_open_source_file, e);
- } catch (JavaModelException e) {
- HibernateConsolePlugin.getDefault().logErrorMessage(DiagramViewerMessages.OpenSourceAction_canot_find_source_file, e);
} catch (FileNotFoundException e) {
HibernateConsolePlugin.getDefault().logErrorMessage(DiagramViewerMessages.OpenSourceAction_canot_find_source_file, e);
}
15 years, 4 months
JBoss Tools SVN: r17603 - in trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject: .settings and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2009-09-15 21:02:19 -0400 (Tue, 15 Sep 2009)
New Revision: 17603
Removed:
trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/.settings/.jsdtscope
trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/.settings/org.eclipse.wst.jsdt.ui.superType.container
trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/.settings/org.eclipse.wst.jsdt.ui.superType.name
trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/.settings/org.eclipse.wst.validation.prefs
Modified:
trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/.project
Log:
test project for common.text.ext.test was cleaned up to make tests faster
Modified: trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/.project
===================================================================
--- trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/.project 2009-09-15 23:34:00 UTC (rev 17602)
+++ trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/.project 2009-09-16 01:02:19 UTC (rev 17603)
@@ -21,7 +21,6 @@
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
- <nature>org.eclipse.wst.jsdt.core.jsNature</nature>
<nature>org.jboss.tools.jsf.jsfnature</nature>
</natures>
</projectDescription>
Deleted: trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/.settings/.jsdtscope
===================================================================
--- trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/.settings/.jsdtscope 2009-09-15 23:34:00 UTC (rev 17602)
+++ trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/.settings/.jsdtscope 2009-09-16 01:02:19 UTC (rev 17603)
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.WebProject">
- <attributes>
- <attribute name="hide" value="true"/>
- </attributes>
- </classpathentry>
- <classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/>
- <classpathentry kind="output" path=""/>
-</classpath>
Deleted: trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/.settings/org.eclipse.wst.jsdt.ui.superType.container
===================================================================
--- trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/.settings/org.eclipse.wst.jsdt.ui.superType.container 2009-09-15 23:34:00 UTC (rev 17602)
+++ trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/.settings/org.eclipse.wst.jsdt.ui.superType.container 2009-09-16 01:02:19 UTC (rev 17603)
@@ -1 +0,0 @@
-org.eclipse.wst.jsdt.launching.baseBrowserLibrary
\ No newline at end of file
Deleted: trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/.settings/org.eclipse.wst.jsdt.ui.superType.name
===================================================================
--- trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/.settings/org.eclipse.wst.jsdt.ui.superType.name 2009-09-15 23:34:00 UTC (rev 17602)
+++ trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/.settings/org.eclipse.wst.jsdt.ui.superType.name 2009-09-16 01:02:19 UTC (rev 17603)
@@ -1 +0,0 @@
-Window
\ No newline at end of file
Deleted: trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/.settings/org.eclipse.wst.validation.prefs
===================================================================
--- trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/.settings/org.eclipse.wst.validation.prefs 2009-09-15 23:34:00 UTC (rev 17602)
+++ trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/.settings/org.eclipse.wst.validation.prefs 2009-09-16 01:02:19 UTC (rev 17603)
@@ -1,9 +0,0 @@
-#Thu Oct 02 16:44:50 PDT 2008
-DELEGATES_PREFERENCE=delegateValidatorList
-USER_BUILD_PREFERENCE=enabledBuildValidatorListorg.eclipse.wst.common.componentcore.internal.ModuleCoreValidator;org.eclipse.wst.wsi.ui.internal.WSIMessageValidator;org.jboss.tools.seam.internal.core.validation.SeamProjectPropertyValidator;org.eclipse.jst.j2ee.internal.web.validation.UIWarValidator;org.eclipse.jst.j2ee.internal.classpathdep.ClasspathDependencyValidator;
-USER_MANUAL_PREFERENCE=enabledManualValidatorListorg.eclipse.wst.common.componentcore.internal.ModuleCoreValidator;org.eclipse.wst.wsi.ui.internal.WSIMessageValidator;org.jboss.tools.seam.internal.core.validation.SeamProjectPropertyValidator;org.eclipse.jst.j2ee.internal.web.validation.UIWarValidator;org.eclipse.jst.j2ee.internal.classpathdep.ClasspathDependencyValidator;
-USER_PREFERENCE=overrideGlobalPreferencesfalse
-eclipse.preferences.version=1
-override=false
-suspend=false
-vf.version=3
15 years, 4 months