Author: scabanovich
Date: 2009-05-15 12:37:12 -0400 (Fri, 15 May 2009)
New Revision: 15305
Removed:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamTextSourceReference.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/IValueInfo.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/event/Change.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/event/IChangeVisitor.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/InnerModelHelper.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamXMLHelper.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ValueInfo.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/xml/XMLValueInfo.java
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamComponentDeclaration.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamDeclaration.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamElement.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamJavaSourceReference.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamProperty.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamXmlFactory.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/event/ISeamValueString.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/event/SeamProjectChangeEvent.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/AbstractContextVariable.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/AbstractSeamDeclaration.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/BijectedAttribute.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/DataModelSelectionAttribute.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamAnnotatedFactory.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamComponent.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamComponentDeclaration.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamComponentMethod.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamContextShortVariable.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamJavaComponentDeclaration.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamJavaContextVariable.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamMessages.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamMessagesComponent.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamObject.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamPackageUtil.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamPropertiesDeclaration.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProperty.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamResourceVisitor.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamScope.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamTextSourceReference.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamValueList.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamValueMap.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamValueMapEntry.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamValueString.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamXMLConstants.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamXmlComponentDeclaration.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamXmlFactory.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/refactoring/RenameComponentProcessor.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ComponentBuilder.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/PackageInfoRequestor.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/ClassPath.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/LibraryScanner.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/TypeScanner.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/xml/PropertiesScanner.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/xml/XMLScanner.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/IValidationErrorManager.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidationHelper.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/ValidationErrorManager.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2808
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamComponentDeclaration.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamComponentDeclaration.java 2009-05-15
16:33:08 UTC (rev 15304)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamComponentDeclaration.java 2009-05-15
16:37:12 UTC (rev 15305)
@@ -10,11 +10,13 @@
******************************************************************************/
package org.jboss.tools.seam.core;
+import org.jboss.tools.common.model.project.ext.ITextSourceReference;
+
/**
* Represents declaration of seam component.
* @author Alexey Kazakov
*/
-public interface ISeamComponentDeclaration extends ISeamDeclaration,
ISeamTextSourceReference {
+public interface ISeamComponentDeclaration extends ISeamDeclaration, ITextSourceReference
{
public ISeamComponentDeclaration clone() throws CloneNotSupportedException;
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamDeclaration.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamDeclaration.java 2009-05-15
16:33:08 UTC (rev 15304)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamDeclaration.java 2009-05-15
16:37:12 UTC (rev 15305)
@@ -11,6 +11,7 @@
package org.jboss.tools.seam.core;
import org.eclipse.core.runtime.IAdaptable;
+import org.jboss.tools.common.model.project.ext.ITextSourceReference;
/**
* @author Viacheslav Kabanovich
@@ -28,6 +29,6 @@
* e.g. if you need source reference for @Name you have to
* invoke getLocationFor("name");
*/
- public ISeamTextSourceReference getLocationFor(String path);
+ public ITextSourceReference getLocationFor(String path);
}
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamElement.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamElement.java 2009-05-15
16:33:08 UTC (rev 15304)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamElement.java 2009-05-15
16:37:12 UTC (rev 15305)
@@ -15,7 +15,7 @@
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IPath;
-import org.jboss.tools.seam.core.event.Change;
+import org.jboss.tools.common.model.project.ext.event.Change;
import org.w3c.dom.Element;
/**
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamJavaSourceReference.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamJavaSourceReference.java 2009-05-15
16:33:08 UTC (rev 15304)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamJavaSourceReference.java 2009-05-15
16:37:12 UTC (rev 15305)
@@ -11,12 +11,13 @@
package org.jboss.tools.seam.core;
import org.eclipse.jdt.core.IMember;
+import org.jboss.tools.common.model.project.ext.ITextSourceReference;
/**
* An interface of seam tools model object that has associated source object in JDT
model
* @author Alexey Kazakov
*/
-public interface ISeamJavaSourceReference extends ISeamTextSourceReference {
+public interface ISeamJavaSourceReference extends ITextSourceReference {
public IMember getSourceMember();
}
\ No newline at end of file
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamProperty.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamProperty.java 2009-05-15
16:33:08 UTC (rev 15304)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamProperty.java 2009-05-15
16:37:12 UTC (rev 15305)
@@ -10,12 +10,13 @@
******************************************************************************/
package org.jboss.tools.seam.core;
+import org.jboss.tools.common.model.project.ext.ITextSourceReference;
import org.jboss.tools.seam.core.event.ISeamValue;
/**
* A property of Seam Component defined in component.xml or seam.properties files
*/
-public interface ISeamProperty extends ISeamDeclaration, ISeamTextSourceReference {
+public interface ISeamProperty extends ISeamDeclaration, ITextSourceReference {
/**
* @return value of this property
Deleted:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamTextSourceReference.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamTextSourceReference.java 2009-05-15
16:33:08 UTC (rev 15304)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamTextSourceReference.java 2009-05-15
16:37:12 UTC (rev 15305)
@@ -1,28 +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.core;
-
-/**
- * An interface of seam tools model object that has text source.
- * @author Alexey Kazakov
- */
-public interface ISeamTextSourceReference {
-
- /**
- * @return start position of element in text
- */
- public int getStartPosition();
-
- /**
- * @return number of characters of element in text
- */
- public int getLength();
-}
\ No newline at end of file
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamXmlFactory.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamXmlFactory.java 2009-05-15
16:33:08 UTC (rev 15304)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamXmlFactory.java 2009-05-15
16:37:12 UTC (rev 15305)
@@ -10,11 +10,13 @@
******************************************************************************/
package org.jboss.tools.seam.core;
+import org.jboss.tools.common.model.project.ext.ITextSourceReference;
+
/**
* Represents <factory> element in components.xml
* @author Alexey Kazakov
*/
-public interface ISeamXmlFactory extends ISeamFactory, ISeamTextSourceReference {
+public interface ISeamXmlFactory extends ISeamFactory, ITextSourceReference {
/**
* @return string value of 'value' attribute
Deleted:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/IValueInfo.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/IValueInfo.java 2009-05-15
16:33:08 UTC (rev 15304)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/IValueInfo.java 2009-05-15
16:37:12 UTC (rev 15305)
@@ -1,31 +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.core;
-
-import java.util.Properties;
-
-import org.w3c.dom.Element;
-
-/**
- * @author Viacheslav Kabanovich
- */
-public interface IValueInfo extends ISeamTextSourceReference {
-
- /**
- * Returns string value
- * @return
- */
- public String getValue();
-
- public Element toXML(Element parent, Properties context);
-
- public void loadXML(Element element, Properties context);
-}
\ No newline at end of file
Deleted:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/event/Change.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/event/Change.java 2009-05-15
16:33:08 UTC (rev 15304)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/event/Change.java 2009-05-15
16:37:12 UTC (rev 15305)
@@ -1,125 +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.core.event;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * This object collects changes in target that should be fired to listeners.
- *
- * @author Viacheslav Kabanovich
- */
-public class Change {
- Object target;
- String property;
- Object oldValue;
- Object newValue;
- List<Change> children;
-
- /**
- * Constructs object with initial values
- *
- * @param target
- * @param property
- * name of property changed or null, if change is adding/removing
- * a child.
- * @param oldValue
- * old value; if null and property = null, then child (newValue)
- * is added
- * @param newValue
- * new value; if null and property = null, then child (oldValue)
- * is removed
- */
- public Change(Object target, String property, Object oldValue, Object newValue) {
- this.target = target;
- this.property = property;
- this.oldValue = oldValue;
- this.newValue = newValue;
- }
-
- public Object getTarget() {
- return target;
- }
-
- public String getProperty() {
- return property;
- }
-
- public Object getOldValue() {
- return oldValue;
- }
-
- public Object getNewValue() {
- return newValue;
- }
-
- public void addChildren(List<Change> children) {
- if(this.children == null) {
- this.children = children;
- } else if(children != null) {
- this.children.addAll(children);
- }
- }
-
- /**
- * Returns true if this object defines no actual change in seam model.
- * @return
- */
- public boolean isEmpty() {
- return oldValue == null && newValue == null && !isChildrenAffected();
- }
-
- /**
- * Returns true if this change includes sub-changes.
- * @return
- */
- public boolean isChildrenAffected() {
- return children != null && !children.isEmpty();
- }
-
- /**
- * Returns list of all changes
- * @return
- */
- public List<Change> getChildren() {
- return children;
- }
-
- /**
- * Invokes visitor for this change, and if visit returns true, iterates over
- * child changes.
- * @param visitor
- */
- public void visit(IChangeVisitor visitor) {
- if(!visitor.visit(this)) return;
- if(children != null) {
- for (Change c: children) {
- c.visit(visitor);
- }
- }
- }
-
- /**
- * Utility method to attach a single change to the list. If list is not provided,
- * new list is created, otherwise the provided list is returned.
- * @param changes
- * @param change
- * @return
- */
- public static List<Change> addChange(List<Change> changes, Change change) {
- if(change == null || change.isEmpty()) return changes;
- if(changes == null) changes = new ArrayList<Change>();
- changes.add(change);
- return changes;
- }
-
-}
Deleted:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/event/IChangeVisitor.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/event/IChangeVisitor.java 2009-05-15
16:33:08 UTC (rev 15304)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/event/IChangeVisitor.java 2009-05-15
16:37:12 UTC (rev 15305)
@@ -1,28 +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.seam.core.event;
-
-/**
- * This interface allows to process SeamProjectChangeEvent, or specific Change by
- * invoking method visit(IChangeVisitor) declared on them.
- *
- * @author Viacheslav Kabanovich
- */
-public interface IChangeVisitor {
-
- /**
- * Processes a single change. If this method returns true,
- * it shall be invoked with child changes
- * @param change
- * @return
- */
- public boolean visit(Change change);
-}
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/event/ISeamValueString.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/event/ISeamValueString.java 2009-05-15
16:33:08 UTC (rev 15304)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/event/ISeamValueString.java 2009-05-15
16:37:12 UTC (rev 15305)
@@ -10,7 +10,7 @@
******************************************************************************/
package org.jboss.tools.seam.core.event;
-import org.jboss.tools.seam.core.IValueInfo;
+import org.jboss.tools.common.model.project.ext.IValueInfo;
/**
* @author Viacheslav Kabanovich
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/event/SeamProjectChangeEvent.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/event/SeamProjectChangeEvent.java 2009-05-15
16:33:08 UTC (rev 15304)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/event/SeamProjectChangeEvent.java 2009-05-15
16:37:12 UTC (rev 15305)
@@ -14,6 +14,8 @@
import java.util.EventObject;
import java.util.List;
+import org.jboss.tools.common.model.project.ext.event.Change;
+import org.jboss.tools.common.model.project.ext.event.IChangeVisitor;
import org.jboss.tools.seam.core.ISeamComponent;
import org.jboss.tools.seam.core.ISeamProject;
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/AbstractContextVariable.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/AbstractContextVariable.java 2009-05-15
16:33:08 UTC (rev 15304)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/AbstractContextVariable.java 2009-05-15
16:37:12 UTC (rev 15305)
@@ -13,12 +13,12 @@
import java.util.List;
import java.util.Properties;
+import org.jboss.tools.common.model.project.ext.IValueInfo;
+import org.jboss.tools.common.model.project.ext.event.Change;
import org.jboss.tools.seam.core.ISeamContextVariable;
import org.jboss.tools.seam.core.ISeamElement;
import org.jboss.tools.seam.core.ISeamXmlComponentDeclaration;
-import org.jboss.tools.seam.core.IValueInfo;
import org.jboss.tools.seam.core.ScopeType;
-import org.jboss.tools.seam.core.event.Change;
import org.w3c.dom.Element;
/**
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/AbstractSeamDeclaration.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/AbstractSeamDeclaration.java 2009-05-15
16:33:08 UTC (rev 15304)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/AbstractSeamDeclaration.java 2009-05-15
16:37:12 UTC (rev 15305)
@@ -18,19 +18,20 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.project.ext.ITextSourceReference;
+import org.jboss.tools.common.model.project.ext.IValueInfo;
+import org.jboss.tools.common.model.project.ext.event.Change;
+import org.jboss.tools.jst.web.model.project.ext.store.XMLStoreHelper;
import org.jboss.tools.seam.core.IOpenableElement;
import org.jboss.tools.seam.core.ISeamDeclaration;
import org.jboss.tools.seam.core.ISeamElement;
-import org.jboss.tools.seam.core.ISeamTextSourceReference;
import org.jboss.tools.seam.core.ISeamXmlComponentDeclaration;
-import org.jboss.tools.seam.core.IValueInfo;
-import org.jboss.tools.seam.core.event.Change;
import org.w3c.dom.Element;
/**
* @author Viacheslav Kabanovich
*/
-public abstract class AbstractSeamDeclaration extends SeamObject implements
ISeamDeclaration, ISeamTextSourceReference, IOpenableElement {
+public abstract class AbstractSeamDeclaration extends SeamObject implements
ISeamDeclaration, ITextSourceReference, IOpenableElement {
public static final String PATH_OF_NAME = "name"; //$NON-NLS-1$
protected String name;
@@ -65,9 +66,9 @@
* e.g. if you need source reference for @Name you have to
* invoke getLocationFor("name");
*/
- public ISeamTextSourceReference getLocationFor(String path) {
+ public ITextSourceReference getLocationFor(String path) {
final IValueInfo valueInfo = attributes.get(path);
- ISeamTextSourceReference reference = new ISeamTextSourceReference() {
+ ITextSourceReference reference = new ITextSourceReference() {
public int getLength() {
return valueInfo != null ? valueInfo.getLength() : 0;
}
@@ -116,7 +117,7 @@
XModelObject old = pushModelObject(context);
if(name != null) element.setAttribute(SeamXMLConstants.ATTR_NAME, name);
- SeamXMLHelper.saveMap(element, attributes, "attributes", context);
+ XMLStoreHelper.saveMap(element, attributes, "attributes", context);
popModelObject(context, old);
@@ -131,7 +132,7 @@
if(element.hasAttribute(SeamXMLConstants.ATTR_NAME)) {
name = element.getAttribute(SeamXMLConstants.ATTR_NAME);
}
- SeamXMLHelper.loadMap(element, attributes, "attributes", context);
+ XMLStoreHelper.loadMap(element, attributes, "attributes", context);
popModelObject(context, old);
}
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/BijectedAttribute.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/BijectedAttribute.java 2009-05-15
16:33:08 UTC (rev 15304)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/BijectedAttribute.java 2009-05-15
16:37:12 UTC (rev 15305)
@@ -14,11 +14,11 @@
import java.util.List;
import java.util.Properties;
+import org.jboss.tools.common.model.project.ext.IValueInfo;
+import org.jboss.tools.common.model.project.ext.event.Change;
import org.jboss.tools.seam.core.BijectedAttributeType;
import org.jboss.tools.seam.core.IBijectedAttribute;
import org.jboss.tools.seam.core.ISeamElement;
-import org.jboss.tools.seam.core.IValueInfo;
-import org.jboss.tools.seam.core.event.Change;
import org.w3c.dom.Element;
/**
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/DataModelSelectionAttribute.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/DataModelSelectionAttribute.java 2009-05-15
16:33:08 UTC (rev 15304)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/DataModelSelectionAttribute.java 2009-05-15
16:37:12 UTC (rev 15305)
@@ -13,9 +13,9 @@
import java.util.List;
import java.util.Properties;
+import org.jboss.tools.common.model.project.ext.IValueInfo;
+import org.jboss.tools.common.model.project.ext.event.Change;
import org.jboss.tools.seam.core.ISeamElement;
-import org.jboss.tools.seam.core.IValueInfo;
-import org.jboss.tools.seam.core.event.Change;
import org.w3c.dom.Element;
/**
Deleted:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/InnerModelHelper.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/InnerModelHelper.java 2009-05-15
16:33:08 UTC (rev 15304)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/InnerModelHelper.java 2009-05-15
16:37:12 UTC (rev 15305)
@@ -1,111 +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.seam.internal.core;
-
-import java.io.IOException;
-
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.common.componentcore.ComponentCore;
-import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
-import org.eclipse.wst.common.componentcore.resources.IVirtualFolder;
-import org.jboss.tools.common.model.XModel;
-import org.jboss.tools.common.model.XModelConstants;
-import org.jboss.tools.common.model.XModelObject;
-import org.jboss.tools.common.model.project.IModelNature;
-import org.jboss.tools.common.model.project.ProjectHome;
-import org.jboss.tools.common.model.util.EclipseResourceUtil;
-import org.jboss.tools.common.model.util.XModelObjectUtil;
-
-public class InnerModelHelper {
-
- public static XModel createXModel(IProject project) {
- IModelNature n = EclipseResourceUtil.getModelNature(project.getProject());
- if(n != null) return n.getModel();
-
- XModel model =
EclipseResourceUtil.createObjectForResource(project.getProject()).getModel();
- XModelObject webinf = model.getByPath("FileSystems/WEB-INF"); //$NON-NLS-1$
- if(webinf != null) return model;
-
- IPath webInfPath = getWebInfPath(project);
-
- if(webInfPath == null) return model;
-
- IFolder webInfFolder = ResourcesPlugin.getWorkspace().getRoot().getFolder(webInfPath);
-
- model.getProperties().setProperty(XModelConstants.WORKSPACE,
webInfFolder.getLocation().toString());
- model.getProperties().setProperty(XModelConstants.WORKSPACE_OLD,
webInfFolder.getLocation().toString());
-
- XModelObject fs = model.getByPath("FileSystems"); //$NON-NLS-1$
- webinf = model.createModelObject("FileSystemFolder", null); //$NON-NLS-1$
- webinf.setAttributeValue("name", "WEB-INF"); //$NON-NLS-1$
//$NON-NLS-2$
- webinf.setAttributeValue("location", XModelConstants.WORKSPACE_REF);
//$NON-NLS-1$
- fs.addChild(webinf);
-
- String webInfLocation = XModelObjectUtil.expand(XModelConstants.WORKSPACE_REF, model,
null);
- String webRootLocation = getWebRootPath(project, webInfLocation);
-
- XModelObject webroot = model.createModelObject("FileSystemFolder", null);
//$NON-NLS-1$
- webroot.setAttributeValue("name", "WEB-ROOT"); //$NON-NLS-1$
//$NON-NLS-2$
- webroot.setAttributeValue("location", webRootLocation); //$NON-NLS-1$
//$NON-NLS-2$
- fs.addChild(webroot);
-
- XModelObject lib = model.createModelObject("FileSystemFolder", null);
//$NON-NLS-1$
- lib.setAttributeValue("name", "lib"); //$NON-NLS-1$ //$NON-NLS-2$
- lib.setAttributeValue("location", XModelConstants.WORKSPACE_REF +
"/lib"); //$NON-NLS-1$ //$NON-NLS-2$
- fs.addChild(lib);
-
- return model;
- }
-
- //Taken from J2EEUtils and modified
- public static IPath getWebInfPath(IProject project) {
- IVirtualComponent component = ComponentCore.createComponent(project);
- if(component == null) return null;
- IVirtualFolder webInfDir = component.getRootFolder().getFolder(new
Path("/WEB-INF"));
- IPath modulePath = webInfDir.getWorkspaceRelativePath();
- return (!webInfDir.exists()) ? null : modulePath;
- }
-
- static String getWebRootPath(IProject project, String webInfLocation) {
- String webRootLocation = XModelConstants.WORKSPACE_REF + "/..";
-
- IPath wrp = ProjectHome.getFirstWebContentPath(project);
- IPath wip = ProjectHome.getWebInfPath(project);
-
- if(wrp == null || wip == null) {
- return webRootLocation;
- }
-
- IResource wrpc = ResourcesPlugin.getWorkspace().getRoot().findMember(wrp);
- IResource wipc = ResourcesPlugin.getWorkspace().getRoot().findMember(wip);
- if(wrpc != null && wipc != null && wipc.isLinked()) {
- IPath p = wrpc.getLocation();
- if(p != null) {
- try {
- webRootLocation = p.toFile().getCanonicalPath().replace('\\', '/');
- } catch (IOException e) {
- }
- String relative =
org.jboss.tools.common.util.FileUtil.getRelativePath(webInfLocation, webRootLocation);
- if(relative != null) {
- webRootLocation = XModelConstants.WORKSPACE_REF + relative;
- }
- }
- }
- return webRootLocation;
- }
-
-}
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamAnnotatedFactory.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamAnnotatedFactory.java 2009-05-15
16:33:08 UTC (rev 15304)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamAnnotatedFactory.java 2009-05-15
16:37:12 UTC (rev 15305)
@@ -14,12 +14,12 @@
import java.util.Properties;
import org.eclipse.jdt.core.IMethod;
+import org.jboss.tools.common.model.project.ext.IValueInfo;
+import org.jboss.tools.common.model.project.ext.event.Change;
import org.jboss.tools.seam.core.ISeamAnnotatedFactory;
import org.jboss.tools.seam.core.ISeamElement;
import org.jboss.tools.seam.core.ISeamXmlComponentDeclaration;
-import org.jboss.tools.seam.core.IValueInfo;
import org.jboss.tools.seam.core.ScopeType;
-import org.jboss.tools.seam.core.event.Change;
import org.w3c.dom.Element;
/**
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamComponent.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamComponent.java 2009-05-15
16:33:08 UTC (rev 15304)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamComponent.java 2009-05-15
16:37:12 UTC (rev 15305)
@@ -16,6 +16,8 @@
import java.util.List;
import java.util.Set;
+import org.jboss.tools.common.model.project.ext.ITextSourceReference;
+import org.jboss.tools.common.model.project.ext.event.Change;
import org.jboss.tools.seam.core.BijectedAttributeType;
import org.jboss.tools.seam.core.IBijectedAttribute;
import org.jboss.tools.seam.core.IRole;
@@ -27,11 +29,9 @@
import org.jboss.tools.seam.core.ISeamPackage;
import org.jboss.tools.seam.core.ISeamPropertiesDeclaration;
import org.jboss.tools.seam.core.ISeamProperty;
-import org.jboss.tools.seam.core.ISeamTextSourceReference;
import org.jboss.tools.seam.core.ISeamXmlComponentDeclaration;
import org.jboss.tools.seam.core.ScopeType;
import org.jboss.tools.seam.core.SeamComponentMethodType;
-import org.jboss.tools.seam.core.event.Change;
/**
* @author Viacheslav Kabanovich
@@ -89,7 +89,7 @@
return null;
}
- public ISeamTextSourceReference getLocationFor(String path) {
+ public ITextSourceReference getLocationFor(String path) {
ISeamJavaComponentDeclaration javaDeclaration = getJavaDeclaration();
if(javaDeclaration != null) return javaDeclaration.getLocationFor(path);
Set<ISeamXmlComponentDeclaration> xml = getXmlDeclarations();
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamComponentDeclaration.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamComponentDeclaration.java 2009-05-15
16:33:08 UTC (rev 15304)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamComponentDeclaration.java 2009-05-15
16:37:12 UTC (rev 15305)
@@ -15,11 +15,11 @@
import java.util.Set;
import org.eclipse.core.resources.IResource;
+import org.jboss.tools.common.model.project.ext.event.Change;
import org.jboss.tools.seam.core.ISeamComponentDeclaration;
import org.jboss.tools.seam.core.ISeamContextVariable;
import org.jboss.tools.seam.core.ISeamElement;
import org.jboss.tools.seam.core.ScopeType;
-import org.jboss.tools.seam.core.event.Change;
/**
* @author Viacheslav Kabanovich
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamComponentMethod.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamComponentMethod.java 2009-05-15
16:33:08 UTC (rev 15304)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamComponentMethod.java 2009-05-15
16:37:12 UTC (rev 15305)
@@ -18,10 +18,10 @@
import org.eclipse.core.resources.IResource;
import org.eclipse.jdt.core.IMember;
import org.eclipse.jdt.core.JavaModelException;
+import org.jboss.tools.common.model.project.ext.event.Change;
import org.jboss.tools.seam.core.ISeamComponentMethod;
import org.jboss.tools.seam.core.ISeamElement;
import org.jboss.tools.seam.core.SeamComponentMethodType;
-import org.jboss.tools.seam.core.event.Change;
import org.w3c.dom.Element;
/**
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamContextShortVariable.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamContextShortVariable.java 2009-05-15
16:33:08 UTC (rev 15304)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamContextShortVariable.java 2009-05-15
16:37:12 UTC (rev 15305)
@@ -1,8 +1,8 @@
package org.jboss.tools.seam.internal.core;
+import org.jboss.tools.common.model.project.ext.ITextSourceReference;
import org.jboss.tools.seam.core.ISeamContextShortVariable;
import org.jboss.tools.seam.core.ISeamContextVariable;
-import org.jboss.tools.seam.core.ISeamTextSourceReference;
import org.jboss.tools.seam.core.ScopeType;
public class SeamContextShortVariable extends SeamObject implements
ISeamContextShortVariable {
@@ -36,7 +36,7 @@
throw new CloneNotSupportedException();
}
- public ISeamTextSourceReference getLocationFor(String path) {
+ public ITextSourceReference getLocationFor(String path) {
return original.getLocationFor(path);
}
}
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamJavaComponentDeclaration.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamJavaComponentDeclaration.java 2009-05-15
16:33:08 UTC (rev 15304)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamJavaComponentDeclaration.java 2009-05-15
16:37:12 UTC (rev 15305)
@@ -26,8 +26,11 @@
import org.jboss.tools.common.meta.action.impl.SpecialWizardSupport;
import org.jboss.tools.common.model.ServiceDialog;
import org.jboss.tools.common.model.options.PreferenceModelUtilities;
+import org.jboss.tools.common.model.project.ext.IValueInfo;
+import org.jboss.tools.common.model.project.ext.event.Change;
import org.jboss.tools.common.model.util.EclipseJavaUtil;
import org.jboss.tools.common.xml.XMLUtilities;
+import org.jboss.tools.jst.web.model.project.ext.store.XMLStoreHelper;
import org.jboss.tools.seam.core.BeanType;
import org.jboss.tools.seam.core.BijectedAttributeType;
import org.jboss.tools.seam.core.IBijectedAttribute;
@@ -38,12 +41,10 @@
import org.jboss.tools.seam.core.ISeamJavaComponentDeclaration;
import org.jboss.tools.seam.core.ISeamProject;
import org.jboss.tools.seam.core.ISeamXmlComponentDeclaration;
-import org.jboss.tools.seam.core.IValueInfo;
import org.jboss.tools.seam.core.ScopeType;
import org.jboss.tools.seam.core.SeamComponentMethodType;
import org.jboss.tools.seam.core.SeamComponentPrecedenceType;
import org.jboss.tools.seam.core.SeamCorePlugin;
-import org.jboss.tools.seam.core.event.Change;
import org.w3c.dom.Element;
public class SeamJavaComponentDeclaration extends SeamComponentDeclaration
@@ -503,14 +504,14 @@
if(v == null) continue;
Element e_type = XMLUtilities.createElement(e_types, "bean-type");
e_type.setAttribute(SeamXMLConstants.ATTR_NAME, t.toString());
- SeamXMLHelper.saveValueInfo(e_type, v, context);
+ XMLStoreHelper.saveValueInfo(e_type, v, context);
}
}
element.setAttribute(SeamXmlComponentDeclaration.PRECEDENCE, "" +
precedence);
if(type != null && type != id) {
- SeamXMLHelper.saveType(element, type, "type", context);
+ XMLStoreHelper.saveType(element, type, "type", context);
}
if(type != null) context.put(SeamXMLConstants.ATTR_TYPE, type);
@@ -565,7 +566,7 @@
continue;
}
if(t == null) continue;
- IValueInfo value = SeamXMLHelper.loadValueInfo(e_type[i], context);
+ IValueInfo value = XMLStoreHelper.loadValueInfo(e_type[i], context);
if(value != null) {
types.put(t, value);
}
@@ -585,7 +586,7 @@
Element e_type = XMLUtilities.getUniqueChild(element, "type");
if(e_type != null) {
- type = SeamXMLHelper.loadType(e_type, context);
+ type = XMLStoreHelper.loadType(e_type, context);
} else if(id instanceof IType) {
type = (IType)id;
}
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamJavaContextVariable.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamJavaContextVariable.java 2009-05-15
16:33:08 UTC (rev 15304)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamJavaContextVariable.java 2009-05-15
16:37:12 UTC (rev 15305)
@@ -25,11 +25,12 @@
import org.jboss.tools.common.meta.action.impl.SpecialWizardSupport;
import org.jboss.tools.common.model.ServiceDialog;
import org.jboss.tools.common.model.options.PreferenceModelUtilities;
+import org.jboss.tools.common.model.project.ext.event.Change;
import org.jboss.tools.common.xml.XMLUtilities;
+import org.jboss.tools.jst.web.model.project.ext.store.XMLStoreHelper;
import org.jboss.tools.seam.core.ISeamElement;
import org.jboss.tools.seam.core.ISeamJavaSourceReference;
import org.jboss.tools.seam.core.SeamCorePlugin;
-import org.jboss.tools.seam.core.event.Change;
import org.w3c.dom.Element;
public abstract class SeamJavaContextVariable extends AbstractContextVariable implements
ISeamJavaSourceReference {
@@ -95,13 +96,13 @@
Element element = super.toXML(parent, context);
if(javaSource instanceof IField) {
- SeamXMLHelper.saveField(element, (IField)javaSource, TAG_JAVA_SOURCE, context);
+ XMLStoreHelper.saveField(element, (IField)javaSource, TAG_JAVA_SOURCE, context);
} else if(javaSource instanceof IMethod) {
- SeamXMLHelper.saveMethod(element, (IMethod)javaSource, TAG_JAVA_SOURCE, context);
+ XMLStoreHelper.saveMethod(element, (IMethod)javaSource, TAG_JAVA_SOURCE, context);
} else if(javaSource instanceof IType) {
Element ce = XMLUtilities.createElement(element, TAG_JAVA_SOURCE);
ce.setAttribute(SeamXMLConstants.ATTR_CLASS, SeamXMLConstants.CLS_TYPE);
- SeamXMLHelper.saveType(ce, (IType)javaSource, context);
+ XMLStoreHelper.saveType(ce, (IType)javaSource, context);
}
return element;
@@ -114,11 +115,11 @@
if(c != null) {
String cls = c.getAttribute(SeamXMLConstants.ATTR_CLASS);
if(SeamXMLConstants.CLS_FIELD.equals(cls)) {
- javaSource = SeamXMLHelper.loadField(c, context);
+ javaSource = XMLStoreHelper.loadField(c, context);
} else if(SeamXMLConstants.CLS_METHOD.equals(cls)) {
- javaSource = SeamXMLHelper.loadMethod(c, context);
+ javaSource = XMLStoreHelper.loadMethod(c, context);
} else if(SeamXMLConstants.CLS_TYPE.equals(cls)) {
- javaSource = SeamXMLHelper.loadType(c, context);
+ javaSource = XMLStoreHelper.loadType(c, context);
}
}
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamMessages.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamMessages.java 2009-05-15
16:33:08 UTC (rev 15304)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamMessages.java 2009-05-15
16:37:12 UTC (rev 15305)
@@ -16,10 +16,10 @@
import java.util.Properties;
import org.eclipse.core.resources.IResource;
+import org.jboss.tools.common.model.project.ext.event.Change;
import org.jboss.tools.seam.core.ISeamElement;
import org.jboss.tools.seam.core.ISeamMessages;
import org.jboss.tools.seam.core.ISeamProperty;
-import org.jboss.tools.seam.core.event.Change;
import org.w3c.dom.Element;
/**
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamMessagesComponent.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamMessagesComponent.java 2009-05-15
16:33:08 UTC (rev 15304)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamMessagesComponent.java 2009-05-15
16:37:12 UTC (rev 15305)
@@ -16,9 +16,9 @@
import java.util.Properties;
import org.eclipse.core.resources.IResource;
+import org.jboss.tools.common.model.project.ext.event.Change;
import org.jboss.tools.seam.core.ISeamElement;
import org.jboss.tools.seam.core.ISeamMessages;
-import org.jboss.tools.seam.core.event.Change;
import org.w3c.dom.Element;
/**
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamObject.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamObject.java 2009-05-15
16:33:08 UTC (rev 15304)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamObject.java 2009-05-15
16:37:12 UTC (rev 15305)
@@ -22,10 +22,11 @@
import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.core.IType;
import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.project.ext.event.Change;
import org.jboss.tools.common.xml.XMLUtilities;
+import org.jboss.tools.jst.web.model.project.ext.store.XMLStoreHelper;
import org.jboss.tools.seam.core.ISeamElement;
import org.jboss.tools.seam.core.ISeamProject;
-import org.jboss.tools.seam.core.event.Change;
import org.w3c.dom.Element;
/**
@@ -167,14 +168,14 @@
eid.setAttribute(SeamXMLConstants.ATTR_CLASS, SeamXMLConstants.CLS_STRING);
eid.setAttribute(SeamXMLConstants.ATTR_VALUE, id.toString());
} else if(id instanceof IType) {
- SeamXMLHelper.saveType(element, ((IType)id), SeamXMLConstants.TAG_ID, context);
+ XMLStoreHelper.saveType(element, ((IType)id), SeamXMLConstants.TAG_ID, context);
} else if(id instanceof IField) {
- SeamXMLHelper.saveField(element, ((IField)id), SeamXMLConstants.TAG_ID, context);
+ XMLStoreHelper.saveField(element, ((IField)id), SeamXMLConstants.TAG_ID, context);
} else if(id instanceof IMethod) {
- SeamXMLHelper.saveMethod(element, ((IMethod)id), SeamXMLConstants.TAG_ID, context);
+ XMLStoreHelper.saveMethod(element, ((IMethod)id), SeamXMLConstants.TAG_ID, context);
} else if(id instanceof XModelObject) {
XModelObject o = (XModelObject)id;
- SeamXMLHelper.saveModelObject(element, o, SeamXMLConstants.TAG_ID, context);
+ XMLStoreHelper.saveModelObject(element, o, SeamXMLConstants.TAG_ID, context);
}
}
return element;
@@ -193,13 +194,13 @@
if(SeamXMLConstants.CLS_STRING.equals(cls)) {
id = e_id.getAttribute("string");
} else if(SeamXMLConstants.CLS_TYPE.equals(cls)) {
- id = SeamXMLHelper.loadType(e_id, context);
+ id = XMLStoreHelper.loadType(e_id, context);
} else if(SeamXMLConstants.CLS_FIELD.equals(cls)) {
- id = SeamXMLHelper.loadField(e_id, context);
+ id = XMLStoreHelper.loadField(e_id, context);
} else if(SeamXMLConstants.CLS_METHOD.equals(cls)) {
- id = SeamXMLHelper.loadMethod(e_id, context);
+ id = XMLStoreHelper.loadMethod(e_id, context);
} else if(SeamXMLConstants.CLS_MODEL_OBJECT.equals(cls)) {
- id = SeamXMLHelper.loadModelObject(e_id, context);
+ id = XMLStoreHelper.loadModelObject(e_id, context);
}
}
}
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamPackageUtil.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamPackageUtil.java 2009-05-15
16:33:08 UTC (rev 15304)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamPackageUtil.java 2009-05-15
16:37:12 UTC (rev 15305)
@@ -5,10 +5,10 @@
import java.util.List;
import java.util.Map;
+import org.jboss.tools.common.model.project.ext.event.Change;
import org.jboss.tools.seam.core.ISeamComponent;
import org.jboss.tools.seam.core.ISeamElement;
import org.jboss.tools.seam.core.ISeamPackage;
-import org.jboss.tools.seam.core.event.Change;
public class SeamPackageUtil {
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java 2009-05-15
16:33:08 UTC (rev 15304)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java 2009-05-15
16:37:12 UTC (rev 15305)
@@ -36,6 +36,7 @@
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.core.runtime.preferences.IScopeContext;
import org.eclipse.jst.jsf.designtime.DesignTimeApplicationManager;
+import org.jboss.tools.common.model.project.ext.event.Change;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.common.xml.XMLUtilities;
import org.jboss.tools.seam.core.BijectedAttributeType;
@@ -53,7 +54,6 @@
import org.jboss.tools.seam.core.ScopeType;
import org.jboss.tools.seam.core.SeamCoreBuilder;
import org.jboss.tools.seam.core.SeamCorePlugin;
-import org.jboss.tools.seam.core.event.Change;
import org.jboss.tools.seam.core.event.ISeamProjectChangeListener;
import org.jboss.tools.seam.core.event.SeamProjectChangeEvent;
import org.jboss.tools.seam.core.project.facet.SeamRuntime;
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamPropertiesDeclaration.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamPropertiesDeclaration.java 2009-05-15
16:33:08 UTC (rev 15304)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamPropertiesDeclaration.java 2009-05-15
16:37:12 UTC (rev 15305)
@@ -28,13 +28,13 @@
import org.jboss.tools.common.model.ServiceDialog;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.options.PreferenceModelUtilities;
+import org.jboss.tools.common.model.project.ext.event.Change;
import org.jboss.tools.common.model.util.FindObjectHelper;
import org.jboss.tools.common.xml.XMLUtilities;
import org.jboss.tools.seam.core.ISeamElement;
import org.jboss.tools.seam.core.ISeamPropertiesDeclaration;
import org.jboss.tools.seam.core.ISeamProperty;
import org.jboss.tools.seam.core.SeamCorePlugin;
-import org.jboss.tools.seam.core.event.Change;
import org.w3c.dom.Element;
public class SeamPropertiesDeclaration extends SeamComponentDeclaration
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProperty.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProperty.java 2009-05-15
16:33:08 UTC (rev 15304)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProperty.java 2009-05-15
16:37:12 UTC (rev 15305)
@@ -14,12 +14,12 @@
import java.util.Properties;
import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.project.ext.IValueInfo;
+import org.jboss.tools.common.model.project.ext.event.Change;
import org.jboss.tools.common.xml.XMLUtilities;
import org.jboss.tools.seam.core.ISeamElement;
import org.jboss.tools.seam.core.ISeamProperty;
import org.jboss.tools.seam.core.ISeamXmlComponentDeclaration;
-import org.jboss.tools.seam.core.IValueInfo;
-import org.jboss.tools.seam.core.event.Change;
import org.jboss.tools.seam.core.event.ISeamValue;
import org.w3c.dom.Element;
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamResourceVisitor.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamResourceVisitor.java 2009-05-15
16:33:08 UTC (rev 15304)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamResourceVisitor.java 2009-05-15
16:37:12 UTC (rev 15305)
@@ -27,6 +27,7 @@
import org.jboss.tools.common.model.filesystems.FileSystemsHelper;
import org.jboss.tools.common.model.plugin.ModelPlugin;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
+import org.jboss.tools.jst.web.model.helpers.InnerModelHelper;
import org.jboss.tools.seam.core.SeamCorePlugin;
import org.jboss.tools.seam.internal.core.scanner.IFileScanner;
import org.jboss.tools.seam.internal.core.scanner.LoadedDeclarations;
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamScope.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamScope.java 2009-05-15
16:33:08 UTC (rev 15304)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamScope.java 2009-05-15
16:37:12 UTC (rev 15305)
@@ -17,11 +17,11 @@
import java.util.List;
import java.util.Map;
+import org.jboss.tools.common.model.project.ext.event.Change;
import org.jboss.tools.seam.core.ISeamComponent;
import org.jboss.tools.seam.core.ISeamPackage;
import org.jboss.tools.seam.core.ISeamScope;
import org.jboss.tools.seam.core.ScopeType;
-import org.jboss.tools.seam.core.event.Change;
public class SeamScope extends SeamObject implements ISeamScope {
//Contains all components for that scope.
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamTextSourceReference.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamTextSourceReference.java 2009-05-15
16:33:08 UTC (rev 15304)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamTextSourceReference.java 2009-05-15
16:37:12 UTC (rev 15305)
@@ -10,12 +10,12 @@
******************************************************************************/
package org.jboss.tools.seam.internal.core;
-import org.jboss.tools.seam.core.ISeamTextSourceReference;
+import org.jboss.tools.common.model.project.ext.ITextSourceReference;
/**
* @author Alexey Kazakov
*/
-public class SeamTextSourceReference implements ISeamTextSourceReference {
+public class SeamTextSourceReference implements ITextSourceReference {
private int length;
private int startPosition;
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamValueList.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamValueList.java 2009-05-15
16:33:08 UTC (rev 15304)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamValueList.java 2009-05-15
16:37:12 UTC (rev 15305)
@@ -14,9 +14,9 @@
import java.util.List;
import java.util.Properties;
+import org.jboss.tools.common.model.project.ext.event.Change;
import org.jboss.tools.common.xml.XMLUtilities;
import org.jboss.tools.seam.core.ISeamElement;
-import org.jboss.tools.seam.core.event.Change;
import org.jboss.tools.seam.core.event.ISeamValueList;
import org.jboss.tools.seam.core.event.ISeamValueString;
import org.w3c.dom.Element;
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamValueMap.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamValueMap.java 2009-05-15
16:33:08 UTC (rev 15304)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamValueMap.java 2009-05-15
16:37:12 UTC (rev 15305)
@@ -14,9 +14,9 @@
import java.util.List;
import java.util.Properties;
+import org.jboss.tools.common.model.project.ext.event.Change;
import org.jboss.tools.common.xml.XMLUtilities;
import org.jboss.tools.seam.core.ISeamElement;
-import org.jboss.tools.seam.core.event.Change;
import org.jboss.tools.seam.core.event.ISeamValueMap;
import org.jboss.tools.seam.core.event.ISeamValueMapEntry;
import org.w3c.dom.Element;
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamValueMapEntry.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamValueMapEntry.java 2009-05-15
16:33:08 UTC (rev 15304)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamValueMapEntry.java 2009-05-15
16:37:12 UTC (rev 15305)
@@ -13,9 +13,9 @@
import java.util.List;
import java.util.Properties;
+import org.jboss.tools.common.model.project.ext.event.Change;
import org.jboss.tools.common.xml.XMLUtilities;
import org.jboss.tools.seam.core.ISeamElement;
-import org.jboss.tools.seam.core.event.Change;
import org.jboss.tools.seam.core.event.ISeamValueMapEntry;
import org.jboss.tools.seam.core.event.ISeamValueString;
import org.w3c.dom.Element;
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamValueString.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamValueString.java 2009-05-15
16:33:08 UTC (rev 15304)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamValueString.java 2009-05-15
16:37:12 UTC (rev 15305)
@@ -13,9 +13,10 @@
import java.util.List;
import java.util.Properties;
+import org.jboss.tools.common.model.project.ext.IValueInfo;
+import org.jboss.tools.common.model.project.ext.event.Change;
+import org.jboss.tools.jst.web.model.project.ext.store.XMLStoreHelper;
import org.jboss.tools.seam.core.ISeamElement;
-import org.jboss.tools.seam.core.IValueInfo;
-import org.jboss.tools.seam.core.event.Change;
import org.jboss.tools.seam.core.event.ISeamValueString;
import org.w3c.dom.Element;
@@ -67,7 +68,7 @@
Element element = super.toXML(parent, context);
if(value != null) {
- SeamXMLHelper.saveValueInfo(element, value, context);
+ XMLStoreHelper.saveValueInfo(element, value, context);
}
return element;
@@ -75,7 +76,7 @@
public void loadXML(Element element, Properties context) {
super.loadXML(element, context);
- setValue(SeamXMLHelper.loadValueInfo(element, context));
+ setValue(XMLStoreHelper.loadValueInfo(element, context));
}
}
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamXMLConstants.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamXMLConstants.java 2009-05-15
16:33:08 UTC (rev 15304)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamXMLConstants.java 2009-05-15
16:37:12 UTC (rev 15305)
@@ -1,26 +1,18 @@
package org.jboss.tools.seam.internal.core;
-public interface SeamXMLConstants {
+import org.jboss.tools.common.model.project.ext.store.XMLStoreConstants;
+
+public interface SeamXMLConstants extends XMLStoreConstants {
- public String TAG_VALUE_INFO = "value-info";
- public String TAG_ID = "id";
public String TAG_VALUE = "value";
public String TAG_PROPERTY = "property";
public String TAG_COMPONENT = "component";
- public String TAG_ENTRY = "entry";
public String TAG_BIJECTED_ATTRIBUTE = "bijected-attribute";
public String TAG_METHOD = "method";
public String TAG_ROLE = "role";
public String TAG_FACTORY = "factory";
public String TAG_IMPORT = "import";
- public String CLS_XML = "xml";
- public String CLS_MODEL_OBJECT = "model-object";
- public String CLS_STRING = "string";
- public String CLS_TYPE = "type";
- public String CLS_FIELD = "field";
- public String CLS_METHOD = "method";
-
public String CLS_PROPERTIES = "properties";
public String CLS_JAVA = "java";
public String CLS_MESSAGES = "messages";
@@ -30,17 +22,5 @@
public String CLS_DATA_MODEL = "datamodel";
- public String ATTR_CLASS = "class";
- public String ATTR_NAME = "name";
- public String ATTR_VALUE = "value";
- public String ATTR_PARAMS = "params";
-
- public String KEY_MODEL_OBJECT = "model-object";
-
- public String ATTR_PROJECT = "project";
- public String ATTR_TYPE = "type";
-
- public String ATTR_PATH = "path";
-
public String ATTR_SCOPE = "scope";
}
Deleted:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamXMLHelper.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamXMLHelper.java 2009-05-15
16:33:08 UTC (rev 15304)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamXMLHelper.java 2009-05-15
16:37:12 UTC (rev 15305)
@@ -1,236 +0,0 @@
-package org.jboss.tools.seam.internal.core;
-
-import java.util.Map;
-import java.util.Properties;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jdt.core.IField;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IMethod;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.jboss.tools.common.model.XModel;
-import org.jboss.tools.common.model.XModelObject;
-import org.jboss.tools.common.model.util.EclipseResourceUtil;
-import org.jboss.tools.common.xml.XMLUtilities;
-import org.jboss.tools.seam.core.IValueInfo;
-import org.jboss.tools.seam.internal.core.scanner.java.ValueInfo;
-import org.jboss.tools.seam.internal.core.scanner.xml.XMLValueInfo;
-import org.w3c.dom.Element;
-
-public class SeamXMLHelper implements SeamXMLConstants {
-
- public static void saveValueInfo(Element parent, IValueInfo value, Properties context)
{
- value.toXML(parent, context);
- }
-
- public static IValueInfo loadValueInfo(Element parent, Properties context) {
- Element c = XMLUtilities.getUniqueChild(parent, TAG_VALUE_INFO);
- if(c == null) return null;
- IValueInfo v = null;
- if(CLS_XML.equals(c.getAttribute(ATTR_CLASS))) {
- v = new XMLValueInfo();
- v.loadXML(c, context);
- if(((XMLValueInfo)v).getObject() == null) {
- v = new ValueInfo();
- //that may be a problem
- ((ValueInfo)v).setValue("");
- }
- } else {
- v = new ValueInfo();
- v.loadXML(c, context);
- }
-
- return v;
- }
-
- public static void saveModelObject(Element element, XModelObject object, Properties
context) {
- if(object == null) return;
- String path = object.getPath();
- if(path == null) return;
- XModelObject base = (XModelObject)context.get(SeamXMLConstants.KEY_MODEL_OBJECT);
- if(base != null && base.getModel() == object.getModel()) {
- String basePath = base.getPath();
- if(path.startsWith("" + basePath + "/")) {
- path = path.substring(basePath.length());
- } else if(path.equals(basePath)) {
- path = ".";
- }
- }
-
- if(path != null) element.setAttribute(ATTR_PATH, path);
- IProject p = EclipseResourceUtil.getProject(object);
- if(p == null) return;
- element.setAttribute(ATTR_PROJECT, p.getName());
- }
-
- public static void saveModelObject(Element parent, XModelObject object, String child,
Properties context) {
- Element element = XMLUtilities.createElement(parent, child);
- element.setAttribute(ATTR_CLASS, CLS_MODEL_OBJECT);
- saveModelObject(element, object, context);
- }
-
- public static XModelObject loadModelObject(Element element, Properties context) {
- String path = element.getAttribute(ATTR_PATH);
- XModelObject base = (XModelObject)context.get(SeamXMLConstants.KEY_MODEL_OBJECT);
- if(path == null || path.length() == 0) {
- //TODO reporting
- return null;
- } else if(path.equals(".")) {
- if(base == null) {
- //TODO reporting
- }
- return base;
- }
- if(path.startsWith("/")) {
- if(base != null) {
- if(base.getChildByPath(path.substring(1)) == null) {
- //TODO reporting
- }
- return base.getChildByPath(path.substring(1));
- }
- //TODO reporting
- return null;
- }
- IProject project = loadProject(element, context);
- if(project == null || !project.isAccessible()) return null;
- XModel model = InnerModelHelper.createXModel(project);
- if(model == null) return null;
- return model.getByPath(path);
- }
-
- public static XModelObject loadModelObject(Element parent, String child, Properties
context) {
- Element element = XMLUtilities.getUniqueChild(parent, child);
- if(element == null) return null;
- return loadModelObject(element, context);
- }
-
- public static void saveType(Element element, IType type, Properties context) {
- if(type == null) return;
- if(context != null && type == context.get(ATTR_TYPE)) return;
- element.setAttribute(ATTR_PROJECT, type.getJavaProject().getProject().getName());
- element.setAttribute(ATTR_TYPE, type.getFullyQualifiedName());
- }
-
- public static void saveType(Element parent, IType type, String child, Properties
context) {
- if(type == null) return;
- if(context != null && type == context.get(ATTR_TYPE)) return;
- Element element = XMLUtilities.createElement(parent, child);
- element.setAttribute(ATTR_CLASS, CLS_TYPE);
- saveType(element, type, context);
- }
-
- public static IProject loadProject(Element element, Properties context) {
- String project = element.getAttribute(ATTR_PROJECT);
- if(project == null || project.length() == 0) return null;
- return ResourcesPlugin.getWorkspace().getRoot().getProject(project);
- }
-
- public static IType loadType(Element element, Properties context) {
- String name = element.getAttribute(ATTR_TYPE);
- if(name == null || name.length() == 0) {
- if(context != null && context.containsKey(ATTR_TYPE)) {
- return (IType)context.get(ATTR_TYPE);
- }
- //TODO reporting
- return null;
- }
- IProject project = loadProject(element, context);
- if(project == null || !project.isAccessible()) return null;
- IJavaProject jp = JavaCore.create(project);
- if(jp != null) {
- try {
- IType type = jp.findType(name.replace('$', '.'));
- if(type == null && name.indexOf('$') >= 0) {
- int ii = name.lastIndexOf('.');
- String pack = (ii < 0) ? "" : name.substring(0, ii);
- String cls = name.substring(ii + 1);
- type = jp.findType(pack, cls.replace('$', '.'), new
NullProgressMonitor());
- }
- return type;
- } catch (JavaModelException e) {
- //ignore
- }
- }
- return null;
- }
-
- public static void saveField(Element element, IField field, Properties context) {
- if(field == null) return;
- saveType(element, field.getDeclaringType(), context);
- element.setAttribute(ATTR_NAME, field.getElementName());
- }
-
- public static void saveField(Element parent, IField field, String child, Properties
context) {
- if(field == null) return;
- Element element = XMLUtilities.createElement(parent, child);
- element.setAttribute(ATTR_CLASS, CLS_FIELD);
- saveField(element, field, context);
- }
-
- public static IField loadField(Element element, Properties context) {
- IType type = loadType(element, context);
- if(type == null) return null;
- String name = element.getAttribute(ATTR_NAME);
- if(name == null || name.length() == 0) return null;
- return type.getField(name);
- }
-
- public static void saveMethod(Element element, IMethod method, Properties context) {
- if(method == null) return;
- saveType(element, method.getDeclaringType(), context);
- element.setAttribute(ATTR_NAME, method.getElementName());
- String[] s = method.getParameterTypes();
- StringBuffer sb = new StringBuffer();
- for (int i = 0; i < s.length; i++) sb.append(s[i]).append(',');
- element.setAttribute(ATTR_PARAMS, sb.toString());
- }
-
- public static void saveMethod(Element parent, IMethod method, String child, Properties
context) {
- if(method == null) return;
- Element element = XMLUtilities.createElement(parent, child);
- element.setAttribute(ATTR_CLASS, CLS_METHOD);
- saveMethod(element, method, context);
- }
-
- public static IMethod loadMethod(Element element, Properties context) {
- IType type = loadType(element, context);
- if(type == null) return null;
- String name = element.getAttribute(ATTR_NAME);
- if(name == null || name.length() == 0) return null;
- String params = element.getAttribute(ATTR_PARAMS);
- String[] ps = new String[0];
- if(params != null && params.length() > 0) {
- ps = params.split(",");
- }
- return type.getMethod(name, ps);
- }
-
- public static void saveMap(Element parent, Map<String, IValueInfo> map, String
child, Properties context) {
- if(map == null || map.isEmpty()) return;
- Element element = XMLUtilities.createElement(parent, child);
- for (String name: map.keySet()) {
- IValueInfo value = map.get(name);
- Element c = XMLUtilities.createElement(element, TAG_ENTRY);
- c.setAttribute(ATTR_NAME, name);
- if(value == null) continue;
- value.toXML(c, context);
- }
- }
-
- public static void loadMap(Element parent, Map<String, IValueInfo> map, String
child, Properties context) {
- Element element = XMLUtilities.getUniqueChild(parent, child);
- if(element == null) return;
- Element[] cs = XMLUtilities.getChildren(element, TAG_ENTRY);
- for (int i = 0; i < cs.length; i++) {
- String name = cs[i].getAttribute(ATTR_NAME);
- IValueInfo value = loadValueInfo(cs[i], context);
- if(name != null && value != null) {
- map.put(name, value);
- }
- }
- }
-}
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamXmlComponentDeclaration.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamXmlComponentDeclaration.java 2009-05-15
16:33:08 UTC (rev 15304)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamXmlComponentDeclaration.java 2009-05-15
16:37:12 UTC (rev 15305)
@@ -15,12 +15,12 @@
import java.util.Properties;
import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.project.ext.IValueInfo;
+import org.jboss.tools.common.model.project.ext.event.Change;
import org.jboss.tools.common.model.util.NamespaceMapping;
import org.jboss.tools.seam.core.ISeamElement;
import org.jboss.tools.seam.core.ISeamXmlComponentDeclaration;
-import org.jboss.tools.seam.core.IValueInfo;
import org.jboss.tools.seam.core.ScopeType;
-import org.jboss.tools.seam.core.event.Change;
import org.jboss.tools.seam.internal.core.scanner.xml.XMLScanner;
import org.w3c.dom.Element;
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamXmlFactory.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamXmlFactory.java 2009-05-15
16:33:08 UTC (rev 15304)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamXmlFactory.java 2009-05-15
16:37:12 UTC (rev 15305)
@@ -14,11 +14,11 @@
import java.util.Properties;
import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.project.ext.IValueInfo;
+import org.jboss.tools.common.model.project.ext.event.Change;
import org.jboss.tools.common.model.util.FindObjectHelper;
import org.jboss.tools.seam.core.ISeamElement;
import org.jboss.tools.seam.core.ISeamXmlFactory;
-import org.jboss.tools.seam.core.IValueInfo;
-import org.jboss.tools.seam.core.event.Change;
import org.w3c.dom.Element;
/**
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-05-15
16:33:08 UTC (rev 15304)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java 2009-05-15
16:37:12 UTC (rev 15305)
@@ -54,6 +54,8 @@
import org.jboss.tools.common.el.core.resolver.TypeInfoCollector;
import org.jboss.tools.common.el.core.resolver.Var;
import org.jboss.tools.common.el.core.resolver.TypeInfoCollector.MemberInfo;
+import org.jboss.tools.common.model.project.ext.ITextSourceReference;
+import org.jboss.tools.common.model.project.ext.event.Change;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.common.text.TextProposal;
import org.jboss.tools.jst.web.kb.IPageContext;
@@ -65,11 +67,9 @@
import org.jboss.tools.seam.core.ISeamJavaSourceReference;
import org.jboss.tools.seam.core.ISeamMessages;
import org.jboss.tools.seam.core.ISeamProject;
-import org.jboss.tools.seam.core.ISeamTextSourceReference;
import org.jboss.tools.seam.core.ISeamXmlFactory;
import org.jboss.tools.seam.core.ScopeType;
import org.jboss.tools.seam.core.SeamCorePlugin;
-import org.jboss.tools.seam.core.event.Change;
import org.jboss.tools.seam.internal.core.el.SeamExpressionResolver.MessagesInfo;
import org.w3c.dom.Element;
@@ -1109,7 +1109,7 @@
}
public void setScope(ScopeType type) {
}
- public ISeamTextSourceReference getLocationFor(String path) {
+ public ITextSourceReference getLocationFor(String path) {
return null;
}
public String getName() {
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/RenameComponentProcessor.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/RenameComponentProcessor.java 2009-05-15
16:33:08 UTC (rev 15304)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/RenameComponentProcessor.java 2009-05-15
16:37:12 UTC (rev 15305)
@@ -55,6 +55,7 @@
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.model.project.ext.ITextSourceReference;
import org.jboss.tools.common.util.FileUtil;
import org.jboss.tools.seam.core.BijectedAttributeType;
import org.jboss.tools.seam.core.IBijectedAttribute;
@@ -62,7 +63,6 @@
import org.jboss.tools.seam.core.ISeamFactory;
import org.jboss.tools.seam.core.ISeamJavaComponentDeclaration;
import org.jboss.tools.seam.core.ISeamProject;
-import org.jboss.tools.seam.core.ISeamTextSourceReference;
import org.jboss.tools.seam.core.ISeamXmlComponentDeclaration;
import org.jboss.tools.seam.core.SeamCoreMessages;
import org.jboss.tools.seam.core.SeamCorePlugin;
@@ -167,7 +167,7 @@
private void renameJavaDeclaration(ISeamJavaComponentDeclaration javaDecl) throws
CoreException{
declarationFile = (IFile)javaDecl.getResource();
if(declarationFile != null && !coreHelper.isJar(javaDecl)){
- ISeamTextSourceReference location =
((SeamComponentDeclaration)javaDecl).getLocationFor(ISeamXmlComponentDeclaration.NAME);
+ ITextSourceReference location =
((SeamComponentDeclaration)javaDecl).getLocationFor(ISeamXmlComponentDeclaration.NAME);
if(location != null){
TextFileChange change = getChange(declarationFile);
TextEdit edit = new ReplaceEdit(location.getStartPosition(), location.getLength(),
"\""+newName+"\""); //$NON-NLS-1$ //$NON-NLS-2$
@@ -179,7 +179,7 @@
private void renameXMLDeclaration(ISeamXmlComponentDeclaration xmlDecl){
declarationFile = (IFile)xmlDecl.getResource();
if(declarationFile != null && !coreHelper.isJar(xmlDecl)){
- ISeamTextSourceReference location =
((SeamComponentDeclaration)xmlDecl).getLocationFor(ISeamXmlComponentDeclaration.NAME);
+ ITextSourceReference location =
((SeamComponentDeclaration)xmlDecl).getLocationFor(ISeamXmlComponentDeclaration.NAME);
if(location != null)
changeXMLNode(location, declarationFile);
}
@@ -408,7 +408,7 @@
Set<IBijectedAttribute> inSet =
seamProject.getBijectedAttributesByName(component.getName(), BijectedAttributeType.IN);
for(IBijectedAttribute inAtt : inSet){
- ISeamTextSourceReference location =
inAtt.getLocationFor(SeamAnnotations.IN_ANNOTATION_TYPE);
+ ITextSourceReference location =
inAtt.getLocationFor(SeamAnnotations.IN_ANNOTATION_TYPE);
if(location != null)
changeAnnotation(location, (IFile)inAtt.getResource());
}
@@ -419,25 +419,25 @@
for(ISeamFactory factory : factorySet){
IFile file = (IFile)factory.getResource();
if(file.getFileExtension().equalsIgnoreCase(JAVA_EXT)){
- ISeamTextSourceReference location =
factory.getLocationFor(SeamAnnotations.FACTORY_ANNOTATION_TYPE);
+ ITextSourceReference location =
factory.getLocationFor(SeamAnnotations.FACTORY_ANNOTATION_TYPE);
if(location != null)
changeAnnotation(location, file);
}else{
- ISeamTextSourceReference location =
factory.getLocationFor(ISeamXmlComponentDeclaration.NAME);
+ ITextSourceReference location =
factory.getLocationFor(ISeamXmlComponentDeclaration.NAME);
if(location != null)
changeXMLNode(location, file);
}
}
}
- private boolean isBadLocation(ISeamTextSourceReference location){
+ private boolean isBadLocation(ITextSourceReference location){
if(location.getStartPosition() == 0 && location.getLength() == 0)
return true;
else
return false;
}
- private void changeXMLNode(ISeamTextSourceReference location, IFile file){
+ private void changeXMLNode(ITextSourceReference location, IFile file){
if(isBadLocation(location))
return;
@@ -466,7 +466,7 @@
}
}
- private void changeAnnotation(ISeamTextSourceReference location, IFile file){
+ private void changeAnnotation(ITextSourceReference location, IFile file){
if(isBadLocation(location))
return;
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ComponentBuilder.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ComponentBuilder.java 2009-05-15
16:33:08 UTC (rev 15304)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ComponentBuilder.java 2009-05-15
16:37:12 UTC (rev 15305)
@@ -29,10 +29,11 @@
import org.eclipse.jdt.core.dom.NormalAnnotation;
import org.eclipse.jdt.core.dom.SingleMemberAnnotation;
import org.eclipse.jdt.core.dom.VariableDeclaration;
+import org.jboss.tools.common.model.project.ext.IValueInfo;
+import org.jboss.tools.common.model.project.ext.impl.ValueInfo;
import org.jboss.tools.seam.core.BeanType;
import org.jboss.tools.seam.core.BijectedAttributeType;
import org.jboss.tools.seam.core.ISeamXmlComponentDeclaration;
-import org.jboss.tools.seam.core.IValueInfo;
import org.jboss.tools.seam.core.SeamComponentMethodType;
import org.jboss.tools.seam.internal.core.BijectedAttribute;
import org.jboss.tools.seam.internal.core.DataModelSelectionAttribute;
@@ -82,9 +83,9 @@
component.setName(ValueInfo.getValueInfo(as[i].getAnnotation(), null));
} else if(SCOPE_ANNOTATION_TYPE.equals(type)) {
ValueInfo scope = ValueInfo.getValueInfo(as[i].getAnnotation(), null);
- if(scope != null && scope.value != null) {
- int q = scope.value.lastIndexOf('.');
- if(q >= 0) scope.value = scope.value.substring(q + 1).toLowerCase();
+ if(scope != null && scope.getValue() != null) {
+ int q = scope.getValue().lastIndexOf('.');
+ if(q >= 0) scope.setValue(scope.getValue().substring(q + 1).toLowerCase());
}
component.setScope(scope);
} else if(INSTALL_ANNOTATION_TYPE.equals(type)) {
@@ -98,7 +99,7 @@
Annotation a = findAnnotation(annotatedType,
BeanType.values()[i].getAnnotationType());
if(a != null) {
ValueInfo v = new ValueInfo();
- v.value = "true"; //$NON-NLS-1$
+ v.setValue("true"); //$NON-NLS-1$
v.valueStartPosition = a.getStartPosition();
v.valueLength = a.getLength();
types.put(BeanType.values()[i], v);
@@ -124,7 +125,7 @@
ValueInfo factoryName = ValueInfo.getValueInfo(a, null);
if(factoryName == null) {
factoryName = new ValueInfo();
- factoryName.value = toPropertyName(m.getName().getIdentifier(), "get");
+ factoryName.setValue(toPropertyName(m.getName().getIdentifier(), "get"));
factoryName.valueLength = m.getName().getLength();
factoryName.valueStartPosition = m.getName().getStartPosition();
}
@@ -144,7 +145,7 @@
}
ValueInfo _a = new ValueInfo();
- _a.value = FACTORY_ANNOTATION_TYPE;
+ _a.setValue(FACTORY_ANNOTATION_TYPE);
_a.valueStartPosition = a.getStartPosition();
_a.valueLength = a.getLength();
factory.addAttribute(FACTORY_ANNOTATION_TYPE, _a);
@@ -181,7 +182,7 @@
Annotation in = as.get(BijectedAttributeType.IN);
if(in != null) {
ValueInfo _in = new ValueInfo();
- _in.value = IN_ANNOTATION_TYPE;
+ _in.setValue(IN_ANNOTATION_TYPE);
_in.valueStartPosition = in.getStartPosition();
_in.valueLength = in.getLength();
att.addAttribute(IN_ANNOTATION_TYPE, _in);
@@ -190,13 +191,13 @@
ValueInfo name = ValueInfo.getValueInfo(main, null);
att.setValue(name);
if(name == null || isDataModelSelectionType
- || name.value == null || name.value.length() == 0) {
+ || name.getValue() == null || name.getValue().length() == 0) {
name = new ValueInfo();
name.valueStartPosition = m.getStartPosition();
name.valueLength = m.getLength();
- name.value = m.getName().getIdentifier();
+ name.setValue(m.getName().getIdentifier());
if(in != null) {
- name.value = toPropertyName(name.value, "set");
+ name.setValue(toPropertyName(name.getValue(), "set"));
}
}
@@ -223,7 +224,7 @@
Annotation in = as.get(BijectedAttributeType.IN);
if(in != null) {
ValueInfo _in = new ValueInfo();
- _in.value = IN_ANNOTATION_TYPE;
+ _in.setValue(IN_ANNOTATION_TYPE);
_in.valueStartPosition = in.getStartPosition();
_in.valueLength = in.getLength();
att.addAttribute(IN_ANNOTATION_TYPE, _in);
@@ -232,11 +233,11 @@
ValueInfo name = ValueInfo.getValueInfo(main, null);
att.setValue(name);
if(name == null || isDataModelSelectionType
- || name.value == null || name.value.length() == 0) {
+ || name.getValue() == null || name.getValue().length() == 0) {
name = new ValueInfo();
name.valueStartPosition = m.getStartPosition();
name.valueLength = m.getLength();
- name.value = getFieldName(m);
+ name.setValue(getFieldName(m));
}
att.setName(name);
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/PackageInfoRequestor.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/PackageInfoRequestor.java 2009-05-15
16:33:08 UTC (rev 15304)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/PackageInfoRequestor.java 2009-05-15
16:37:12 UTC (rev 15305)
@@ -22,6 +22,7 @@
import org.eclipse.jdt.core.dom.IAnnotationBinding;
import org.eclipse.jdt.core.dom.NormalAnnotation;
import org.eclipse.jdt.core.dom.PackageDeclaration;
+import org.jboss.tools.common.model.project.ext.impl.ValueInfo;
import org.jboss.tools.seam.internal.core.SeamNamespace;
import org.jboss.tools.seam.internal.core.scanner.LoadedDeclarations;
Deleted:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ValueInfo.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ValueInfo.java 2009-05-15
16:33:08 UTC (rev 15304)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ValueInfo.java 2009-05-15
16:37:12 UTC (rev 15305)
@@ -1,135 +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.seam.internal.core.scanner.java;
-
-import java.util.List;
-import java.util.Properties;
-
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.Expression;
-import org.eclipse.jdt.core.dom.MemberValuePair;
-import org.eclipse.jdt.core.dom.NormalAnnotation;
-import org.eclipse.jdt.core.dom.QualifiedName;
-import org.eclipse.jdt.core.dom.SingleMemberAnnotation;
-import org.eclipse.jdt.core.dom.StringLiteral;
-import org.jboss.tools.common.xml.XMLUtilities;
-import org.jboss.tools.seam.core.IValueInfo;
-import org.jboss.tools.seam.internal.core.SeamXMLConstants;
-import org.w3c.dom.Element;
-
-public class ValueInfo implements IValueInfo {
- String value;
- int valueStartPosition;
- int valueLength;
-
- /**
- * Factory method.
- * @param node
- * @param name
- * @return
- */
- public static ValueInfo getValueInfo(Annotation node, String name) {
- if(name == null) name = "value"; //$NON-NLS-1$
- if(node instanceof SingleMemberAnnotation) {
- if(name == null || "value".equals(name)) { //$NON-NLS-1$
- SingleMemberAnnotation m = (SingleMemberAnnotation)node;
- ValueInfo result = new ValueInfo();
- Expression exp = m.getValue();
- result.valueLength = exp.getLength();
- result.valueStartPosition = exp.getStartPosition();
- result.value = checkExpression(exp);
- return result;
- }
- return null;
- } else if(node instanceof NormalAnnotation) {
- NormalAnnotation n = (NormalAnnotation)node;
- List<?> vs = n.values();
- if(vs != null) for (int i = 0; i < vs.size(); i++) {
- MemberValuePair p = (MemberValuePair)vs.get(i);
- String pname = p.getName().getIdentifier();
- if(!name.equals(pname)) continue;
- ValueInfo result = new ValueInfo();
- Expression exp = p.getValue();
- result.valueLength = exp.getLength();
- result.valueStartPosition = exp.getStartPosition();
- result.value = checkExpression(exp);
- return result;
- }
- return null;
- }
- return null;
- }
-
- public ValueInfo() {
- }
-
- public String getValue() {
- return value;
- }
-
- public int getStartPosition() {
- return valueStartPosition;
- }
-
- public int getLength() {
- return valueLength;
- }
-
- static String checkExpression(Expression exp) {
- if(exp == null) return null;
- if(exp instanceof StringLiteral) {
- return ((StringLiteral)exp).getLiteralValue();
- } else if(exp instanceof QualifiedName) {
- Object o = exp.resolveConstantExpressionValue();
- if(o != null) return o.toString();
- return exp.toString();
- }
- Object o = exp.resolveConstantExpressionValue();
- if(o != null) return o.toString();
- return exp.toString();
- }
-
- public void setValue(String value) {
- this.value = value;
- }
-
- public Element toXML(Element parent, Properties context) {
- Element element = XMLUtilities.createElement(parent, SeamXMLConstants.TAG_VALUE_INFO);
- if(value != null) element.setAttribute(SeamXMLConstants.ATTR_VALUE, value);
- if(valueStartPosition != 0) element.setAttribute(ATTR_START, "" +
valueStartPosition);
- if(valueLength != 0) element.setAttribute(ATTR_LENGTH, "" + valueLength);
- return element;
- }
-
- static String ATTR_START = "start";
- static String ATTR_LENGTH = "length";
-
- public void loadXML(Element element, Properties context) {
- value = element.getAttribute(SeamXMLConstants.ATTR_VALUE);
- String start = element.getAttribute(ATTR_START);
- if(start != null && start.length() > 0) {
- try {
- valueStartPosition = Integer.parseInt(start);
- } catch (NumberFormatException e) {
- //ignore
- }
- }
- String length = element.getAttribute(ATTR_LENGTH);
- if(length != null && length.length() > 0) {
- try {
- valueLength = Integer.parseInt(length);
- } catch (NumberFormatException e) {
- //ignore
- }
- }
- }
-}
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/ClassPath.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/ClassPath.java 2009-05-15
16:33:08 UTC (rev 15304)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/ClassPath.java 2009-05-15
16:37:12 UTC (rev 15305)
@@ -33,9 +33,9 @@
import org.jboss.tools.common.model.filesystems.impl.FileSystemsLoader;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.common.model.util.XModelObjectUtil;
+import org.jboss.tools.jst.web.model.helpers.InnerModelHelper;
import org.jboss.tools.seam.core.ISeamProject;
import org.jboss.tools.seam.core.SeamCorePlugin;
-import org.jboss.tools.seam.internal.core.InnerModelHelper;
import org.jboss.tools.seam.internal.core.SeamProject;
import org.jboss.tools.seam.internal.core.scanner.LoadedDeclarations;
import org.jboss.tools.seam.internal.core.scanner.ScannerException;
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/LibraryScanner.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/LibraryScanner.java 2009-05-15
16:33:08 UTC (rev 15304)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/LibraryScanner.java 2009-05-15
16:37:12 UTC (rev 15305)
@@ -32,9 +32,9 @@
import org.jboss.tools.common.model.plugin.ModelPlugin;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.common.model.util.XModelObjectUtil;
+import org.jboss.tools.jst.web.model.helpers.InnerModelHelper;
import org.jboss.tools.seam.core.ISeamProject;
import org.jboss.tools.seam.core.SeamCoreMessages;
-import org.jboss.tools.seam.internal.core.InnerModelHelper;
import org.jboss.tools.seam.internal.core.SeamNamespace;
import org.jboss.tools.seam.internal.core.scanner.IFileScanner;
import org.jboss.tools.seam.internal.core.scanner.LoadedDeclarations;
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/TypeScanner.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/TypeScanner.java 2009-05-15
16:33:08 UTC (rev 15304)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/TypeScanner.java 2009-05-15
16:37:12 UTC (rev 15305)
@@ -31,9 +31,10 @@
import org.eclipse.jdt.internal.compiler.env.IBinaryField;
import org.eclipse.jdt.internal.compiler.env.IBinaryMethod;
import org.eclipse.jdt.internal.compiler.impl.Constant;
+import org.jboss.tools.common.model.project.ext.IValueInfo;
+import org.jboss.tools.common.model.project.ext.impl.ValueInfo;
import org.jboss.tools.seam.core.BeanType;
import org.jboss.tools.seam.core.BijectedAttributeType;
-import org.jboss.tools.seam.core.IValueInfo;
import org.jboss.tools.seam.core.SeamComponentMethodType;
import org.jboss.tools.seam.core.SeamCorePlugin;
import org.jboss.tools.seam.internal.core.AbstractContextVariable;
@@ -46,7 +47,6 @@
import org.jboss.tools.seam.internal.core.scanner.LoadedDeclarations;
import org.jboss.tools.seam.internal.core.scanner.Util;
import org.jboss.tools.seam.internal.core.scanner.java.SeamAnnotations;
-import org.jboss.tools.seam.internal.core.scanner.java.ValueInfo;
public class TypeScanner implements SeamAnnotations {
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/xml/PropertiesScanner.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/xml/PropertiesScanner.java 2009-05-15
16:33:08 UTC (rev 15304)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/xml/PropertiesScanner.java 2009-05-15
16:37:12 UTC (rev 15305)
@@ -22,8 +22,9 @@
import org.jboss.tools.common.model.filesystems.impl.FolderImpl;
import org.jboss.tools.common.model.plugin.ModelPlugin;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
+import org.jboss.tools.jst.web.model.helpers.InnerModelHelper;
+import org.jboss.tools.jst.web.model.project.ext.store.XMLValueInfo;
import org.jboss.tools.seam.core.ISeamProject;
-import org.jboss.tools.seam.internal.core.InnerModelHelper;
import org.jboss.tools.seam.internal.core.SeamPropertiesDeclaration;
import org.jboss.tools.seam.internal.core.SeamProperty;
import org.jboss.tools.seam.internal.core.SeamValueString;
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/xml/XMLScanner.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/xml/XMLScanner.java 2009-05-15
16:33:08 UTC (rev 15304)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/xml/XMLScanner.java 2009-05-15
16:37:12 UTC (rev 15305)
@@ -30,16 +30,18 @@
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.filesystems.impl.FolderImpl;
import org.jboss.tools.common.model.plugin.ModelPlugin;
+import org.jboss.tools.common.model.project.ext.impl.ValueInfo;
import org.jboss.tools.common.model.util.EclipseJavaUtil;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.common.model.util.NamespaceMapping;
+import org.jboss.tools.jst.web.model.helpers.InnerModelHelper;
+import org.jboss.tools.jst.web.model.project.ext.store.XMLValueInfo;
import org.jboss.tools.seam.core.ISeamNamespace;
import org.jboss.tools.seam.core.ISeamProject;
import org.jboss.tools.seam.core.ISeamXmlComponentDeclaration;
import org.jboss.tools.seam.core.SeamCorePlugin;
import org.jboss.tools.seam.core.event.ISeamValue;
import org.jboss.tools.seam.core.event.ISeamValueString;
-import org.jboss.tools.seam.internal.core.InnerModelHelper;
import org.jboss.tools.seam.internal.core.SeamProperty;
import org.jboss.tools.seam.internal.core.SeamValueList;
import org.jboss.tools.seam.internal.core.SeamValueMap;
@@ -50,7 +52,6 @@
import org.jboss.tools.seam.internal.core.scanner.IFileScanner;
import org.jboss.tools.seam.internal.core.scanner.LoadedDeclarations;
import org.jboss.tools.seam.internal.core.scanner.ScannerException;
-import org.jboss.tools.seam.internal.core.scanner.java.ValueInfo;
/**
* @author Viacheslav Kabanovich
Deleted:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/xml/XMLValueInfo.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/xml/XMLValueInfo.java 2009-05-15
16:33:08 UTC (rev 15304)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/xml/XMLValueInfo.java 2009-05-15
16:37:12 UTC (rev 15305)
@@ -1,82 +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.scanner.xml;
-
-import java.util.Properties;
-
-import org.jboss.tools.common.model.XModelObject;
-import org.jboss.tools.common.model.util.PositionHolder;
-import org.jboss.tools.common.xml.XMLUtilities;
-import org.jboss.tools.seam.core.IValueInfo;
-import org.jboss.tools.seam.internal.core.SeamXMLConstants;
-import org.jboss.tools.seam.internal.core.SeamXMLHelper;
-import org.w3c.dom.Element;
-
-/**
- * @author Viacheslav Kabanovich
- */
-public class XMLValueInfo implements IValueInfo {
- XModelObject object;
- String attribute;
-
- PositionHolder h = null;
-
- public XMLValueInfo() {
- }
-
- public XMLValueInfo(XModelObject object, String attribute) {
- this.object = object;
- this.attribute = attribute;
- }
-
- public int getLength() {
- getPositionHolder();
- int length = h.getEnd() - h.getStart();
- return length < 0 ? 0 : length;
- }
-
- public int getStartPosition() {
- getPositionHolder();
- return h.getStart();
- }
-
- public String getValue() {
- return object.getAttributeValue(attribute);
- }
-
- PositionHolder getPositionHolder() {
- if(h == null) {
- h = PositionHolder.getPosition(object, attribute);
- }
- h.update();
- return h;
- }
-
- public XModelObject getObject() {
- return object;
- }
-
- public Element toXML(Element parent, Properties context) {
- Element element = XMLUtilities.createElement(parent, SeamXMLConstants.TAG_VALUE_INFO);
- element.setAttribute(SeamXMLConstants.ATTR_CLASS, SeamXMLConstants.CLS_XML);
- if(attribute != null) element.setAttribute("attr", attribute);
- if(object != null) {
- SeamXMLHelper.saveModelObject(element, object, "object", context);
- }
- return element;
- }
-
- public void loadXML(Element element, Properties context) {
- attribute = element.getAttribute("attr");
- object = SeamXMLHelper.loadModelObject(element, "object", context);
- }
-
-}
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/IValidationErrorManager.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/IValidationErrorManager.java 2009-05-15
16:33:08 UTC (rev 15304)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/IValidationErrorManager.java 2009-05-15
16:37:12 UTC (rev 15305)
@@ -14,8 +14,8 @@
import org.eclipse.core.resources.IResource;
import org.eclipse.wst.validation.internal.operations.WorkbenchReporter;
+import org.jboss.tools.common.model.project.ext.ITextSourceReference;
import org.jboss.tools.seam.core.ISeamProject;
-import org.jboss.tools.seam.core.ISeamTextSourceReference;
/**
* @author Alexey Kazakov
@@ -31,7 +31,7 @@
* @param target
*/
void addError(String messageId, String preferenceKey,
- String[] messageArguments, ISeamTextSourceReference location,
+ String[] messageArguments, ITextSourceReference location,
IResource target);
/**
@@ -53,7 +53,7 @@
* @param target
*/
void addError(String messageId, String preferenceKey,
- ISeamTextSourceReference location, IResource target);
+ ITextSourceReference location, IResource target);
/**
* Adds a marker to the resource
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java 2009-05-15
16:33:08 UTC (rev 15304)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java 2009-05-15
16:37:12 UTC (rev 15305)
@@ -32,6 +32,7 @@
import org.eclipse.wst.validation.internal.provisional.core.IReporter;
import org.jboss.tools.common.el.core.resolver.TypeInfoCollector;
import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.project.ext.ITextSourceReference;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.seam.core.BijectedAttributeType;
import org.jboss.tools.seam.core.IBijectedAttribute;
@@ -46,7 +47,6 @@
import org.jboss.tools.seam.core.ISeamJavaSourceReference;
import org.jboss.tools.seam.core.ISeamProject;
import org.jboss.tools.seam.core.ISeamProperty;
-import org.jboss.tools.seam.core.ISeamTextSourceReference;
import org.jboss.tools.seam.core.ISeamXmlComponentDeclaration;
import org.jboss.tools.seam.core.ISeamXmlFactory;
import org.jboss.tools.seam.core.ScopeType;
@@ -317,7 +317,7 @@
(factoryScope == variable.getScope() ||
factoryScope.getPriority()>variable.getScope().getPriority())) {
// Duplicate factory name. Mark it.
// Save link to factory resource.
- ISeamTextSourceReference location = null;
+ ITextSourceReference location = null;
if(!firstDuplicateVariableWasMarked) {
firstDuplicateVariableWasMarked = true;
// mark original factory
@@ -449,7 +449,7 @@
if(!markedDeclarations.contains(checkedDeclaration) &&
sourceCheckedDeclaration) {
// Mark first wrong declaration with that name
IResource checkedDeclarationResource = checkedDeclaration.getResource();
- ISeamTextSourceReference location =
((SeamComponentDeclaration)checkedDeclaration).getLocationFor(SeamComponentDeclaration.PATH_OF_NAME);
+ ITextSourceReference location =
((SeamComponentDeclaration)checkedDeclaration).getLocationFor(SeamComponentDeclaration.PATH_OF_NAME);
if(!isEmptyLocation(location)) {
addError(NONUNIQUE_COMPONENT_NAME_MESSAGE_ID,
SeamPreferences.NONUNIQUE_COMPONENT_NAME, new String[]{componentName}, location,
checkedDeclarationResource);
}
@@ -457,7 +457,7 @@
}
// Mark next wrong declaration with that name
markedDeclarations.add(javaDeclaration);
- ISeamTextSourceReference location =
((SeamComponentDeclaration)javaDeclaration).getLocationFor(SeamComponentDeclaration.PATH_OF_NAME);
+ ITextSourceReference location =
((SeamComponentDeclaration)javaDeclaration).getLocationFor(SeamComponentDeclaration.PATH_OF_NAME);
if(!isEmptyLocation(location)) {
addError(NONUNIQUE_COMPONENT_NAME_MESSAGE_ID,
SeamPreferences.NONUNIQUE_COMPONENT_NAME, new String[]{componentName}, location,
javaDeclarationResource);
}
@@ -493,7 +493,7 @@
type = EclipseResourceUtil.getJavaProject(p).findType(className);
if(type==null) {
// Mark wrong class name
- ISeamTextSourceReference location =
((SeamComponentDeclaration)declaration).getLocationFor(ISeamXmlComponentDeclaration.CLASS);
+ ITextSourceReference location =
((SeamComponentDeclaration)declaration).getLocationFor(ISeamXmlComponentDeclaration.CLASS);
if(isEmptyLocation(location)) {
location =
((SeamComponentDeclaration)declaration).getLocationFor(ISeamXmlComponentDeclaration.NAME);
}
@@ -532,7 +532,7 @@
}
}
- static boolean isEmptyLocation(ISeamTextSourceReference location) {
+ static boolean isEmptyLocation(ITextSourceReference location) {
return (location == null
//is dead location, we cannot now change provider to return null
//because it may give rise to other errors.
@@ -546,22 +546,22 @@
ISeamJavaComponentDeclaration javaDeclaration = component.getJavaDeclaration();
ScopeType scope = component.getScope();
if(scope == ScopeType.STATELESS) {
- ISeamTextSourceReference location = getScopeLocation(component);
+ ITextSourceReference location = getScopeLocation(component);
addError(ENTITY_COMPONENT_WRONG_SCOPE_MESSAGE_ID,
SeamPreferences.ENTITY_COMPONENT_WRONG_SCOPE, new String[]{component.getName()}, location,
javaDeclaration.getResource());
}
}
}
- private ISeamTextSourceReference getScopeLocation(ISeamComponent component) {
+ private ITextSourceReference getScopeLocation(ISeamComponent component) {
ISeamJavaComponentDeclaration javaDeclaration = component.getJavaDeclaration();
- ISeamTextSourceReference location =
((SeamComponentDeclaration)javaDeclaration).getLocationFor(SeamComponentDeclaration.PATH_OF_SCOPE);
+ ITextSourceReference location =
((SeamComponentDeclaration)javaDeclaration).getLocationFor(SeamComponentDeclaration.PATH_OF_SCOPE);
if(isEmptyLocation(location)) {
location = getNameLocation(javaDeclaration);
}
return location;
}
- private ISeamTextSourceReference getNameLocation(ISeamJavaSourceReference source) {
+ private ITextSourceReference getNameLocation(ISeamJavaSourceReference source) {
int length = 0;
int offset = 0;
try {
@@ -580,7 +580,7 @@
validateStatefulComponentMethods(SeamComponentMethodType.REMOVE, component,
REMOVE_METHOD_SUFIX_MESSAGE_ID,
SeamPreferences.STATEFUL_COMPONENT_DOES_NOT_CONTENT_REMOVE);
ScopeType scope = component.getScope();
if(scope == ScopeType.PAGE || scope == ScopeType.STATELESS) {
- ISeamTextSourceReference location = getScopeLocation(component);
+ ITextSourceReference location = getScopeLocation(component);
addError(STATEFUL_COMPONENT_WRONG_SCOPE_MESSAGE_ID,
SeamPreferences.STATEFUL_COMPONENT_WRONG_SCOPE, new String[]{component.getName()},
location, javaDeclaration.getResource());
}
validateDuplicateComponentMethod(SeamComponentMethodType.REMOVE, component,
REMOVE_METHOD_SUFIX_MESSAGE_ID, SeamPreferences.DUPLICATE_REMOVE);
@@ -589,7 +589,7 @@
private void validateStatefulComponentMethods(SeamComponentMethodType methodType,
ISeamComponent component, String postfixMessageId, String preferenceKey) {
ISeamJavaComponentDeclaration javaDeclaration = component.getJavaDeclaration();
- ISeamTextSourceReference classNameLocation = getNameLocation(javaDeclaration);
+ ITextSourceReference classNameLocation = getNameLocation(javaDeclaration);
Set<ISeamComponentMethod> methods =
javaDeclaration.getMethodsByType(methodType);
if(methods==null || methods.isEmpty()) {
addError(STATEFUL_COMPONENT_DOES_NOT_CONTAIN_METHOD_SUFIX_MESSAGE_ID +
postfixMessageId, preferenceKey, new String[]{component.getName()}, classNameLocation,
javaDeclaration.getResource());
@@ -610,7 +610,7 @@
if(javaDeclaration.getSourcePath().equals(method.getSourcePath())) {
IMethod javaMethod = (IMethod)method.getSourceMember();
String methodName = javaMethod.getElementName();
- ISeamTextSourceReference methodNameLocation = getNameLocation(method);
+ ITextSourceReference methodNameLocation = getNameLocation(method);
addError(DUPLICATE_METHOD_PREFIX_MESSAGE_ID + postfixMessageId, preferenceKey, new
String[]{methodName}, methodNameLocation, javaDeclaration.getResource());
}
}
@@ -659,7 +659,7 @@
if(variables==null || variables.size()<1) {
// Injection has unknown name. Mark it.
IResource declarationResource = declaration.getResource();
- ISeamTextSourceReference nameRef = getNameLocation(bijection);
+ ITextSourceReference nameRef = getNameLocation(bijection);
if(nameRef == null) {
nameRef = bijection;
}
@@ -727,7 +727,7 @@
String methodName = javaMethod.getElementName();
if(javaDeclaration.getSourcePath().equals(javaMethod.getPath())) {
validationContext.addLinkedCoreResource(component.getName(),
javaDeclaration.getSourcePath());
- ISeamTextSourceReference methodNameLocation = getNameLocation(method);
+ ITextSourceReference methodNameLocation = getNameLocation(method);
addError(DESTROY_METHOD_BELONGS_TO_STATELESS_SESSION_BEAN_ID,
SeamPreferences.DESTROY_METHOD_BELONGS_TO_STATELESS_SESSION_BEAN, new
String[]{methodName}, methodNameLocation, method.getResource());
}
}
@@ -741,7 +741,7 @@
IMethod javaMethod = (IMethod)method.getSourceMember();
String methodName = javaMethod.getElementName();
if(declaration.getSourcePath().equals(javaMethod.getPath())) {
- ISeamTextSourceReference methodNameLocation = getNameLocation(method);
+ ITextSourceReference methodNameLocation = getNameLocation(method);
addError(sufixMessageId + NONCOMPONENTS_METHOD_SUFIX_MESSAGE_ID, preferenceKey, new
String[]{methodName}, methodNameLocation, method.getResource());
validationContext.addUnnamedCoreResource(declaration.getSourcePath());
}
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidationHelper.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidationHelper.java 2009-05-15
16:33:08 UTC (rev 15304)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidationHelper.java 2009-05-15
16:37:12 UTC (rev 15305)
@@ -24,12 +24,12 @@
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.wst.validation.internal.operations.WorkbenchContext;
+import org.jboss.tools.common.model.project.ext.ITextSourceReference;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.seam.core.ISeamComponent;
import org.jboss.tools.seam.core.ISeamComponentDeclaration;
import org.jboss.tools.seam.core.ISeamElement;
import org.jboss.tools.seam.core.ISeamProject;
-import org.jboss.tools.seam.core.ISeamTextSourceReference;
import org.jboss.tools.seam.core.SeamCoreMessages;
import org.jboss.tools.seam.core.SeamCorePlugin;
import org.jboss.tools.seam.internal.core.AbstractContextVariable;
@@ -66,7 +66,7 @@
Set<ISeamComponentDeclaration> declarations =
((ISeamComponent)element).getAllDeclarations();
for (Object o : declarations) {
SeamComponentDeclaration d = (SeamComponentDeclaration)o;
- ISeamTextSourceReference location =
d.getLocationFor(SeamComponentDeclaration.PATH_OF_NAME);
+ ITextSourceReference location =
d.getLocationFor(SeamComponentDeclaration.PATH_OF_NAME);
if(!SeamCoreValidator.isEmptyLocation(location)) {
return d.getResource();
}
@@ -79,7 +79,7 @@
* @param seam model element
* @return location of name attribute
*/
- public ISeamTextSourceReference getLocationOfName(ISeamElement element) {
+ public ITextSourceReference getLocationOfName(ISeamElement element) {
return getLocationOfAttribute(element, SeamComponentDeclaration.PATH_OF_NAME);
}
@@ -87,8 +87,8 @@
* @param seam model element
* @return location of attribute
*/
- public ISeamTextSourceReference getLocationOfAttribute(ISeamElement element, String
attributeName) {
- ISeamTextSourceReference location = null;
+ public ITextSourceReference getLocationOfAttribute(ISeamElement element, String
attributeName) {
+ ITextSourceReference location = null;
if(element instanceof AbstractContextVariable) {
location = ((AbstractContextVariable)element).getLocationFor(attributeName);
} else if(element instanceof ISeamComponent) {
@@ -102,8 +102,8 @@
} else if(element instanceof SeamComponentDeclaration) {
location = ((SeamComponentDeclaration)element).getLocationFor(attributeName);
}
- if(SeamCoreValidator.isEmptyLocation(location) && element instanceof
ISeamTextSourceReference) {
- location = (ISeamTextSourceReference)element;
+ if(SeamCoreValidator.isEmptyLocation(location) && element instanceof
ITextSourceReference) {
+ location = (ITextSourceReference)element;
}
return location;
}
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/ValidationErrorManager.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/ValidationErrorManager.java 2009-05-15
16:33:08 UTC (rev 15304)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/ValidationErrorManager.java 2009-05-15
16:37:12 UTC (rev 15305)
@@ -23,8 +23,8 @@
import org.eclipse.wst.validation.internal.provisional.core.IMessage;
import org.eclipse.wst.validation.internal.provisional.core.IReporter;
import org.eclipse.wst.validation.internal.provisional.core.IValidator;
+import org.jboss.tools.common.model.project.ext.ITextSourceReference;
import org.jboss.tools.seam.core.ISeamProject;
-import org.jboss.tools.seam.core.ISeamTextSourceReference;
import org.jboss.tools.seam.core.SeamCorePlugin;
import org.jboss.tools.seam.core.SeamPreferences;
@@ -76,7 +76,7 @@
* org.eclipse.core.resources.IResource)
*/
public void addError(String messageId, String preferenceKey,
- String[] messageArguments, ISeamTextSourceReference location,
+ String[] messageArguments, ITextSourceReference location,
IResource target) {
addError(messageId, preferenceKey, messageArguments, location
.getLength(), location.getStartPosition(), target);
@@ -91,7 +91,7 @@
* org.eclipse.core.resources.IResource)
*/
public void addError(String messageId, String preferenceKey,
- ISeamTextSourceReference location, IResource target) {
+ ITextSourceReference location, IResource target) {
addError(messageId, preferenceKey, new String[0], location, target);
}