Author: scabanovich
Date: 2008-02-28 11:05:23 -0500 (Thu, 28 Feb 2008)
New Revision: 6643
Added:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamDeclaration.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/ISeamContextVariable.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/internal/core/AbstractSeamDeclaration.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/SeamContextShortVariable.java
Log:
JBIDE-509 internal method getLocationFor(String) moved to new interface ISeamDeclaration
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 2008-02-28
15:58:34 UTC (rev 6642)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamComponentDeclaration.java 2008-02-28
16:05:23 UTC (rev 6643)
@@ -14,13 +14,8 @@
* Represents declaration of seam component.
* @author Alexey Kazakov
*/
-public interface ISeamComponentDeclaration extends ISeamElement, ISeamTextSourceReference
{
+public interface ISeamComponentDeclaration extends ISeamDeclaration,
ISeamTextSourceReference {
- /**
- * @return name of component.
- */
- public String getName();
-
public ISeamComponentDeclaration clone() throws CloneNotSupportedException;
}
\ No newline at end of file
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamContextVariable.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamContextVariable.java 2008-02-28
15:58:34 UTC (rev 6642)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamContextVariable.java 2008-02-28
16:05:23 UTC (rev 6643)
@@ -14,14 +14,9 @@
* Represents Seam Context Variable.
* @author Alexey Kazakov
*/
-public interface ISeamContextVariable extends ISeamElement {
+public interface ISeamContextVariable extends ISeamDeclaration {
/**
- * @return name of context variable
- */
- public String getName();
-
- /**
* Sets name
* @param name
*/
Added:
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
(rev 0)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamDeclaration.java 2008-02-28
16:05:23 UTC (rev 6643)
@@ -0,0 +1,31 @@
+ /*******************************************************************************
+ * 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;
+
+/**
+ * @author Viacheslav Kabanovich
+ */
+public interface ISeamDeclaration extends ISeamElement {
+
+ /**
+ * @return name of this declaration
+ */
+ public String getName();
+
+ /**
+ * @param path
+ * @return source reference for some member of declaration.
+ * e.g. if you need source reference for @Name you have to
+ * invoke getLocationFor("name");
+ */
+ public ISeamTextSourceReference getLocationFor(String path);
+
+}
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 2008-02-28
15:58:34 UTC (rev 6642)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamProperty.java 2008-02-28
16:05:23 UTC (rev 6643)
@@ -15,14 +15,9 @@
/**
* A property of Seam Component defined in component.xml or seam.properties files
*/
-public interface ISeamProperty extends ISeamElement, ISeamTextSourceReference {
+public interface ISeamProperty extends ISeamDeclaration, ISeamTextSourceReference {
/**
- * @return name of this property
- */
- public String getName();
-
- /**
* @return value of this property
*/
public ISeamValue getValue();
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 2008-02-28
15:58:34 UTC (rev 6642)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/AbstractSeamDeclaration.java 2008-02-28
16:05:23 UTC (rev 6643)
@@ -17,6 +17,7 @@
import org.jboss.tools.common.model.XModelObject;
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;
@@ -27,7 +28,7 @@
/**
* @author Viacheslav Kabanovich
*/
-public abstract class AbstractSeamDeclaration extends SeamObject implements
ISeamTextSourceReference, IOpenableElement {
+public abstract class AbstractSeamDeclaration extends SeamObject implements
ISeamDeclaration, ISeamTextSourceReference, IOpenableElement {
public static final String PATH_OF_NAME = "name"; //$NON-NLS-1$
protected String name;
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 2008-02-28
15:58:34 UTC (rev 6642)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamComponent.java 2008-02-28
16:05:23 UTC (rev 6643)
@@ -27,6 +27,7 @@
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;
@@ -88,6 +89,18 @@
return null;
}
+ public ISeamTextSourceReference getLocationFor(String path) {
+ ISeamJavaComponentDeclaration javaDeclaration = getJavaDeclaration();
+ if(javaDeclaration != null) return javaDeclaration.getLocationFor(path);
+ Set<ISeamXmlComponentDeclaration> xml = getXmlDeclarations();
+ for(ISeamXmlComponentDeclaration d: xml) {
+ if(d.getLocationFor(path) != null) {
+ return d.getLocationFor(path);
+ }
+ }
+ return null;
+ }
+
/**
*
*/
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 2008-02-28
15:58:34 UTC (rev 6642)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamContextShortVariable.java 2008-02-28
16:05:23 UTC (rev 6643)
@@ -2,6 +2,7 @@
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 {
@@ -34,4 +35,8 @@
public SeamContextShortVariable clone() throws CloneNotSupportedException {
throw new CloneNotSupportedException();
}
+
+ public ISeamTextSourceReference getLocationFor(String path) {
+ return original.getLocationFor(path);
+ }
}