Author: estherbin
Date: 2008-08-22 06:17:11 -0400 (Fri, 22 Aug 2008)
New Revision: 9860
Added:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/VpeCssReferencesDialog.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/IELService.java
Removed:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/AbsoluteFolderReferenceComposite.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/AbsoluteFolderReferenceList.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/CSSReferenceList.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/CssReferencesComposite.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/ELReferenceList.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/ElVariablesComposite.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/FolderReferenceComposite.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/GlobalELReferenceList.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/GlobalElVariablesComposite.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/GlobalResourceReference.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/RelativeFolderReferenceComposite.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/RelativeFolderReferenceList.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/ResourceReference.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/ResourceReferenceList.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/ResourceReferenceListListener.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/ResourceReferencesComposite.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/ResourceReferencesTableProvider.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/TaglibReferenceList.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/TaglibReferencesComposite.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/VpeAddReferenceSupport.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/VpeCssReferencesDialog.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/IELService.java
Modified:
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/css/ResourceReferencesDialogView.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/VpeResourcesDialogView.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateManager.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/FileUtil.java
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/XmlUtil.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/VpeUIMessages.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/messages.properties
trunk/vpe/plugins/org.jboss.tools.vpe/templates/vpe-templates-auto.xml
Log:
Move configuration for el substitution to the another bundle.
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/plugin.xml
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/plugin.xml 2008-08-22 10:13:57 UTC (rev 9859)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/plugin.xml 2008-08-22 10:17:11 UTC (rev 9860)
@@ -28,8 +28,8 @@
/>
</extension>
<extension point="org.jboss.tools.common.model.classes">
- <xclass id="org.jboss.tools.vpe.editor.css.VpeAddReferenceSupport"
- class="org.jboss.tools.vpe.editor.css.VpeAddReferenceSupport"/>
+ <xclass
id="org.jboss.tools.common.editor.rreferences.VpeAddReferenceSupport"
+ class="org.jboss.tools.common.editor.rreferences.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-08-22 10:13:57 UTC
(rev 9859)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/resources/meta/vpe.meta 2008-08-22 10:17:11 UTC
(rev 9860)
@@ -35,7 +35,7 @@
<XActionItem kind="list">
<XActionItem kind="list" name="CreateActions">
<XActionItem HandlerClassName="%SpecialWizard%"
ICON="action.empty"
-
PROPERTIES="support=org.jboss.tools.vpe.editor.css.VpeAddReferenceSupport"
+
PROPERTIES="support=org.jboss.tools.common.editor.rreferences.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.vpe.editor.css.VpeAddReferenceSupport"
+
PROPERTIES="support=org.jboss.tools.common.editor.rreferences.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.vpe.editor.css.VpeAddReferenceSupport"
+
PROPERTIES="support=org.jboss.tools.common.editor.rreferences.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.vpe.editor.css.VpeAddReferenceSupport"
+
PROPERTIES="support=org.jboss.tools.common.editor.rreferences.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.vpe.editor.css.VpeAddReferenceSupport"
+
PROPERTIES="support=org.jboss.tools.common.editor.rreferences.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.vpe.editor.css.VpeAddReferenceSupport"
+
PROPERTIES="support=org.jboss.tools.common.editor.rreferences.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.vpe.editor.css.VpeAddReferenceSupport"
+
PROPERTIES="support=org.jboss.tools.common.editor.rreferences.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.vpe.editor.css.VpeAddReferenceSupport"
+
PROPERTIES="support=org.jboss.tools.common.editor.rreferences.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.vpe.editor.css.VpeAddReferenceSupport"
+
PROPERTIES="support=org.jboss.tools.common.editor.rreferences.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.vpe.editor.css.VpeAddReferenceSupport"
+
PROPERTIES="support=org.jboss.tools.common.editor.rreferences.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.vpe.editor.css.VpeAddReferenceSupport"
+
PROPERTIES="support=org.jboss.tools.common.editor.rreferences.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.vpe.editor.css.VpeAddReferenceSupport"
+
PROPERTIES="support=org.jboss.tools.common.editor.rreferences.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.vpe.editor.css.VpeAddReferenceSupport"
+
PROPERTIES="support=org.jboss.tools.common.editor.rreferences.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.vpe.editor.css.VpeAddReferenceSupport"
+
PROPERTIES="support=org.jboss.tools.common.editor.rreferences.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.vpe.editor.css.VpeAddReferenceSupport"
+
PROPERTIES="support=org.jboss.tools.common.editor.rreferences.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.vpe.editor.css.VpeAddReferenceSupport"
+
PROPERTIES="support=org.jboss.tools.common.editor.rreferences.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.vpe.editor.css.VpeAddReferenceSupport"
+
PROPERTIES="support=org.jboss.tools.common.editor.rreferences.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.vpe.editor.css.VpeAddReferenceSupport"
+
PROPERTIES="support=org.jboss.tools.common.editor.rreferences.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.vpe.editor.css.VpeAddReferenceSupport"
+
PROPERTIES="support=org.jboss.tools.common.editor.rreferences.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.vpe.editor.css.VpeAddReferenceSupport"
+
PROPERTIES="support=org.jboss.tools.common.editor.rreferences.VpeAddReferenceSupport"
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-08-22
10:13:57 UTC (rev 9859)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2008-08-22
10:17:11 UTC (rev 9860)
@@ -86,6 +86,12 @@
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.editor.el.ELReferenceList;
+import org.jboss.tools.common.editor.rreferences.AbsoluteFolderReferenceList;
+import org.jboss.tools.common.editor.rreferences.CSSReferenceList;
+import org.jboss.tools.common.editor.rreferences.RelativeFolderReferenceList;
+import org.jboss.tools.common.editor.rreferences.ResourceReferenceListListener;
+import org.jboss.tools.common.editor.rreferences.TaglibReferenceList;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.event.XModelTreeEvent;
import org.jboss.tools.common.model.event.XModelTreeListener;
@@ -117,12 +123,6 @@
import org.jboss.tools.vpe.VpePlugin;
import org.jboss.tools.vpe.editor.bundle.BundleMap;
import org.jboss.tools.vpe.editor.context.VpePageContext;
-import org.jboss.tools.vpe.editor.css.AbsoluteFolderReferenceList;
-import org.jboss.tools.vpe.editor.css.CSSReferenceList;
-import org.jboss.tools.vpe.editor.css.ELReferenceList;
-import org.jboss.tools.vpe.editor.css.RelativeFolderReferenceList;
-import org.jboss.tools.vpe.editor.css.ResourceReferenceListListener;
-import org.jboss.tools.vpe.editor.css.TaglibReferenceList;
import org.jboss.tools.vpe.editor.mapping.VpeDomMapping;
import org.jboss.tools.vpe.editor.mapping.VpeElementMapping;
import org.jboss.tools.vpe.editor.menu.NodeActionManager;
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-08-22
10:13:57 UTC (rev 9859)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2008-08-22
10:17:11 UTC (rev 9860)
@@ -39,6 +39,8 @@
import org.eclipse.wst.xml.core.internal.document.ElementImpl;
import org.eclipse.wst.xml.core.internal.document.NodeImpl;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
+import org.jboss.tools.common.editor.rreferences.CSSReferenceList;
+import org.jboss.tools.common.editor.rreferences.ResourceReference;
import org.jboss.tools.common.model.XModel;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.project.IModelNature;
@@ -49,8 +51,6 @@
import org.jboss.tools.vpe.VpePlugin;
import org.jboss.tools.vpe.dnd.VpeDnD;
import org.jboss.tools.vpe.editor.context.VpePageContext;
-import org.jboss.tools.vpe.editor.css.CSSReferenceList;
-import org.jboss.tools.vpe.editor.css.ResourceReference;
import org.jboss.tools.vpe.editor.mapping.VpeDomMapping;
import org.jboss.tools.vpe.editor.mapping.VpeElementData;
import org.jboss.tools.vpe.editor.mapping.VpeElementMapping;
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-08-22
10:13:57 UTC (rev 9859)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/context/VpePageContext.java 2008-08-22
10:17:11 UTC (rev 9860)
@@ -27,6 +27,11 @@
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.ide.IDE;
import org.eclipse.wst.xml.core.internal.document.ElementImpl;
+import org.jboss.tools.common.editor.rreferences.AbsoluteFolderReferenceList;
+import org.jboss.tools.common.editor.rreferences.CSSReferenceList;
+import org.jboss.tools.common.editor.rreferences.RelativeFolderReferenceList;
+import org.jboss.tools.common.editor.rreferences.ResourceReference;
+import org.jboss.tools.common.editor.rreferences.TaglibReferenceList;
import org.jboss.tools.common.kb.KbConnectorFactory;
import org.jboss.tools.common.kb.KbConnectorType;
import org.jboss.tools.common.kb.wtp.WtpKbConnector;
@@ -39,11 +44,6 @@
import org.jboss.tools.vpe.editor.VpeSourceDomBuilder;
import org.jboss.tools.vpe.editor.VpeVisualDomBuilder;
import org.jboss.tools.vpe.editor.bundle.BundleMap;
-import org.jboss.tools.vpe.editor.css.AbsoluteFolderReferenceList;
-import org.jboss.tools.vpe.editor.css.CSSReferenceList;
-import org.jboss.tools.vpe.editor.css.RelativeFolderReferenceList;
-import org.jboss.tools.vpe.editor.css.ResourceReference;
-import org.jboss.tools.vpe.editor.css.TaglibReferenceList;
import org.jboss.tools.vpe.editor.mapping.VpeDomMapping;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
import org.jboss.tools.vpe.editor.template.VpeTemplateManager;
Deleted:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/AbsoluteFolderReferenceComposite.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/AbsoluteFolderReferenceComposite.java 2008-08-22
10:13:57 UTC (rev 9859)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/AbsoluteFolderReferenceComposite.java 2008-08-22
10:17:11 UTC (rev 9860)
@@ -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.editor.css;
-
-import org.jboss.tools.vpe.messages.VpeUIMessages;
-
-public class AbsoluteFolderReferenceComposite extends FolderReferenceComposite {
-
- protected ResourceReferenceList getReferenceList() {
- return AbsoluteFolderReferenceList.getInstance();
- }
-
- protected String getTitle() {
- return VpeUIMessages.ACTUAL_RUN_TIME_ABSOLUTE_FOLDER;
- }
-
-}
Deleted:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/AbsoluteFolderReferenceList.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/AbsoluteFolderReferenceList.java 2008-08-22
10:13:57 UTC (rev 9859)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/AbsoluteFolderReferenceList.java 2008-08-22
10:17:11 UTC (rev 9860)
@@ -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.editor.css;
-
-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/editor/css/CSSReferenceList.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/CSSReferenceList.java 2008-08-22
10:13:57 UTC (rev 9859)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/CSSReferenceList.java 2008-08-22
10:17:11 UTC (rev 9860)
@@ -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.editor.css;
-
-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/editor/css/CssReferencesComposite.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/CssReferencesComposite.java 2008-08-22
10:13:57 UTC (rev 9859)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/CssReferencesComposite.java 2008-08-22
10:17:11 UTC (rev 9860)
@@ -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.editor.css;
-
-import java.util.List;
-
-import org.jboss.tools.vpe.messages.VpeUIMessages;
-
-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 VpeUIMessages.INCLUDED_CSS_FILES;
- }
-
-
-}
Deleted:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/ELReferenceList.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/ELReferenceList.java 2008-08-22
10:13:57 UTC (rev 9859)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/ELReferenceList.java 2008-08-22
10:17:11 UTC (rev 9860)
@@ -1,37 +0,0 @@
-
-
-package org.jboss.tools.vpe.editor.css;
-
-
-import org.eclipse.core.runtime.QualifiedName;
-
-
-/**
- * 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/editor/css/ElVariablesComposite.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/ElVariablesComposite.java 2008-08-22
10:13:57 UTC (rev 9859)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/ElVariablesComposite.java 2008-08-22
10:17:11 UTC (rev 9860)
@@ -1,55 +0,0 @@
-package org.jboss.tools.vpe.editor.css;
-
-import java.util.List;
-
-import org.jboss.tools.vpe.messages.VpeUIMessages;
-
-/**
- * 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 VpeUIMessages.SUBSTITUTED_EL_EXPRESSIONS;
- }
-
-
-
-}
Deleted:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/FolderReferenceComposite.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/FolderReferenceComposite.java 2008-08-22
10:13:57 UTC (rev 9859)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/FolderReferenceComposite.java 2008-08-22
10:17:11 UTC (rev 9860)
@@ -1,123 +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.editor.css;
-
-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.jboss.tools.common.model.ui.attribute.XAttributeSupport;
-import org.jboss.tools.common.model.ui.attribute.editor.DirectoryFieldEditorEx;
-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;
-
-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/editor/css/GlobalELReferenceList.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/GlobalELReferenceList.java 2008-08-22
10:13:57 UTC (rev 9859)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/GlobalELReferenceList.java 2008-08-22
10:17:11 UTC (rev 9860)
@@ -1,50 +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.editor.css;
-
-import org.eclipse.core.runtime.QualifiedName;
-
-/**
- * @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/editor/css/GlobalElVariablesComposite.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/GlobalElVariablesComposite.java 2008-08-22
10:13:57 UTC (rev 9859)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/GlobalElVariablesComposite.java 2008-08-22
10:17:11 UTC (rev 9860)
@@ -1,62 +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.editor.css;
-
-import java.util.List;
-
-/**
- * Composite class for the global el variables.
- * @author Evgenij Stherbin
- *
- */
-public class GlobalElVariablesComposite extends ResourceReferencesComposite {
-
- /**
- * @see
org.jboss.tools.vpe.editor.css.ResourceReferencesComposite#createGroupLabel()
- */
- @Override
- protected String createGroupLabel() {
- return "";
- }
-
- /**
- * @see
org.jboss.tools.vpe.editor.css.ResourceReferencesComposite#createTableProvider(java.util.List)
- */
- @Override
- protected ResourceReferencesTableProvider createTableProvider(List dataList) {
- return ResourceReferencesTableProvider.getGlobalELTableProvider(dataList);
- }
-
- /**
- * @see org.jboss.tools.vpe.editor.css.ResourceReferencesComposite#getEntity()
- */
- @Override
- protected String getEntity() {
- return (file != null) ? "VPEGlobalElReference" :
"VPEGlobalElReferenceExt";
- }
-
- /**
- * @see
org.jboss.tools.vpe.editor.css.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/editor/css/GlobalResourceReference.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/GlobalResourceReference.java 2008-08-22
10:13:57 UTC (rev 9859)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/GlobalResourceReference.java 2008-08-22
10:17:11 UTC (rev 9860)
@@ -1,29 +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.editor.css;
-
-/**
- * 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/editor/css/RelativeFolderReferenceComposite.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/RelativeFolderReferenceComposite.java 2008-08-22
10:13:57 UTC (rev 9859)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/RelativeFolderReferenceComposite.java 2008-08-22
10:17:11 UTC (rev 9860)
@@ -1,23 +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.editor.css;
-
-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/editor/css/RelativeFolderReferenceList.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/RelativeFolderReferenceList.java 2008-08-22
10:13:57 UTC (rev 9859)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/RelativeFolderReferenceList.java 2008-08-22
10:17:11 UTC (rev 9860)
@@ -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.editor.css;
-
-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/editor/css/ResourceReference.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/ResourceReference.java 2008-08-22
10:13:57 UTC (rev 9859)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/ResourceReference.java 2008-08-22
10:17:11 UTC (rev 9860)
@@ -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.editor.css;
-
-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/editor/css/ResourceReferenceList.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/ResourceReferenceList.java 2008-08-22
10:13:57 UTC (rev 9859)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/ResourceReferenceList.java 2008-08-22
10:17:11 UTC (rev 9860)
@@ -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.editor.css;
-
-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/editor/css/ResourceReferenceListListener.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/ResourceReferenceListListener.java 2008-08-22
10:13:57 UTC (rev 9859)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/ResourceReferenceListListener.java 2008-08-22
10:17:11 UTC (rev 9860)
@@ -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.editor.css;
-
-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/editor/css/ResourceReferencesComposite.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/ResourceReferencesComposite.java 2008-08-22
10:13:57 UTC (rev 9859)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/ResourceReferencesComposite.java 2008-08-22
10:17:11 UTC (rev 9860)
@@ -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.editor.css;
-
-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 {
- 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 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());
- }
- }
- }
- }
-
-
-}
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/ResourceReferencesDialogView.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/ResourceReferencesDialogView.java 2008-08-22
10:13:57 UTC (rev 9859)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/ResourceReferencesDialogView.java 2008-08-22
10:17:11 UTC (rev 9860)
@@ -15,6 +15,10 @@
import java.util.Properties;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.IPath;
+import org.jboss.tools.common.editor.rreferences.ResourceReference;
+import org.jboss.tools.common.editor.rreferences.ResourceReferenceList;
+import org.jboss.tools.common.editor.rreferences.ResourceReferencesTableProvider;
+import org.jboss.tools.common.editor.rreferences.VpeAddReferenceSupport;
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;
Deleted:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/ResourceReferencesTableProvider.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/ResourceReferencesTableProvider.java 2008-08-22
10:13:57 UTC (rev 9859)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/ResourceReferencesTableProvider.java 2008-08-22
10:17:11 UTC (rev 9860)
@@ -1,107 +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.editor.css;
-
-import java.util.List;
-import org.jboss.tools.common.model.ui.objecteditor.*;
-import org.eclipse.swt.graphics.*;
-
-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/editor/css/TaglibReferenceList.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/TaglibReferenceList.java 2008-08-22
10:13:57 UTC (rev 9859)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/TaglibReferenceList.java 2008-08-22
10:17:11 UTC (rev 9860)
@@ -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.editor.css;
-
-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/editor/css/TaglibReferencesComposite.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/TaglibReferencesComposite.java 2008-08-22
10:13:57 UTC (rev 9859)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/TaglibReferencesComposite.java 2008-08-22
10:17:11 UTC (rev 9860)
@@ -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.editor.css;
-
-import java.util.List;
-
-import org.jboss.tools.vpe.messages.VpeUIMessages;
-
-public class TaglibReferencesComposite extends ResourceReferencesComposite {
-
- protected String getEntity() {
- return (file != null) ? "VPETLDReference" : "VPETLDReferenceExt";
- }
-
- protected ResourceReferencesTableProvider createTableProvider(List dataList) {
- return ResourceReferencesTableProvider.getTLDTableProvider(dataList);
- }
-
- protected ResourceReferenceList getReferenceList() {
- return TaglibReferenceList.getInstance();
- }
-
- /**
- * @see ResourceReferencesComposite#createGroupLabel()
- */
- @Override
- protected String createGroupLabel() {
- return VpeUIMessages.INCLUDED_TAG_LIBS;
- }
-
-
-
-}
Deleted:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/VpeAddReferenceSupport.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/VpeAddReferenceSupport.java 2008-08-22
10:13:57 UTC (rev 9859)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/VpeAddReferenceSupport.java 2008-08-22
10:17:11 UTC (rev 9860)
@@ -1,143 +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.editor.css;
-
-import java.util.*;
-
-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.*;
-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);
- }
-
- public static boolean edit(IFile file, ResourceReference css, ResourceReference[] list,
String entity) {
- return run(file, css, list, "EditActions.EditItem", entity);
- }
-
- 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());
- if(object.getAttributeValue("prefix") != null) {
- object.setAttributeValue("prefix", css.getProperties());
- }
- Properties p = new Properties();
- p.put("scope",Integer.valueOf(css.getScope()));
- p.put("list", list);
- if(file != null) p.put("file", file);
- XActionInvoker.invoke(action, object, p);
- boolean ok = "true".equals(p.getProperty("okPressed"));
- if(ok) {
- css.setLocation(object.getAttributeValue("location"));
- Integer scope = (Integer)p.get("scope");
-
- css.setScope(scope.intValue());
- if(css.isGlobal()){
- css.setScope(ResourceReference.GLOBAL_SCOPE);
- }
- String properties = object.getAttributeValue("prefix");
- 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");
- setAttributeValue(0, "location", initialLocation);
- initialPrefix = getTarget().getAttributeValue("prefix");
- if(initialPrefix != null) {
- setAttributeValue(0, "prefix", initialPrefix);
- }
- final XAttributeConstraintL scopeAttribute = ((XAttributeConstraintL)
getTarget().getModelEntity().getAttribute("scope")
- .getConstraint());
- if (scopeAttribute != null) {
- scopeNames = scopeAttribute.getValues();
- }
- int scopeIndex = ((Integer)getProperties().get("scope")).intValue();
-
- 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);
- list = (ResourceReference[])getProperties().get("list");
- file = (IFile)getProperties().get("file");
- setURIList();
- }
-
- void setURIList() {
- if(file == null) return;
- if(getEntityData()[0].getModelEntity().getName().startsWith("VPETLD")) {
- 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);
- }
- }
-
- public void action(String name) throws XModelException {
- if(OK.equals(name) || FINISH.equals(name)) {
- execute();
- setFinished(true);
- getProperties().setProperty("okPressed", "true");
- } else if(CANCEL.equals(name)) {
- setFinished(true);
- }
- }
-
- protected void execute() throws XModelException {
- Properties p0 = extractStepData(0);
- getTarget().setAttributeValue("location",
p0.getProperty("location"));
- if(p0.containsKey("prefix")) {
- getTarget().setAttributeValue("prefix",
p0.getProperty("prefix"));
- }
- int scope = getSelectedScope(p0);
- getProperties().put("scope", Integer.valueOf(scope));
- }
-
- int getSelectedScope(Properties p0) {
- String scopeName = p0.getProperty("scope");
- 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/editor/css/VpeCssReferencesDialog.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/VpeCssReferencesDialog.java 2008-08-22
10:13:57 UTC (rev 9859)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/VpeCssReferencesDialog.java 2008-08-22
10:17:11 UTC (rev 9860)
@@ -1,65 +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.editor.css;
-
-import java.util.*;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IPath;
-import org.jboss.tools.common.model.ui.wizards.query.*;
-import org.jboss.tools.common.model.options.PreferenceModelUtilities;
-
-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();
- }
-
-}
Added:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/VpeCssReferencesDialog.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/VpeCssReferencesDialog.java
(rev 0)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/VpeCssReferencesDialog.java 2008-08-22
10:17:11 UTC (rev 9860)
@@ -0,0 +1,68 @@
+/*******************************************************************************
+ * 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.editor.css;
+
+import java.util.*;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.IPath;
+import org.jboss.tools.common.editor.rreferences.CSSReferenceList;
+import org.jboss.tools.common.editor.rreferences.ResourceReferenceList;
+import org.jboss.tools.common.editor.rreferences.ResourceReferencesTableProvider;
+import org.jboss.tools.common.model.ui.wizards.query.*;
+import org.jboss.tools.common.model.options.PreferenceModelUtilities;
+
+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();
+ }
+
+}
Property changes on:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/VpeCssReferencesDialog.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/VpeResourcesDialogView.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/VpeResourcesDialogView.java 2008-08-22
10:13:57 UTC (rev 9859)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/VpeResourcesDialogView.java 2008-08-22
10:17:11 UTC (rev 9860)
@@ -11,15 +11,21 @@
package org.jboss.tools.vpe.editor.css;
import java.util.Properties;
+
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.IPath;
-import org.jboss.tools.common.model.ui.wizards.query.AbstractQueryWizardView;
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.editor.el.ElVariablesComposite;
+import org.jboss.tools.common.editor.rreferences.AbsoluteFolderReferenceComposite;
+import org.jboss.tools.common.editor.rreferences.CssReferencesComposite;
+import org.jboss.tools.common.editor.rreferences.RelativeFolderReferenceComposite;
+import org.jboss.tools.common.editor.rreferences.TaglibReferencesComposite;
+import org.jboss.tools.common.model.ui.wizards.query.AbstractQueryWizardView;
public class VpeResourcesDialogView extends AbstractQueryWizardView {
IFile file;
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateManager.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateManager.java 2008-08-22
10:13:57 UTC (rev 9859)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateManager.java 2008-08-22
10:17:11 UTC (rev 9860)
@@ -26,11 +26,11 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Platform;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
+import org.jboss.tools.common.editor.rreferences.ResourceReference;
import org.jboss.tools.common.xml.XMLUtilities;
import org.jboss.tools.jst.web.tld.TaglibData;
import org.jboss.tools.vpe.VpePlugin;
import org.jboss.tools.vpe.editor.context.VpePageContext;
-import org.jboss.tools.vpe.editor.css.ResourceReference;
import org.jboss.tools.vpe.editor.template.textformating.TextFormatingData;
import org.jboss.tools.vpe.editor.util.HTML;
import org.jboss.tools.vpe.editor.util.XmlUtil;
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-08-22
10:13:57 UTC (rev 9859)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionSrc.java 2008-08-22
10:17:11 UTC (rev 9860)
@@ -22,6 +22,7 @@
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IFileEditorInput;
import org.eclipse.ui.editors.text.ILocationProvider;
+import org.jboss.tools.common.editor.rreferences.ResourceReference;
import org.jboss.tools.common.kb.AttributeDescriptor;
import org.jboss.tools.common.kb.AttributeValueDescriptor;
import org.jboss.tools.common.kb.KbException;
@@ -34,7 +35,6 @@
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.css.ResourceReference;
import org.jboss.tools.vpe.editor.template.VpeCreatorUtil;
import org.jboss.tools.vpe.editor.util.ElService;
import org.w3c.dom.Node;
Deleted:
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-08-22
10:13:57 UTC (rev 9859)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/ElService.java 2008-08-22
10:17:11 UTC (rev 9860)
@@ -1,386 +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.editor.util;
-
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Platform;
-import org.jboss.tools.vpe.editor.bundle.BundleMap;
-import org.jboss.tools.vpe.editor.context.VpePageContext;
-import org.jboss.tools.vpe.editor.css.ELReferenceList;
-import org.jboss.tools.vpe.editor.css.GlobalELReferenceList;
-import org.jboss.tools.vpe.editor.css.ResourceReference;
-import org.w3c.dom.Attr;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-
-
-/**
- * The {@link IELService} implementation.
- *
- * @author Eugeny Stherbin
- */
-public final class ElService implements IELService {
-
- /** The Constant INSTANCE. */
- private static final IELService INSTANCE = new ElService();
-
- /**
- * Checks if is available.
- *
- * @param resourceFile the resource file
- *
- * @return true, if is available
- */
- public boolean isAvailable(IFile resourceFile) {
- boolean rst = false;
- final ResourceReference[] references = getAllResources(resourceFile);
-
- if ((references != null) && (references.length > 0)) {
- rst = true;
- }
- return rst;
- }
-
-
- /**
- * Gets the singleton instance.
- *
- * @return the singleton instance
- */
- public static synchronized IELService getInstance() {
- return INSTANCE;
- }
-
- /**
- * The Constructor.
- */
- private ElService() {
- super();
- }
-
-
- /**
- * Replace el.
- *
- * @param resourceFile the resource file
- * @param resourceString the resource string
- *
- * @return the string
- *
- * @see IELService#getReplacedElValue(IFile, String)
- */
- //@Deprecated
- public String replaceEl(IFile resourceFile, String resourceString) {
- // Assert.isNotNull(resourceString);
- if ((resourceString == null) || (resourceFile == null)) {
- return ""; //$NON-NLS-1$
- }
- Assert.isNotNull(resourceFile);
- String rst = resourceString;
- final ResourceReference[] references = getAllResources(resourceFile);
-
-
- if ((references != null) && (references.length > 0)) {
- rst = replace(resourceString, references);
- }
- return rst;
- }
-
-
-
- /**
- * Replace.
- *
- * @param resourceString the resource string
- * @param references the references
- *
- * @return the string
- */
- private String replace(String resourceString, ResourceReference[] references) {
- String result = resourceString;
-
- for (ResourceReference rf : references) {
- if (resourceString.contains(rf.getLocation())) {
- result = result.replace(rf.getLocation(),rf.getProperties());
- }
- }
- return result;
- }
-
-
- /**
- * Checks if is cloneable node.
- *
- * @param sourceNode the source node
- * @param pageContext the page context
- *
- * @return true, if is cloneable node
- */
- public boolean isCloneableNode(VpePageContext pageContext,Node sourceNode) {
- boolean rst = false;
- final IFile file =
pageContext.getVisualBuilder().getCurrentIncludeInfo().getFile();
-
- if (((this.isAvailable(file) && this.isAvailableForNode(sourceNode,
file))) || isInResourcesBundle(pageContext, sourceNode)){
- rst = true;
- }
- return rst;
- }
-
- /**
- *
- * @param pageContext
- * @param sourceNode
- * @return
- */
- public boolean isInResourcesBundle(VpePageContext pageContext, Node sourceNode) {
- boolean rst = findInResourcesBundle(pageContext, sourceNode);
-
-// if (!rst && (sourceNode.getChildNodes() != null) &&
(sourceNode.getChildNodes().getLength() > 0)) {
-// for (int i = 0; i < sourceNode.getChildNodes().getLength(); i++) {
-// final Node node = sourceNode.getChildNodes().item(i);
-//
-// if (node.getNodeType() == Node.ELEMENT_NODE) {
-// if((rst = findInResourcesBundle(pageContext, node))){
-// break;
-// }
-//
-//
-// }
-//
-// }
-// }
-
- return rst;
- }
-
-
- /**
- * @param pageContext
- * @param sourceNode
- * @return
- */
- private boolean findInResourcesBundle(VpePageContext pageContext, Node sourceNode) {
- boolean rst = false;
-
- BundleMap bundleMap = pageContext.getBundle();
- if (bundleMap != null) {
- String textValue = null;
-
- if (sourceNode.getNodeType() == Node.TEXT_NODE) {
- textValue = sourceNode.getNodeValue();
-
- if ((textValue != null) && TextUtil.isContainsEl(textValue)) {
- final String newValue = bundleMap.getBundleValue(textValue, 0);
-
- if (!textValue.equals(newValue)) {
- rst = true;
- }
- }
- }
-// }else if ((sourceNode.getFirstChild() != null) &&
(sourceNode.getFirstChild().getNodeType() == Node.TEXT_NODE)) {
-// textValue = sourceNode.getFirstChild().getNodeValue();
-// }
-
- if (!rst) {
- final NamedNodeMap nodeMap = sourceNode.getAttributes();
-
- if (nodeMap != null && nodeMap.getLength() > 0) {
- for (int i = 0; i < nodeMap.getLength(); i++) {
- final Attr attr = (Attr) nodeMap.item(i);
- final String value = attr.getValue();
-
- if (value != null && TextUtil.isContainsEl(value)) {
- final String value2 = bundleMap.getBundleValue(value, 0);
-
- if (!value2.equals(value)) {
- rst = true;
- break;
- }
- }
- }
- }
- }
- }
- return rst;
- }
-
-
-
- /**
- * Checks if is available for node.
- *
- * @param resourceFile the resource file
- * @param sourceNode the source node
- *
- * @return true, if is available for node
- */
- private boolean isAvailableForNode(Node sourceNode, IFile resourceFile) {
- boolean rst = findForNode(sourceNode, resourceFile);
-
-// if (!rst && (sourceNode.getChildNodes() != null) &&
(sourceNode.getChildNodes().getLength() > 0)) {
-// for (int i = 0; i < sourceNode.getChildNodes().getLength(); i++) {
-// final Node node = sourceNode.getChildNodes().item(i);
-//
-// if (node.getNodeType() == Node.ELEMENT_NODE) {
-// if((rst = findForNode((Element) node, resourceFile))){
-// break;
-// }
-// }
-//
-// }
-// }
-
- return rst;
- }
-
-
- /**
- * @param sourceNode
- * @param resourceFile
- * @return
- */
- private boolean findForNode(Node sourceNode, IFile resourceFile) {
- boolean rst = false;
- final NamedNodeMap nodeMap = sourceNode.getAttributes();
- final ResourceReference[] references = getAllResources(resourceFile);
- //ELReferenceList.getInstance().getAllResources(resourceFile);
- String textValue = null;
-
- if (sourceNode.getNodeType() == Node.TEXT_NODE/*
- * sourceNode.getFirstChild
- * () != null &&
- * sourceNode
- * .getFirstChild
- * ().getNodeType() ==
- * Node.TEXT_NODE
- */) {
- textValue = sourceNode.getNodeValue();
- if (textValue != null) {
- if (isInReferenceResourcesList(references, textValue)) {
- return true;
- }
- }
- }
-
- if ((nodeMap != null) && (nodeMap.getLength() > 0)) {
- for (int i = 0; i < nodeMap.getLength(); i++) {
- if (isInReferenceResourcesList(references, ((Attr)
nodeMap.item(i)).getValue())) {
- rst = true;
- break;
- }
- }
- }
- return rst;
- }
-
-
- /**
- * Checks if is in reference resources list.
- *
- * @param value the value
- * @param references the references
- *
- * @return true, if is in reference resources list
- */
- private boolean isInReferenceResourcesList(ResourceReference[] references, String
value) {
- boolean rst = false;
-
- for (ResourceReference ref : references) {
- if (value.contains(ref.getLocation())) {
- rst = true;
- }
- }
- return rst;
- }
-
-
- /**
- * Reverse replace.
- *
- * @param resourceFile the resource file
- * @param replacedString the replaced string
- *
- * @return the string
- */
- public String reverseReplace(IFile resourceFile, String replacedString) {
- String str = replacedString;
- final ResourceReference[] references = getAllResources(resourceFile);
- //ELReferenceList.getInstance().getAllResources(resourceFile);
-
- if ((str != null) && (references != null) && (references.length
> 0)) {
- for (ResourceReference rf : references) {
- if (replacedString.contains(rf.getProperties())) {
- str = str.replace(rf.getProperties(), rf.getLocation());
- }
- }
- }
-
- return str;
- }
-
-
-
- protected ResourceReference[] getAllResources(IFile resourceFile) {
- ResourceReference[] rst = null;
- final IPath workspacePath = Platform.getLocation();
-
- final ResourceReference[] gResources =
GlobalELReferenceList.getInstance().getAllResources(workspacePath);
- final ResourceReference[] elResources =
ELReferenceList.getInstance().getAllResources(resourceFile);
-
- int size = (gResources == null ? 0 : gResources.length);
- size += (elResources == null ? 0 : elResources.length);
- rst = new ResourceReference[size];
- int counter = 0;
- if ((gResources != null) && (gResources.length > 0)) {
- for (ResourceReference r : gResources) {
- rst[counter] = r;
- counter++;
- }
- }
- if ((elResources != null) && (elResources.length > 0)) {
- for (ResourceReference r : elResources) {
- rst[counter] = r;
- counter++;
- }
- }
-
- return rst;
-
- }
-
- public String replaceElAndResources(VpePageContext pageContext, Node attributeNode)
{
- final IFile file =
pageContext.getVisualBuilder().getCurrentIncludeInfo().getFile();
-
- String attribuString = null;
- if (attributeNode instanceof Attr) {
- attribuString = ((Attr) attributeNode).getValue();
- } else {
- attribuString = attributeNode.getNodeValue();
- }
- String rst = attribuString;
-
- rst = ResourceUtil.getBundleValue(pageContext, attributeNode);
- rst = replaceEl(file, rst);
-
- return rst;
- }
-
-// private String replaceResourceBundle(VpePageContext context,Attr attributeNode){
-//
-// }
-
-
-
-}
Added:
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
(rev 0)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/ElService.java 2008-08-22
10:17:11 UTC (rev 9860)
@@ -0,0 +1,386 @@
+/*******************************************************************************
+ * 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.editor.util;
+
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Platform;
+import org.jboss.tools.common.editor.el.ELReferenceList;
+import org.jboss.tools.common.editor.el.GlobalELReferenceList;
+import org.jboss.tools.common.editor.rreferences.ResourceReference;
+import org.jboss.tools.vpe.editor.bundle.BundleMap;
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.w3c.dom.Attr;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+
+
+/**
+ * The {@link IELService} implementation.
+ *
+ * @author Eugeny Stherbin
+ */
+public final class ElService implements IELService {
+
+ /** The Constant INSTANCE. */
+ private static final IELService INSTANCE = new ElService();
+
+ /**
+ * Checks if is available.
+ *
+ * @param resourceFile the resource file
+ *
+ * @return true, if is available
+ */
+ public boolean isAvailable(IFile resourceFile) {
+ boolean rst = false;
+ final ResourceReference[] references = getAllResources(resourceFile);
+
+ if ((references != null) && (references.length > 0)) {
+ rst = true;
+ }
+ return rst;
+ }
+
+
+ /**
+ * Gets the singleton instance.
+ *
+ * @return the singleton instance
+ */
+ public static synchronized IELService getInstance() {
+ return INSTANCE;
+ }
+
+ /**
+ * The Constructor.
+ */
+ private ElService() {
+ super();
+ }
+
+
+ /**
+ * Replace el.
+ *
+ * @param resourceFile the resource file
+ * @param resourceString the resource string
+ *
+ * @return the string
+ *
+ * @see IELService#getReplacedElValue(IFile, String)
+ */
+ //@Deprecated
+ public String replaceEl(IFile resourceFile, String resourceString) {
+ // Assert.isNotNull(resourceString);
+ if ((resourceString == null) || (resourceFile == null)) {
+ return ""; //$NON-NLS-1$
+ }
+ Assert.isNotNull(resourceFile);
+ String rst = resourceString;
+ final ResourceReference[] references = getAllResources(resourceFile);
+
+
+ if ((references != null) && (references.length > 0)) {
+ rst = replace(resourceString, references);
+ }
+ return rst;
+ }
+
+
+
+ /**
+ * Replace.
+ *
+ * @param resourceString the resource string
+ * @param references the references
+ *
+ * @return the string
+ */
+ private String replace(String resourceString, ResourceReference[] references) {
+ String result = resourceString;
+
+ for (ResourceReference rf : references) {
+ if (resourceString.contains(rf.getLocation())) {
+ result = result.replace(rf.getLocation(),rf.getProperties());
+ }
+ }
+ return result;
+ }
+
+
+ /**
+ * Checks if is cloneable node.
+ *
+ * @param sourceNode the source node
+ * @param pageContext the page context
+ *
+ * @return true, if is cloneable node
+ */
+ public boolean isCloneableNode(VpePageContext pageContext,Node sourceNode) {
+ boolean rst = false;
+ final IFile file =
pageContext.getVisualBuilder().getCurrentIncludeInfo().getFile();
+
+ if (((this.isAvailable(file) && this.isAvailableForNode(sourceNode,
file))) || isInResourcesBundle(pageContext, sourceNode)){
+ rst = true;
+ }
+ return rst;
+ }
+
+ /**
+ *
+ * @param pageContext
+ * @param sourceNode
+ * @return
+ */
+ public boolean isInResourcesBundle(VpePageContext pageContext, Node sourceNode) {
+ boolean rst = findInResourcesBundle(pageContext, sourceNode);
+
+// if (!rst && (sourceNode.getChildNodes() != null) &&
(sourceNode.getChildNodes().getLength() > 0)) {
+// for (int i = 0; i < sourceNode.getChildNodes().getLength(); i++) {
+// final Node node = sourceNode.getChildNodes().item(i);
+//
+// if (node.getNodeType() == Node.ELEMENT_NODE) {
+// if((rst = findInResourcesBundle(pageContext, node))){
+// break;
+// }
+//
+//
+// }
+//
+// }
+// }
+
+ return rst;
+ }
+
+
+ /**
+ * @param pageContext
+ * @param sourceNode
+ * @return
+ */
+ private boolean findInResourcesBundle(VpePageContext pageContext, Node sourceNode) {
+ boolean rst = false;
+
+ BundleMap bundleMap = pageContext.getBundle();
+ if (bundleMap != null) {
+ String textValue = null;
+
+ if (sourceNode.getNodeType() == Node.TEXT_NODE) {
+ textValue = sourceNode.getNodeValue();
+
+ if ((textValue != null) && TextUtil.isContainsEl(textValue)) {
+ final String newValue = bundleMap.getBundleValue(textValue, 0);
+
+ if (!textValue.equals(newValue)) {
+ rst = true;
+ }
+ }
+ }
+// }else if ((sourceNode.getFirstChild() != null) &&
(sourceNode.getFirstChild().getNodeType() == Node.TEXT_NODE)) {
+// textValue = sourceNode.getFirstChild().getNodeValue();
+// }
+
+ if (!rst) {
+ final NamedNodeMap nodeMap = sourceNode.getAttributes();
+
+ if (nodeMap != null && nodeMap.getLength() > 0) {
+ for (int i = 0; i < nodeMap.getLength(); i++) {
+ final Attr attr = (Attr) nodeMap.item(i);
+ final String value = attr.getValue();
+
+ if (value != null && TextUtil.isContainsEl(value)) {
+ final String value2 = bundleMap.getBundleValue(value, 0);
+
+ if (!value2.equals(value)) {
+ rst = true;
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
+ return rst;
+ }
+
+
+
+ /**
+ * Checks if is available for node.
+ *
+ * @param resourceFile the resource file
+ * @param sourceNode the source node
+ *
+ * @return true, if is available for node
+ */
+ private boolean isAvailableForNode(Node sourceNode, IFile resourceFile) {
+ boolean rst = findForNode(sourceNode, resourceFile);
+
+// if (!rst && (sourceNode.getChildNodes() != null) &&
(sourceNode.getChildNodes().getLength() > 0)) {
+// for (int i = 0; i < sourceNode.getChildNodes().getLength(); i++) {
+// final Node node = sourceNode.getChildNodes().item(i);
+//
+// if (node.getNodeType() == Node.ELEMENT_NODE) {
+// if((rst = findForNode((Element) node, resourceFile))){
+// break;
+// }
+// }
+//
+// }
+// }
+
+ return rst;
+ }
+
+
+ /**
+ * @param sourceNode
+ * @param resourceFile
+ * @return
+ */
+ private boolean findForNode(Node sourceNode, IFile resourceFile) {
+ boolean rst = false;
+ final NamedNodeMap nodeMap = sourceNode.getAttributes();
+ final ResourceReference[] references = getAllResources(resourceFile);
+ //ELReferenceList.getInstance().getAllResources(resourceFile);
+ String textValue = null;
+
+ if (sourceNode.getNodeType() == Node.TEXT_NODE/*
+ * sourceNode.getFirstChild
+ * () != null &&
+ * sourceNode
+ * .getFirstChild
+ * ().getNodeType() ==
+ * Node.TEXT_NODE
+ */) {
+ textValue = sourceNode.getNodeValue();
+ if (textValue != null) {
+ if (isInReferenceResourcesList(references, textValue)) {
+ return true;
+ }
+ }
+ }
+
+ if ((nodeMap != null) && (nodeMap.getLength() > 0)) {
+ for (int i = 0; i < nodeMap.getLength(); i++) {
+ if (isInReferenceResourcesList(references, ((Attr)
nodeMap.item(i)).getValue())) {
+ rst = true;
+ break;
+ }
+ }
+ }
+ return rst;
+ }
+
+
+ /**
+ * Checks if is in reference resources list.
+ *
+ * @param value the value
+ * @param references the references
+ *
+ * @return true, if is in reference resources list
+ */
+ private boolean isInReferenceResourcesList(ResourceReference[] references, String
value) {
+ boolean rst = false;
+
+ for (ResourceReference ref : references) {
+ if (value.contains(ref.getLocation())) {
+ rst = true;
+ }
+ }
+ return rst;
+ }
+
+
+ /**
+ * Reverse replace.
+ *
+ * @param resourceFile the resource file
+ * @param replacedString the replaced string
+ *
+ * @return the string
+ */
+ public String reverseReplace(IFile resourceFile, String replacedString) {
+ String str = replacedString;
+ final ResourceReference[] references = getAllResources(resourceFile);
+ //ELReferenceList.getInstance().getAllResources(resourceFile);
+
+ if ((str != null) && (references != null) && (references.length
> 0)) {
+ for (ResourceReference rf : references) {
+ if (replacedString.contains(rf.getProperties())) {
+ str = str.replace(rf.getProperties(), rf.getLocation());
+ }
+ }
+ }
+
+ return str;
+ }
+
+
+
+ protected ResourceReference[] getAllResources(IFile resourceFile) {
+ ResourceReference[] rst = null;
+ final IPath workspacePath = Platform.getLocation();
+
+ final ResourceReference[] gResources =
GlobalELReferenceList.getInstance().getAllResources(workspacePath);
+ final ResourceReference[] elResources =
ELReferenceList.getInstance().getAllResources(resourceFile);
+
+ int size = (gResources == null ? 0 : gResources.length);
+ size += (elResources == null ? 0 : elResources.length);
+ rst = new ResourceReference[size];
+ int counter = 0;
+ if ((gResources != null) && (gResources.length > 0)) {
+ for (ResourceReference r : gResources) {
+ rst[counter] = r;
+ counter++;
+ }
+ }
+ if ((elResources != null) && (elResources.length > 0)) {
+ for (ResourceReference r : elResources) {
+ rst[counter] = r;
+ counter++;
+ }
+ }
+
+ return rst;
+
+ }
+
+ public String replaceElAndResources(VpePageContext pageContext, Node attributeNode)
{
+ final IFile file =
pageContext.getVisualBuilder().getCurrentIncludeInfo().getFile();
+
+ String attribuString = null;
+ if (attributeNode instanceof Attr) {
+ attribuString = ((Attr) attributeNode).getValue();
+ } else {
+ attribuString = attributeNode.getNodeValue();
+ }
+ String rst = attribuString;
+
+ rst = ResourceUtil.getBundleValue(pageContext, attributeNode);
+ rst = replaceEl(file, rst);
+
+ return rst;
+ }
+
+// private String replaceResourceBundle(VpePageContext context,Attr attributeNode){
+//
+// }
+
+
+
+}
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-08-22
10:13:57 UTC (rev 9859)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/FileUtil.java 2008-08-22
10:17:11 UTC (rev 9860)
@@ -28,15 +28,15 @@
import org.eclipse.wst.common.componentcore.ComponentCore;
import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
import org.eclipse.wst.common.componentcore.resources.IVirtualFolder;
+import org.jboss.tools.common.editor.rreferences.AbsoluteFolderReferenceList;
+import org.jboss.tools.common.editor.rreferences.RelativeFolderReferenceList;
+import org.jboss.tools.common.editor.rreferences.ResourceReference;
import org.jboss.tools.common.model.XModel;
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.vpe.VpeDebug;
import org.jboss.tools.vpe.VpePlugin;
-import org.jboss.tools.vpe.editor.css.AbsoluteFolderReferenceList;
-import org.jboss.tools.vpe.editor.css.RelativeFolderReferenceList;
-import org.jboss.tools.vpe.editor.css.ResourceReference;
public class FileUtil {
Deleted:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/IELService.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/IELService.java 2008-08-22
10:13:57 UTC (rev 9859)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/IELService.java 2008-08-22
10:17:11 UTC (rev 9860)
@@ -1,94 +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.editor.util;
-
-
-import org.eclipse.core.resources.IFile;
-import org.jboss.tools.vpe.editor.context.VpePageContext;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-
-/**
- * The service that substitute El values in vpe source editor. For more details
- * see issues
http://jira.jboss.com/jira/browse/JBIDE-2010 and
- *
http://jira.jboss.com/jira/browse/JBIDE-1410
- *
- * @author Eugeny Stherbin
- */
-public interface IELService {
-
- /**
- * Return the {@link String} with substitued el values for given resource.
- *
- * @param resourceFile the resource file where resource
- * @param resourceString the source string that will be substitute
- *
- * @return string where el values was substituted.
- */
- //@Deprecated
- String replaceEl(IFile resourceFile, String resourceString);
-
- /**
- * Replace el and resources.
- *
- * @param attributeNode the attribute node
- * @param resourceFile the resource file
- * @param resourceString the resource string
- * @param pageContext the page context
- *
- * @return the string
- */
- String replaceElAndResources(VpePageContext pageContext, Node attributeNode);
-
- /**
- * Reverse replace.
- *
- * @param resourceFile the resource file
- * @param replacedString the replaced string
- *
- * @return the string
- */
- String reverseReplace(IFile resourceFile, String replacedString);
-
- /**
- * Checks if is available.
- *
- * @param resourceFile the resource file
- *
- * @return true, if is available
- */
- boolean isAvailable(IFile resourceFile);
-
- /**
- * Checks if is cloneable node.
- *
- * @param sourceNode the source node
- * @param pageContext the page context
- *
- * @return true, if is cloneable node
- */
- public boolean isCloneableNode(VpePageContext pageContext, Node sourceNode);
-
-
- /**
- * Checks if is in resources bundle.
- *
- * @param sourceNode the source node
- * @param pageContext the page context
- *
- * @return true, if is in resources bundle
- */
- boolean isInResourcesBundle(VpePageContext pageContext, Node sourceNode);
-
-}
Added:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/IELService.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/IELService.java
(rev 0)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/IELService.java 2008-08-22
10:17:11 UTC (rev 9860)
@@ -0,0 +1,94 @@
+/*******************************************************************************
+ * 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.editor.util;
+
+
+import org.eclipse.core.resources.IFile;
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+
+/**
+ * The service that substitute El values in vpe source editor. For more details
+ * see issues
http://jira.jboss.com/jira/browse/JBIDE-2010 and
+ *
http://jira.jboss.com/jira/browse/JBIDE-1410
+ *
+ * @author Eugeny Stherbin
+ */
+public interface IELService {
+
+ /**
+ * Return the {@link String} with substitued el values for given resource.
+ *
+ * @param resourceFile the resource file where resource
+ * @param resourceString the source string that will be substitute
+ *
+ * @return string where el values was substituted.
+ */
+ //@Deprecated
+ String replaceEl(IFile resourceFile, String resourceString);
+
+ /**
+ * Replace el and resources.
+ *
+ * @param attributeNode the attribute node
+ * @param resourceFile the resource file
+ * @param resourceString the resource string
+ * @param pageContext the page context
+ *
+ * @return the string
+ */
+ String replaceElAndResources(VpePageContext pageContext, Node attributeNode);
+
+ /**
+ * Reverse replace.
+ *
+ * @param resourceFile the resource file
+ * @param replacedString the replaced string
+ *
+ * @return the string
+ */
+ String reverseReplace(IFile resourceFile, String replacedString);
+
+ /**
+ * Checks if is available.
+ *
+ * @param resourceFile the resource file
+ *
+ * @return true, if is available
+ */
+ boolean isAvailable(IFile resourceFile);
+
+ /**
+ * Checks if is cloneable node.
+ *
+ * @param sourceNode the source node
+ * @param pageContext the page context
+ *
+ * @return true, if is cloneable node
+ */
+ public boolean isCloneableNode(VpePageContext pageContext, Node sourceNode);
+
+
+ /**
+ * Checks if is in resources bundle.
+ *
+ * @param sourceNode the source node
+ * @param pageContext the page context
+ *
+ * @return true, if is in resources bundle
+ */
+ boolean isInResourcesBundle(VpePageContext pageContext, Node sourceNode);
+
+}
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-08-22
10:13:57 UTC (rev 9859)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/VpeStyleUtil.java 2008-08-22
10:17:11 UTC (rev 9860)
@@ -22,6 +22,7 @@
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IFileEditorInput;
import org.eclipse.ui.editors.text.ILocationProvider;
+import org.jboss.tools.common.editor.rreferences.ResourceReference;
import org.jboss.tools.common.model.XModel;
import org.jboss.tools.common.model.project.IModelNature;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
@@ -29,7 +30,6 @@
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.css.ResourceReference;
import org.jboss.tools.vpe.editor.mapping.VpeElementMapping;
import org.mozilla.interfaces.nsIDOMElement;
import org.mozilla.interfaces.nsIDOMNode;
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/XmlUtil.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/XmlUtil.java 2008-08-22
10:13:57 UTC (rev 9859)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/XmlUtil.java 2008-08-22
10:17:11 UTC (rev 9860)
@@ -23,10 +23,10 @@
import org.eclipse.jst.jsp.core.internal.contentmodel.TaglibController;
import org.eclipse.jst.jsp.core.internal.contentmodel.tld.TLDCMDocumentManager;
import org.eclipse.jst.jsp.core.internal.contentmodel.tld.TaglibTracker;
+import org.jboss.tools.common.editor.rreferences.ResourceReference;
import org.jboss.tools.jst.web.tld.TaglibData;
import org.jboss.tools.vpe.VpePlugin;
import org.jboss.tools.vpe.editor.context.VpePageContext;
-import org.jboss.tools.vpe.editor.css.ResourceReference;
import org.mozilla.interfaces.nsIDOMNode;
import org.w3c.dom.Attr;
import org.w3c.dom.Document;
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/VpeUIMessages.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/VpeUIMessages.java 2008-08-22
10:13:57 UTC (rev 9859)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/VpeUIMessages.java 2008-08-22
10:17:11 UTC (rev 9860)
@@ -39,7 +39,6 @@
}
public static String NAMESPACE_NOT_DEFINED;
- public static String ACTUAL_RUN_TIME_ABSOLUTE_FOLDER;
public static String PREFERENCES;
public static String REFRESH;
public static String PAGE_DESIGN_OPTIONS;
@@ -95,8 +94,5 @@
public static String CONFIRM_SELECTION_BAR_DIALOG_TOGGLE_MESSAGE;
public static String VPE_UPDATE_JOB_TITLE;
public static String VPE_VISUAL_REFRESH_JOB;
- public static String INCLUDED_CSS_FILES;
- public static String INCLUDED_TAG_LIBS;
- public static String SUBSTITUTED_EL_EXPRESSIONS;
}
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/messages.properties
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/messages.properties 2008-08-22
10:13:57 UTC (rev 9859)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/messages.properties 2008-08-22
10:17:11 UTC (rev 9860)
@@ -55,8 +55,5 @@
CONFIRM_SELECTION_BAR_DIALOG_TOGGLE_MESSAGE=Always hide selection bar without prompt
VPE_UPDATE_JOB_TITLE=Visual Editor View Update
VPE_VISUAL_REFRESH_JOB=Visual Editor Refresh
-INCLUDED_CSS_FILES=Included css files
-INCLUDED_TAG_LIBS=Included tag libs
-SUBSTITUTED_EL_EXPRESSIONS=Substituted El expressions
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/templates/vpe-templates-auto.xml
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/templates/vpe-templates-auto.xml 2008-08-22
10:13:57 UTC (rev 9859)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/templates/vpe-templates-auto.xml 2008-08-22
10:17:11 UTC (rev 9860)
@@ -1,17 +1,31 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<vpe:templates>
- <vpe:tag case-sensitive="no" name="">
- <vpe:template children="no" modify="no">
- <vpe:any background-color="blue" border="yes"
border-color="white"
- display="tag-name1" icon="yes" value="tag-value"
- value-background-color="green" value-color="red"/>
- </vpe:template>
- </vpe:tag>
- <vpe:tag case-sensitive="no" name="">
- <vpe:template children="no" modify="no">
- <vpe:any background-color="blue" border="yes"
border-color="white"
- display="tag-name2" icon="yes" value="tag-value"
- value-background-color="green" value-color="red"/>
- </vpe:template>
- </vpe:tag>
-</vpe:templates>
+<?xml version="1.0" encoding="UTF-8"?>
+<vpe:templates>
+ <vpe:tag case-sensitive="no" name="">
+ <vpe:template children="no" modify="no">
+ <vpe:any background-color="blue" border="yes"
border-color="white"
+ display="tag-name1" icon="yes" value="tag-value"
+ value-background-color="green" value-color="red"/>
+ </vpe:template>
+ </vpe:tag>
+ <vpe:tag case-sensitive="no" name="">
+ <vpe:template children="no" modify="no">
+ <vpe:any background-color="blue" border="yes"
border-color="white"
+ display="tag-name2" icon="yes" value="tag-value"
+ value-background-color="green" value-color="red"/>
+ </vpe:template>
+ </vpe:tag>
+ <vpe:tag case-sensitive="no" name="">
+ <vpe:template children="no" modify="no">
+ <vpe:any background-color="blue" border="yes"
border-color="white"
+ display="tag-name1" icon="yes" value="tag-value"
+ value-background-color="green" value-color="red"/>
+ </vpe:template>
+ </vpe:tag>
+ <vpe:tag case-sensitive="no" name="">
+ <vpe:template children="no" modify="no">
+ <vpe:any background-color="blue" border="yes"
border-color="white"
+ display="tag-name2" icon="yes" value="tag-value"
+ value-background-color="green" value-color="red"/>
+ </vpe:template>
+ </vpe:tag>
+</vpe:templates>