JBoss Tools SVN: r10002 - trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2008-09-01 12:49:03 -0400 (Mon, 01 Sep 2008)
New Revision: 10002
Modified:
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/JumpToHyperlink.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2576 Unhandled event loop exception is occured when make OpenOn on <servlet-name>Faces Servlet</servlet-name> in web.xml
Issue is fixed
Modified: trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/JumpToHyperlink.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/JumpToHyperlink.java 2008-09-01 16:39:52 UTC (rev 10001)
+++ trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/JumpToHyperlink.java 2008-09-01 16:49:03 UTC (rev 10002)
@@ -125,20 +125,21 @@
String requiredAxis = axis.toLowerCase();
List<Node> elements = new ArrayList<Node>();
for (int i = 0; list != null && i < list.getLength(); i++) {
- IDOMElement element = (IDOMElement)list.item(i);
- String currentAxis = XMLRootHyperlinkPartitioner.computeAxis(getDocument(), element.getStartOffset()) + "/";
- currentAxis = currentAxis.toLowerCase();
-
- if (currentAxis.endsWith(requiredAxis)) {
- elements.add(element);
- }
-
- if (element.hasChildNodes()) {
- List<Node> add = findElementsByAxis(element.getChildNodes(), axis);
- if (add != null)
- elements.addAll(add);
- }
-
+ if (!(list.item(i) instanceof IDOMElement))
+ continue;
+ IDOMElement element = (IDOMElement)list.item(i);
+ String currentAxis = XMLRootHyperlinkPartitioner.computeAxis(getDocument(), element.getStartOffset()) + "/";
+ currentAxis = currentAxis.toLowerCase();
+
+ if (currentAxis.endsWith(requiredAxis)) {
+ elements.add(element);
+ }
+
+ if (element.hasChildNodes()) {
+ List<Node> add = findElementsByAxis(element.getChildNodes(), axis);
+ if (add != null)
+ elements.addAll(add);
+ }
}
return elements;
}
16 years, 4 months
JBoss Tools SVN: r10001 - trunk/ws/docs/reference/en/images.
by jbosstools-commits@lists.jboss.org
Author: abogachuk
Date: 2008-09-01 12:39:52 -0400 (Mon, 01 Sep 2008)
New Revision: 10001
Modified:
trunk/ws/docs/reference/en/images/jbossws_bottomup.png
Log:
resolution changed
Modified: trunk/ws/docs/reference/en/images/jbossws_bottomup.png
===================================================================
(Binary files differ)
16 years, 4 months
JBoss Tools SVN: r10000 - in trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test: src/org/jboss/tools/jsf/vpe/jsf/test and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: estherbin
Date: 2008-09-01 10:50:59 -0400 (Mon, 01 Sep 2008)
New Revision: 10000
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/META-INF/MANIFEST.MF
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/CommonJBIDE2010Test.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2594Test.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2624.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE924Test.java
Log:
Moved resources reference functionality to the separate bundle.
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/META-INF/MANIFEST.MF 2008-09-01 14:44:41 UTC (rev 9999)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/META-INF/MANIFEST.MF 2008-09-01 14:50:59 UTC (rev 10000)
@@ -19,7 +19,10 @@
org.jboss.tools.vpe.ui.test;visibility:=reexport,
org.eclipse.jface.text,
org.jboss.tools.jsf.vpe.jsf,
- org.jboss.tools.jst.web
+ org.jboss.tools.jst.web,
+ org.jboss.tools.common.el,
+ org.jboss.tools.common.rreferences
+
Bundle-ClassPath: jsf-test.jar
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/CommonJBIDE2010Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/CommonJBIDE2010Test.java 2008-09-01 14:44:41 UTC (rev 9999)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/CommonJBIDE2010Test.java 2008-09-01 14:50:59 UTC (rev 10000)
@@ -17,8 +17,8 @@
import java.util.Map.Entry;
import org.eclipse.core.resources.IFile;
-import org.jboss.tools.vpe.el.ELReferenceList;
-import org.jboss.tools.vpe.rreferences.ResourceReference;
+import org.jboss.tools.common.el.vpe.ELReferenceList;
+import org.jboss.tools.common.rreferences.core.ResourceReference;
import org.jboss.tools.vpe.ui.test.TestUtil;
import org.jboss.tools.vpe.ui.test.VpeTest;
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2594Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2594Test.java 2008-09-01 14:44:41 UTC (rev 9999)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2594Test.java 2008-09-01 14:50:59 UTC (rev 10000)
@@ -18,10 +18,10 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Platform;
+import org.jboss.tools.common.el.global.GlobalELReferenceList;
+import org.jboss.tools.common.rreferences.core.ResourceReference;
import org.jboss.tools.jsf.vpe.jsf.test.CommonJBIDE2010Test;
import org.jboss.tools.vpe.editor.util.ElService;
-import org.jboss.tools.vpe.el.GlobalELReferenceList;
-import org.jboss.tools.vpe.rreferences.ResourceReference;
/**
* Test case for testing global El expression substitution
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2624.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2624.java 2008-09-01 14:44:41 UTC (rev 9999)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2624.java 2008-09-01 14:50:59 UTC (rev 10000)
@@ -21,12 +21,12 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.part.FileEditorInput;
+import org.jboss.tools.common.rreferences.core.RelativeFolderReferenceList;
+import org.jboss.tools.common.rreferences.core.ResourceReference;
import org.jboss.tools.jsf.vpe.jsf.test.JsfAllTests;
import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
import org.jboss.tools.vpe.editor.VpeController;
import org.jboss.tools.vpe.editor.util.HTML;
-import org.jboss.tools.vpe.rreferences.RelativeFolderReferenceList;
-import org.jboss.tools.vpe.rreferences.ResourceReference;
import org.jboss.tools.vpe.ui.test.TestUtil;
import org.jboss.tools.vpe.ui.test.VpeTest;
import org.mozilla.interfaces.nsIDOMDocument;
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE924Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE924Test.java 2008-09-01 14:44:41 UTC (rev 9999)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE924Test.java 2008-09-01 14:50:59 UTC (rev 10000)
@@ -16,12 +16,12 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.part.FileEditorInput;
+import org.jboss.tools.common.rreferences.core.AbsoluteFolderReferenceList;
+import org.jboss.tools.common.rreferences.core.ResourceReference;
import org.jboss.tools.jsf.vpe.jsf.test.JsfAllTests;
import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
import org.jboss.tools.vpe.editor.VpeController;
import org.jboss.tools.vpe.editor.util.HTML;
-import org.jboss.tools.vpe.rreferences.AbsoluteFolderReferenceList;
-import org.jboss.tools.vpe.rreferences.ResourceReference;
import org.jboss.tools.vpe.ui.test.TestUtil;
import org.jboss.tools.vpe.ui.test.VpeTest;
import org.mozilla.interfaces.nsIDOMDocument;
16 years, 4 months
JBoss Tools SVN: r9999 - in trunk/vpe/plugins/org.jboss.tools.vpe: META-INF and 8 other directories.
by jbosstools-commits@lists.jboss.org
Author: estherbin
Date: 2008-09-01 10:44:41 -0400 (Mon, 01 Sep 2008)
New Revision: 9999
Added:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/VpeResourcesDialog.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/VpeResourcesDialogView.java
Removed:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/el/ELReferenceList.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/el/ElVariablesComposite.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/el/GlobalELReferenceList.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/el/GlobalElVariablesComposite.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/AbsoluteFolderReferenceComposite.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/AbsoluteFolderReferenceList.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/CSSReferenceList.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/CssReferencesComposite.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/FolderReferenceComposite.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/GlobalResourceReference.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/RelativeFolderReferenceComposite.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/RelativeFolderReferenceList.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/ResourceReference.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/ResourceReferenceList.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/ResourceReferenceListListener.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/ResourceReferencesComposite.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/ResourceReferencesDialogView.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/ResourceReferencesTableProvider.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/TaglibReferenceList.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/TaglibReferencesComposite.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/VpeAddReferenceSupport.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/VpeCssReferencesDialog.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/VpeResourcesDialog.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/VpeResourcesDialogView.java
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/META-INF/MANIFEST.MF
trunk/vpe/plugins/org.jboss.tools.vpe/plugin.xml
trunk/vpe/plugins/org.jboss.tools.vpe/resources/meta/vpe.meta
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/context/VpePageContext.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/preferences/ELVariablesPreferencePage.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/preferences/TemplatesPreferencePage.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionSrc.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/ElService.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/FileUtil.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/VpeStyleUtil.java
Log:
Moved resources reference functionality to the separate bundle.
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/META-INF/MANIFEST.MF
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/META-INF/MANIFEST.MF 2008-09-01 14:42:40 UTC (rev 9998)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/META-INF/MANIFEST.MF 2008-09-01 14:44:41 UTC (rev 9999)
@@ -72,6 +72,8 @@
org.jboss.tools.vpe.xulrunner,
org.mozilla.xpcom,
org.eclipse.draw2d,
- org.jboss.tools.jst.web
+ org.jboss.tools.jst.web,
+ org.jboss.tools.common.rreferences,
+ org.jboss.tools.common.el
Bundle-Version: 2.1.0
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/plugin.xml
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/plugin.xml 2008-09-01 14:42:40 UTC (rev 9998)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/plugin.xml 2008-09-01 14:44:41 UTC (rev 9999)
@@ -28,8 +28,8 @@
/>
</extension>
<extension point="org.jboss.tools.common.model.classes">
- <xclass id="org.jboss.tools.jst.web.ui.rreferences.VpeAddReferenceSupport"
- class="org.jboss.tools.vpe.rreferences.VpeAddReferenceSupport"/>
+ <xclass id="org.jboss.tools.common.rreferences.core.VpeAddReferenceSupport"
+ class="org.jboss.tools.common.rreferences.core.VpeAddReferenceSupport"/>
</extension>
<extension point="org.eclipse.ui.preferencePages">
<page category="org.jboss.tools.common.xstudio.editors" class="org.jboss.tools.vpe.editor.preferences.VpeEditorPreferencesPage" id="org.jboss.tools.vpe.editor" name="Visual Page Editor"></page>
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/resources/meta/vpe.meta
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/resources/meta/vpe.meta 2008-09-01 14:42:40 UTC (rev 9998)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/resources/meta/vpe.meta 2008-09-01 14:44:41 UTC (rev 9999)
@@ -35,7 +35,7 @@
<XActionItem kind="list">
<XActionItem kind="list" name="CreateActions">
<XActionItem HandlerClassName="%SpecialWizard%" ICON="action.empty"
- PROPERTIES="support=org.jboss.tools.jst.web.rreferences.VpeAddReferenceSupport"
+ PROPERTIES="support=org.jboss.tools.rreferences.core.VpeAddReferenceSupport"
displayName="Add CSS Reference..." kind="action" name="AddItem">
<EntityData EntityName="VPECSSReference">
<AttributeData AttributeName="location"/>
@@ -45,7 +45,7 @@
</XActionItem>
<XActionItem kind="list" name="EditActions">
<XActionItem HandlerClassName="%SpecialWizard%" ICON="action.empty"
- PROPERTIES="support=org.jboss.tools.jst.web.rreferences.VpeAddReferenceSupport"
+ PROPERTIES="support=org.jboss.tools.rreferences.core.VpeAddReferenceSupport"
displayName="Edit CSS Reference..." kind="action" name="EditItem">
<EntityData EntityName="VPECSSReference">
<AttributeData AttributeName="location"/>
@@ -85,7 +85,7 @@
<XActionItem kind="list">
<XActionItem kind="list" name="CreateActions">
<XActionItem HandlerClassName="%SpecialWizard%" ICON="action.empty"
- PROPERTIES="support=org.jboss.tools.jst.web.rreferences.VpeAddReferenceSupport"
+ PROPERTIES="support=org.jboss.tools.rreferences.core.VpeAddReferenceSupport"
displayName="Add CSS Reference..." kind="action" name="AddItem">
<EntityData EntityName="VPECSSReferenceExt">
<AttributeData AttributeName="location"/>
@@ -95,7 +95,7 @@
</XActionItem>
<XActionItem kind="list" name="EditActions">
<XActionItem HandlerClassName="%SpecialWizard%" ICON="action.empty"
- PROPERTIES="support=org.jboss.tools.jst.web.rreferences.VpeAddReferenceSupport"
+ PROPERTIES="support=org.jboss.tools.rreferences.core.VpeAddReferenceSupport"
displayName="Edit CSS Reference..." kind="action" name="EditItem">
<EntityData EntityName="VPECSSReferenceExt">
<AttributeData AttributeName="location"/>
@@ -138,7 +138,7 @@
<XActionItem kind="list">
<XActionItem kind="list" name="CreateActions">
<XActionItem HandlerClassName="%SpecialWizard%" ICON="action.empty"
- PROPERTIES="support=org.jboss.tools.jst.web.rreferences.VpeAddReferenceSupport"
+ PROPERTIES="support=org.jboss.tools.rreferences.core.VpeAddReferenceSupport"
displayName="Add El Reference..." kind="action" name="AddItem">
<EntityData EntityName="VPEElReference">
<AttributeData AttributeName="location" Mandatory="no"/>
@@ -149,7 +149,7 @@
</XActionItem>
<XActionItem kind="list" name="EditActions">
<XActionItem HandlerClassName="%SpecialWizard%" ICON="action.empty"
- PROPERTIES="support=org.jboss.tools.jst.web.rreferences.VpeAddReferenceSupport"
+ PROPERTIES="support=org.jboss.tools.rreferences.core.VpeAddReferenceSupport"
displayName="Edit El Reference..." kind="action" name="EditItem">
<EntityData EntityName="VPEElReference">
<AttributeData AttributeName="location"/>
@@ -192,7 +192,7 @@
<XActionItem kind="list">
<XActionItem kind="list" name="CreateActions">
<XActionItem HandlerClassName="%SpecialWizard%" ICON="action.empty"
- PROPERTIES="support=org.jboss.tools.jst.web.rreferences.VpeAddReferenceSupport"
+ PROPERTIES="support=org.jboss.tools.rreferences.core.VpeAddReferenceSupport"
displayName="Add El Reference..." kind="action" name="AddItem">
<EntityData EntityName="VPEELReferenceExt">
<AttributeData AttributeName="location"/>
@@ -203,7 +203,7 @@
</XActionItem>
<XActionItem kind="list" name="EditActions">
<XActionItem HandlerClassName="%SpecialWizard%" ICON="action.empty"
- PROPERTIES="support=org.jboss.tools.jst.web.rreferences.VpeAddReferenceSupport"
+ PROPERTIES="support=org.jboss.tools.rreferences.core.VpeAddReferenceSupport"
displayName="Edit El Reference..." kind="action" name="EditItem">
<EntityData EntityName="VPEElReference">
<AttributeData AttributeName="location"/>
@@ -244,7 +244,7 @@
<XActionItem kind="list">
<XActionItem kind="list" name="CreateActions">
<XActionItem HandlerClassName="%SpecialWizard%" ICON="action.empty"
- PROPERTIES="support=org.jboss.tools.jst.web.rreferences.VpeAddReferenceSupport"
+ PROPERTIES="support=org.jboss.tools.rreferences.core.VpeAddReferenceSupport"
displayName="Add El Reference..." kind="action" name="AddItem">
<EntityData EntityName="VPEGlobalElReference">
<AttributeData AttributeName="location" Mandatory="no"/>
@@ -255,7 +255,7 @@
</XActionItem>
<XActionItem kind="list" name="EditActions">
<XActionItem HandlerClassName="%SpecialWizard%" ICON="action.empty"
- PROPERTIES="support=org.jboss.tools.jst.web.rreferences.VpeAddReferenceSupport"
+ PROPERTIES="support=org.jboss.tools.rreferences.core.VpeAddReferenceSupport"
displayName="Edit El Reference..." kind="action" name="EditItem">
<EntityData EntityName="VPEGlobalElReference">
<AttributeData AttributeName="location"/>
@@ -297,7 +297,7 @@
<XActionItem kind="list">
<XActionItem kind="list" name="CreateActions">
<XActionItem HandlerClassName="%SpecialWizard%" ICON="action.empty"
- PROPERTIES="support=org.jboss.tools.jst.web.rreferences.VpeAddReferenceSupport"
+ PROPERTIES="support=org.jboss.tools.rreferences.core.VpeAddReferenceSupport"
displayName="Add El Reference..." kind="action" name="AddItem">
<EntityData EntityName="VPEGlobalElReferenceExt">
<AttributeData AttributeName="location"/>
@@ -308,7 +308,7 @@
</XActionItem>
<XActionItem kind="list" name="EditActions">
<XActionItem HandlerClassName="%SpecialWizard%" ICON="action.empty"
- PROPERTIES="support=org.jboss.tools.jst.web.rreferences.VpeAddReferenceSupport"
+ PROPERTIES="support=org.jboss.tools.rreferences.core.VpeAddReferenceSupport"
displayName="Edit El Reference..." kind="action" name="EditItem">
<EntityData EntityName="VPEGlobalElReferenceExt">
<AttributeData AttributeName="location"/>
@@ -411,7 +411,7 @@
<XActionItem kind="list">
<XActionItem kind="list" name="CreateActions">
<XActionItem HandlerClassName="%SpecialWizard%" ICON="action.empty"
- PROPERTIES="support=org.jboss.tools.jst.web.rreferences.VpeAddReferenceSupport"
+ PROPERTIES="support=org.jboss.tools.rreferences.core.VpeAddReferenceSupport"
displayName="Add CSS Reference..." kind="action" name="AddItem">
<EntityData EntityName="VPEImageReference">
<AttributeData AttributeName="location"/>
@@ -421,7 +421,7 @@
</XActionItem>
<XActionItem kind="list" name="EditActions">
<XActionItem HandlerClassName="%SpecialWizard%" ICON="action.empty"
- PROPERTIES="support=org.jboss.tools.jst.web.rreferences.VpeAddReferenceSupport"
+ PROPERTIES="support=org.jboss.tools.rreferences.core.VpeAddReferenceSupport"
displayName="Edit CSS Reference..." kind="action" name="EditItem">
<EntityData EntityName="VPEImageReference">
<AttributeData AttributeName="location"/>
@@ -460,7 +460,7 @@
<XActionItem kind="list">
<XActionItem kind="list" name="CreateActions">
<XActionItem HandlerClassName="%SpecialWizard%" ICON="action.empty"
- PROPERTIES="support=org.jboss.tools.jst.web.rreferences.VpeAddReferenceSupport"
+ PROPERTIES="support=org.jboss.tools.rreferences.core.VpeAddReferenceSupport"
displayName="Add CSS Reference..." kind="action" name="AddItem">
<EntityData EntityName="VPEImageReferenceExt">
<AttributeData AttributeName="location"/>
@@ -470,7 +470,7 @@
</XActionItem>
<XActionItem kind="list" name="EditActions">
<XActionItem HandlerClassName="%SpecialWizard%" ICON="action.empty"
- PROPERTIES="support=org.jboss.tools.jst.web.rreferences.VpeAddReferenceSupport"
+ PROPERTIES="support=org.jboss.tools.rreferences.core.VpeAddReferenceSupport"
displayName="Edit CSS Reference..." kind="action" name="EditItem">
<EntityData EntityName="VPEImageReferenceExt">
<AttributeData AttributeName="location"/>
@@ -510,7 +510,7 @@
<XActionItem kind="list">
<XActionItem kind="list" name="CreateActions">
<XActionItem HandlerClassName="%SpecialWizard%" ICON="action.empty"
- PROPERTIES="support=org.jboss.tools.jst.web.rreferences.VpeAddReferenceSupport"
+ PROPERTIES="support=org.jboss.tools.rreferences.core.VpeAddReferenceSupport"
displayName="Add Taglib Reference..." kind="action" name="AddItem">
<EntityData EntityName="VPETLDReference">
<AttributeData AttributeName="location"/>
@@ -521,7 +521,7 @@
</XActionItem>
<XActionItem kind="list" name="EditActions">
<XActionItem HandlerClassName="%SpecialWizard%" ICON="action.empty"
- PROPERTIES="support=org.jboss.tools.jst.web.rreferences.VpeAddReferenceSupport"
+ PROPERTIES="support=org.jboss.tools.rreferences.core.VpeAddReferenceSupport"
displayName="Edit Taglib Reference..." kind="action" name="EditItem">
<EntityData EntityName="VPETLDReference">
<AttributeData AttributeName="location"/>
@@ -561,7 +561,7 @@
<XActionItem kind="list">
<XActionItem kind="list" name="CreateActions">
<XActionItem HandlerClassName="%SpecialWizard%" ICON="action.empty"
- PROPERTIES="support=org.jboss.tools.jst.web.rreferences.VpeAddReferenceSupport"
+ PROPERTIES="support=org.jboss.tools.rreferences.core.VpeAddReferenceSupport"
displayName="Add TLD Reference..." kind="action" name="AddItem">
<EntityData EntityName="VPETLDReferenceExt">
<AttributeData AttributeName="location"/>
@@ -572,7 +572,7 @@
</XActionItem>
<XActionItem kind="list" name="EditActions">
<XActionItem HandlerClassName="%SpecialWizard%" ICON="action.empty"
- PROPERTIES="support=org.jboss.tools.jst.web.rreferences.VpeAddReferencceSupport"
+ PROPERTIES="support=org.jboss.tools.rreferences.core.VpeAddReferencceSupport"
displayName="Edit TLD Reference..." kind="action" name="EditItem">
<EntityData EntityName="VPETLDReferenceExt">
<AttributeData AttributeName="location"/>
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2008-09-01 14:42:40 UTC (rev 9998)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2008-09-01 14:44:41 UTC (rev 9999)
@@ -86,6 +86,7 @@
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
+import org.jboss.tools.common.el.vpe.ELReferenceList;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.event.XModelTreeEvent;
import org.jboss.tools.common.model.event.XModelTreeListener;
@@ -106,6 +107,11 @@
import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.common.model.util.ModelFeatureFactory;
import org.jboss.tools.common.model.util.XModelTreeListenerSWTSync;
+import org.jboss.tools.common.rreferences.core.AbsoluteFolderReferenceList;
+import org.jboss.tools.common.rreferences.core.CSSReferenceList;
+import org.jboss.tools.common.rreferences.core.RelativeFolderReferenceList;
+import org.jboss.tools.common.rreferences.core.ResourceReferenceListListener;
+import org.jboss.tools.common.rreferences.core.TaglibReferenceList;
import org.jboss.tools.jst.jsp.editor.IJSPTextEditor;
import org.jboss.tools.jst.jsp.editor.IVisualController;
import org.jboss.tools.jst.jsp.preferences.VpePreference;
@@ -142,13 +148,7 @@
import org.jboss.tools.vpe.editor.util.SelectionUtil;
import org.jboss.tools.vpe.editor.util.VisualDomUtil;
import org.jboss.tools.vpe.editor.util.VpeDndUtil;
-import org.jboss.tools.vpe.el.ELReferenceList;
import org.jboss.tools.vpe.messages.VpeUIMessages;
-import org.jboss.tools.vpe.rreferences.AbsoluteFolderReferenceList;
-import org.jboss.tools.vpe.rreferences.CSSReferenceList;
-import org.jboss.tools.vpe.rreferences.RelativeFolderReferenceList;
-import org.jboss.tools.vpe.rreferences.ResourceReferenceListListener;
-import org.jboss.tools.vpe.rreferences.TaglibReferenceList;
import org.jboss.tools.vpe.selbar.SelectionBar;
import org.jboss.tools.vpe.xulrunner.browser.util.DOMTreeDumper;
import org.jboss.tools.vpe.xulrunner.editor.XulRunnerEditor;
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2008-09-01 14:42:40 UTC (rev 9998)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2008-09-01 14:44:41 UTC (rev 9999)
@@ -43,6 +43,8 @@
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.project.IModelNature;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
+import org.jboss.tools.common.rreferences.core.CSSReferenceList;
+import org.jboss.tools.common.rreferences.core.ResourceReference;
import org.jboss.tools.jst.jsp.preferences.VpePreference;
import org.jboss.tools.jst.web.model.helpers.WebAppHelper;
import org.jboss.tools.vpe.VpeDebug;
@@ -74,8 +76,6 @@
import org.jboss.tools.vpe.editor.util.TextUtil;
import org.jboss.tools.vpe.editor.util.VisualDomUtil;
import org.jboss.tools.vpe.editor.util.VpeStyleUtil;
-import org.jboss.tools.vpe.rreferences.CSSReferenceList;
-import org.jboss.tools.vpe.rreferences.ResourceReference;
import org.jboss.tools.vpe.xulrunner.editor.XulRunnerEditor;
import org.jboss.tools.vpe.xulrunner.editor.XulRunnerVpeUtils;
import org.mozilla.interfaces.nsIDOMAttr;
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/context/VpePageContext.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/context/VpePageContext.java 2008-09-01 14:42:40 UTC (rev 9998)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/context/VpePageContext.java 2008-09-01 14:44:41 UTC (rev 9999)
@@ -29,6 +29,11 @@
import org.jboss.tools.common.kb.KbConnectorType;
import org.jboss.tools.common.kb.KbException;
import org.jboss.tools.common.kb.wtp.WtpKbConnector;
+import org.jboss.tools.common.rreferences.core.AbsoluteFolderReferenceList;
+import org.jboss.tools.common.rreferences.core.CSSReferenceList;
+import org.jboss.tools.common.rreferences.core.RelativeFolderReferenceList;
+import org.jboss.tools.common.rreferences.core.ResourceReference;
+import org.jboss.tools.common.rreferences.core.TaglibReferenceList;
import org.jboss.tools.jst.jsp.editor.IVisualContext;
import org.jboss.tools.jst.jsp.preferences.VpePreference;
import org.jboss.tools.jst.web.tld.TaglibData;
@@ -42,11 +47,6 @@
import org.jboss.tools.vpe.editor.template.VpeTemplateManager;
import org.jboss.tools.vpe.editor.util.FileUtil;
import org.jboss.tools.vpe.editor.util.XmlUtil;
-import org.jboss.tools.vpe.rreferences.AbsoluteFolderReferenceList;
-import org.jboss.tools.vpe.rreferences.CSSReferenceList;
-import org.jboss.tools.vpe.rreferences.RelativeFolderReferenceList;
-import org.jboss.tools.vpe.rreferences.ResourceReference;
-import org.jboss.tools.vpe.rreferences.TaglibReferenceList;
import org.mozilla.interfaces.nsIDOMNode;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/preferences/ELVariablesPreferencePage.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/preferences/ELVariablesPreferencePage.java 2008-09-01 14:42:40 UTC (rev 9998)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/preferences/ELVariablesPreferencePage.java 2008-09-01 14:44:41 UTC (rev 9999)
@@ -22,9 +22,9 @@
import org.eclipse.swt.widgets.Control;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.jboss.tools.common.el.global.GlobalElVariablesComposite;
import org.jboss.tools.common.model.options.PreferenceModelUtilities;
-import org.jboss.tools.vpe.el.GlobalElVariablesComposite;
-import org.jboss.tools.vpe.rreferences.ResourceReference;
+import org.jboss.tools.common.rreferences.core.ResourceReference;
import org.jboss.tools.vpe.rreferences.VpeResourcesDialog;
/**
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/preferences/TemplatesPreferencePage.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/preferences/TemplatesPreferencePage.java 2008-09-01 14:42:40 UTC (rev 9998)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/preferences/TemplatesPreferencePage.java 2008-09-01 14:44:41 UTC (rev 9999)
@@ -10,23 +10,26 @@
******************************************************************************/
package org.jboss.tools.vpe.editor.preferences;
-import org.jboss.tools.common.model.ui.action.*;
-import org.jboss.tools.common.model.ui.objecteditor.XTable;
+import java.util.List;
+
import org.eclipse.jface.preference.PreferencePage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.ui.*;
-
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.jboss.tools.common.model.ui.action.CommandBar;
+import org.jboss.tools.common.model.ui.action.CommandBarListener;
+import org.jboss.tools.common.model.ui.objecteditor.XTable;
import org.jboss.tools.vpe.editor.template.VpeAnyData;
import org.jboss.tools.vpe.editor.template.VpeEditAnyDialog;
import org.jboss.tools.vpe.editor.template.VpeTemplateManager;
import org.jboss.tools.vpe.messages.VpeUIMessages;
-import java.util.List;
-
public class TemplatesPreferencePage extends PreferencePage implements IWorkbenchPreferencePage, CommandBarListener {
static String EDIT = "Edit"; //$NON-NLS-1$
static String REMOVE = "Remove"; //$NON-NLS-1$
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionSrc.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionSrc.java 2008-09-01 14:42:40 UTC (rev 9998)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionSrc.java 2008-09-01 14:44:41 UTC (rev 9999)
@@ -30,13 +30,13 @@
import org.jboss.tools.common.model.XModel;
import org.jboss.tools.common.model.project.IModelNature;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
+import org.jboss.tools.common.rreferences.core.ResourceReference;
import org.jboss.tools.jst.web.project.WebProject;
import org.jboss.tools.jst.web.tld.IFilePathEncoder;
import org.jboss.tools.vpe.VpePlugin;
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.template.VpeCreatorUtil;
import org.jboss.tools.vpe.editor.util.ElService;
-import org.jboss.tools.vpe.rreferences.ResourceReference;
import org.w3c.dom.Node;
public class VpeFunctionSrc extends VpeFunction {
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/ElService.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/ElService.java 2008-09-01 14:42:40 UTC (rev 9998)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/ElService.java 2008-09-01 14:44:41 UTC (rev 9999)
@@ -16,11 +16,11 @@
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Platform;
+import org.jboss.tools.common.el.global.GlobalELReferenceList;
+import org.jboss.tools.common.el.vpe.ELReferenceList;
+import org.jboss.tools.common.rreferences.core.ResourceReference;
import org.jboss.tools.vpe.editor.bundle.BundleMap;
import org.jboss.tools.vpe.editor.context.VpePageContext;
-import org.jboss.tools.vpe.el.ELReferenceList;
-import org.jboss.tools.vpe.el.GlobalELReferenceList;
-import org.jboss.tools.vpe.rreferences.ResourceReference;
import org.w3c.dom.Attr;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/FileUtil.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/FileUtil.java 2008-09-01 14:42:40 UTC (rev 9998)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/FileUtil.java 2008-09-01 14:44:41 UTC (rev 9999)
@@ -33,10 +33,10 @@
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.project.IModelNature;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
+import org.jboss.tools.common.rreferences.core.AbsoluteFolderReferenceList;
+import org.jboss.tools.common.rreferences.core.RelativeFolderReferenceList;
+import org.jboss.tools.common.rreferences.core.ResourceReference;
import org.jboss.tools.vpe.VpePlugin;
-import org.jboss.tools.vpe.rreferences.AbsoluteFolderReferenceList;
-import org.jboss.tools.vpe.rreferences.RelativeFolderReferenceList;
-import org.jboss.tools.vpe.rreferences.ResourceReference;
public class FileUtil {
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/VpeStyleUtil.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/VpeStyleUtil.java 2008-09-01 14:42:40 UTC (rev 9998)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/VpeStyleUtil.java 2008-09-01 14:44:41 UTC (rev 9999)
@@ -25,12 +25,12 @@
import org.jboss.tools.common.model.XModel;
import org.jboss.tools.common.model.project.IModelNature;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
+import org.jboss.tools.common.rreferences.core.ResourceReference;
import org.jboss.tools.jst.web.project.WebProject;
import org.jboss.tools.vpe.VpePlugin;
import org.jboss.tools.vpe.editor.VpeVisualDomBuilder;
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.mapping.VpeElementMapping;
-import org.jboss.tools.vpe.rreferences.ResourceReference;
import org.mozilla.interfaces.nsIDOMNode;
import org.mozilla.interfaces.nsIDOMNodeList;
import org.w3c.dom.Element;
Deleted: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/el/ELReferenceList.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/el/ELReferenceList.java 2008-09-01 14:42:40 UTC (rev 9998)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/el/ELReferenceList.java 2008-09-01 14:44:41 UTC (rev 9999)
@@ -1,36 +0,0 @@
-package org.jboss.tools.vpe.el;
-
-
-import org.eclipse.core.runtime.QualifiedName;
-import org.jboss.tools.vpe.rreferences.ResourceReferenceList;
-
-
-/**
- * The Class ELReferenceList.
- */
-public class ELReferenceList extends ResourceReferenceList {
-
- /** The PROPERT y_ NAME. */
- private static QualifiedName PROPERTY_NAME = new QualifiedName("", "org.jboss.tools.vpe.editor.css.ELReference");
-
- /** The instance. */
- static ELReferenceList instance = new ELReferenceList();
-
- /**
- * Gets the instance.
- *
- * @return the instance
- */
- public static ELReferenceList getInstance() {
- return instance;
- }
-
- /**
- * Gets the property name.
- *
- * @return the property name
- */
- protected QualifiedName getPropertyName() {
- return PROPERTY_NAME;
- }
-}
Deleted: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/el/ElVariablesComposite.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/el/ElVariablesComposite.java 2008-09-01 14:42:40 UTC (rev 9998)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/el/ElVariablesComposite.java 2008-09-01 14:44:41 UTC (rev 9999)
@@ -1,58 +0,0 @@
-package org.jboss.tools.vpe.el;
-
-import java.util.List;
-
-import org.jboss.tools.vpe.el.messages.Messages;
-import org.jboss.tools.vpe.rreferences.ResourceReferenceList;
-import org.jboss.tools.vpe.rreferences.ResourceReferencesComposite;
-import org.jboss.tools.vpe.rreferences.ResourceReferencesTableProvider;
-
-/**
- * The Class ElVariablesComposite.
- */
-public class ElVariablesComposite extends ResourceReferencesComposite {
-
- /**
- * Creates the table provider.
- *
- * @param dataList the data list
- * g
- * @return the resource references table provider
- */
- @Override
- protected ResourceReferencesTableProvider createTableProvider(List dataList) {
- return ResourceReferencesTableProvider.getELTableProvider(dataList);
- };
-
-
- /**
- * Gets the entity.
- *
- * @return the entity
- */
- @Override
- protected String getEntity() {
- return (file != null) ? "VPEElReference" : "VPEElReferenceExt";
- }
-
- /**c
- * Gets the reference list.
- *
- * @return the reference list
- */
- @Override
- protected ResourceReferenceList getReferenceList() {
- return ELReferenceList.getInstance();
- }
-
- /**
- * @see ResourceReferencesComposite#createGroupLabel()
- */
- @Override
- protected String createGroupLabel() {
- return Messages.SUBSTITUTED_EL_EXPRESSIONS;
- }
-
-
-
-}
Deleted: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/el/GlobalELReferenceList.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/el/GlobalELReferenceList.java 2008-09-01 14:42:40 UTC (rev 9998)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/el/GlobalELReferenceList.java 2008-09-01 14:44:41 UTC (rev 9999)
@@ -1,51 +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.vpe.el;
-
-import org.eclipse.core.runtime.QualifiedName;
-import org.jboss.tools.vpe.rreferences.ResourceReferenceList;
-
-/**
- * @author Evgenij Stherbin
- *
- */
-public class GlobalELReferenceList extends ResourceReferenceList {
- /** The PROPERT y_ NAME. */
- private static QualifiedName PROPERTY_NAME = new QualifiedName("", "org.jboss.tools.vpe.editor.css.GlobalELReference");
-
- /** The instance. */
- private static GlobalELReferenceList instance = new GlobalELReferenceList();
-
- /**
- * Gets the instance.
- *
- * @return the instance
- */
- public synchronized static GlobalELReferenceList getInstance() {
- return instance;
- }
-
- private GlobalELReferenceList() {
- super();
- }
-
- /**
- * Gets the property name.
- *
- * @return the property name
- */
- protected QualifiedName getPropertyName() {
- return PROPERTY_NAME;
- }
-
-
-}
Deleted: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/el/GlobalElVariablesComposite.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/el/GlobalElVariablesComposite.java 2008-09-01 14:42:40 UTC (rev 9998)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/el/GlobalElVariablesComposite.java 2008-09-01 14:44:41 UTC (rev 9999)
@@ -1,68 +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.vpe.el;
-
-import java.util.List;
-
-import org.jboss.tools.vpe.rreferences.ResourceReference;
-import org.jboss.tools.vpe.rreferences.ResourceReferenceList;
-import org.jboss.tools.vpe.rreferences.ResourceReferencesComposite;
-import org.jboss.tools.vpe.rreferences.ResourceReferencesTableProvider;
-
-
-/**
- * Composite class for the global el variables.
- * @author Evgenij Stherbin
- *
- */
-public class GlobalElVariablesComposite extends ResourceReferencesComposite {
-
- /**
- * @see org.jboss.tools.vpe.rreferences.ResourceReferencesComposite#createGroupLabel()
- */
- @Override
- protected String createGroupLabel() {
- return "";
- }
-
- /**
- * @see org.jboss.tools.vpe.rreferences.ResourceReferencesComposite#createTableProvider(java.util.List)
- */
- @Override
- protected ResourceReferencesTableProvider createTableProvider(List dataList) {
- return ResourceReferencesTableProvider.getGlobalELTableProvider(dataList);
- }
-
- /**
- * @see org.jboss.tools.vpe.rreferences.ResourceReferencesComposite#getEntity()
- */
- @Override
- protected String getEntity() {
- return (file != null) ? "VPEGlobalElReference" : "VPEGlobalElReferenceExt";
- }
-
- /**
- * @see org.jboss.tools.vpe.rreferences.ResourceReferencesComposite#getReferenceList()
- */
- @Override
- protected ResourceReferenceList getReferenceList() {
- return GlobalELReferenceList.getInstance();
- }
-
- @Override
- protected ResourceReference getDefaultResourceReference() {
- ResourceReference rf = new ResourceReference("", ResourceReference.GLOBAL_SCOPE);
- rf.setGlobal(true);
- return rf;
- }
-
-}
Deleted: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/AbsoluteFolderReferenceComposite.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/AbsoluteFolderReferenceComposite.java 2008-09-01 14:42:40 UTC (rev 9998)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/AbsoluteFolderReferenceComposite.java 2008-09-01 14:44:41 UTC (rev 9999)
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.vpe.rreferences;
-
-import org.jboss.tools.vpe.el.messages.Messages;
-
-public class AbsoluteFolderReferenceComposite extends FolderReferenceComposite {
-
- protected ResourceReferenceList getReferenceList() {
- return AbsoluteFolderReferenceList.getInstance();
- }
-
- protected String getTitle() {
- return Messages.ACTUAL_RUN_TIME_ABSOLUTE_FOLDER;
- }
-
-}
Deleted: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/AbsoluteFolderReferenceList.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/AbsoluteFolderReferenceList.java 2008-09-01 14:42:40 UTC (rev 9998)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/AbsoluteFolderReferenceList.java 2008-09-01 14:44:41 UTC (rev 9999)
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.vpe.rreferences;
-
-import org.eclipse.core.runtime.QualifiedName;
-
-public class AbsoluteFolderReferenceList extends ResourceReferenceList {
- private static QualifiedName PROPERTY_NAME = new QualifiedName("", "org.jboss.tools.vpe.editor.css.AbsoluteFolder");
- static AbsoluteFolderReferenceList instance = new AbsoluteFolderReferenceList();
-
- public static AbsoluteFolderReferenceList getInstance() {
- return instance;
- }
-
- protected QualifiedName getPropertyName() {
- return PROPERTY_NAME;
- }
-}
Deleted: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/CSSReferenceList.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/CSSReferenceList.java 2008-09-01 14:42:40 UTC (rev 9998)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/CSSReferenceList.java 2008-09-01 14:44:41 UTC (rev 9999)
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.vpe.rreferences;
-
-import org.eclipse.core.runtime.QualifiedName;
-
-public class CSSReferenceList extends ResourceReferenceList {
- private static QualifiedName PROPERTY_NAME = new QualifiedName("", "org.jboss.tools.vpe.editor.css.CSSList");
- static CSSReferenceList instance = new CSSReferenceList();
-
- public static CSSReferenceList getInstance() {
- return instance;
- }
-
- protected QualifiedName getPropertyName() {
- return PROPERTY_NAME;
- }
-
-}
Deleted: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/CssReferencesComposite.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/CssReferencesComposite.java 2008-09-01 14:42:40 UTC (rev 9998)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/CssReferencesComposite.java 2008-09-01 14:44:41 UTC (rev 9999)
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.vpe.rreferences;
-
-import java.util.List;
-
-import org.jboss.tools.vpe.el.messages.Messages;
-
-public class CssReferencesComposite extends ResourceReferencesComposite {
-
- protected String getEntity() {
- return (file != null) ? "VPECSSReference" : "VPECSSReferenceExt";
- }
-
- protected ResourceReferencesTableProvider createTableProvider(List dataList) {
- return ResourceReferencesTableProvider.getCSSTableProvider(dataList);
- }
-
- protected ResourceReferenceList getReferenceList() {
- return CSSReferenceList.getInstance();
- }
-
-
- /**
- * @see ResourceReferencesComposite#createGroupLabel()
- */
- @Override
- protected String createGroupLabel() {
- return Messages.INCLUDED_CSS_FILES;
- }
-
-
-}
Deleted: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/FolderReferenceComposite.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/FolderReferenceComposite.java 2008-09-01 14:42:40 UTC (rev 9998)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/FolderReferenceComposite.java 2008-09-01 14:44:41 UTC (rev 9999)
@@ -1,124 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.vpe.rreferences;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Properties;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Group;
-import org.jboss.tools.common.meta.action.XEntityData;
-import org.jboss.tools.common.meta.action.impl.XEntityDataImpl;
-import org.jboss.tools.common.model.XModelObject;
-import org.jboss.tools.common.model.options.PreferenceModelUtilities;
-import org.jboss.tools.common.model.ui.attribute.XAttributeSupport;
-import org.jboss.tools.common.model.ui.attribute.editor.DirectoryFieldEditorEx;
-
-public abstract class FolderReferenceComposite {
- XAttributeSupport support = new XAttributeSupport();
- XModelObject object;
- IFile file;
- IPath path;
- ResourceReference[] rs;
- ResourceReference current;
- XEntityData data;
-
- public FolderReferenceComposite() {
- object = PreferenceModelUtilities.getPreferenceModel().createModelObject(getEntity(), new Properties());
- }
-
- public void setObject(Properties p) {
- file = (IFile)p.get("file");
- path = (IPath)p.get("path");
- rs = (file != null) ? getReferenceList().getAllResources(file) :
- (path != null) ? getReferenceList().getAllResources(path)
- : new ResourceReference[0];
- if(rs.length == 0) {
- rs = new ResourceReference[1];
- rs[0] = new ResourceReference("", ResourceReference.FILE_SCOPE);
- }
- current = rs[0];
- object.setAttributeValue("location", current.getLocation());
- object.setAttributeValue("scope", current.getScopeName());
-
- data = XEntityDataImpl.create(new String[][]{
- {getEntity(), "yes"},
- {"location", "no"},
- {"scope", "no"}
- });
-
- data.getAttributeData()[0].setValue(current.getLocation());
- data.getAttributeData()[1].setValue(current.getScopeName());
-
- support.init(object, data);
-// support.addPropertyChangeListener(new PropertyChangeListener() {
-// public void propertyChange(PropertyChangeEvent evt) {
-// }
-// });
- }
-
- protected String getEntity() {
- return (file != null) ? "VPEFolderReference" : "VPEFolderReferenceExt";
- }
-
- protected abstract ResourceReferenceList getReferenceList();
- protected abstract String getTitle();
-
- public Control createControl(Composite parent) {
- Group g = new Group(parent, SWT.SHADOW_ETCHED_IN);
- GridLayout layout = new GridLayout(1, false);
- g.setLayout(layout);
- g.setText(getTitle());
- Control c = support.createControl(g);
- if(file != null) {
- DirectoryFieldEditorEx f = (DirectoryFieldEditorEx)support.getFieldEditorByName("location");
- f.setLastPath(file.getProject().getLocation().toString());
- }
- GridData data = new GridData(GridData.FILL_BOTH);
- c.setLayoutData(data);
- return g;
- }
-
- public void commit() {
- support.store();
- current.setLocation(data.getAttributeData()[0].getValue());
- current.setScope(getNewScope());
- List l = new ArrayList();
- for (int i = rs.length - 2; i >= 0; i--) {
- if(rs[i].getLocation().equals(current.getLocation())) continue;
- if(rs[i].getScope() == current.getScope()) continue;
- l.add(rs[i]);
- }
- l.add(current);
- rs = (ResourceReference[])l.toArray(new ResourceReference[0]);
- if(file != null) {
- getReferenceList().setAllResources(file, rs);
- } else {
- getReferenceList().setAllResources(path, rs);
- }
- }
-
- int getNewScope() {
- String s = data.getAttributeData()[1].getValue();
- for (int i = 0; i < ResourceReference.SCOPE_NAMES.length; i++) {
- if(ResourceReference.SCOPE_NAMES[i].equals(s)) return i;
- }
- return ResourceReference.FILE_SCOPE;
- }
-
-}
Deleted: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/GlobalResourceReference.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/GlobalResourceReference.java 2008-09-01 14:42:40 UTC (rev 9998)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/GlobalResourceReference.java 2008-09-01 14:44:41 UTC (rev 9999)
@@ -1,30 +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.vpe.rreferences;
-
-
-/**
- * Global resource reference
- * @author Evgenij Stherbin
- *
- */
-public class GlobalResourceReference extends ResourceReference {
-
- /**
- * @param location
- * @param scope
- */
- public GlobalResourceReference(String location, int scope) {
- super(location, scope);
- }
-
-}
Deleted: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/RelativeFolderReferenceComposite.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/RelativeFolderReferenceComposite.java 2008-09-01 14:42:40 UTC (rev 9998)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/RelativeFolderReferenceComposite.java 2008-09-01 14:44:41 UTC (rev 9999)
@@ -1,24 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.vpe.rreferences;
-
-
-public class RelativeFolderReferenceComposite extends FolderReferenceComposite {
-
- protected ResourceReferenceList getReferenceList() {
- return RelativeFolderReferenceList.getInstance();
- }
-
- protected String getTitle() {
- return "Actual Run-Time Relative Folder";
- }
-
-}
Deleted: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/RelativeFolderReferenceList.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/RelativeFolderReferenceList.java 2008-09-01 14:42:40 UTC (rev 9998)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/RelativeFolderReferenceList.java 2008-09-01 14:44:41 UTC (rev 9999)
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.vpe.rreferences;
-
-import org.eclipse.core.runtime.QualifiedName;
-
-public class RelativeFolderReferenceList extends ResourceReferenceList {
- private static QualifiedName PROPERTY_NAME = new QualifiedName("", "org.jboss.tools.vpe.editor.css.RelativeFolder");
- static RelativeFolderReferenceList instance = new RelativeFolderReferenceList();
-
- public static RelativeFolderReferenceList getInstance() {
- return instance;
- }
-
- protected QualifiedName getPropertyName() {
- return PROPERTY_NAME;
- }
-
-}
Deleted: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/ResourceReference.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/ResourceReference.java 2008-09-01 14:42:40 UTC (rev 9998)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/ResourceReference.java 2008-09-01 14:44:41 UTC (rev 9999)
@@ -1,109 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.vpe.rreferences;
-
-public class ResourceReference {
- public final static int FILE_SCOPE = 0;
- public final static int FOLDER_SCOPE = 1;
- public final static int PROJECT_SCOPE = 2;
- public final static int GLOBAL_SCOPE = 3;
-
- public final static String[] SCOPE_NAMES = new String[]{"Page", "Folder", "Project","Global"};
-
- protected String location;
- protected int scope;
- protected int depth = 0;
- protected String properties = "";
-
- protected boolean isGlobal = false;
-
- public boolean isGlobal() {
- return isGlobal;
- }
-
- public void setGlobal(boolean isGlobal) {
- this.isGlobal = isGlobal;
- }
-
- public ResourceReference(String location, int scope) {
- this.location = location;
- this.scope = scope;
- int q = location.indexOf('%');
- if(q >= 0) {
- properties = location.substring(q + 1);
- this.location = location.substring(0, q);
- }
- }
-
- public String getLocation() {
- return location;
- }
-
- public int getScope() {
- return scope;
- }
-
- public void setLocation(String location) {
- this.location = location;
- }
-
- public void setProperties(String properties) {
- this.properties = properties;
- }
-
- public String getProperties() {
- return properties;
- }
-
- public void setScope(int scope) {
- this.scope = scope;
- }
-
- public String getScopeName() {
- return SCOPE_NAMES[scope];
- }
-
- public void setDepth(int depth) {
- this.depth = depth;
- }
-
- public int getDepth() {
- return depth;
- }
-
- public String getLocationAndProperties() {
- String v = location;
- if(properties.length() > 0) {
- v += "%" + properties;
- }
- return v;
- }
-
-
-// public static ResourceReference createResourceReference(String location, int scope) {
-// ResourceReference rst = null;
-//
-// switch (scope) {
-// case FILE_SCOPE:
-// case FOLDER_SCOPE:
-// case PROJECT_SCOPE:
-// rst = new ResourceReference(location, scope);
-// break;
-// case GLOBAL_SCOPE:
-// rst = new GlobalResourceReference(location, scope);
-// break;
-// default:
-// throw new IllegalArgumentException("Illegal scope=" + scope);
-// }
-// return rst;
-// }
-
-}
Deleted: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/ResourceReferenceList.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/ResourceReferenceList.java 2008-09-01 14:42:40 UTC (rev 9998)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/ResourceReferenceList.java 2008-09-01 14:44:41 UTC (rev 9999)
@@ -1,274 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.vpe.rreferences;
-
-import java.io.File;
-import java.util.*;
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
-import org.jboss.tools.common.model.plugin.ModelPlugin;
-import org.jboss.tools.common.model.util.XModelObjectUtil;
-
-public abstract class ResourceReferenceList {
- ResourceReferenceListListener[] listeners = new ResourceReferenceListListener[0];
-
- protected abstract QualifiedName getPropertyName();
-
- public void addChangeListener(ResourceReferenceListListener listener) {
- int i = getListenerIndex(listener);
- if(i >= 0) return;
- ResourceReferenceListListener[] ls = new ResourceReferenceListListener[listeners.length + 1];
- System.arraycopy(listeners, 0, ls, 0, listeners.length);
- ls[listeners.length] = listener;
- listeners = ls;
- }
-
- public void removeChangeListener(ResourceReferenceListListener listener) {
- int i = getListenerIndex(listener);
- if(i < 0) return;
- ResourceReferenceListListener[] ls = new ResourceReferenceListListener[listeners.length - 1];
- if(i > 0) System.arraycopy(listeners, 0, ls, 0, i);
- if(i < ls.length) System.arraycopy(listeners, i + 1, ls, i, ls.length - i);
- listeners = ls;
- }
-
- private int getListenerIndex(ResourceReferenceListListener listener) {
- for (int i = 0; i < listeners.length; i++) {
- if(listeners[i] == listener) return i;
- }
- return -1;
- }
-
- public ResourceReference[] getAllResources(IFile file) {
- Set locations = new HashSet();
- List css = new ArrayList();
- if(file.getProject() != null) {
- String[] dcss = getDeclaredResources(file.getProject());
- for (int i = 0; i < dcss.length; i++) {
- ResourceReference ref = new ResourceReference(dcss[i], ResourceReference.PROJECT_SCOPE);
- locations.add(dcss[i]);
- css.add(ref);
- }
- }
- IResource parent = file.getParent();
- int depth = 0;
- while(parent instanceof IFolder) {
- String[] dcss = getDeclaredResources(parent);
- for (int i = 0; i < dcss.length; i++) {
- if(locations.contains(dcss[i])) continue;
- ResourceReference ref = new ResourceReference(dcss[i], ResourceReference.FOLDER_SCOPE);
- ref.setDepth(depth);
- locations.add(dcss[i]);
- css.add(ref);
- }
- parent = parent.getParent();
- depth++;
- }
- String[] dcss = getDeclaredResources(file);
- for (int i = 0; i < dcss.length; i++) {
- if(locations.contains(dcss[i])) continue;
- ResourceReference ref = new ResourceReference(dcss[i], ResourceReference.FILE_SCOPE);
- locations.add(dcss[i]);
- css.add(ref);
- }
- return (ResourceReference[])css.toArray(new ResourceReference[0]);
- }
-
- private String[] getDeclaredResources(IResource resource) {
- String s = null;
- try {
- s = resource.getPersistentProperty(getPropertyName());
- } catch (CoreException e) {
- //ignore
- }
- if(s == null || s.length() == 0) return new String[0];
- return XModelObjectUtil.asStringArray(s);
- }
-
- public void setAllResources(IFile file, ResourceReference[] entries) {
- IResource changed = null;
- boolean b = setDeclaredResources(file, entries, ResourceReference.FILE_SCOPE, 0);
- if(b) changed = file;
- IResource parent = file.getParent();
- int depth = 0;
- while(parent instanceof IFolder) {
- b = setDeclaredResources(parent, entries, ResourceReference.FOLDER_SCOPE, depth);
- if(b) changed = parent;
- parent = parent.getParent();
- depth++;
- }
- if(file.getProject() != null) {
- int scope = ResourceReference.PROJECT_SCOPE;
- if(file.getParent() == file.getProject()) scope = 10;
- b = setDeclaredResources(file.getProject(), entries, scope, 0);
- if(b) changed = file.getProject();
- }
- if(changed != null) fire(changed.getFullPath());
- }
-
- private boolean setDeclaredResources(IResource resource, ResourceReference[] entries, int scope, int depth) {
- try {
- String oldValue = resource.getPersistentProperty(getPropertyName());
- if(oldValue == null) oldValue = "";
- String newValue = encodeDeclaredResources(entries, scope, depth);
- if(oldValue.equals(newValue)) return false;
- resource.setPersistentProperty(getPropertyName(), newValue);
- } catch (CoreException e) {
- return false;
- }
- return true;
- }
-
- private String encodeDeclaredResources(ResourceReference[] entries, int scope, int depth) {
- StringBuffer sb = new StringBuffer();
- for (int i = 0; i < entries.length; i++) {
- int s = entries[i].getScope();
- if(scope < 10 && s != scope) continue;
- if(scope == 10 && s == ResourceReference.FILE_SCOPE) continue;
- if(scope == ResourceReference.FOLDER_SCOPE && entries[i].getDepth() != depth) continue;
- if(sb.length() > 0) sb.append(";");
- sb.append(entries[i].getLocationAndProperties());
- }
- return sb.toString();
- }
-
- void fire(IPath path) {
- ResourceReferenceListListener[] ls = listeners;
- for (int i = 0; i < ls.length; i++) {
- IPath listenedPath = ls[i].getPath();
- if(listenedPath != null && path.isPrefixOf(listenedPath)) {
- ls[i].changed(this);
- }
- }
- }
-
- /*
- * Handle opened external files
- */
- TreeMap allExternalResources = null;
-
- private TreeMap getAllExternalResources() {
- if(allExternalResources == null) {
- allExternalResources = new TreeMap();
- String s = null;
- try {
- s = ModelPlugin.getWorkspace().getRoot().getPersistentProperty(getPropertyName());
- if(s != null) parseExternalResources(s);
- } catch (CoreException e) {
- //ignore
- }
- }
- return allExternalResources;
- }
- private void parseExternalResources(String s) {
- StringTokenizer st = new StringTokenizer(s, "#");
- while(st.hasMoreTokens()) {
- String t = st.nextToken();
- int e = t.indexOf('=');
- String path = t.substring(0, e);
- String list = t.substring(e + 1);
- if(new File(path).exists()) allExternalResources.put(path, list);
- }
- }
-
- private void setAllExternalResources() {
- StringBuffer sb = new StringBuffer();
- Iterator it = allExternalResources.keySet().iterator();
- while(it.hasNext()) {
- String path = it.next().toString();
- String list = (String)allExternalResources.get(path);
- if(path != null && list != null && new File(path).exists()) {
- if(sb.length() > 0) sb.append('#');
- sb.append(path).append('=').append(list);
- }
- }
- try {
- ModelPlugin.getWorkspace().getRoot().setPersistentProperty(getPropertyName(), sb.toString());
- } catch (CoreException e) {
- //ignore
- }
- }
-
- public ResourceReference[] getAllResources(IPath path) {
- Set locations = new HashSet();
- List css = new ArrayList();
- IPath parent = path.removeLastSegments(1);
- int depth = 0;
- boolean isGlobal = path.equals(Platform.getLocation());
- int setScope = isGlobal ? ResourceReference.GLOBAL_SCOPE : ResourceReference.FILE_SCOPE;
- while(parent != null && parent.segmentCount() > 1) {
- String[] dcss = getDeclaredResources(path);
- for (int i = 0; i < dcss.length; i++) {
- if(locations.contains(dcss[i])) continue;
- ResourceReference ref = new ResourceReference(dcss[i],isGlobal ? ResourceReference.GLOBAL_SCOPE : ResourceReference.FOLDER_SCOPE);
- if(isGlobal){
- ref.setGlobal(true);
- }
- ref.setDepth(depth);
- locations.add(dcss[i]);
- css.add(ref);
- }
- parent = parent.removeLastSegments(1);
- depth++;
- }
- String[] dcss = getDeclaredResources(path);
- for (int i = 0; i < dcss.length; i++) {
- if(locations.contains(dcss[i])) continue;
- ResourceReference ref = new ResourceReference(dcss[i], setScope);
- if(setScope == ResourceReference.GLOBAL_SCOPE){
- ref.setGlobal(true);
- }
- locations.add(dcss[i]);
- css.add(ref);
- }
- return (ResourceReference[])css.toArray(new ResourceReference[0]);
- }
-
- private String[] getDeclaredResources(IPath path) {
- String s = (String)getAllExternalResources().get(path.toString());
- return (s == null || s.length() == 0) ? new String[0] : XModelObjectUtil.asStringArray(s);
- }
-
- public void setAllResources(IPath path, ResourceReference[] entries) {
- IPath changed = null;
- boolean b = false;
- int checkScope = path.equals(Platform.getLocation()) ? ResourceReference.GLOBAL_SCOPE : ResourceReference.FILE_SCOPE;
-
- b = setDeclaredResources(path, entries, checkScope, 0);
- if(b) changed = path;
- IPath parent = path.removeLastSegments(1);
- int depth = 0;
- while(parent != null && parent.segmentCount() > 1) {
- b = setDeclaredResources(parent, entries, ResourceReference.FOLDER_SCOPE, depth);
- if(b) changed = parent;
- parent = parent.removeLastSegments(1);
- depth++;
- }
- if(changed != null) {
- setAllExternalResources();
- fire(changed);
- }
- }
-
- private boolean setDeclaredResources(IPath path, ResourceReference[] entries, int scope, int depth) {
- String oldValue = (String)getAllExternalResources().get(path.toString());
- if(oldValue == null) oldValue = "";
- String newValue = encodeDeclaredResources(entries, scope, depth);
- if(oldValue.equals(newValue)) return false;
- if(newValue == null || newValue.length() == 0) {
- getAllExternalResources().remove(path.toString());
- } else {
- getAllExternalResources().put(path.toString(), newValue);
- }
- return true;
- }
-
-}
Deleted: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/ResourceReferenceListListener.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/ResourceReferenceListListener.java 2008-09-01 14:42:40 UTC (rev 9998)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/ResourceReferenceListListener.java 2008-09-01 14:44:41 UTC (rev 9999)
@@ -1,19 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.vpe.rreferences;
-
-import org.eclipse.core.runtime.IPath;
-
-public interface ResourceReferenceListListener {
- public IPath getPath();
- public void changed(Object source);
-
-}
Deleted: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/ResourceReferencesComposite.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/ResourceReferencesComposite.java 2008-09-01 14:42:40 UTC (rev 9998)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/ResourceReferencesComposite.java 2008-09-01 14:44:41 UTC (rev 9999)
@@ -1,210 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.vpe.rreferences;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Properties;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Group;
-import org.jboss.tools.common.meta.XAttribute;
-import org.jboss.tools.common.meta.XModelEntity;
-import org.jboss.tools.common.meta.constraint.impl.XAttributeConstraintFileFilter;
-import org.jboss.tools.common.meta.impl.XModelMetaDataImpl;
-import org.jboss.tools.common.model.ui.action.CommandBar;
-import org.jboss.tools.common.model.ui.action.CommandBarListener;
-import org.jboss.tools.common.model.ui.objecteditor.XTable;
-
-public abstract class ResourceReferencesComposite {
- protected static String ADD = "Add";
- protected static String EDIT = "Edit";
- protected static String REMOVE = "Remove";
- protected XTable table = new XTable();
- protected CommandBar bar = new CommandBar();
- protected ResourceReferencesTableProvider tableProvider;// = new TemplatesTableProvider();
- protected IFile file;
- protected IPath path;
- protected List dataList = new ArrayList();
-
- public ResourceReferencesComposite() {
- init();
- }
-
- private void init() {
- tableProvider = createTableProvider(dataList);
- bar.getLayout().buttonWidth = 80;
- bar.getLayout().direction = SWT.VERTICAL;
- bar.setCommands(new String[]{ADD, EDIT, REMOVE});
- bar.addCommandBarListener(new BarListener());
- table.setTableProvider(tableProvider);
- }
-
- protected abstract ResourceReferencesTableProvider createTableProvider(List dataList);
- protected abstract ResourceReferenceList getReferenceList();
-
- /**
- * Returned the label that will display in group.
- *
- * @return label displayed in group
- * @see #createControl(Composite)
- */
- protected abstract String createGroupLabel();
-
-
- public void setObject(Object object) {
- Properties p = (Properties)object;
- file = (IFile)p.get("file");
- path = (IPath)p.get("path");
- ResourceReference[] rs = (file != null) ? getReferenceList().getAllResources(file) :
- (path != null) ? getReferenceList().getAllResources(path)
- : new ResourceReference[0];
- for (int i = 0; i < rs.length; i++) dataList.add(rs[i]);
- }
-
- public Control createControl(Composite parent) {
- Composite c1 = new Composite(parent, SWT.NONE);
-
- c1.setLayoutData(new GridData(GridData.FILL_BOTH));
- c1.setLayout(new GridLayout(2,false));
-
- final Group group = new Group(c1,SWT.NONE);
-
- group.setText(createGroupLabel());
- group.setLayoutData(new GridData(GridData.FILL_BOTH));
- GridLayout g = new GridLayout(2, false);
- group.setLayout(g);
-
-
- Control slc = table.createControl(group);
- slc.setLayoutData(new GridData(GridData.FILL_BOTH));
- Control bc = bar.createControl(group);
-
-
- GridData gd = new GridData(GridData.FILL_VERTICAL);
- bc.setLayoutData(gd);
- table.getTable().addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
- updateBars();
- }
- public void widgetDefaultSelected(SelectionEvent e) {
- widgetSelected(e);
- }
- });
- update();
- return c1;
- }
-
- ResourceReference[] getReferenceArray() {
- return (ResourceReference[])dataList.toArray(new ResourceReference[0]);
- }
-
- /**
- * Clear all entries from table.
- */
- public void clearAll(){
- if(this.dataList!=null){
- this.dataList.clear();
- }
- }
-
- public void commit() {
- if(file != null) {
- getReferenceList().setAllResources(file, getReferenceArray());
- } else {
- getReferenceList().setAllResources(path, getReferenceArray());
- }
- }
- class BarListener implements CommandBarListener {
- public void action(String command) {
- int index = table.getSelectionIndex();
- if(ADD.equals(command)) {
- add(index);
- } else if(EDIT.equals(command)) {
- edit(index);
- } else if(REMOVE.equals(command)) {
- remove(index);
- }
- update();
- }
- }
-
- protected void add(int index) {
- ResourceReference css = getDefaultResourceReference();
-
- initFilterInFileChooser();
- boolean ok = VpeAddReferenceSupport.add(file, css, getReferenceArray(), getEntity());
- if(!ok) return;
- dataList.add(css);
- update();
- table.setSelection(dataList.size() - 1);
- }
-
- /**
- * @return
- */
- protected ResourceReference getDefaultResourceReference() {
- return new ResourceReference("", ResourceReference.FOLDER_SCOPE);
- }
-
- protected void edit(int index) {
- if(index < 0) return;
- ResourceReference css = getReferenceArray()[index];
- initFilterInFileChooser();
- boolean ok = VpeAddReferenceSupport.edit(file, css, getReferenceArray(), getEntity());
- if(!ok) return;
- update();
- }
-
- protected abstract String getEntity();
-
- void remove(int index) {
- if(index >= 0) dataList.remove(index);
- }
-
- public void update() {
- if(table != null) table.update();
- updateBars();
- }
-
- void updateBars() {
- bar.setEnabled(EDIT, canModify());
- bar.setEnabled(REMOVE, canModify());
- }
-
- private boolean canModify() {
- return table.getSelectionIndex() >= 0;
- }
-
- private void initFilterInFileChooser() {
- String entityName = getEntity();
- XModelEntity entity = XModelMetaDataImpl.getInstance().getEntity(entityName);
- if(entity != null && file != null && file.getProject() != null) {
- XAttribute[] as = entity.getAttributes();
- for (int i = 0; i < as.length; i++) {
- if(as[i].getConstraint() instanceof XAttributeConstraintFileFilter) {
- XAttributeConstraintFileFilter f = (XAttributeConstraintFileFilter)as[i].getConstraint();
- f.getProperties().setProperty("filterFolder", file.getProject().getLocation().toFile().getAbsolutePath());
- }
- }
- }
- }
-
-
-}
Deleted: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/ResourceReferencesDialogView.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/ResourceReferencesDialogView.java 2008-09-01 14:42:40 UTC (rev 9998)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/ResourceReferencesDialogView.java 2008-09-01 14:44:41 UTC (rev 9999)
@@ -1,159 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.vpe.rreferences;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Properties;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.jboss.tools.common.model.ui.action.CommandBar;
-import org.jboss.tools.common.model.ui.action.CommandBarListener;
-import org.jboss.tools.common.model.ui.objecteditor.XTable;
-import org.jboss.tools.common.model.ui.wizards.query.AbstractQueryWizardView;
-
-public abstract class ResourceReferencesDialogView extends AbstractQueryWizardView {
- static String ADD = "Add";
- static String EDIT = "Edit";
- static String REMOVE = "Remove";
- protected XTable table = new XTable();
- protected CommandBar bar = new CommandBar();
- protected ResourceReferencesTableProvider tableProvider;// = new TemplatesTableProvider();
- IFile file;
- IPath path;
- protected List dataList = new ArrayList();
-
- public ResourceReferencesDialogView() {
- init();
- }
-
- private void init() {
-// changed = false;
- tableProvider = createTableProvider(dataList);
-///ResourceReferencesTableProvider.getCSSTableProvider(dataList);
- bar.getLayout().buttonWidth = 80;
- bar.getLayout().direction = SWT.VERTICAL;
- bar.setCommands(new String[]{ADD, EDIT, REMOVE});
- bar.addCommandBarListener(new BarListener());
- table.setTableProvider(tableProvider);
- }
-
- protected abstract ResourceReferencesTableProvider createTableProvider(List dataList);
- protected abstract ResourceReferenceList getReferenceList();
-
- public void setObject(Object object) {
- super.setObject(object);
- Properties p = findProperties(object);
- file = (IFile)p.get("file");
- path = (IPath)p.get("path");
- ResourceReference[] rs = (file != null) ? getReferenceList().getAllResources(file) :
- (path != null) ? getReferenceList().getAllResources(path)
- : new ResourceReference[0];
- for (int i = 0; i < rs.length; i++) dataList.add(rs[i]);
- }
-
- public Control createControl(Composite parent) {
- Composite c = new Composite(parent, SWT.NONE);
- c.setLayoutData(new GridData(GridData.FILL_BOTH));
- GridLayout g = new GridLayout(2, false);
- c.setLayout(g);
- Control slc = table.createControl(c);
- slc.setLayoutData(new GridData(GridData.FILL_BOTH));
- Control bc = bar.createControl(c);
- GridData gd = new GridData(GridData.FILL_VERTICAL);
- bc.setLayoutData(gd);
- table.getTable().addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
- updateBars();
- }
- public void widgetDefaultSelected(SelectionEvent e) {
- widgetSelected(e);
- }
- });
- update();
- return c;
- }
-
- ResourceReference[] getReferenceArray() {
- return (ResourceReference[])dataList.toArray(new ResourceReference[0]);
- }
-
- public void action(String command) {
- stopEditing();
- if(OK.equalsIgnoreCase(command)) {
- if(file != null) {
- getReferenceList().setAllResources(file, getReferenceArray());
- } else {
- getReferenceList().setAllResources(path, getReferenceArray());
- }
- }
- super.action(command);
- }
- class BarListener implements CommandBarListener {
- public void action(String command) {
- int index = table.getSelectionIndex();
- if(ADD.equals(command)) {
- add(index);
- } else if(EDIT.equals(command)) {
- edit(index);
- } else if(REMOVE.equals(command)) {
- remove(index);
- }
- update();
- }
- }
-
- protected void add(int index) {
- ResourceReference css = new ResourceReference("", ResourceReference.FOLDER_SCOPE);
- boolean ok = VpeAddReferenceSupport.add(file, css, getReferenceArray(), getEntity());
- if(!ok) return;
- dataList.add(css);
- update();
- table.setSelection(dataList.size() - 1);
- }
-
- protected void edit(int index) {
- if(index < 0) return;
- ResourceReference css = getReferenceArray()[index];
- boolean ok = VpeAddReferenceSupport.edit(file, css, getReferenceArray(), getEntity());
- if(!ok) return;
- update();
- }
-
- protected abstract String getEntity();
-
- void remove(int index) {
- if(index >= 0) dataList.remove(index);
- }
-
- public void update() {
- if(table != null) table.update();
- updateBars();
- }
-
- void updateBars() {
- bar.setEnabled(EDIT, canModify());
- bar.setEnabled(REMOVE, canModify());
- }
-
- private boolean canModify() {
- return table.getSelectionIndex() >= 0;
- }
-
-}
Deleted: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/ResourceReferencesTableProvider.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/ResourceReferencesTableProvider.java 2008-09-01 14:42:40 UTC (rev 9998)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/ResourceReferencesTableProvider.java 2008-09-01 14:44:41 UTC (rev 9999)
@@ -1,110 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.vpe.rreferences;
-
-import java.util.List;
-
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Image;
-import org.jboss.tools.common.model.ui.objecteditor.XTableImageProvider;
-import org.jboss.tools.common.model.ui.objecteditor.XTableProvider;
-
-public class ResourceReferencesTableProvider implements XTableProvider, XTableImageProvider {
- static String[] CSS_COLUMNS = new String[]{"Scope", "CSS File Path"};
- static String[] IMG_COLUMNS = new String[]{"Scope", "Image Folder Path"};
- static String[] TLD_COLUMNS = new String[]{"Scope", "URI", "Prefix"};
- static String[] EL_COLUMNS = new String[]{"Scope", "El Expression", "Value"};
- private final static String[] GLOBAL_EL_COLUMNS = new String[]{"Scope","El Expression", "Value"};
-
- int[] widths = new int[]{50, 200};
- List dataList;
- String[] columns;
-
- public static ResourceReferencesTableProvider getCSSTableProvider(List dataList) {
- ResourceReferencesTableProvider p = new ResourceReferencesTableProvider(dataList);
- p.columns = CSS_COLUMNS;
- return p;
- }
-
- public static ResourceReferencesTableProvider getImageTableProvider(List dataList) {
- ResourceReferencesTableProvider p = new ResourceReferencesTableProvider(dataList);
- p.columns = IMG_COLUMNS;
- return p;
- }
-
- public static ResourceReferencesTableProvider getTLDTableProvider(List dataList) {
- ResourceReferencesTableProvider p = new ResourceReferencesTableProvider(dataList);
- p.columns = TLD_COLUMNS;
- p.widths = new int[]{50, 150, 50};
- return p;
- }
-
- public static ResourceReferencesTableProvider getELTableProvider(List dataList) {
- ResourceReferencesTableProvider p = new ResourceReferencesTableProvider(dataList);
- p.columns = EL_COLUMNS;
- p.widths = new int[]{50, 150, 50};
- return p;
- }
-
-
- public static ResourceReferencesTableProvider getGlobalELTableProvider(final List dataList) {
- ResourceReferencesTableProvider p = new ResourceReferencesTableProvider(dataList);
-
- p.columns = GLOBAL_EL_COLUMNS;
- p.widths = new int[]{50,150, 50};
- return p;
- }
-
-
-
-
- private ResourceReferencesTableProvider(List dataList) {
- this.dataList = dataList;
- }
-
- public int getColumnCount() {
- return columns.length;
- }
-
- public int getRowCount() {
- if(dataList == null) return 0;
- return dataList.size();
- }
-
- public String getColumnName(int c) {
- return columns[c];
- }
-
- public String getValueAt(int r, int c) {
- ResourceReference css = (ResourceReference)dataList.get(r);
- return (c == 0) ? css.getScopeName() : (c == 2) ? css.getProperties() : css.getLocation();
- }
-
- public Object getDataAt(int r) {
- return null;
- }
-
- public Color getColor(int r) {
- return null;
- }
-
- public int getWidthHint(int c) {
- return widths[c];
- }
-
- public void dispose() {
- }
-
- public Image getImage(int r) {
- return null;
- }
-
-}
Deleted: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/TaglibReferenceList.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/TaglibReferenceList.java 2008-09-01 14:42:40 UTC (rev 9998)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/TaglibReferenceList.java 2008-09-01 14:44:41 UTC (rev 9999)
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.vpe.rreferences;
-
-import org.eclipse.core.runtime.QualifiedName;
-
-public class TaglibReferenceList extends ResourceReferenceList {
- private static QualifiedName PROPERTY_NAME = new QualifiedName("", "org.jboss.tools.vpe.editor.css.TLDList");
- static TaglibReferenceList instance = new TaglibReferenceList();
-
- public static TaglibReferenceList getInstance() {
- return instance;
- }
-
- protected QualifiedName getPropertyName() {
- return PROPERTY_NAME;
- }
-
-}
Deleted: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/TaglibReferencesComposite.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/TaglibReferencesComposite.java 2008-09-01 14:42:40 UTC (rev 9998)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/TaglibReferencesComposite.java 2008-09-01 14:44:41 UTC (rev 9999)
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.vpe.rreferences;
-
-import java.util.List;
-
-import org.jboss.tools.vpe.el.messages.Messages;
-
-/**
- *
- * @author Eugene Stherbin
- *
- */
-public class TaglibReferencesComposite extends ResourceReferencesComposite {
-
- protected String getEntity() {
- return (file != null) ? "VPETLDReference" : "VPETLDReferenceExt"; //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- protected ResourceReferencesTableProvider createTableProvider(List dataList) {
- return ResourceReferencesTableProvider.getTLDTableProvider(dataList);
- }
-
- protected ResourceReferenceList getReferenceList() {
- return TaglibReferenceList.getInstance();
- }
-
- /**
- * @see ResourceReferencesComposite#createGroupLabel()
- */
- @Override
- protected String createGroupLabel() {
- return Messages.INCLUDED_TAG_LIBS;
- }
-
-
-
-}
Deleted: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/VpeAddReferenceSupport.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/VpeAddReferenceSupport.java 2008-09-01 14:42:40 UTC (rev 9998)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/VpeAddReferenceSupport.java 2008-09-01 14:44:41 UTC (rev 9999)
@@ -1,148 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.vpe.rreferences;
-
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Set;
-import java.util.TreeSet;
-
-import org.eclipse.core.resources.IFile;
-import org.jboss.tools.common.meta.action.XActionInvoker;
-import org.jboss.tools.common.meta.action.impl.SpecialWizardSupport;
-import org.jboss.tools.common.meta.constraint.XAttributeConstraintL;
-import org.jboss.tools.common.model.XModel;
-import org.jboss.tools.common.model.XModelException;
-import org.jboss.tools.common.model.XModelObject;
-import org.jboss.tools.common.model.options.PreferenceModelUtilities;
-import org.jboss.tools.common.model.project.IModelNature;
-import org.jboss.tools.common.model.util.EclipseResourceUtil;
-import org.jboss.tools.jst.web.project.WebProject;
-import org.jboss.tools.jst.web.tld.TaglibMapping;
-
-public class VpeAddReferenceSupport extends SpecialWizardSupport {
-
- public static boolean add(IFile file, ResourceReference css, ResourceReference[] list, String entity) {
- return run(file, css, list, "CreateActions.AddItem", entity); //$NON-NLS-1$
- }
-
- public static boolean edit(IFile file, ResourceReference css, ResourceReference[] list, String entity) {
- return run(file, css, list, "EditActions.EditItem", entity); //$NON-NLS-1$
- }
-
- private static boolean run(IFile file, ResourceReference css, ResourceReference[] list, String action, String entity) {
- XModel model = PreferenceModelUtilities.getPreferenceModel();
- XModelObject object = model.createModelObject(entity, null);
- object.setAttributeValue("location", css.getLocation()); //$NON-NLS-1$
- if(object.getAttributeValue("prefix") != null) { //$NON-NLS-1$
- object.setAttributeValue("prefix", css.getProperties()); //$NON-NLS-1$
- }
- Properties p = new Properties();
- p.put("scope",Integer.valueOf(css.getScope())); //$NON-NLS-1$
- p.put("list", list); //$NON-NLS-1$
- if(file != null) p.put("file", file); //$NON-NLS-1$
- XActionInvoker.invoke(action, object, p);
- boolean ok = "true".equals(p.getProperty("okPressed")); //$NON-NLS-1$ //$NON-NLS-2$
- if(ok) {
- css.setLocation(object.getAttributeValue("location")); //$NON-NLS-1$
- Integer scope = (Integer)p.get("scope"); //$NON-NLS-1$
-
- css.setScope(scope.intValue());
- if(css.isGlobal()){
- css.setScope(ResourceReference.GLOBAL_SCOPE);
- }
- String properties = object.getAttributeValue("prefix"); //$NON-NLS-1$
- if(properties != null) css.setProperties(properties);
- }
- return ok;
- }
-
- IFile file = null;
- String initialLocation;
- String initialPrefix;
- ResourceReference[] list;
- String[] scopeNames;
-
- protected void reset() {
- initialLocation = getTarget().getAttributeValue("location"); //$NON-NLS-1$
- setAttributeValue(0, "location", initialLocation); //$NON-NLS-1$
- initialPrefix = getTarget().getAttributeValue("prefix"); //$NON-NLS-1$
- if(initialPrefix != null) {
- setAttributeValue(0, "prefix", initialPrefix); //$NON-NLS-1$
- }
- final XAttributeConstraintL scopeAttribute = ((XAttributeConstraintL) getTarget().getModelEntity().getAttribute("scope") //$NON-NLS-1$
- .getConstraint());
- if (scopeAttribute != null) {
- scopeNames = scopeAttribute.getValues();
- }
- int scopeIndex = ((Integer)getProperties().get("scope")).intValue(); //$NON-NLS-1$
-
- if(scopeIndex == 1 && scopeNames.length == 1){
- scopeIndex = 0;
- }else if(scopeIndex > scopeNames.length){
- scopeIndex = scopeNames.length -1;
- }
- String scope = scopeNames[scopeIndex];
- setAttributeValue(0, "scope", scope); //$NON-NLS-1$
- list = (ResourceReference[])getProperties().get("list"); //$NON-NLS-1$
- file = (IFile)getProperties().get("file"); //$NON-NLS-1$
- setURIList();
- }
-
- void setURIList() {
- if(file == null) return;
- if(getEntityData()[0].getModelEntity().getName().startsWith("VPETLD")) { //$NON-NLS-1$
- Set set = new TreeSet();
- IModelNature n = EclipseResourceUtil.getModelNature(file.getProject());
- if(n == null) return;
- XModel model = n.getModel();
- TaglibMapping taglibs = WebProject.getInstance(model).getTaglibMapping();
- Map map = taglibs.getTaglibObjects();
- Iterator it = map.keySet().iterator();
- while(it.hasNext()) {
- String s = it.next().toString();
- set.add(taglibs.resolveURI(s));
- }
- String[] uris = (String[])set.toArray(new String[0]);
- setValueList(0, "location", uris); //$NON-NLS-1$
- }
- }
-
- public void action(String name) throws XModelException {
- if(OK.equals(name) || FINISH.equals(name)) {
- execute();
- setFinished(true);
- getProperties().setProperty("okPressed", "true"); //$NON-NLS-1$ //$NON-NLS-2$
- } else if(CANCEL.equals(name)) {
- setFinished(true);
- }
- }
-
- protected void execute() throws XModelException {
- Properties p0 = extractStepData(0);
- getTarget().setAttributeValue("location", p0.getProperty("location")); //$NON-NLS-1$ //$NON-NLS-2$
- if(p0.containsKey("prefix")) { //$NON-NLS-1$
- getTarget().setAttributeValue("prefix", p0.getProperty("prefix")); //$NON-NLS-1$ //$NON-NLS-2$
- }
- int scope = getSelectedScope(p0);
- getProperties().put("scope", Integer.valueOf(scope)); //$NON-NLS-1$
- }
-
- int getSelectedScope(Properties p0) {
- String scopeName = p0.getProperty("scope"); //$NON-NLS-1$
- for (int i = 0; i < scopeNames.length; i++) {
- if(scopeNames[i].equals(scopeName)) return i;
- }
- return 0;
- }
-
-}
Deleted: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/VpeCssReferencesDialog.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/VpeCssReferencesDialog.java 2008-09-01 14:42:40 UTC (rev 9998)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/VpeCssReferencesDialog.java 2008-09-01 14:44:41 UTC (rev 9999)
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.vpe.rreferences;
-
-import java.util.List;
-import java.util.Properties;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IPath;
-import org.jboss.tools.common.model.options.PreferenceModelUtilities;
-import org.jboss.tools.common.model.ui.wizards.query.AbstractQueryWizard;
-
-public class VpeCssReferencesDialog extends AbstractQueryWizard {
-
- public static boolean run(IFile file) {
- VpeCssReferencesDialog dialog = new VpeCssReferencesDialog();
- Properties p = new Properties();
- p.setProperty("help", "VpeCssReferencesDialog");
- p.put("file", file);
- p.put("model", PreferenceModelUtilities.getPreferenceModel());
- dialog.setObject(p);
- int code = dialog.execute();
- return code == 0;
- }
-
- public static boolean run(IPath path) {
- VpeCssReferencesDialog dialog = new VpeCssReferencesDialog();
- Properties p = new Properties();
- p.setProperty("help", "VpeCssReferencesDialog");
- p.put("path", path);
- p.put("model", PreferenceModelUtilities.getPreferenceModel());
- dialog.setObject(p);
- int code = dialog.execute();
- return code == 0;
- }
-
- public VpeCssReferencesDialog() {
- setView(new VpeCssReferencesDialogView());
- }
-
-}
-
-class VpeCssReferencesDialogView extends ResourceReferencesDialogView {
-
- public VpeCssReferencesDialogView() {}
-
- protected String getEntity() {
- return (file != null) ? "VPECSSReference" : "VPECSSReferenceExt";
- }
-
- protected ResourceReferencesTableProvider createTableProvider(List dataList) {
- return ResourceReferencesTableProvider.getCSSTableProvider(dataList);
- }
-
- protected ResourceReferenceList getReferenceList() {
- return CSSReferenceList.getInstance();
- }
-
-}
Deleted: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/VpeResourcesDialog.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/VpeResourcesDialog.java 2008-09-01 14:42:40 UTC (rev 9998)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/VpeResourcesDialog.java 2008-09-01 14:44:41 UTC (rev 9999)
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.vpe.rreferences;
-
-import java.util.Properties;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IPath;
-import org.jboss.tools.common.model.options.PreferenceModelUtilities;
-import org.jboss.tools.common.model.ui.wizards.query.AbstractQueryWizard;
-
-public class VpeResourcesDialog extends AbstractQueryWizard {
-
- public static boolean run(IFile file) {
- VpeResourcesDialog dialog = new VpeResourcesDialog();
- Properties p = new Properties();
- p.setProperty("help", "VpeResourcesDialog");
- p.put("file", file);
- p.put("model", PreferenceModelUtilities.getPreferenceModel());
- dialog.setObject(p);
- int code = dialog.execute();
- return code == 0;
- }
-
- public static boolean run(IPath path) {
- VpeResourcesDialog dialog = new VpeResourcesDialog();
- Properties p = new Properties();
- p.setProperty("help", "VpeResourcesDialog");
- p.put("path", path);
- p.put("model", PreferenceModelUtilities.getPreferenceModel());
- dialog.setObject(p);
- int code = dialog.execute();
- return code == 0;
- }
-
- public VpeResourcesDialog() {
- setView(new VpeResourcesDialogView());
- }
-
-}
Added: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/VpeResourcesDialog.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/VpeResourcesDialog.java (rev 0)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/VpeResourcesDialog.java 2008-09-01 14:44:41 UTC (rev 9999)
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.vpe.rreferences;
+
+import java.util.Properties;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.IPath;
+import org.jboss.tools.common.model.options.PreferenceModelUtilities;
+import org.jboss.tools.common.model.ui.wizards.query.AbstractQueryWizard;
+
+public class VpeResourcesDialog extends AbstractQueryWizard {
+
+ public static boolean run(IFile file) {
+ VpeResourcesDialog dialog = new VpeResourcesDialog();
+ Properties p = new Properties();
+ p.setProperty("help", "VpeResourcesDialog");
+ p.put("file", file);
+ p.put("model", PreferenceModelUtilities.getPreferenceModel());
+ dialog.setObject(p);
+ int code = dialog.execute();
+ return code == 0;
+ }
+
+ public static boolean run(IPath path) {
+ VpeResourcesDialog dialog = new VpeResourcesDialog();
+ Properties p = new Properties();
+ p.setProperty("help", "VpeResourcesDialog");
+ p.put("path", path);
+ p.put("model", PreferenceModelUtilities.getPreferenceModel());
+ dialog.setObject(p);
+ int code = dialog.execute();
+ return code == 0;
+ }
+
+ public VpeResourcesDialog() {
+ setView(new VpeResourcesDialogView());
+ }
+
+}
Property changes on: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/VpeResourcesDialog.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Deleted: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/VpeResourcesDialogView.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/VpeResourcesDialogView.java 2008-09-01 14:42:40 UTC (rev 9998)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/VpeResourcesDialogView.java 2008-09-01 14:44:41 UTC (rev 9999)
@@ -1,104 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.vpe.rreferences;
-
-import java.util.Properties;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.jboss.tools.common.model.ui.wizards.query.AbstractQueryWizardView;
-import org.jboss.tools.vpe.el.ElVariablesComposite;
-
-public class VpeResourcesDialogView extends AbstractQueryWizardView {
- IFile file;
- IPath path;
- CssReferencesComposite css = new CssReferencesComposite();
- //changed by estherbin
- //http://jira.jboss.com/jira/browse/JBIDE-2010
- ElVariablesComposite el = new ElVariablesComposite();
- TaglibReferencesComposite tld = new TaglibReferencesComposite();
- AbsoluteFolderReferenceComposite absFolder = new AbsoluteFolderReferenceComposite();
- RelativeFolderReferenceComposite relFolder = new RelativeFolderReferenceComposite();
-
- public void setObject(Object object) {
- super.setObject(object);
- Properties p = findProperties(object);
- file = (IFile)p.get("file");
- path = (IPath)p.get("path");
-
- css.setObject(object);
- //changed by estherbin
- //http://jira.jboss.com/jira/browse/JBIDE-2010
- el.setObject(object);
- tld.setObject(object);
- absFolder.setObject(p);
- relFolder.setObject(p);
- }
-
- public Control createControl(Composite parent) {
- GridData data;
- Composite c = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout(1, false);
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- c.setLayout(layout);
-
- Control absControl = absFolder.createControl(c);
- data = new GridData(GridData.FILL_HORIZONTAL);
- absControl.setLayoutData(data);
-
- Control relControl = relFolder.createControl(c);
- data = new GridData(GridData.FILL_HORIZONTAL);
- relControl.setLayoutData(data);
-
- Control cssControl = css.createControl(c);
- data = new GridData(GridData.FILL_BOTH);
- cssControl.setLayoutData(data);
- Control tldControl = tld.createControl(c);
- data = new GridData(GridData.FILL_BOTH);
- tldControl.setLayoutData(data);
-
- //changed by estherbin
- //http://jira.jboss.com/jira/browse/JBIDE-2010
- Control elControl = el.createControl(c);
- data = new GridData(GridData.FILL_BOTH);
- elControl.setLayoutData(data);
- return c;
- }
-
- public void action(String command) {
- if(OK.equals(command)) {
- absFolder.commit();
- relFolder.commit();
- el.commit();
- css.commit();
- tld.commit();
- }
- super.action(command);
- }
-
- public Point getPreferredSize() {
- //changed by estherbin
- //http://jira.jboss.com/jira/browse/JBIDE-2010
- String os_name = System.getProperty("os.name");
- if(os_name != null && os_name.indexOf("Windows") >= 0) return new Point(800, 600);
- //changed by estherbin
- //http://jira.jboss.com/jira/browse/JBIDE-2010
- return new Point(600, 700);
- }
-
-}
Added: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/VpeResourcesDialogView.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/VpeResourcesDialogView.java (rev 0)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/VpeResourcesDialogView.java 2008-09-01 14:44:41 UTC (rev 9999)
@@ -0,0 +1,108 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.vpe.rreferences;
+
+import java.util.Properties;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.jboss.tools.common.el.vpe.ElVariablesComposite;
+import org.jboss.tools.common.model.ui.wizards.query.AbstractQueryWizardView;
+import org.jboss.tools.common.rreferences.core.AbsoluteFolderReferenceComposite;
+import org.jboss.tools.common.rreferences.core.CssReferencesComposite;
+import org.jboss.tools.common.rreferences.core.RelativeFolderReferenceComposite;
+import org.jboss.tools.common.rreferences.core.TaglibReferencesComposite;
+
+public class VpeResourcesDialogView extends AbstractQueryWizardView {
+ IFile file;
+ IPath path;
+ CssReferencesComposite css = new CssReferencesComposite();
+ //changed by estherbin
+ //http://jira.jboss.com/jira/browse/JBIDE-2010
+ ElVariablesComposite el = new ElVariablesComposite();
+ TaglibReferencesComposite tld = new TaglibReferencesComposite();
+ AbsoluteFolderReferenceComposite absFolder = new AbsoluteFolderReferenceComposite();
+ RelativeFolderReferenceComposite relFolder = new RelativeFolderReferenceComposite();
+
+ public void setObject(Object object) {
+ super.setObject(object);
+ Properties p = findProperties(object);
+ file = (IFile)p.get("file");
+ path = (IPath)p.get("path");
+
+ css.setObject(object);
+ //changed by estherbin
+ //http://jira.jboss.com/jira/browse/JBIDE-2010
+ el.setObject(object);
+ tld.setObject(object);
+ absFolder.setObject(p);
+ relFolder.setObject(p);
+ }
+
+ public Control createControl(Composite parent) {
+ GridData data;
+ Composite c = new Composite(parent, SWT.NONE);
+ GridLayout layout = new GridLayout(1, false);
+ layout.marginWidth = 0;
+ layout.marginHeight = 0;
+ c.setLayout(layout);
+
+ Control absControl = absFolder.createControl(c);
+ data = new GridData(GridData.FILL_HORIZONTAL);
+ absControl.setLayoutData(data);
+
+ Control relControl = relFolder.createControl(c);
+ data = new GridData(GridData.FILL_HORIZONTAL);
+ relControl.setLayoutData(data);
+
+ Control cssControl = css.createControl(c);
+ data = new GridData(GridData.FILL_BOTH);
+ cssControl.setLayoutData(data);
+ Control tldControl = tld.createControl(c);
+ data = new GridData(GridData.FILL_BOTH);
+ tldControl.setLayoutData(data);
+
+ //changed by estherbin
+ //http://jira.jboss.com/jira/browse/JBIDE-2010
+ Control elControl = el.createControl(c);
+ data = new GridData(GridData.FILL_BOTH);
+ elControl.setLayoutData(data);
+ return c;
+ }
+
+ public void action(String command) {
+ if(OK.equals(command)) {
+ absFolder.commit();
+ relFolder.commit();
+ el.commit();
+ css.commit();
+ tld.commit();
+ }
+ super.action(command);
+ }
+
+ public Point getPreferredSize() {
+ //changed by estherbin
+ //http://jira.jboss.com/jira/browse/JBIDE-2010
+ String os_name = System.getProperty("os.name");
+ if(os_name != null && os_name.indexOf("Windows") >= 0) return new Point(800, 600);
+ //changed by estherbin
+ //http://jira.jboss.com/jira/browse/JBIDE-2010
+ return new Point(600, 700);
+ }
+
+}
Property changes on: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/VpeResourcesDialogView.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
16 years, 4 months
JBoss Tools SVN: r9998 - trunk/common/plugins/org.jboss.tools.common.rreferences/META-INF.
by jbosstools-commits@lists.jboss.org
Author: estherbin
Date: 2008-09-01 10:42:40 -0400 (Mon, 01 Sep 2008)
New Revision: 9998
Modified:
trunk/common/plugins/org.jboss.tools.common.rreferences/META-INF/MANIFEST.MF
Log:
Moved resources reference functionality to the separate bundle.
Modified: trunk/common/plugins/org.jboss.tools.common.rreferences/META-INF/MANIFEST.MF
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.rreferences/META-INF/MANIFEST.MF 2008-09-01 14:24:35 UTC (rev 9997)
+++ trunk/common/plugins/org.jboss.tools.common.rreferences/META-INF/MANIFEST.MF 2008-09-01 14:42:40 UTC (rev 9998)
@@ -2,7 +2,7 @@
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Bundle-Name: Resources to references Plug-in
-Bundle-SymbolicName: corg.jboss.tools.common.rreferences;singleton:=true
+Bundle-SymbolicName: org.jboss.tools.common.rreferences;singleton:=true
Bundle-Version: 2.0.0
Bundle-ManifestVersion: 2
Bundle-Activator: org.jboss.tools.common.rreferences.Activator
16 years, 4 months
JBoss Tools SVN: r9997 - trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2008-09-01 10:24:35 -0400 (Mon, 01 Sep 2008)
New Revision: 9997
Modified:
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/AbstractHyperlink.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2192 Unhandled event loop exception when try to make OpenOn on <ui:include src="#{}"/>
Issue is fixed
Modified: trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/AbstractHyperlink.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/AbstractHyperlink.java 2008-09-01 14:10:06 UTC (rev 9996)
+++ trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/AbstractHyperlink.java 2008-09-01 14:24:35 UTC (rev 9997)
@@ -155,7 +155,7 @@
"/" + name);
}
}
- if (member != null) {
+ if (member != null && (member instanceof IFile)) {
if (((IFile) member).exists())
return (IFile) member;
}
@@ -165,6 +165,10 @@
private IFile findFileByRelativePath(IProject project,
WorkbenchComponent module, IPath basePath, String path) {
+
+ if (path == null || path.trim().length() == 0)
+ return null;
+
ComponentResource[] resources = module.findResourcesBySourcePath(
new Path("/"), 0);
IPath projectPath = project.getLocation();
@@ -180,7 +184,7 @@
basePath);
IPath filePath = relativePath.append(path);
member = project.getFolder(sourcePath).findMember(filePath);
- if (member != null) {
+ if (member != null && (member instanceof IFile)) {
if (((IFile) member).exists())
return (IFile) member;
}
@@ -190,7 +194,7 @@
relativePath = Utils.getRelativePath(webRootPath, basePath);
filePath = relativePath.append(path);
member = project.getFolder(runtimePath).findMember(filePath);
- if (member != null) {
+ if (member != null && (member instanceof IFile)) {
if (((IFile) member).exists())
return (IFile) member;
}
16 years, 4 months
JBoss Tools SVN: r9996 - in trunk/common/plugins/org.jboss.tools.common.el: META-INF and 5 other directories.
by jbosstools-commits@lists.jboss.org
Author: estherbin
Date: 2008-09-01 10:10:06 -0400 (Mon, 01 Sep 2008)
New Revision: 9996
Added:
trunk/common/plugins/org.jboss.tools.common.el/src/org/jboss/tools/common/
trunk/common/plugins/org.jboss.tools.common.el/src/org/jboss/tools/common/el/
trunk/common/plugins/org.jboss.tools.common.el/src/org/jboss/tools/common/el/global/
trunk/common/plugins/org.jboss.tools.common.el/src/org/jboss/tools/common/el/global/GlobalELReferenceList.java
trunk/common/plugins/org.jboss.tools.common.el/src/org/jboss/tools/common/el/global/GlobalElVariablesComposite.java
trunk/common/plugins/org.jboss.tools.common.el/src/org/jboss/tools/common/el/vpe/
trunk/common/plugins/org.jboss.tools.common.el/src/org/jboss/tools/common/el/vpe/ELReferenceList.java
trunk/common/plugins/org.jboss.tools.common.el/src/org/jboss/tools/common/el/vpe/ElVariablesComposite.java
Removed:
trunk/common/plugins/org.jboss.tools.common.el/src/org/jboss/tools/vpe/
Modified:
trunk/common/plugins/org.jboss.tools.common.el/.classpath
trunk/common/plugins/org.jboss.tools.common.el/META-INF/MANIFEST.MF
trunk/common/plugins/org.jboss.tools.common.el/src/org/jboss/tools/common/el/Activator.java
Log:
Moved resources reference functionality to the separate bundle.
Modified: trunk/common/plugins/org.jboss.tools.common.el/.classpath
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el/.classpath 2008-09-01 13:46:47 UTC (rev 9995)
+++ trunk/common/plugins/org.jboss.tools.common.el/.classpath 2008-09-01 14:10:06 UTC (rev 9996)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Modified: trunk/common/plugins/org.jboss.tools.common.el/META-INF/MANIFEST.MF
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el/META-INF/MANIFEST.MF 2008-09-01 13:46:47 UTC (rev 9995)
+++ trunk/common/plugins/org.jboss.tools.common.el/META-INF/MANIFEST.MF 2008-09-01 14:10:06 UTC (rev 9996)
@@ -1,10 +1,15 @@
Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
+Eclipse-LazyStart: true
+Bundle-Vendor: %providerName
+Bundle-Localization: plugin
Bundle-Name: El Plug-in
Bundle-SymbolicName: org.jboss.tools.common.el
-Bundle-Version: 1.0.0
-Bundle-Activator: org.jboss.tools.vpe.el.Activator
+Bundle-Version: 2.0.0
+Provide-Package: org.jboss.tools.common.el,
+ org.jboss.tools.common.el.global,
+ org.jboss.tools.common.el.vpe
+Bundle-Activator: org.jboss.tools.common.el.Activator
Require-Bundle: org.eclipse.ui,
- org.eclipse.core.runtime
-Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
+ org.eclipse.core.runtime,
+ org.jboss.tools.common.rreferences;bundle-version="2.0.0",
+ org.eclipse.core.resources;bundle-version="3.4.0"
Copied: trunk/common/plugins/org.jboss.tools.common.el/src/org/jboss/tools/common/el (from rev 9978, trunk/common/plugins/org.jboss.tools.common.el/src/org/jboss/tools/vpe/el)
Modified: trunk/common/plugins/org.jboss.tools.common.el/src/org/jboss/tools/common/el/Activator.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el/src/org/jboss/tools/vpe/el/Activator.java 2008-09-01 11:45:16 UTC (rev 9978)
+++ trunk/common/plugins/org.jboss.tools.common.el/src/org/jboss/tools/common/el/Activator.java 2008-09-01 14:10:06 UTC (rev 9996)
@@ -1,4 +1,4 @@
-package org.jboss.tools.vpe.el;
+package org.jboss.tools.common.el;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
@@ -9,7 +9,7 @@
public class Activator extends AbstractUIPlugin {
// The plug-in ID
- public static final String PLUGIN_ID = "org.jboss.tools.vpe.el";
+ public static final String PLUGIN_ID = "org.jboss.tools.common.el";
// The shared instance
private static Activator plugin;
Added: trunk/common/plugins/org.jboss.tools.common.el/src/org/jboss/tools/common/el/global/GlobalELReferenceList.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el/src/org/jboss/tools/common/el/global/GlobalELReferenceList.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.el/src/org/jboss/tools/common/el/global/GlobalELReferenceList.java 2008-09-01 14:10:06 UTC (rev 9996)
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.common.el.global;
+
+import org.eclipse.core.runtime.QualifiedName;
+import org.jboss.tools.common.rreferences.core.ResourceReferenceList;
+
+/**
+ * @author Evgenij Stherbin
+ *
+ */
+public class GlobalELReferenceList extends ResourceReferenceList {
+ /** The PROPERT y_ NAME. */
+ private static QualifiedName PROPERTY_NAME = new QualifiedName("", "org.jboss.tools.vpe.editor.css.GlobalELReference");
+
+ /** The instance. */
+ private static GlobalELReferenceList instance = new GlobalELReferenceList();
+
+ /**
+ * Gets the instance.
+ *
+ * @return the instance
+ */
+ public synchronized static GlobalELReferenceList getInstance() {
+ return instance;
+ }
+
+ private GlobalELReferenceList() {
+ super();
+ }
+
+ /**
+ * Gets the property name.
+ *
+ * @return the property name
+ */
+ protected QualifiedName getPropertyName() {
+ return PROPERTY_NAME;
+ }
+
+
+}
Property changes on: trunk/common/plugins/org.jboss.tools.common.el/src/org/jboss/tools/common/el/global/GlobalELReferenceList.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added: trunk/common/plugins/org.jboss.tools.common.el/src/org/jboss/tools/common/el/global/GlobalElVariablesComposite.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el/src/org/jboss/tools/common/el/global/GlobalElVariablesComposite.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.el/src/org/jboss/tools/common/el/global/GlobalElVariablesComposite.java 2008-09-01 14:10:06 UTC (rev 9996)
@@ -0,0 +1,68 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.common.el.global;
+
+import java.util.List;
+
+import org.jboss.tools.common.rreferences.core.ResourceReference;
+import org.jboss.tools.common.rreferences.core.ResourceReferenceList;
+import org.jboss.tools.common.rreferences.core.ResourceReferencesComposite;
+import org.jboss.tools.common.rreferences.core.ResourceReferencesTableProvider;
+
+
+/**
+ * Composite class for the global el variables.
+ * @author Evgenij Stherbin
+ *
+ */
+public class GlobalElVariablesComposite extends ResourceReferencesComposite {
+
+ /**
+ * @see org.jboss.tools.common.rreferences.core.ResourceReferencesComposite#createGroupLabel()
+ */
+ @Override
+ protected String createGroupLabel() {
+ return "";
+ }
+
+ /**
+ * @see org.jboss.tools.common.rreferences.core.ResourceReferencesComposite#createTableProvider(java.util.List)
+ */
+ @Override
+ protected ResourceReferencesTableProvider createTableProvider(List dataList) {
+ return ResourceReferencesTableProvider.getGlobalELTableProvider(dataList);
+ }
+
+ /**
+ * @see org.jboss.tools.common.rreferences.core.ResourceReferencesComposite#getEntity()
+ */
+ @Override
+ protected String getEntity() {
+ return (file != null) ? "VPEGlobalElReference" : "VPEGlobalElReferenceExt";
+ }
+
+ /**
+ * @see org.jboss.tools.common.rreferences.core.ResourceReferencesComposite#getReferenceList()
+ */
+ @Override
+ protected ResourceReferenceList getReferenceList() {
+ return GlobalELReferenceList.getInstance();
+ }
+
+ @Override
+ protected ResourceReference getDefaultResourceReference() {
+ ResourceReference rf = new ResourceReference("", ResourceReference.GLOBAL_SCOPE);
+ rf.setGlobal(true);
+ return rf;
+ }
+
+}
Property changes on: trunk/common/plugins/org.jboss.tools.common.el/src/org/jboss/tools/common/el/global/GlobalElVariablesComposite.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added: trunk/common/plugins/org.jboss.tools.common.el/src/org/jboss/tools/common/el/vpe/ELReferenceList.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el/src/org/jboss/tools/common/el/vpe/ELReferenceList.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.el/src/org/jboss/tools/common/el/vpe/ELReferenceList.java 2008-09-01 14:10:06 UTC (rev 9996)
@@ -0,0 +1,36 @@
+package org.jboss.tools.common.el.vpe;
+
+
+import org.eclipse.core.runtime.QualifiedName;
+import org.jboss.tools.common.rreferences.core.ResourceReferenceList;
+
+
+/**
+ * The Class ELReferenceList.
+ */
+public class ELReferenceList extends ResourceReferenceList {
+
+ /** The PROPERT y_ NAME. */
+ private static QualifiedName PROPERTY_NAME = new QualifiedName("", "org.jboss.tools.vpe.editor.css.ELReference");
+
+ /** The instance. */
+ static ELReferenceList instance = new ELReferenceList();
+
+ /**
+ * Gets the instance.
+ *
+ * @return the instance
+ */
+ public static ELReferenceList getInstance() {
+ return instance;
+ }
+
+ /**
+ * Gets the property name.
+ *
+ * @return the property name
+ */
+ protected QualifiedName getPropertyName() {
+ return PROPERTY_NAME;
+ }
+}
Property changes on: trunk/common/plugins/org.jboss.tools.common.el/src/org/jboss/tools/common/el/vpe/ELReferenceList.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added: trunk/common/plugins/org.jboss.tools.common.el/src/org/jboss/tools/common/el/vpe/ElVariablesComposite.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el/src/org/jboss/tools/common/el/vpe/ElVariablesComposite.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.el/src/org/jboss/tools/common/el/vpe/ElVariablesComposite.java 2008-09-01 14:10:06 UTC (rev 9996)
@@ -0,0 +1,58 @@
+package org.jboss.tools.common.el.vpe;
+
+import java.util.List;
+
+import org.jboss.tools.common.rreferences.core.ResourceReferenceList;
+import org.jboss.tools.common.rreferences.core.ResourceReferencesComposite;
+import org.jboss.tools.common.rreferences.core.ResourceReferencesTableProvider;
+import org.jboss.tools.common.rreferences.messages.Messages;
+
+/**
+ * The Class ElVariablesComposite.
+ */
+public class ElVariablesComposite extends ResourceReferencesComposite {
+
+ /**
+ * Creates the table provider.
+ *
+ * @param dataList the data list
+ * g
+ * @return the resource references table provider
+ */
+ @Override
+ protected ResourceReferencesTableProvider createTableProvider(List dataList) {
+ return ResourceReferencesTableProvider.getELTableProvider(dataList);
+ };
+
+
+ /**
+ * Gets the entity.
+ *
+ * @return the entity
+ */
+ @Override
+ protected String getEntity() {
+ return (file != null) ? "VPEElReference" : "VPEElReferenceExt";
+ }
+
+ /**c
+ * Gets the reference list.
+ *
+ * @return the reference list
+ */
+ @Override
+ protected ResourceReferenceList getReferenceList() {
+ return ELReferenceList.getInstance();
+ }
+
+ /**
+ * @see ResourceReferencesComposite#createGroupLabel()
+ */
+ @Override
+ protected String createGroupLabel() {
+ return Messages.SUBSTITUTED_EL_EXPRESSIONS;
+ }
+
+
+
+}
Property changes on: trunk/common/plugins/org.jboss.tools.common.el/src/org/jboss/tools/common/el/vpe/ElVariablesComposite.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
16 years, 4 months
JBoss Tools SVN: r9995 - trunk/common/plugins/org.jboss.tools.common.rreferences/META-INF.
by jbosstools-commits@lists.jboss.org
Author: estherbin
Date: 2008-09-01 09:46:47 -0400 (Mon, 01 Sep 2008)
New Revision: 9995
Modified:
trunk/common/plugins/org.jboss.tools.common.rreferences/META-INF/MANIFEST.MF
Log:
Moved resources reference functionality to the separate bundle.
Modified: trunk/common/plugins/org.jboss.tools.common.rreferences/META-INF/MANIFEST.MF
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.rreferences/META-INF/MANIFEST.MF 2008-09-01 13:37:50 UTC (rev 9994)
+++ trunk/common/plugins/org.jboss.tools.common.rreferences/META-INF/MANIFEST.MF 2008-09-01 13:46:47 UTC (rev 9995)
@@ -4,6 +4,7 @@
Bundle-Name: Resources to references Plug-in
Bundle-SymbolicName: corg.jboss.tools.common.rreferences;singleton:=true
Bundle-Version: 2.0.0
+Bundle-ManifestVersion: 2
Bundle-Activator: org.jboss.tools.common.rreferences.Activator
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
16 years, 4 months
JBoss Tools SVN: r9994 - trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/messages.
by jbosstools-commits@lists.jboss.org
Author: estherbin
Date: 2008-09-01 09:37:50 -0400 (Mon, 01 Sep 2008)
New Revision: 9994
Added:
trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/messages/Messages.java
trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/messages/messages.properties
Log:
Moved resources reference functionality to the separate bundle.
Added: trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/messages/Messages.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/messages/Messages.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/messages/Messages.java 2008-09-01 13:37:50 UTC (rev 9994)
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.common.rreferences.messages;
+
+import java.util.ResourceBundle;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * The Class Messages.
+ *
+ * @author Eugene Stherbin
+ */
+public final class Messages {
+
+ /** The Constant BUNDLE_NAME. */
+ private static final String BUNDLE_NAME = "org.jboss.tools.common.rreferences.messages.messages";//$NON-NLS-1$
+
+ /** The f resource bundle. */
+ private static ResourceBundle fResourceBundle;
+ static {
+ // load message values from bundle file
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ /**
+ * The Constructor.
+ */
+ private Messages(){}
+
+
+ public static String INCLUDED_CSS_FILES;
+ public static String INCLUDED_TAG_LIBS;
+ public static String SUBSTITUTED_EL_EXPRESSIONS;
+ public static String ACTUAL_RUN_TIME_ABSOLUTE_FOLDER;
+}
Property changes on: trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/messages/Messages.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added: trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/messages/messages.properties
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/messages/messages.properties (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/messages/messages.properties 2008-09-01 13:37:50 UTC (rev 9994)
@@ -0,0 +1,4 @@
+INCLUDED_CSS_FILES=Included css files
+INCLUDED_TAG_LIBS=Included tag libs
+SUBSTITUTED_EL_EXPRESSIONS=Substituted El expressions
+ACTUAL_RUN_TIME_ABSOLUTE_FOLDER=Actual Run-Time Absolute Folder
\ No newline at end of file
Property changes on: trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/messages/messages.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
16 years, 4 months
JBoss Tools SVN: r9993 - in trunk/common/plugins/org.jboss.tools.common.rreferences: META-INF and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: estherbin
Date: 2008-09-01 09:37:19 -0400 (Mon, 01 Sep 2008)
New Revision: 9993
Added:
trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/core/
trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/core/AbsoluteFolderReferenceComposite.java
trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/core/AbsoluteFolderReferenceList.java
trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/core/CSSReferenceList.java
trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/core/CssReferencesComposite.java
trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/core/FolderReferenceComposite.java
trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/core/GlobalResourceReference.java
trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/core/RelativeFolderReferenceComposite.java
trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/core/RelativeFolderReferenceList.java
trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/core/ResourceReference.java
trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/core/ResourceReferenceList.java
trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/core/ResourceReferenceListListener.java
trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/core/ResourceReferencesComposite.java
trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/core/ResourceReferencesDialogView.java
trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/core/ResourceReferencesTableProvider.java
trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/core/TaglibReferenceList.java
trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/core/TaglibReferencesComposite.java
trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/core/VpeAddReferenceSupport.java
trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/core/VpeCssReferencesDialog.java
trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/messages/
Modified:
trunk/common/plugins/org.jboss.tools.common.rreferences/.classpath
trunk/common/plugins/org.jboss.tools.common.rreferences/META-INF/MANIFEST.MF
Log:
Moved resources reference functionality to the separate bundle.
Modified: trunk/common/plugins/org.jboss.tools.common.rreferences/.classpath
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.rreferences/.classpath 2008-09-01 12:00:58 UTC (rev 9992)
+++ trunk/common/plugins/org.jboss.tools.common.rreferences/.classpath 2008-09-01 13:37:19 UTC (rev 9993)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Modified: trunk/common/plugins/org.jboss.tools.common.rreferences/META-INF/MANIFEST.MF
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.rreferences/META-INF/MANIFEST.MF 2008-09-01 12:00:58 UTC (rev 9992)
+++ trunk/common/plugins/org.jboss.tools.common.rreferences/META-INF/MANIFEST.MF 2008-09-01 13:37:19 UTC (rev 9993)
@@ -1,10 +1,17 @@
Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: Rreferences Plug-in
-Bundle-SymbolicName: org.jboss.tools.common.rreferences
-Bundle-Version: 1.0.0
+Bundle-Vendor: %providerName
+Bundle-Localization: plugin
+Bundle-Name: Resources to references Plug-in
+Bundle-SymbolicName: corg.jboss.tools.common.rreferences;singleton:=true
+Bundle-Version: 2.0.0
Bundle-Activator: org.jboss.tools.common.rreferences.Activator
Require-Bundle: org.eclipse.ui,
- org.eclipse.core.runtime
-Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
+ org.eclipse.core.runtime,
+ org.jboss.tools.common.model.ui,
+ org.eclipse.core.resources,
+ org.jboss.tools.jst.web
+Eclipse-LazyStart: true
+Provide-Package: org.jboss.tools.common.rreferences,
+ org.jboss.tools.common.rreferences.core,
+ org.jboss.tools.common.rreferences.messages
+
Copied: trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/core/AbsoluteFolderReferenceComposite.java (from rev 9974, trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/AbsoluteFolderReferenceComposite.java)
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/core/AbsoluteFolderReferenceComposite.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/core/AbsoluteFolderReferenceComposite.java 2008-09-01 13:37:19 UTC (rev 9993)
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.rreferences.core;
+
+import org.jboss.tools.common.rreferences.messages.Messages;
+
+public class AbsoluteFolderReferenceComposite extends FolderReferenceComposite {
+
+ protected ResourceReferenceList getReferenceList() {
+ return AbsoluteFolderReferenceList.getInstance();
+ }
+
+ protected String getTitle() {
+ return Messages.ACTUAL_RUN_TIME_ABSOLUTE_FOLDER;
+ }
+
+}
Copied: trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/core/AbsoluteFolderReferenceList.java (from rev 9974, trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/AbsoluteFolderReferenceList.java)
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/core/AbsoluteFolderReferenceList.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/core/AbsoluteFolderReferenceList.java 2008-09-01 13:37:19 UTC (rev 9993)
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.rreferences.core;
+
+import org.eclipse.core.runtime.QualifiedName;
+
+public class AbsoluteFolderReferenceList extends ResourceReferenceList {
+ private static QualifiedName PROPERTY_NAME = new QualifiedName("", "org.jboss.tools.vpe.editor.css.AbsoluteFolder");
+ static AbsoluteFolderReferenceList instance = new AbsoluteFolderReferenceList();
+
+ public static AbsoluteFolderReferenceList getInstance() {
+ return instance;
+ }
+
+ protected QualifiedName getPropertyName() {
+ return PROPERTY_NAME;
+ }
+}
Copied: trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/core/CSSReferenceList.java (from rev 9974, trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/CSSReferenceList.java)
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/core/CSSReferenceList.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/core/CSSReferenceList.java 2008-09-01 13:37:19 UTC (rev 9993)
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.rreferences.core;
+
+import org.eclipse.core.runtime.QualifiedName;
+
+public class CSSReferenceList extends ResourceReferenceList {
+ private static QualifiedName PROPERTY_NAME = new QualifiedName("", "org.jboss.tools.vpe.editor.css.CSSList");
+ static CSSReferenceList instance = new CSSReferenceList();
+
+ public static CSSReferenceList getInstance() {
+ return instance;
+ }
+
+ protected QualifiedName getPropertyName() {
+ return PROPERTY_NAME;
+ }
+
+}
Copied: trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/core/CssReferencesComposite.java (from rev 9974, trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/CssReferencesComposite.java)
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/core/CssReferencesComposite.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/core/CssReferencesComposite.java 2008-09-01 13:37:19 UTC (rev 9993)
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.rreferences.core;
+
+import java.util.List;
+
+import org.jboss.tools.common.rreferences.messages.Messages;
+
+public class CssReferencesComposite extends ResourceReferencesComposite {
+
+ protected String getEntity() {
+ return (file != null) ? "VPECSSReference" : "VPECSSReferenceExt";
+ }
+
+ protected ResourceReferencesTableProvider createTableProvider(List dataList) {
+ return ResourceReferencesTableProvider.getCSSTableProvider(dataList);
+ }
+
+ protected ResourceReferenceList getReferenceList() {
+ return CSSReferenceList.getInstance();
+ }
+
+
+ /**
+ * @see ResourceReferencesComposite#createGroupLabel()
+ */
+ @Override
+ protected String createGroupLabel() {
+ return Messages.INCLUDED_CSS_FILES;
+ }
+
+
+}
Copied: trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/core/FolderReferenceComposite.java (from rev 9974, trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/FolderReferenceComposite.java)
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/core/FolderReferenceComposite.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/core/FolderReferenceComposite.java 2008-09-01 13:37:19 UTC (rev 9993)
@@ -0,0 +1,124 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.rreferences.core;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Group;
+import org.jboss.tools.common.meta.action.XEntityData;
+import org.jboss.tools.common.meta.action.impl.XEntityDataImpl;
+import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.options.PreferenceModelUtilities;
+import org.jboss.tools.common.model.ui.attribute.XAttributeSupport;
+import org.jboss.tools.common.model.ui.attribute.editor.DirectoryFieldEditorEx;
+
+public abstract class FolderReferenceComposite {
+ XAttributeSupport support = new XAttributeSupport();
+ XModelObject object;
+ IFile file;
+ IPath path;
+ ResourceReference[] rs;
+ ResourceReference current;
+ XEntityData data;
+
+ public FolderReferenceComposite() {
+ object = PreferenceModelUtilities.getPreferenceModel().createModelObject(getEntity(), new Properties());
+ }
+
+ public void setObject(Properties p) {
+ file = (IFile)p.get("file");
+ path = (IPath)p.get("path");
+ rs = (file != null) ? getReferenceList().getAllResources(file) :
+ (path != null) ? getReferenceList().getAllResources(path)
+ : new ResourceReference[0];
+ if(rs.length == 0) {
+ rs = new ResourceReference[1];
+ rs[0] = new ResourceReference("", ResourceReference.FILE_SCOPE);
+ }
+ current = rs[0];
+ object.setAttributeValue("location", current.getLocation());
+ object.setAttributeValue("scope", current.getScopeName());
+
+ data = XEntityDataImpl.create(new String[][]{
+ {getEntity(), "yes"},
+ {"location", "no"},
+ {"scope", "no"}
+ });
+
+ data.getAttributeData()[0].setValue(current.getLocation());
+ data.getAttributeData()[1].setValue(current.getScopeName());
+
+ support.init(object, data);
+// support.addPropertyChangeListener(new PropertyChangeListener() {
+// public void propertyChange(PropertyChangeEvent evt) {
+// }
+// });
+ }
+
+ protected String getEntity() {
+ return (file != null) ? "VPEFolderReference" : "VPEFolderReferenceExt";
+ }
+
+ protected abstract ResourceReferenceList getReferenceList();
+ protected abstract String getTitle();
+
+ public Control createControl(Composite parent) {
+ Group g = new Group(parent, SWT.SHADOW_ETCHED_IN);
+ GridLayout layout = new GridLayout(1, false);
+ g.setLayout(layout);
+ g.setText(getTitle());
+ Control c = support.createControl(g);
+ if(file != null) {
+ DirectoryFieldEditorEx f = (DirectoryFieldEditorEx)support.getFieldEditorByName("location");
+ f.setLastPath(file.getProject().getLocation().toString());
+ }
+ GridData data = new GridData(GridData.FILL_BOTH);
+ c.setLayoutData(data);
+ return g;
+ }
+
+ public void commit() {
+ support.store();
+ current.setLocation(data.getAttributeData()[0].getValue());
+ current.setScope(getNewScope());
+ List l = new ArrayList();
+ for (int i = rs.length - 2; i >= 0; i--) {
+ if(rs[i].getLocation().equals(current.getLocation())) continue;
+ if(rs[i].getScope() == current.getScope()) continue;
+ l.add(rs[i]);
+ }
+ l.add(current);
+ rs = (ResourceReference[])l.toArray(new ResourceReference[0]);
+ if(file != null) {
+ getReferenceList().setAllResources(file, rs);
+ } else {
+ getReferenceList().setAllResources(path, rs);
+ }
+ }
+
+ int getNewScope() {
+ String s = data.getAttributeData()[1].getValue();
+ for (int i = 0; i < ResourceReference.SCOPE_NAMES.length; i++) {
+ if(ResourceReference.SCOPE_NAMES[i].equals(s)) return i;
+ }
+ return ResourceReference.FILE_SCOPE;
+ }
+
+}
Copied: trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/core/GlobalResourceReference.java (from rev 9974, trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/GlobalResourceReference.java)
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/core/GlobalResourceReference.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/core/GlobalResourceReference.java 2008-09-01 13:37:19 UTC (rev 9993)
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.common.rreferences.core;
+
+
+/**
+ * Global resource reference
+ * @author Evgenij Stherbin
+ *
+ */
+public class GlobalResourceReference extends ResourceReference {
+
+ /**
+ * @param location
+ * @param scope
+ */
+ public GlobalResourceReference(String location, int scope) {
+ super(location, scope);
+ }
+
+}
Copied: trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/core/RelativeFolderReferenceComposite.java (from rev 9974, trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/RelativeFolderReferenceComposite.java)
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/core/RelativeFolderReferenceComposite.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/core/RelativeFolderReferenceComposite.java 2008-09-01 13:37:19 UTC (rev 9993)
@@ -0,0 +1,24 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.rreferences.core;
+
+
+public class RelativeFolderReferenceComposite extends FolderReferenceComposite {
+
+ protected ResourceReferenceList getReferenceList() {
+ return RelativeFolderReferenceList.getInstance();
+ }
+
+ protected String getTitle() {
+ return "Actual Run-Time Relative Folder";
+ }
+
+}
Copied: trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/core/RelativeFolderReferenceList.java (from rev 9974, trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/RelativeFolderReferenceList.java)
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/core/RelativeFolderReferenceList.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/core/RelativeFolderReferenceList.java 2008-09-01 13:37:19 UTC (rev 9993)
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.rreferences.core;
+
+import org.eclipse.core.runtime.QualifiedName;
+
+public class RelativeFolderReferenceList extends ResourceReferenceList {
+ private static QualifiedName PROPERTY_NAME = new QualifiedName("", "org.jboss.tools.vpe.editor.css.RelativeFolder");
+ static RelativeFolderReferenceList instance = new RelativeFolderReferenceList();
+
+ public static RelativeFolderReferenceList getInstance() {
+ return instance;
+ }
+
+ protected QualifiedName getPropertyName() {
+ return PROPERTY_NAME;
+ }
+
+}
Copied: trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/core/ResourceReference.java (from rev 9974, trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/ResourceReference.java)
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/core/ResourceReference.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/core/ResourceReference.java 2008-09-01 13:37:19 UTC (rev 9993)
@@ -0,0 +1,109 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.rreferences.core;
+
+public class ResourceReference {
+ public final static int FILE_SCOPE = 0;
+ public final static int FOLDER_SCOPE = 1;
+ public final static int PROJECT_SCOPE = 2;
+ public final static int GLOBAL_SCOPE = 3;
+
+ public final static String[] SCOPE_NAMES = new String[]{"Page", "Folder", "Project","Global"};
+
+ protected String location;
+ protected int scope;
+ protected int depth = 0;
+ protected String properties = "";
+
+ protected boolean isGlobal = false;
+
+ public boolean isGlobal() {
+ return isGlobal;
+ }
+
+ public void setGlobal(boolean isGlobal) {
+ this.isGlobal = isGlobal;
+ }
+
+ public ResourceReference(String location, int scope) {
+ this.location = location;
+ this.scope = scope;
+ int q = location.indexOf('%');
+ if(q >= 0) {
+ properties = location.substring(q + 1);
+ this.location = location.substring(0, q);
+ }
+ }
+
+ public String getLocation() {
+ return location;
+ }
+
+ public int getScope() {
+ return scope;
+ }
+
+ public void setLocation(String location) {
+ this.location = location;
+ }
+
+ public void setProperties(String properties) {
+ this.properties = properties;
+ }
+
+ public String getProperties() {
+ return properties;
+ }
+
+ public void setScope(int scope) {
+ this.scope = scope;
+ }
+
+ public String getScopeName() {
+ return SCOPE_NAMES[scope];
+ }
+
+ public void setDepth(int depth) {
+ this.depth = depth;
+ }
+
+ public int getDepth() {
+ return depth;
+ }
+
+ public String getLocationAndProperties() {
+ String v = location;
+ if(properties.length() > 0) {
+ v += "%" + properties;
+ }
+ return v;
+ }
+
+
+// public static ResourceReference createResourceReference(String location, int scope) {
+// ResourceReference rst = null;
+//
+// switch (scope) {
+// case FILE_SCOPE:
+// case FOLDER_SCOPE:
+// case PROJECT_SCOPE:
+// rst = new ResourceReference(location, scope);
+// break;
+// case GLOBAL_SCOPE:
+// rst = new GlobalResourceReference(location, scope);
+// break;
+// default:
+// throw new IllegalArgumentException("Illegal scope=" + scope);
+// }
+// return rst;
+// }
+
+}
Copied: trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/core/ResourceReferenceList.java (from rev 9974, trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/ResourceReferenceList.java)
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/core/ResourceReferenceList.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/core/ResourceReferenceList.java 2008-09-01 13:37:19 UTC (rev 9993)
@@ -0,0 +1,274 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.rreferences.core;
+
+import java.io.File;
+import java.util.*;
+import org.eclipse.core.resources.*;
+import org.eclipse.core.runtime.*;
+import org.jboss.tools.common.model.plugin.ModelPlugin;
+import org.jboss.tools.common.model.util.XModelObjectUtil;
+
+public abstract class ResourceReferenceList {
+ ResourceReferenceListListener[] listeners = new ResourceReferenceListListener[0];
+
+ protected abstract QualifiedName getPropertyName();
+
+ public void addChangeListener(ResourceReferenceListListener listener) {
+ int i = getListenerIndex(listener);
+ if(i >= 0) return;
+ ResourceReferenceListListener[] ls = new ResourceReferenceListListener[listeners.length + 1];
+ System.arraycopy(listeners, 0, ls, 0, listeners.length);
+ ls[listeners.length] = listener;
+ listeners = ls;
+ }
+
+ public void removeChangeListener(ResourceReferenceListListener listener) {
+ int i = getListenerIndex(listener);
+ if(i < 0) return;
+ ResourceReferenceListListener[] ls = new ResourceReferenceListListener[listeners.length - 1];
+ if(i > 0) System.arraycopy(listeners, 0, ls, 0, i);
+ if(i < ls.length) System.arraycopy(listeners, i + 1, ls, i, ls.length - i);
+ listeners = ls;
+ }
+
+ private int getListenerIndex(ResourceReferenceListListener listener) {
+ for (int i = 0; i < listeners.length; i++) {
+ if(listeners[i] == listener) return i;
+ }
+ return -1;
+ }
+
+ public ResourceReference[] getAllResources(IFile file) {
+ Set locations = new HashSet();
+ List css = new ArrayList();
+ if(file.getProject() != null) {
+ String[] dcss = getDeclaredResources(file.getProject());
+ for (int i = 0; i < dcss.length; i++) {
+ ResourceReference ref = new ResourceReference(dcss[i], ResourceReference.PROJECT_SCOPE);
+ locations.add(dcss[i]);
+ css.add(ref);
+ }
+ }
+ IResource parent = file.getParent();
+ int depth = 0;
+ while(parent instanceof IFolder) {
+ String[] dcss = getDeclaredResources(parent);
+ for (int i = 0; i < dcss.length; i++) {
+ if(locations.contains(dcss[i])) continue;
+ ResourceReference ref = new ResourceReference(dcss[i], ResourceReference.FOLDER_SCOPE);
+ ref.setDepth(depth);
+ locations.add(dcss[i]);
+ css.add(ref);
+ }
+ parent = parent.getParent();
+ depth++;
+ }
+ String[] dcss = getDeclaredResources(file);
+ for (int i = 0; i < dcss.length; i++) {
+ if(locations.contains(dcss[i])) continue;
+ ResourceReference ref = new ResourceReference(dcss[i], ResourceReference.FILE_SCOPE);
+ locations.add(dcss[i]);
+ css.add(ref);
+ }
+ return (ResourceReference[])css.toArray(new ResourceReference[0]);
+ }
+
+ private String[] getDeclaredResources(IResource resource) {
+ String s = null;
+ try {
+ s = resource.getPersistentProperty(getPropertyName());
+ } catch (CoreException e) {
+ //ignore
+ }
+ if(s == null || s.length() == 0) return new String[0];
+ return XModelObjectUtil.asStringArray(s);
+ }
+
+ public void setAllResources(IFile file, ResourceReference[] entries) {
+ IResource changed = null;
+ boolean b = setDeclaredResources(file, entries, ResourceReference.FILE_SCOPE, 0);
+ if(b) changed = file;
+ IResource parent = file.getParent();
+ int depth = 0;
+ while(parent instanceof IFolder) {
+ b = setDeclaredResources(parent, entries, ResourceReference.FOLDER_SCOPE, depth);
+ if(b) changed = parent;
+ parent = parent.getParent();
+ depth++;
+ }
+ if(file.getProject() != null) {
+ int scope = ResourceReference.PROJECT_SCOPE;
+ if(file.getParent() == file.getProject()) scope = 10;
+ b = setDeclaredResources(file.getProject(), entries, scope, 0);
+ if(b) changed = file.getProject();
+ }
+ if(changed != null) fire(changed.getFullPath());
+ }
+
+ private boolean setDeclaredResources(IResource resource, ResourceReference[] entries, int scope, int depth) {
+ try {
+ String oldValue = resource.getPersistentProperty(getPropertyName());
+ if(oldValue == null) oldValue = "";
+ String newValue = encodeDeclaredResources(entries, scope, depth);
+ if(oldValue.equals(newValue)) return false;
+ resource.setPersistentProperty(getPropertyName(), newValue);
+ } catch (CoreException e) {
+ return false;
+ }
+ return true;
+ }
+
+ private String encodeDeclaredResources(ResourceReference[] entries, int scope, int depth) {
+ StringBuffer sb = new StringBuffer();
+ for (int i = 0; i < entries.length; i++) {
+ int s = entries[i].getScope();
+ if(scope < 10 && s != scope) continue;
+ if(scope == 10 && s == ResourceReference.FILE_SCOPE) continue;
+ if(scope == ResourceReference.FOLDER_SCOPE && entries[i].getDepth() != depth) continue;
+ if(sb.length() > 0) sb.append(";");
+ sb.append(entries[i].getLocationAndProperties());
+ }
+ return sb.toString();
+ }
+
+ void fire(IPath path) {
+ ResourceReferenceListListener[] ls = listeners;
+ for (int i = 0; i < ls.length; i++) {
+ IPath listenedPath = ls[i].getPath();
+ if(listenedPath != null && path.isPrefixOf(listenedPath)) {
+ ls[i].changed(this);
+ }
+ }
+ }
+
+ /*
+ * Handle opened external files
+ */
+ TreeMap allExternalResources = null;
+
+ private TreeMap getAllExternalResources() {
+ if(allExternalResources == null) {
+ allExternalResources = new TreeMap();
+ String s = null;
+ try {
+ s = ModelPlugin.getWorkspace().getRoot().getPersistentProperty(getPropertyName());
+ if(s != null) parseExternalResources(s);
+ } catch (CoreException e) {
+ //ignore
+ }
+ }
+ return allExternalResources;
+ }
+ private void parseExternalResources(String s) {
+ StringTokenizer st = new StringTokenizer(s, "#");
+ while(st.hasMoreTokens()) {
+ String t = st.nextToken();
+ int e = t.indexOf('=');
+ String path = t.substring(0, e);
+ String list = t.substring(e + 1);
+ if(new File(path).exists()) allExternalResources.put(path, list);
+ }
+ }
+
+ private void setAllExternalResources() {
+ StringBuffer sb = new StringBuffer();
+ Iterator it = allExternalResources.keySet().iterator();
+ while(it.hasNext()) {
+ String path = it.next().toString();
+ String list = (String)allExternalResources.get(path);
+ if(path != null && list != null && new File(path).exists()) {
+ if(sb.length() > 0) sb.append('#');
+ sb.append(path).append('=').append(list);
+ }
+ }
+ try {
+ ModelPlugin.getWorkspace().getRoot().setPersistentProperty(getPropertyName(), sb.toString());
+ } catch (CoreException e) {
+ //ignore
+ }
+ }
+
+ public ResourceReference[] getAllResources(IPath path) {
+ Set locations = new HashSet();
+ List css = new ArrayList();
+ IPath parent = path.removeLastSegments(1);
+ int depth = 0;
+ boolean isGlobal = path.equals(Platform.getLocation());
+ int setScope = isGlobal ? ResourceReference.GLOBAL_SCOPE : ResourceReference.FILE_SCOPE;
+ while(parent != null && parent.segmentCount() > 1) {
+ String[] dcss = getDeclaredResources(path);
+ for (int i = 0; i < dcss.length; i++) {
+ if(locations.contains(dcss[i])) continue;
+ ResourceReference ref = new ResourceReference(dcss[i],isGlobal ? ResourceReference.GLOBAL_SCOPE : ResourceReference.FOLDER_SCOPE);
+ if(isGlobal){
+ ref.setGlobal(true);
+ }
+ ref.setDepth(depth);
+ locations.add(dcss[i]);
+ css.add(ref);
+ }
+ parent = parent.removeLastSegments(1);
+ depth++;
+ }
+ String[] dcss = getDeclaredResources(path);
+ for (int i = 0; i < dcss.length; i++) {
+ if(locations.contains(dcss[i])) continue;
+ ResourceReference ref = new ResourceReference(dcss[i], setScope);
+ if(setScope == ResourceReference.GLOBAL_SCOPE){
+ ref.setGlobal(true);
+ }
+ locations.add(dcss[i]);
+ css.add(ref);
+ }
+ return (ResourceReference[])css.toArray(new ResourceReference[0]);
+ }
+
+ private String[] getDeclaredResources(IPath path) {
+ String s = (String)getAllExternalResources().get(path.toString());
+ return (s == null || s.length() == 0) ? new String[0] : XModelObjectUtil.asStringArray(s);
+ }
+
+ public void setAllResources(IPath path, ResourceReference[] entries) {
+ IPath changed = null;
+ boolean b = false;
+ int checkScope = path.equals(Platform.getLocation()) ? ResourceReference.GLOBAL_SCOPE : ResourceReference.FILE_SCOPE;
+
+ b = setDeclaredResources(path, entries, checkScope, 0);
+ if(b) changed = path;
+ IPath parent = path.removeLastSegments(1);
+ int depth = 0;
+ while(parent != null && parent.segmentCount() > 1) {
+ b = setDeclaredResources(parent, entries, ResourceReference.FOLDER_SCOPE, depth);
+ if(b) changed = parent;
+ parent = parent.removeLastSegments(1);
+ depth++;
+ }
+ if(changed != null) {
+ setAllExternalResources();
+ fire(changed);
+ }
+ }
+
+ private boolean setDeclaredResources(IPath path, ResourceReference[] entries, int scope, int depth) {
+ String oldValue = (String)getAllExternalResources().get(path.toString());
+ if(oldValue == null) oldValue = "";
+ String newValue = encodeDeclaredResources(entries, scope, depth);
+ if(oldValue.equals(newValue)) return false;
+ if(newValue == null || newValue.length() == 0) {
+ getAllExternalResources().remove(path.toString());
+ } else {
+ getAllExternalResources().put(path.toString(), newValue);
+ }
+ return true;
+ }
+
+}
Copied: trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/core/ResourceReferenceListListener.java (from rev 9974, trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/ResourceReferenceListListener.java)
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/core/ResourceReferenceListListener.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/core/ResourceReferenceListListener.java 2008-09-01 13:37:19 UTC (rev 9993)
@@ -0,0 +1,19 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.rreferences.core;
+
+import org.eclipse.core.runtime.IPath;
+
+public interface ResourceReferenceListListener {
+ public IPath getPath();
+ public void changed(Object source);
+
+}
Copied: trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/core/ResourceReferencesComposite.java (from rev 9974, trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/ResourceReferencesComposite.java)
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/core/ResourceReferencesComposite.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/core/ResourceReferencesComposite.java 2008-09-01 13:37:19 UTC (rev 9993)
@@ -0,0 +1,210 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.rreferences.core;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Group;
+import org.jboss.tools.common.meta.XAttribute;
+import org.jboss.tools.common.meta.XModelEntity;
+import org.jboss.tools.common.meta.constraint.impl.XAttributeConstraintFileFilter;
+import org.jboss.tools.common.meta.impl.XModelMetaDataImpl;
+import org.jboss.tools.common.model.ui.action.CommandBar;
+import org.jboss.tools.common.model.ui.action.CommandBarListener;
+import org.jboss.tools.common.model.ui.objecteditor.XTable;
+
+public abstract class ResourceReferencesComposite {
+ protected static String ADD = "Add";
+ protected static String EDIT = "Edit";
+ protected static String REMOVE = "Remove";
+ protected XTable table = new XTable();
+ protected CommandBar bar = new CommandBar();
+ protected ResourceReferencesTableProvider tableProvider;// = new TemplatesTableProvider();
+ protected IFile file;
+ protected IPath path;
+ protected List dataList = new ArrayList();
+
+ public ResourceReferencesComposite() {
+ init();
+ }
+
+ private void init() {
+ tableProvider = createTableProvider(dataList);
+ bar.getLayout().buttonWidth = 80;
+ bar.getLayout().direction = SWT.VERTICAL;
+ bar.setCommands(new String[]{ADD, EDIT, REMOVE});
+ bar.addCommandBarListener(new BarListener());
+ table.setTableProvider(tableProvider);
+ }
+
+ protected abstract ResourceReferencesTableProvider createTableProvider(List dataList);
+ protected abstract ResourceReferenceList getReferenceList();
+
+ /**
+ * Returned the label that will display in group.
+ *
+ * @return label displayed in group
+ * @see #createControl(Composite)
+ */
+ protected abstract String createGroupLabel();
+
+
+ public void setObject(Object object) {
+ Properties p = (Properties)object;
+ file = (IFile)p.get("file");
+ path = (IPath)p.get("path");
+ ResourceReference[] rs = (file != null) ? getReferenceList().getAllResources(file) :
+ (path != null) ? getReferenceList().getAllResources(path)
+ : new ResourceReference[0];
+ for (int i = 0; i < rs.length; i++) dataList.add(rs[i]);
+ }
+
+ public Control createControl(Composite parent) {
+ Composite c1 = new Composite(parent, SWT.NONE);
+
+ c1.setLayoutData(new GridData(GridData.FILL_BOTH));
+ c1.setLayout(new GridLayout(2,false));
+
+ final Group group = new Group(c1,SWT.NONE);
+
+ group.setText(createGroupLabel());
+ group.setLayoutData(new GridData(GridData.FILL_BOTH));
+ GridLayout g = new GridLayout(2, false);
+ group.setLayout(g);
+
+
+ Control slc = table.createControl(group);
+ slc.setLayoutData(new GridData(GridData.FILL_BOTH));
+ Control bc = bar.createControl(group);
+
+
+ GridData gd = new GridData(GridData.FILL_VERTICAL);
+ bc.setLayoutData(gd);
+ table.getTable().addSelectionListener(new SelectionListener() {
+ public void widgetSelected(SelectionEvent e) {
+ updateBars();
+ }
+ public void widgetDefaultSelected(SelectionEvent e) {
+ widgetSelected(e);
+ }
+ });
+ update();
+ return c1;
+ }
+
+ ResourceReference[] getReferenceArray() {
+ return (ResourceReference[])dataList.toArray(new ResourceReference[0]);
+ }
+
+ /**
+ * Clear all entries from table.
+ */
+ public void clearAll(){
+ if(this.dataList!=null){
+ this.dataList.clear();
+ }
+ }
+
+ public void commit() {
+ if(file != null) {
+ getReferenceList().setAllResources(file, getReferenceArray());
+ } else {
+ getReferenceList().setAllResources(path, getReferenceArray());
+ }
+ }
+ class BarListener implements CommandBarListener {
+ public void action(String command) {
+ int index = table.getSelectionIndex();
+ if(ADD.equals(command)) {
+ add(index);
+ } else if(EDIT.equals(command)) {
+ edit(index);
+ } else if(REMOVE.equals(command)) {
+ remove(index);
+ }
+ update();
+ }
+ }
+
+ protected void add(int index) {
+ ResourceReference css = getDefaultResourceReference();
+
+ initFilterInFileChooser();
+ boolean ok = VpeAddReferenceSupport.add(file, css, getReferenceArray(), getEntity());
+ if(!ok) return;
+ dataList.add(css);
+ update();
+ table.setSelection(dataList.size() - 1);
+ }
+
+ /**
+ * @return
+ */
+ protected ResourceReference getDefaultResourceReference() {
+ return new ResourceReference("", ResourceReference.FOLDER_SCOPE);
+ }
+
+ protected void edit(int index) {
+ if(index < 0) return;
+ ResourceReference css = getReferenceArray()[index];
+ initFilterInFileChooser();
+ boolean ok = VpeAddReferenceSupport.edit(file, css, getReferenceArray(), getEntity());
+ if(!ok) return;
+ update();
+ }
+
+ protected abstract String getEntity();
+
+ void remove(int index) {
+ if(index >= 0) dataList.remove(index);
+ }
+
+ public void update() {
+ if(table != null) table.update();
+ updateBars();
+ }
+
+ void updateBars() {
+ bar.setEnabled(EDIT, canModify());
+ bar.setEnabled(REMOVE, canModify());
+ }
+
+ private boolean canModify() {
+ return table.getSelectionIndex() >= 0;
+ }
+
+ private void initFilterInFileChooser() {
+ String entityName = getEntity();
+ XModelEntity entity = XModelMetaDataImpl.getInstance().getEntity(entityName);
+ if(entity != null && file != null && file.getProject() != null) {
+ XAttribute[] as = entity.getAttributes();
+ for (int i = 0; i < as.length; i++) {
+ if(as[i].getConstraint() instanceof XAttributeConstraintFileFilter) {
+ XAttributeConstraintFileFilter f = (XAttributeConstraintFileFilter)as[i].getConstraint();
+ f.getProperties().setProperty("filterFolder", file.getProject().getLocation().toFile().getAbsolutePath());
+ }
+ }
+ }
+ }
+
+
+}
Copied: trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/core/ResourceReferencesDialogView.java (from rev 9974, trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/ResourceReferencesDialogView.java)
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/core/ResourceReferencesDialogView.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/core/ResourceReferencesDialogView.java 2008-09-01 13:37:19 UTC (rev 9993)
@@ -0,0 +1,159 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.rreferences.core;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.jboss.tools.common.model.ui.action.CommandBar;
+import org.jboss.tools.common.model.ui.action.CommandBarListener;
+import org.jboss.tools.common.model.ui.objecteditor.XTable;
+import org.jboss.tools.common.model.ui.wizards.query.AbstractQueryWizardView;
+
+public abstract class ResourceReferencesDialogView extends AbstractQueryWizardView {
+ static String ADD = "Add";
+ static String EDIT = "Edit";
+ static String REMOVE = "Remove";
+ protected XTable table = new XTable();
+ protected CommandBar bar = new CommandBar();
+ protected ResourceReferencesTableProvider tableProvider;// = new TemplatesTableProvider();
+ IFile file;
+ IPath path;
+ protected List dataList = new ArrayList();
+
+ public ResourceReferencesDialogView() {
+ init();
+ }
+
+ private void init() {
+// changed = false;
+ tableProvider = createTableProvider(dataList);
+///ResourceReferencesTableProvider.getCSSTableProvider(dataList);
+ bar.getLayout().buttonWidth = 80;
+ bar.getLayout().direction = SWT.VERTICAL;
+ bar.setCommands(new String[]{ADD, EDIT, REMOVE});
+ bar.addCommandBarListener(new BarListener());
+ table.setTableProvider(tableProvider);
+ }
+
+ protected abstract ResourceReferencesTableProvider createTableProvider(List dataList);
+ protected abstract ResourceReferenceList getReferenceList();
+
+ public void setObject(Object object) {
+ super.setObject(object);
+ Properties p = findProperties(object);
+ file = (IFile)p.get("file");
+ path = (IPath)p.get("path");
+ ResourceReference[] rs = (file != null) ? getReferenceList().getAllResources(file) :
+ (path != null) ? getReferenceList().getAllResources(path)
+ : new ResourceReference[0];
+ for (int i = 0; i < rs.length; i++) dataList.add(rs[i]);
+ }
+
+ public Control createControl(Composite parent) {
+ Composite c = new Composite(parent, SWT.NONE);
+ c.setLayoutData(new GridData(GridData.FILL_BOTH));
+ GridLayout g = new GridLayout(2, false);
+ c.setLayout(g);
+ Control slc = table.createControl(c);
+ slc.setLayoutData(new GridData(GridData.FILL_BOTH));
+ Control bc = bar.createControl(c);
+ GridData gd = new GridData(GridData.FILL_VERTICAL);
+ bc.setLayoutData(gd);
+ table.getTable().addSelectionListener(new SelectionListener() {
+ public void widgetSelected(SelectionEvent e) {
+ updateBars();
+ }
+ public void widgetDefaultSelected(SelectionEvent e) {
+ widgetSelected(e);
+ }
+ });
+ update();
+ return c;
+ }
+
+ ResourceReference[] getReferenceArray() {
+ return (ResourceReference[])dataList.toArray(new ResourceReference[0]);
+ }
+
+ public void action(String command) {
+ stopEditing();
+ if(OK.equalsIgnoreCase(command)) {
+ if(file != null) {
+ getReferenceList().setAllResources(file, getReferenceArray());
+ } else {
+ getReferenceList().setAllResources(path, getReferenceArray());
+ }
+ }
+ super.action(command);
+ }
+ class BarListener implements CommandBarListener {
+ public void action(String command) {
+ int index = table.getSelectionIndex();
+ if(ADD.equals(command)) {
+ add(index);
+ } else if(EDIT.equals(command)) {
+ edit(index);
+ } else if(REMOVE.equals(command)) {
+ remove(index);
+ }
+ update();
+ }
+ }
+
+ protected void add(int index) {
+ ResourceReference css = new ResourceReference("", ResourceReference.FOLDER_SCOPE);
+ boolean ok = VpeAddReferenceSupport.add(file, css, getReferenceArray(), getEntity());
+ if(!ok) return;
+ dataList.add(css);
+ update();
+ table.setSelection(dataList.size() - 1);
+ }
+
+ protected void edit(int index) {
+ if(index < 0) return;
+ ResourceReference css = getReferenceArray()[index];
+ boolean ok = VpeAddReferenceSupport.edit(file, css, getReferenceArray(), getEntity());
+ if(!ok) return;
+ update();
+ }
+
+ protected abstract String getEntity();
+
+ void remove(int index) {
+ if(index >= 0) dataList.remove(index);
+ }
+
+ public void update() {
+ if(table != null) table.update();
+ updateBars();
+ }
+
+ void updateBars() {
+ bar.setEnabled(EDIT, canModify());
+ bar.setEnabled(REMOVE, canModify());
+ }
+
+ private boolean canModify() {
+ return table.getSelectionIndex() >= 0;
+ }
+
+}
Copied: trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/core/ResourceReferencesTableProvider.java (from rev 9974, trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/ResourceReferencesTableProvider.java)
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/core/ResourceReferencesTableProvider.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/core/ResourceReferencesTableProvider.java 2008-09-01 13:37:19 UTC (rev 9993)
@@ -0,0 +1,110 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.rreferences.core;
+
+import java.util.List;
+
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Image;
+import org.jboss.tools.common.model.ui.objecteditor.XTableImageProvider;
+import org.jboss.tools.common.model.ui.objecteditor.XTableProvider;
+
+public class ResourceReferencesTableProvider implements XTableProvider, XTableImageProvider {
+ static String[] CSS_COLUMNS = new String[]{"Scope", "CSS File Path"};
+ static String[] IMG_COLUMNS = new String[]{"Scope", "Image Folder Path"};
+ static String[] TLD_COLUMNS = new String[]{"Scope", "URI", "Prefix"};
+ static String[] EL_COLUMNS = new String[]{"Scope", "El Expression", "Value"};
+ private final static String[] GLOBAL_EL_COLUMNS = new String[]{"Scope","El Expression", "Value"};
+
+ int[] widths = new int[]{50, 200};
+ List dataList;
+ String[] columns;
+
+ public static ResourceReferencesTableProvider getCSSTableProvider(List dataList) {
+ ResourceReferencesTableProvider p = new ResourceReferencesTableProvider(dataList);
+ p.columns = CSS_COLUMNS;
+ return p;
+ }
+
+ public static ResourceReferencesTableProvider getImageTableProvider(List dataList) {
+ ResourceReferencesTableProvider p = new ResourceReferencesTableProvider(dataList);
+ p.columns = IMG_COLUMNS;
+ return p;
+ }
+
+ public static ResourceReferencesTableProvider getTLDTableProvider(List dataList) {
+ ResourceReferencesTableProvider p = new ResourceReferencesTableProvider(dataList);
+ p.columns = TLD_COLUMNS;
+ p.widths = new int[]{50, 150, 50};
+ return p;
+ }
+
+ public static ResourceReferencesTableProvider getELTableProvider(List dataList) {
+ ResourceReferencesTableProvider p = new ResourceReferencesTableProvider(dataList);
+ p.columns = EL_COLUMNS;
+ p.widths = new int[]{50, 150, 50};
+ return p;
+ }
+
+
+ public static ResourceReferencesTableProvider getGlobalELTableProvider(final List dataList) {
+ ResourceReferencesTableProvider p = new ResourceReferencesTableProvider(dataList);
+
+ p.columns = GLOBAL_EL_COLUMNS;
+ p.widths = new int[]{50,150, 50};
+ return p;
+ }
+
+
+
+
+ private ResourceReferencesTableProvider(List dataList) {
+ this.dataList = dataList;
+ }
+
+ public int getColumnCount() {
+ return columns.length;
+ }
+
+ public int getRowCount() {
+ if(dataList == null) return 0;
+ return dataList.size();
+ }
+
+ public String getColumnName(int c) {
+ return columns[c];
+ }
+
+ public String getValueAt(int r, int c) {
+ ResourceReference css = (ResourceReference)dataList.get(r);
+ return (c == 0) ? css.getScopeName() : (c == 2) ? css.getProperties() : css.getLocation();
+ }
+
+ public Object getDataAt(int r) {
+ return null;
+ }
+
+ public Color getColor(int r) {
+ return null;
+ }
+
+ public int getWidthHint(int c) {
+ return widths[c];
+ }
+
+ public void dispose() {
+ }
+
+ public Image getImage(int r) {
+ return null;
+ }
+
+}
Copied: trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/core/TaglibReferenceList.java (from rev 9974, trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/TaglibReferenceList.java)
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/core/TaglibReferenceList.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/core/TaglibReferenceList.java 2008-09-01 13:37:19 UTC (rev 9993)
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.rreferences.core;
+
+import org.eclipse.core.runtime.QualifiedName;
+
+public class TaglibReferenceList extends ResourceReferenceList {
+ private static QualifiedName PROPERTY_NAME = new QualifiedName("", "org.jboss.tools.vpe.editor.css.TLDList");
+ static TaglibReferenceList instance = new TaglibReferenceList();
+
+ public static TaglibReferenceList getInstance() {
+ return instance;
+ }
+
+ protected QualifiedName getPropertyName() {
+ return PROPERTY_NAME;
+ }
+
+}
Copied: trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/core/TaglibReferencesComposite.java (from rev 9974, trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/TaglibReferencesComposite.java)
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/core/TaglibReferencesComposite.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/core/TaglibReferencesComposite.java 2008-09-01 13:37:19 UTC (rev 9993)
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.rreferences.core;
+
+import java.util.List;
+
+import org.jboss.tools.common.rreferences.messages.Messages;
+
+/**
+ *
+ * @author Eugene Stherbin
+ *
+ */
+public class TaglibReferencesComposite extends ResourceReferencesComposite {
+
+ protected String getEntity() {
+ return (file != null) ? "VPETLDReference" : "VPETLDReferenceExt"; //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ protected ResourceReferencesTableProvider createTableProvider(List dataList) {
+ return ResourceReferencesTableProvider.getTLDTableProvider(dataList);
+ }
+
+ protected ResourceReferenceList getReferenceList() {
+ return TaglibReferenceList.getInstance();
+ }
+
+ /**
+ * @see ResourceReferencesComposite#createGroupLabel()
+ */
+ @Override
+ protected String createGroupLabel() {
+ return Messages.INCLUDED_TAG_LIBS;
+ }
+
+
+
+}
Copied: trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/core/VpeAddReferenceSupport.java (from rev 9974, trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/VpeAddReferenceSupport.java)
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/core/VpeAddReferenceSupport.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/core/VpeAddReferenceSupport.java 2008-09-01 13:37:19 UTC (rev 9993)
@@ -0,0 +1,148 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.rreferences.core;
+
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+import java.util.TreeSet;
+
+import org.eclipse.core.resources.IFile;
+import org.jboss.tools.common.meta.action.XActionInvoker;
+import org.jboss.tools.common.meta.action.impl.SpecialWizardSupport;
+import org.jboss.tools.common.meta.constraint.XAttributeConstraintL;
+import org.jboss.tools.common.model.XModel;
+import org.jboss.tools.common.model.XModelException;
+import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.options.PreferenceModelUtilities;
+import org.jboss.tools.common.model.project.IModelNature;
+import org.jboss.tools.common.model.util.EclipseResourceUtil;
+import org.jboss.tools.jst.web.project.WebProject;
+import org.jboss.tools.jst.web.tld.TaglibMapping;
+
+public class VpeAddReferenceSupport extends SpecialWizardSupport {
+
+ public static boolean add(IFile file, ResourceReference css, ResourceReference[] list, String entity) {
+ return run(file, css, list, "CreateActions.AddItem", entity); //$NON-NLS-1$
+ }
+
+ public static boolean edit(IFile file, ResourceReference css, ResourceReference[] list, String entity) {
+ return run(file, css, list, "EditActions.EditItem", entity); //$NON-NLS-1$
+ }
+
+ private static boolean run(IFile file, ResourceReference css, ResourceReference[] list, String action, String entity) {
+ XModel model = PreferenceModelUtilities.getPreferenceModel();
+ XModelObject object = model.createModelObject(entity, null);
+ object.setAttributeValue("location", css.getLocation()); //$NON-NLS-1$
+ if(object.getAttributeValue("prefix") != null) { //$NON-NLS-1$
+ object.setAttributeValue("prefix", css.getProperties()); //$NON-NLS-1$
+ }
+ Properties p = new Properties();
+ p.put("scope",Integer.valueOf(css.getScope())); //$NON-NLS-1$
+ p.put("list", list); //$NON-NLS-1$
+ if(file != null) p.put("file", file); //$NON-NLS-1$
+ XActionInvoker.invoke(action, object, p);
+ boolean ok = "true".equals(p.getProperty("okPressed")); //$NON-NLS-1$ //$NON-NLS-2$
+ if(ok) {
+ css.setLocation(object.getAttributeValue("location")); //$NON-NLS-1$
+ Integer scope = (Integer)p.get("scope"); //$NON-NLS-1$
+
+ css.setScope(scope.intValue());
+ if(css.isGlobal()){
+ css.setScope(ResourceReference.GLOBAL_SCOPE);
+ }
+ String properties = object.getAttributeValue("prefix"); //$NON-NLS-1$
+ if(properties != null) css.setProperties(properties);
+ }
+ return ok;
+ }
+
+ IFile file = null;
+ String initialLocation;
+ String initialPrefix;
+ ResourceReference[] list;
+ String[] scopeNames;
+
+ protected void reset() {
+ initialLocation = getTarget().getAttributeValue("location"); //$NON-NLS-1$
+ setAttributeValue(0, "location", initialLocation); //$NON-NLS-1$
+ initialPrefix = getTarget().getAttributeValue("prefix"); //$NON-NLS-1$
+ if(initialPrefix != null) {
+ setAttributeValue(0, "prefix", initialPrefix); //$NON-NLS-1$
+ }
+ final XAttributeConstraintL scopeAttribute = ((XAttributeConstraintL) getTarget().getModelEntity().getAttribute("scope") //$NON-NLS-1$
+ .getConstraint());
+ if (scopeAttribute != null) {
+ scopeNames = scopeAttribute.getValues();
+ }
+ int scopeIndex = ((Integer)getProperties().get("scope")).intValue(); //$NON-NLS-1$
+
+ if(scopeIndex == 1 && scopeNames.length == 1){
+ scopeIndex = 0;
+ }else if(scopeIndex > scopeNames.length){
+ scopeIndex = scopeNames.length -1;
+ }
+ String scope = scopeNames[scopeIndex];
+ setAttributeValue(0, "scope", scope); //$NON-NLS-1$
+ list = (ResourceReference[])getProperties().get("list"); //$NON-NLS-1$
+ file = (IFile)getProperties().get("file"); //$NON-NLS-1$
+ setURIList();
+ }
+
+ void setURIList() {
+ if(file == null) return;
+ if(getEntityData()[0].getModelEntity().getName().startsWith("VPETLD")) { //$NON-NLS-1$
+ Set set = new TreeSet();
+ IModelNature n = EclipseResourceUtil.getModelNature(file.getProject());
+ if(n == null) return;
+ XModel model = n.getModel();
+ TaglibMapping taglibs = WebProject.getInstance(model).getTaglibMapping();
+ Map map = taglibs.getTaglibObjects();
+ Iterator it = map.keySet().iterator();
+ while(it.hasNext()) {
+ String s = it.next().toString();
+ set.add(taglibs.resolveURI(s));
+ }
+ String[] uris = (String[])set.toArray(new String[0]);
+ setValueList(0, "location", uris); //$NON-NLS-1$
+ }
+ }
+
+ public void action(String name) throws XModelException {
+ if(OK.equals(name) || FINISH.equals(name)) {
+ execute();
+ setFinished(true);
+ getProperties().setProperty("okPressed", "true"); //$NON-NLS-1$ //$NON-NLS-2$
+ } else if(CANCEL.equals(name)) {
+ setFinished(true);
+ }
+ }
+
+ protected void execute() throws XModelException {
+ Properties p0 = extractStepData(0);
+ getTarget().setAttributeValue("location", p0.getProperty("location")); //$NON-NLS-1$ //$NON-NLS-2$
+ if(p0.containsKey("prefix")) { //$NON-NLS-1$
+ getTarget().setAttributeValue("prefix", p0.getProperty("prefix")); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ int scope = getSelectedScope(p0);
+ getProperties().put("scope", Integer.valueOf(scope)); //$NON-NLS-1$
+ }
+
+ int getSelectedScope(Properties p0) {
+ String scopeName = p0.getProperty("scope"); //$NON-NLS-1$
+ for (int i = 0; i < scopeNames.length; i++) {
+ if(scopeNames[i].equals(scopeName)) return i;
+ }
+ return 0;
+ }
+
+}
Copied: trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/core/VpeCssReferencesDialog.java (from rev 9974, trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/VpeCssReferencesDialog.java)
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/core/VpeCssReferencesDialog.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.rreferences/src/org/jboss/tools/common/rreferences/core/VpeCssReferencesDialog.java 2008-09-01 13:37:19 UTC (rev 9993)
@@ -0,0 +1,67 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.rreferences.core;
+
+import java.util.List;
+import java.util.Properties;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.IPath;
+import org.jboss.tools.common.model.options.PreferenceModelUtilities;
+import org.jboss.tools.common.model.ui.wizards.query.AbstractQueryWizard;
+
+public class VpeCssReferencesDialog extends AbstractQueryWizard {
+
+ public static boolean run(IFile file) {
+ VpeCssReferencesDialog dialog = new VpeCssReferencesDialog();
+ Properties p = new Properties();
+ p.setProperty("help", "VpeCssReferencesDialog");
+ p.put("file", file);
+ p.put("model", PreferenceModelUtilities.getPreferenceModel());
+ dialog.setObject(p);
+ int code = dialog.execute();
+ return code == 0;
+ }
+
+ public static boolean run(IPath path) {
+ VpeCssReferencesDialog dialog = new VpeCssReferencesDialog();
+ Properties p = new Properties();
+ p.setProperty("help", "VpeCssReferencesDialog");
+ p.put("path", path);
+ p.put("model", PreferenceModelUtilities.getPreferenceModel());
+ dialog.setObject(p);
+ int code = dialog.execute();
+ return code == 0;
+ }
+
+ public VpeCssReferencesDialog() {
+ setView(new VpeCssReferencesDialogView());
+ }
+
+}
+
+class VpeCssReferencesDialogView extends ResourceReferencesDialogView {
+
+ public VpeCssReferencesDialogView() {}
+
+ protected String getEntity() {
+ return (file != null) ? "VPECSSReference" : "VPECSSReferenceExt";
+ }
+
+ protected ResourceReferencesTableProvider createTableProvider(List dataList) {
+ return ResourceReferencesTableProvider.getCSSTableProvider(dataList);
+ }
+
+ protected ResourceReferenceList getReferenceList() {
+ return CSSReferenceList.getInstance();
+ }
+
+}
16 years, 4 months