Author: estherbin
Date: 2008-08-26 10:16:12 -0400 (Tue, 26 Aug 2008)
New Revision: 9900
Added:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/DndUtil.java
Removed:
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/VpeCssReferencesDialog.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/VpeResourcesDialog.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/VpeResourcesDialogView.java
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/META-INF/MANIFEST.MF
trunk/vpe/plugins/org.jboss.tools.vpe/plugin.xml
trunk/vpe/plugins/org.jboss.tools.vpe/resources/meta/vpe.meta
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/context/VpePageContext.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.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/ElService.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/FileUtil.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/VpeStyleUtil.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/XmlUtil.java
Log:
Move configuration for el substitution to the another bundle.
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/META-INF/MANIFEST.MF
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/META-INF/MANIFEST.MF 2008-08-26 14:05:50 UTC
(rev 9899)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/META-INF/MANIFEST.MF 2008-08-26 14:16:12 UTC
(rev 9900)
@@ -62,6 +62,7 @@
org.eclipse.ui.ide,
org.jboss.tools.vpe.xulrunner,
org.mozilla.xpcom,
- org.eclipse.draw2d
+ org.eclipse.draw2d,
+ org.jboss.tools.jst.web
Bundle-Version: 2.1.0
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/plugin.xml
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/plugin.xml 2008-08-26 14:05:50 UTC (rev 9899)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/plugin.xml 2008-08-26 14:16:12 UTC (rev 9900)
@@ -28,8 +28,8 @@
/>
</extension>
<extension point="org.jboss.tools.common.model.classes">
- <xclass
id="org.jboss.tools.common.editor.rreferences.VpeAddReferenceSupport"
- class="org.jboss.tools.common.editor.rreferences.VpeAddReferenceSupport"/>
+ <xclass
id="org.jboss.tools.jst.web.rreferences.VpeAddReferenceSupport"
+ class="org.jboss.tools.jst.web.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-26 14:05:50 UTC
(rev 9899)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/resources/meta/vpe.meta 2008-08-26 14:16:12 UTC
(rev 9900)
@@ -35,7 +35,7 @@
<XActionItem kind="list">
<XActionItem kind="list" name="CreateActions">
<XActionItem HandlerClassName="%SpecialWizard%"
ICON="action.empty"
-
PROPERTIES="support=org.jboss.tools.common.editor.rreferences.VpeAddReferenceSupport"
+
PROPERTIES="support=org.jboss.tools.jst.web.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.common.editor.rreferences.VpeAddReferenceSupport"
+
PROPERTIES="support=org.jboss.tools.jst.web.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.common.editor.rreferences.VpeAddReferenceSupport"
+
PROPERTIES="support=org.jboss.tools.jst.web.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.common.editor.rreferences.VpeAddReferenceSupport"
+
PROPERTIES="support=org.jboss.tools.jst.web.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.common.editor.rreferences.VpeAddReferenceSupport"
+
PROPERTIES="support=org.jboss.tools.jst.web.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.common.editor.rreferences.VpeAddReferenceSupport"
+
PROPERTIES="support=org.jboss.tools.jst.web.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.common.editor.rreferences.VpeAddReferenceSupport"
+
PROPERTIES="support=org.jboss.tools.jst.web.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.common.editor.rreferences.VpeAddReferenceSupport"
+
PROPERTIES="support=org.jboss.tools.jst.web.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.common.editor.rreferences.VpeAddReferenceSupport"
+
PROPERTIES="support=org.jboss.tools.jst.web.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.common.editor.rreferences.VpeAddReferenceSupport"
+
PROPERTIES="support=org.jboss.tools.jst.web.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.common.editor.rreferences.VpeAddReferenceSupport"
+
PROPERTIES="support=org.jboss.tools.jst.web.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.common.editor.rreferences.VpeAddReferenceSupport"
+
PROPERTIES="support=org.jboss.tools.jst.web.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.common.editor.rreferences.VpeAddReferenceSupport"
+
PROPERTIES="support=org.jboss.tools.jst.web.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.common.editor.rreferences.VpeAddReferenceSupport"
+
PROPERTIES="support=org.jboss.tools.jst.web.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.common.editor.rreferences.VpeAddReferenceSupport"
+
PROPERTIES="support=org.jboss.tools.jst.web.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.common.editor.rreferences.VpeAddReferenceSupport"
+
PROPERTIES="support=org.jboss.tools.jst.web.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.common.editor.rreferences.VpeAddReferenceSupport"
+
PROPERTIES="support=org.jboss.tools.jst.web.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.common.editor.rreferences.VpeAddReferenceSupport"
+
PROPERTIES="support=org.jboss.tools.jst.web.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.common.editor.rreferences.VpeAddReferenceSupport"
+
PROPERTIES="support=org.jboss.tools.jst.web.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.common.editor.rreferences.VpeAddReferenceSupport"
+
PROPERTIES="support=org.jboss.tools.jst.web.rreferences.VpeAddReferencceSupport"
displayName="Edit TLD Reference..." kind="action"
name="EditItem">
<EntityData EntityName="VPETLDReferenceExt">
<AttributeData AttributeName="location"/>
Added: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/DndUtil.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/DndUtil.java
(rev 0)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/DndUtil.java 2008-08-26
14:16:12 UTC (rev 9900)
@@ -0,0 +1,140 @@
+/*******************************************************************************
+ * 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.dnd;
+
+import org.eclipse.swt.events.TypedEvent;
+import org.jboss.tools.common.model.ui.editors.dnd.context.DropContext;
+import org.jboss.tools.common.model.ui.editors.dnd.context.IDNDTextEditor;
+import org.jboss.tools.vpe.xulrunner.XPCOM;
+import org.mozilla.interfaces.nsIComponentManager;
+import org.mozilla.interfaces.nsIDOMEvent;
+import org.mozilla.interfaces.nsIDragService;
+import org.mozilla.interfaces.nsIDragSession;
+import org.mozilla.interfaces.nsIServiceManager;
+import org.mozilla.interfaces.nsISupports;
+import org.mozilla.interfaces.nsITransferable;
+import org.mozilla.xpcom.Mozilla;
+
+
+/**
+ * The Class DndUtil.
+ *
+ * @author Eugene Stherbin
+ */
+public class DndUtil {
+
+
+ /** The Constant kTextMime. */
+ public static final String kTextMime = "text/plain"; //$NON-NLS-1$
+
+ /** The Constant kUnicodeMime. */
+ public static final String kUnicodeMime = "text/unicode"; //$NON-NLS-1$
+
+ /** The Constant kHTMLMime. */
+ public static final String kHTMLMime = "text/html"; //$NON-NLS-1$
+
+ /** The Constant kAOLMailMime. */
+ public static final String kAOLMailMime = "AOLMAIL"; //$NON-NLS-1$
+
+ /** The Constant kPNGImageMime. */
+ public static final String kPNGImageMime = "image/png"; //$NON-NLS-1$
+
+ /** The Constant kJPEGImageMime. */
+ public static final String kJPEGImageMime = "image/jpg"; //$NON-NLS-1$
+
+ /** The Constant kGIFImageMime. */
+ public static final String kGIFImageMime = "image/gif"; //$NON-NLS-1$
+
+ /** The Constant kFileMime. */
+ public static final String kFileMime = "application/x-moz-file";
//$NON-NLS-1$
+
+ /** The Constant kURLMime. */
+ public static final String kURLMime = "text/x-moz-url"; //$NON-NLS-1$
+
+ /** The Constant kURLDataMime. */
+ public static final String kURLDataMime = "text/x-moz-url-data";
//$NON-NLS-1$
+
+ /** The Constant kURLDescriptionMime. */
+ public static final String kURLDescriptionMime = "text/x-moz-url-desc";
//$NON-NLS-1$
+
+ /** The Constant kNativeImageMime. */
+ public static final String kNativeImageMime =
"application/x-moz-nativeimage"; //$NON-NLS-1$
+
+ /** The Constant kNativeHTMLMime. */
+ public static final String kNativeHTMLMime =
"application/x-moz-nativehtml"; //$NON-NLS-1$
+
+ /** The Constant kFilePromiseURLMime. */
+ public static final String kFilePromiseURLMime =
"application/x-moz-file-promise-url"; //$NON-NLS-1$
+
+ /** The Constant kFilePromiseMime. */
+ public static final String kFilePromiseMime =
"application/x-moz-file-promise"; //$NON-NLS-1$
+
+ /** The Constant kFilePromiseDirectoryMime. */
+ public static final String kFilePromiseDirectoryMime =
"application/x-moz-file-promise-dir"; //$NON-NLS-1$
+
+ /** The Constant FLAVORS. */
+ public static final String[] FLAVORS = { kTextMime, kUnicodeMime, kHTMLMime,
kAOLMailMime, kPNGImageMime, kJPEGImageMime,
+ kGIFImageMime, kFileMime, kURLMime, kURLDataMime, kURLDescriptionMime,
kNativeImageMime, kNativeHTMLMime, kFilePromiseURLMime,
+ kFilePromiseMime, kFilePromiseDirectoryMime };
+
+ /**
+ * The Constructor.
+ */
+ private DndUtil() {
+ super();
+ }
+
+ /**
+ * Fire dn D event.
+ *
+ * @param dropContext the drop context
+ * @param event the event
+ * @param textEditor the text editor
+ */
+ public static void fireDnDEvent(DropContext dropContext, IDNDTextEditor textEditor,
TypedEvent event) {
+
+ dropContext.runDropCommand(textEditor, event);
+ }
+
+ /**
+ * Gets the dn D file.
+ *
+ * @param event the event
+ *
+ * @return the dn D file
+ */
+ public static nsISupports getDnDValue(nsIDOMEvent event) {
+ nsIServiceManager serviceManager = Mozilla.getInstance().getServiceManager();
+ nsIComponentManager componentManager =
Mozilla.getInstance().getComponentManager();
+ nsIDragService dragService = (nsIDragService)
serviceManager.getServiceByContractID("(a)mozilla.org/widget/dragservice;1",
//$NON-NLS-1$
+ nsIDragService.NS_IDRAGSERVICE_IID);
+ final nsIDragSession dragSession = dragService.getCurrentSession();
+
+ final nsITransferable iTransferable = (nsITransferable)
componentManager.createInstanceByContractID(
+ XPCOM.NS_TRANSFERABLE_CONTRACTID, null,
nsITransferable.NS_ITRANSFERABLE_IID);
+
+ for (String flavor1 : FLAVORS) {
+ if (dragSession.isDataFlavorSupported(flavor1)) {
+ iTransferable.addDataFlavor(flavor1);
+ }
+ }
+ String[] aFlavor = { "" }; //$NON-NLS-1$
+ long[] aDataLen = { 0 };
+ nsISupports[] aData = { null };
+
+ dragSession.getData(iTransferable, 0);
+ iTransferable.getAnyTransferData(aFlavor, aData, aDataLen);
+ return aData[0];
+ }
+
+}
Property changes on:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/DndUtil.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/VpeController.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2008-08-26
14:05:50 UTC (rev 9899)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2008-08-26
14:16:12 UTC (rev 9900)
@@ -14,6 +14,7 @@
import java.util.LinkedList;
import java.util.List;
import java.util.Properties;
+
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
@@ -46,7 +47,6 @@
import org.eclipse.swt.events.MenuListener;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.events.TypedEvent;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.layout.GridData;
@@ -86,17 +86,10 @@
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;
import org.jboss.tools.common.model.options.PreferenceModelUtilities;
-import org.jboss.tools.common.model.ui.dnd.DnDUtil;
import org.jboss.tools.common.model.ui.dnd.ModelTransfer;
import org.jboss.tools.common.model.ui.editor.IModelObjectEditorInput;
import org.jboss.tools.common.model.ui.editors.dnd.DropCommandFactory;
@@ -116,11 +109,18 @@
import org.jboss.tools.jst.jsp.editor.IJSPTextEditor;
import org.jboss.tools.jst.jsp.editor.IVisualController;
import org.jboss.tools.jst.jsp.preferences.VpePreference;
+import org.jboss.tools.jst.web.el.ELReferenceList;
+import org.jboss.tools.jst.web.rreferences.AbsoluteFolderReferenceList;
+import org.jboss.tools.jst.web.rreferences.CSSReferenceList;
+import org.jboss.tools.jst.web.rreferences.RelativeFolderReferenceList;
+import org.jboss.tools.jst.web.rreferences.ResourceReferenceListListener;
+import org.jboss.tools.jst.web.rreferences.TaglibReferenceList;
import org.jboss.tools.jst.web.tld.TLDToPaletteHelper;
import org.jboss.tools.jst.web.tld.TLDUtil;
import org.jboss.tools.jst.web.tld.URIConstants;
import org.jboss.tools.vpe.VpeDebug;
import org.jboss.tools.vpe.VpePlugin;
+import org.jboss.tools.vpe.dnd.DndUtil;
import org.jboss.tools.vpe.editor.bundle.BundleMap;
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.mapping.VpeDomMapping;
@@ -2818,20 +2818,20 @@
// .getModelBuffer().source();
// if(object == null)
- nsISupports aValue = DnDUtil.getDnDValue(mouseEvent);
+ nsISupports aValue = DndUtil.getDnDValue(mouseEvent);
String aFlavor = "";
if (isNsIFileInstance(aValue)) {
nsIFile aFile = (nsIFile) aValue.queryInterface(nsIFile.NS_IFILE_IID);
if (aValue != null) {
data = aFile.getPath();
- aFlavor = DnDUtil.kFileMime;
+ aFlavor = DndUtil.kFileMime;
}
} else if (isNsIStringInstance(aValue)) {
nsISupportsCString aString = (nsISupportsCString)
aValue.queryInterface(nsISupportsCString.NS_ISUPPORTSCSTRING_IID);
data = aString.getData();
- aFlavor = DnDUtil.kHTMLMime;
+ aFlavor = DndUtil.kHTMLMime;
}
// if (object.getFileType() == XModelObject.FILE
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-26
14:05:50 UTC (rev 9899)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2008-08-26
14:16:12 UTC (rev 9900)
@@ -39,14 +39,14 @@
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;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.jst.jsp.preferences.VpePreference;
import org.jboss.tools.jst.web.model.helpers.WebAppHelper;
+import org.jboss.tools.jst.web.rreferences.CSSReferenceList;
+import org.jboss.tools.jst.web.rreferences.ResourceReference;
import org.jboss.tools.vpe.VpeDebug;
import org.jboss.tools.vpe.VpePlugin;
import org.jboss.tools.vpe.dnd.VpeDnD;
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-26
14:05:50 UTC (rev 9899)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/context/VpePageContext.java 2008-08-26
14:16:12 UTC (rev 9900)
@@ -11,11 +11,9 @@
package org.jboss.tools.vpe.editor.context;
import java.util.ArrayList;
-import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
-import java.util.Map;
import java.util.Set;
import org.eclipse.core.resources.IFile;
@@ -27,16 +25,16 @@
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;
import org.jboss.tools.jst.jsp.editor.IVisualContext;
import org.jboss.tools.jst.jsp.preferences.VpePreference;
+import org.jboss.tools.jst.web.rreferences.AbsoluteFolderReferenceList;
+import org.jboss.tools.jst.web.rreferences.CSSReferenceList;
+import org.jboss.tools.jst.web.rreferences.RelativeFolderReferenceList;
+import org.jboss.tools.jst.web.rreferences.ResourceReference;
+import org.jboss.tools.jst.web.rreferences.TaglibReferenceList;
import org.jboss.tools.jst.web.tld.TaglibData;
import org.jboss.tools.jst.web.tld.VpeTaglibListener;
import org.jboss.tools.vpe.VpePlugin;
@@ -45,7 +43,6 @@
import org.jboss.tools.vpe.editor.VpeVisualDomBuilder;
import org.jboss.tools.vpe.editor.bundle.BundleMap;
import org.jboss.tools.vpe.editor.mapping.VpeDomMapping;
-import org.jboss.tools.vpe.editor.template.VpeCreationData;
import org.jboss.tools.vpe.editor.template.VpeTemplateManager;
import org.jboss.tools.vpe.editor.util.FileUtil;
import org.jboss.tools.vpe.editor.util.XmlUtil;
Deleted:
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-26
14:05:50 UTC (rev 9899)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/ResourceReferencesDialogView.java 2008-08-26
14:16:12 UTC (rev 9900)
@@ -1,159 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at
http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.vpe.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.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;
-import org.jboss.tools.common.model.ui.wizards.query.AbstractQueryWizardView;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.*;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.widgets.*;
-
-public abstract class ResourceReferencesDialogView extends AbstractQueryWizardView {
- static String ADD = "Add";
- static String EDIT = "Edit";
- static String REMOVE = "Remove";
- protected XTable table = new XTable();
- protected CommandBar bar = new CommandBar();
- protected ResourceReferencesTableProvider tableProvider;// = new
TemplatesTableProvider();
- IFile file;
- IPath path;
- protected List dataList = new ArrayList();
-
- public ResourceReferencesDialogView() {
- init();
- }
-
- private void init() {
-// changed = false;
- tableProvider = createTableProvider(dataList);
-///ResourceReferencesTableProvider.getCSSTableProvider(dataList);
- bar.getLayout().buttonWidth = 80;
- bar.getLayout().direction = SWT.VERTICAL;
- bar.setCommands(new String[]{ADD, EDIT, REMOVE});
- bar.addCommandBarListener(new BarListener());
- table.setTableProvider(tableProvider);
- }
-
- protected abstract ResourceReferencesTableProvider createTableProvider(List dataList);
- protected abstract ResourceReferenceList getReferenceList();
-
- public void setObject(Object object) {
- super.setObject(object);
- Properties p = findProperties(object);
- file = (IFile)p.get("file");
- path = (IPath)p.get("path");
- ResourceReference[] rs = (file != null) ? getReferenceList().getAllResources(file) :
- (path != null) ? getReferenceList().getAllResources(path)
- : new ResourceReference[0];
- for (int i = 0; i < rs.length; i++) dataList.add(rs[i]);
- }
-
- public Control createControl(Composite parent) {
- Composite c = new Composite(parent, SWT.NONE);
- c.setLayoutData(new GridData(GridData.FILL_BOTH));
- GridLayout g = new GridLayout(2, false);
- c.setLayout(g);
- Control slc = table.createControl(c);
- slc.setLayoutData(new GridData(GridData.FILL_BOTH));
- Control bc = bar.createControl(c);
- GridData gd = new GridData(GridData.FILL_VERTICAL);
- bc.setLayoutData(gd);
- table.getTable().addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
- updateBars();
- }
- public void widgetDefaultSelected(SelectionEvent e) {
- widgetSelected(e);
- }
- });
- update();
- return c;
- }
-
- ResourceReference[] getReferenceArray() {
- return (ResourceReference[])dataList.toArray(new ResourceReference[0]);
- }
-
- public void action(String command) {
- stopEditing();
- if(OK.equalsIgnoreCase(command)) {
- if(file != null) {
- getReferenceList().setAllResources(file, getReferenceArray());
- } else {
- getReferenceList().setAllResources(path, getReferenceArray());
- }
- }
- super.action(command);
- }
- class BarListener implements CommandBarListener {
- public void action(String command) {
- int index = table.getSelectionIndex();
- if(ADD.equals(command)) {
- add(index);
- } else if(EDIT.equals(command)) {
- edit(index);
- } else if(REMOVE.equals(command)) {
- remove(index);
- }
- update();
- }
- }
-
- protected void add(int index) {
- ResourceReference css = new ResourceReference("",
ResourceReference.FOLDER_SCOPE);
- boolean ok = VpeAddReferenceSupport.add(file, css, getReferenceArray(), getEntity());
- if(!ok) return;
- dataList.add(css);
- update();
- table.setSelection(dataList.size() - 1);
- }
-
- protected void edit(int index) {
- if(index < 0) return;
- ResourceReference css = getReferenceArray()[index];
- boolean ok = VpeAddReferenceSupport.edit(file, css, getReferenceArray(), getEntity());
- if(!ok) return;
- update();
- }
-
- protected abstract String getEntity();
-
- void remove(int index) {
- if(index >= 0) dataList.remove(index);
- }
-
- public void update() {
- if(table != null) table.update();
- updateBars();
- }
-
- void updateBars() {
- bar.setEnabled(EDIT, canModify());
- bar.setEnabled(REMOVE, canModify());
- }
-
- private boolean canModify() {
- return table.getSelectionIndex() >= 0;
- }
-
-}
Deleted:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/VpeCssReferencesDialog.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/VpeCssReferencesDialog.java 2008-08-26
14:05:50 UTC (rev 9899)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/VpeCssReferencesDialog.java 2008-08-26
14:16:12 UTC (rev 9900)
@@ -1,68 +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.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();
- }
-
-}
Deleted:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/VpeResourcesDialog.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/VpeResourcesDialog.java 2008-08-26
14:05:50 UTC (rev 9899)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/VpeResourcesDialog.java 2008-08-26
14:16:12 UTC (rev 9900)
@@ -1,49 +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.Properties;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IPath;
-import org.jboss.tools.common.model.ui.wizards.query.AbstractQueryWizard;
-
-import org.jboss.tools.common.model.options.PreferenceModelUtilities;
-
-public class VpeResourcesDialog extends AbstractQueryWizard {
-
- public static boolean run(IFile file) {
- VpeResourcesDialog dialog = new VpeResourcesDialog();
- Properties p = new Properties();
- p.setProperty("help", "VpeResourcesDialog");
- p.put("file", file);
- p.put("model", PreferenceModelUtilities.getPreferenceModel());
- dialog.setObject(p);
- int code = dialog.execute();
- return code == 0;
- }
-
- public static boolean run(IPath path) {
- VpeResourcesDialog dialog = new VpeResourcesDialog();
- Properties p = new Properties();
- p.setProperty("help", "VpeResourcesDialog");
- p.put("path", path);
- p.put("model", PreferenceModelUtilities.getPreferenceModel());
- dialog.setObject(p);
- int code = dialog.execute();
- return code == 0;
- }
-
- public VpeResourcesDialog() {
- setView(new VpeResourcesDialogView());
- }
-
-}
Deleted:
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-26
14:05:50 UTC (rev 9899)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/VpeResourcesDialogView.java 2008-08-26
14:16:12 UTC (rev 9900)
@@ -1,108 +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.Properties;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.jboss.tools.common.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;
- IPath path;
- CssReferencesComposite css = new CssReferencesComposite();
- //changed by estherbin
- //http://jira.jboss.com/jira/browse/JBIDE-2010
- ElVariablesComposite el = new ElVariablesComposite();
- TaglibReferencesComposite tld = new TaglibReferencesComposite();
- AbsoluteFolderReferenceComposite absFolder = new AbsoluteFolderReferenceComposite();
- RelativeFolderReferenceComposite relFolder = new RelativeFolderReferenceComposite();
-
- public void setObject(Object object) {
- super.setObject(object);
- Properties p = findProperties(object);
- file = (IFile)p.get("file");
- path = (IPath)p.get("path");
-
- css.setObject(object);
- //changed by estherbin
- //http://jira.jboss.com/jira/browse/JBIDE-2010
- el.setObject(object);
- tld.setObject(object);
- absFolder.setObject(p);
- relFolder.setObject(p);
- }
-
- public Control createControl(Composite parent) {
- GridData data;
- Composite c = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout(1, false);
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- c.setLayout(layout);
-
- Control absControl = absFolder.createControl(c);
- data = new GridData(GridData.FILL_HORIZONTAL);
- absControl.setLayoutData(data);
-
- Control relControl = relFolder.createControl(c);
- data = new GridData(GridData.FILL_HORIZONTAL);
- relControl.setLayoutData(data);
-
- Control cssControl = css.createControl(c);
- data = new GridData(GridData.FILL_BOTH);
- cssControl.setLayoutData(data);
- Control tldControl = tld.createControl(c);
- data = new GridData(GridData.FILL_BOTH);
- tldControl.setLayoutData(data);
-
- //changed by estherbin
- //http://jira.jboss.com/jira/browse/JBIDE-2010
- Control elControl = el.createControl(c);
- data = new GridData(GridData.FILL_BOTH);
- elControl.setLayoutData(data);
- return c;
- }
-
- public void action(String command) {
- if(OK.equals(command)) {
- absFolder.commit();
- relFolder.commit();
- el.commit();
- css.commit();
- tld.commit();
- }
- super.action(command);
- }
-
- public Point getPreferredSize() {
- //changed by estherbin
- //http://jira.jboss.com/jira/browse/JBIDE-2010
- String os_name = System.getProperty("os.name");
- if(os_name != null && os_name.indexOf("Windows") >= 0) return new
Point(800, 600);
- //changed by estherbin
- //http://jira.jboss.com/jira/browse/JBIDE-2010
- return new Point(600, 700);
- }
-
-}
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java 2008-08-26
14:05:50 UTC (rev 9899)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java 2008-08-26
14:16:12 UTC (rev 9900)
@@ -48,9 +48,9 @@
import org.eclipse.ui.browser.IWorkbenchBrowserSupport;
import org.eclipse.ui.editors.text.ILocationProvider;
import org.eclipse.ui.part.EditorPart;
+import org.jboss.tools.jst.web.rreferences.VpeResourcesDialog;
import org.jboss.tools.vpe.VpePlugin;
import org.jboss.tools.vpe.editor.VpeController;
-import org.jboss.tools.vpe.editor.css.VpeResourcesDialog;
import org.jboss.tools.vpe.editor.preferences.VpeEditorPreferencesPage;
import org.jboss.tools.vpe.editor.toolbar.IVpeToolBarManager;
import org.jboss.tools.vpe.editor.toolbar.VpeToolBarManager;
@@ -74,8 +74,6 @@
import org.mozilla.interfaces.nsIHTMLInlineTableEditor;
import org.mozilla.interfaces.nsIHTMLObjectResizer;
import org.mozilla.interfaces.nsIPlaintextEditor;
-import org.mozilla.interfaces.nsISelection;
-import org.mozilla.interfaces.nsISelectionPrivate;
public class MozillaEditor extends EditorPart implements IReusableEditor {
protected static final String INIT_URL = /*"file://" +*/ (new
File(VpePlugin.getDefault().getResourcePath("ve"),
"init.html")).getAbsolutePath(); //$NON-NLS-1$ //$NON-NLS-2$
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-26
14:05:50 UTC (rev 9899)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateManager.java 2008-08-26
14:16:12 UTC (rev 9900)
@@ -26,7 +26,6 @@
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;
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-26
14:05:50 UTC (rev 9899)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionSrc.java 2008-08-26
14:16:12 UTC (rev 9900)
@@ -22,7 +22,6 @@
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;
@@ -32,6 +31,7 @@
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.rreferences.ResourceReference;
import org.jboss.tools.jst.web.tld.IFilePathEncoder;
import org.jboss.tools.vpe.VpePlugin;
import org.jboss.tools.vpe.editor.context.VpePageContext;
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/ElService.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/ElService.java 2008-08-26
14:05:50 UTC (rev 9899)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/ElService.java 2008-08-26
14:16:12 UTC (rev 9900)
@@ -1,386 +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){
-//
-// }
-
-
-
-}
+/*******************************************************************************
+ * 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.jst.web.el.ELReferenceList;
+import org.jboss.tools.jst.web.el.GlobalELReferenceList;
+import org.jboss.tools.jst.web.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-26
14:05:50 UTC (rev 9899)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/FileUtil.java 2008-08-26
14:16:12 UTC (rev 9900)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+// * 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,
@@ -28,14 +28,13 @@
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.jst.web.rreferences.AbsoluteFolderReferenceList;
+import org.jboss.tools.jst.web.rreferences.RelativeFolderReferenceList;
+import org.jboss.tools.jst.web.rreferences.ResourceReference;
import org.jboss.tools.vpe.VpePlugin;
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-26
14:05:50 UTC (rev 9899)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/VpeStyleUtil.java 2008-08-26
14:16:12 UTC (rev 9900)
@@ -22,16 +22,15 @@
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;
import org.jboss.tools.jst.web.project.WebProject;
+import org.jboss.tools.jst.web.rreferences.ResourceReference;
import org.jboss.tools.vpe.VpePlugin;
import org.jboss.tools.vpe.editor.VpeVisualDomBuilder;
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.mapping.VpeElementMapping;
-import org.mozilla.interfaces.nsIDOMElement;
import org.mozilla.interfaces.nsIDOMNode;
import org.mozilla.interfaces.nsIDOMNodeList;
import org.w3c.dom.Element;
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-26
14:05:50 UTC (rev 9899)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/XmlUtil.java 2008-08-26
14:16:12 UTC (rev 9900)
@@ -23,7 +23,6 @@
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;