JBoss Tools SVN: r9860 - in trunk/vpe/plugins/org.jboss.tools.vpe: resources/meta and 8 other directories.
by jbosstools-commits@lists.jboss.org
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>
16 years, 4 months
JBoss Tools SVN: r9859 - trunk/common/plugins/org.jboss.tools.common.model.ui/META-INF.
by jbosstools-commits@lists.jboss.org
Author: estherbin
Date: 2008-08-22 06:13:57 -0400 (Fri, 22 Aug 2008)
New Revision: 9859
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/META-INF/MANIFEST.MF
Log:
Move configuration for el substitution to the another bundle.
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/META-INF/MANIFEST.MF 2008-08-22 10:13:16 UTC (rev 9858)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/META-INF/MANIFEST.MF 2008-08-22 10:13:57 UTC (rev 9859)
@@ -115,6 +115,8 @@
org.eclipse.core.filesystem,
org.jboss.tools.vpe.xulrunner,
org.eclipse.wst.html.core,
- org.mozilla.xpcom
+ org.mozilla.xpcom,
+ org.jboss.tools.jst.web
Bundle-Version: 2.0.0
-
+Export-Package: org.jboss.tools.common.editor.el,
+ org.jboss.tools.common.editor.rreferences
16 years, 4 months
JBoss Tools SVN: r9858 - in trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor: el and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: estherbin
Date: 2008-08-22 06:13:16 -0400 (Fri, 22 Aug 2008)
New Revision: 9858
Added:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/el/
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/el/ELReferenceList.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/el/ElVariablesComposite.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/el/GlobalELReferenceList.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/el/GlobalElVariablesComposite.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/messages/
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/messages/Messages.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/messages/messages.properties
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/rreferences/
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/rreferences/AbsoluteFolderReferenceComposite.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/rreferences/AbsoluteFolderReferenceList.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/rreferences/CSSReferenceList.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/rreferences/CssReferencesComposite.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/rreferences/FolderReferenceComposite.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/rreferences/GlobalResourceReference.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/rreferences/RelativeFolderReferenceComposite.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/rreferences/RelativeFolderReferenceList.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/rreferences/ResourceReference.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/rreferences/ResourceReferenceList.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/rreferences/ResourceReferenceListListener.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/rreferences/ResourceReferencesComposite.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/rreferences/ResourceReferencesTableProvider.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/rreferences/TaglibReferenceList.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/rreferences/TaglibReferencesComposite.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/rreferences/VpeAddReferenceSupport.java
Log:
Move configuration for el substitution to the another bundle.
Copied: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/el/ELReferenceList.java (from rev 9834, trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/ELReferenceList.java)
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/el/ELReferenceList.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/el/ELReferenceList.java 2008-08-22 10:13:16 UTC (rev 9858)
@@ -0,0 +1,38 @@
+
+
+package org.jboss.tools.common.editor.el;
+
+
+import org.eclipse.core.runtime.QualifiedName;
+import org.jboss.tools.common.editor.rreferences.ResourceReferenceList;
+
+
+/**
+ * The Class ELReferenceList.
+ */
+public class ELReferenceList extends ResourceReferenceList {
+
+ /** The PROPERT y_ NAME. */
+ private static QualifiedName PROPERTY_NAME = new QualifiedName("", "org.jboss.tools.vpe.editor.css.ELReference");
+
+ /** The instance. */
+ static ELReferenceList instance = new ELReferenceList();
+
+ /**
+ * Gets the instance.
+ *
+ * @return the instance
+ */
+ public static ELReferenceList getInstance() {
+ return instance;
+ }
+
+ /**
+ * Gets the property name.
+ *
+ * @return the property name
+ */
+ protected QualifiedName getPropertyName() {
+ return PROPERTY_NAME;
+ }
+}
Copied: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/el/ElVariablesComposite.java (from rev 9834, trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/ElVariablesComposite.java)
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/el/ElVariablesComposite.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/el/ElVariablesComposite.java 2008-08-22 10:13:16 UTC (rev 9858)
@@ -0,0 +1,58 @@
+package org.jboss.tools.common.editor.el;
+
+import java.util.List;
+
+import org.jboss.tools.common.editor.messages.Messages;
+import org.jboss.tools.common.editor.rreferences.ResourceReferenceList;
+import org.jboss.tools.common.editor.rreferences.ResourceReferencesComposite;
+import org.jboss.tools.common.editor.rreferences.ResourceReferencesTableProvider;
+
+/**
+ * The Class ElVariablesComposite.
+ */
+public class ElVariablesComposite extends ResourceReferencesComposite {
+
+ /**
+ * Creates the table provider.
+ *
+ * @param dataList the data list
+ * g
+ * @return the resource references table provider
+ */
+ @Override
+ protected ResourceReferencesTableProvider createTableProvider(List dataList) {
+ return ResourceReferencesTableProvider.getELTableProvider(dataList);
+ };
+
+
+ /**
+ * Gets the entity.
+ *
+ * @return the entity
+ */
+ @Override
+ protected String getEntity() {
+ return (file != null) ? "VPEElReference" : "VPEElReferenceExt";
+ }
+
+ /**c
+ * Gets the reference list.
+ *
+ * @return the reference list
+ */
+ @Override
+ protected ResourceReferenceList getReferenceList() {
+ return ELReferenceList.getInstance();
+ }
+
+ /**
+ * @see ResourceReferencesComposite#createGroupLabel()
+ */
+ @Override
+ protected String createGroupLabel() {
+ return Messages.SUBSTITUTED_EL_EXPRESSIONS;
+ }
+
+
+
+}
Added: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/el/GlobalELReferenceList.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/el/GlobalELReferenceList.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/el/GlobalELReferenceList.java 2008-08-22 10:13:16 UTC (rev 9858)
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.common.editor.el;
+
+import org.eclipse.core.runtime.QualifiedName;
+import org.jboss.tools.common.editor.rreferences.ResourceReferenceList;
+
+/**
+ * @author Evgenij Stherbin
+ *
+ */
+public class GlobalELReferenceList extends ResourceReferenceList {
+ /** The PROPERT y_ NAME. */
+ private static QualifiedName PROPERTY_NAME = new QualifiedName("", "org.jboss.tools.vpe.editor.css.GlobalELReference");
+
+ /** The instance. */
+ private static GlobalELReferenceList instance = new GlobalELReferenceList();
+
+ /**
+ * Gets the instance.
+ *
+ * @return the instance
+ */
+ public synchronized static GlobalELReferenceList getInstance() {
+ return instance;
+ }
+
+ private GlobalELReferenceList() {
+ super();
+ }
+
+ /**
+ * Gets the property name.
+ *
+ * @return the property name
+ */
+ protected QualifiedName getPropertyName() {
+ return PROPERTY_NAME;
+ }
+
+
+}
Property changes on: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/el/GlobalELReferenceList.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/el/GlobalElVariablesComposite.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/el/GlobalElVariablesComposite.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/el/GlobalElVariablesComposite.java 2008-08-22 10:13:16 UTC (rev 9858)
@@ -0,0 +1,68 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.common.editor.el;
+
+import java.util.List;
+
+import org.jboss.tools.common.editor.rreferences.ResourceReference;
+import org.jboss.tools.common.editor.rreferences.ResourceReferenceList;
+import org.jboss.tools.common.editor.rreferences.ResourceReferencesComposite;
+import org.jboss.tools.common.editor.rreferences.ResourceReferencesTableProvider;
+
+
+/**
+ * Composite class for the global el variables.
+ * @author Evgenij Stherbin
+ *
+ */
+public class GlobalElVariablesComposite extends ResourceReferencesComposite {
+
+ /**
+ * @see org.jboss.tools.common.editor.rreferences.ResourceReferencesComposite#createGroupLabel()
+ */
+ @Override
+ protected String createGroupLabel() {
+ return "";
+ }
+
+ /**
+ * @see org.jboss.tools.common.editor.rreferences.ResourceReferencesComposite#createTableProvider(java.util.List)
+ */
+ @Override
+ protected ResourceReferencesTableProvider createTableProvider(List dataList) {
+ return ResourceReferencesTableProvider.getGlobalELTableProvider(dataList);
+ }
+
+ /**
+ * @see org.jboss.tools.common.editor.rreferences.ResourceReferencesComposite#getEntity()
+ */
+ @Override
+ protected String getEntity() {
+ return (file != null) ? "VPEGlobalElReference" : "VPEGlobalElReferenceExt";
+ }
+
+ /**
+ * @see org.jboss.tools.common.editor.rreferences.ResourceReferencesComposite#getReferenceList()
+ */
+ @Override
+ protected ResourceReferenceList getReferenceList() {
+ return GlobalELReferenceList.getInstance();
+ }
+
+ @Override
+ protected ResourceReference getDefaultResourceReference() {
+ ResourceReference rf = new ResourceReference("", ResourceReference.GLOBAL_SCOPE);
+ rf.setGlobal(true);
+ return rf;
+ }
+
+}
Property changes on: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/el/GlobalElVariablesComposite.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/messages/Messages.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/messages/Messages.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/messages/Messages.java 2008-08-22 10:13:16 UTC (rev 9858)
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+
+package org.jboss.tools.common.editor.messages;
+
+
+import org.eclipse.osgi.util.NLS;
+
+
+/**
+ * The Class Messages.
+ *
+ * @author Evgenij Stherbin
+ */
+public class Messages extends NLS {
+
+ /** The Constant BUNDLE_NAME. */
+ private static final String BUNDLE_NAME = "org.jboss.tools.common.editor.messages.messages";//$NON-NLS-1$
+
+ static {
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ /**
+ * The Constructor.
+ */
+ private Messages() {
+ super();
+ }
+
+ public static String INCLUDED_CSS_FILES;
+ public static String INCLUDED_TAG_LIBS;
+ public static String SUBSTITUTED_EL_EXPRESSIONS;
+ public static String ACTUAL_RUN_TIME_ABSOLUTE_FOLDER;
+}
Property changes on: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/messages/Messages.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/messages/messages.properties
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/messages/messages.properties (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/messages/messages.properties 2008-08-22 10:13:16 UTC (rev 9858)
@@ -0,0 +1,4 @@
+INCLUDED_CSS_FILES=Included css files
+INCLUDED_TAG_LIBS=Included tag libs
+SUBSTITUTED_EL_EXPRESSIONS=Substituted El expressions
+ACTUAL_RUN_TIME_ABSOLUTE_FOLDER=Actual Run-Time Absolute Folder
\ No newline at end of file
Property changes on: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/messages/messages.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Copied: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/rreferences/AbsoluteFolderReferenceComposite.java (from rev 9834, trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/AbsoluteFolderReferenceComposite.java)
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/rreferences/AbsoluteFolderReferenceComposite.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/rreferences/AbsoluteFolderReferenceComposite.java 2008-08-22 10:13:16 UTC (rev 9858)
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.editor.rreferences;
+
+import org.jboss.tools.common.editor.messages.Messages;
+
+public class AbsoluteFolderReferenceComposite extends FolderReferenceComposite {
+
+ protected ResourceReferenceList getReferenceList() {
+ return AbsoluteFolderReferenceList.getInstance();
+ }
+
+ protected String getTitle() {
+ return Messages.ACTUAL_RUN_TIME_ABSOLUTE_FOLDER;
+ }
+
+}
Copied: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/rreferences/AbsoluteFolderReferenceList.java (from rev 9834, trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/AbsoluteFolderReferenceList.java)
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/rreferences/AbsoluteFolderReferenceList.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/rreferences/AbsoluteFolderReferenceList.java 2008-08-22 10:13:16 UTC (rev 9858)
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.editor.rreferences;
+
+import org.eclipse.core.runtime.QualifiedName;
+
+public class AbsoluteFolderReferenceList extends ResourceReferenceList {
+ private static QualifiedName PROPERTY_NAME = new QualifiedName("", "org.jboss.tools.vpe.editor.css.AbsoluteFolder");
+ static AbsoluteFolderReferenceList instance = new AbsoluteFolderReferenceList();
+
+ public static AbsoluteFolderReferenceList getInstance() {
+ return instance;
+ }
+
+ protected QualifiedName getPropertyName() {
+ return PROPERTY_NAME;
+ }
+}
Copied: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/rreferences/CSSReferenceList.java (from rev 9834, trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/CSSReferenceList.java)
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/rreferences/CSSReferenceList.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/rreferences/CSSReferenceList.java 2008-08-22 10:13:16 UTC (rev 9858)
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.editor.rreferences;
+
+import org.eclipse.core.runtime.QualifiedName;
+
+public class CSSReferenceList extends ResourceReferenceList {
+ private static QualifiedName PROPERTY_NAME = new QualifiedName("", "org.jboss.tools.vpe.editor.css.CSSList");
+ static CSSReferenceList instance = new CSSReferenceList();
+
+ public static CSSReferenceList getInstance() {
+ return instance;
+ }
+
+ protected QualifiedName getPropertyName() {
+ return PROPERTY_NAME;
+ }
+
+}
Copied: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/rreferences/CssReferencesComposite.java (from rev 9834, trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/CssReferencesComposite.java)
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/rreferences/CssReferencesComposite.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/rreferences/CssReferencesComposite.java 2008-08-22 10:13:16 UTC (rev 9858)
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.editor.rreferences;
+
+import java.util.List;
+
+import org.jboss.tools.common.editor.messages.Messages;
+
+public class CssReferencesComposite extends ResourceReferencesComposite {
+
+ protected String getEntity() {
+ return (file != null) ? "VPECSSReference" : "VPECSSReferenceExt";
+ }
+
+ protected ResourceReferencesTableProvider createTableProvider(List dataList) {
+ return ResourceReferencesTableProvider.getCSSTableProvider(dataList);
+ }
+
+ protected ResourceReferenceList getReferenceList() {
+ return CSSReferenceList.getInstance();
+ }
+
+
+ /**
+ * @see ResourceReferencesComposite#createGroupLabel()
+ */
+ @Override
+ protected String createGroupLabel() {
+ return Messages.INCLUDED_CSS_FILES;
+ }
+
+
+}
Copied: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/rreferences/FolderReferenceComposite.java (from rev 9834, trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/FolderReferenceComposite.java)
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/rreferences/FolderReferenceComposite.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/rreferences/FolderReferenceComposite.java 2008-08-22 10:13:16 UTC (rev 9858)
@@ -0,0 +1,123 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.editor.rreferences;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.IPath;
+import org.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;
+ }
+
+}
Copied: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/rreferences/GlobalResourceReference.java (from rev 9834, trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/GlobalResourceReference.java)
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/rreferences/GlobalResourceReference.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/rreferences/GlobalResourceReference.java 2008-08-22 10:13:16 UTC (rev 9858)
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.common.editor.rreferences;
+
+
+/**
+ * Global resource reference
+ * @author Evgenij Stherbin
+ *
+ */
+public class GlobalResourceReference extends ResourceReference {
+
+ /**
+ * @param location
+ * @param scope
+ */
+ public GlobalResourceReference(String location, int scope) {
+ super(location, scope);
+ }
+
+}
Copied: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/rreferences/RelativeFolderReferenceComposite.java (from rev 9834, trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/RelativeFolderReferenceComposite.java)
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/rreferences/RelativeFolderReferenceComposite.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/rreferences/RelativeFolderReferenceComposite.java 2008-08-22 10:13:16 UTC (rev 9858)
@@ -0,0 +1,24 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.editor.rreferences;
+
+
+public class RelativeFolderReferenceComposite extends FolderReferenceComposite {
+
+ protected ResourceReferenceList getReferenceList() {
+ return RelativeFolderReferenceList.getInstance();
+ }
+
+ protected String getTitle() {
+ return "Actual Run-Time Relative Folder";
+ }
+
+}
Copied: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/rreferences/RelativeFolderReferenceList.java (from rev 9834, trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/RelativeFolderReferenceList.java)
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/rreferences/RelativeFolderReferenceList.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/rreferences/RelativeFolderReferenceList.java 2008-08-22 10:13:16 UTC (rev 9858)
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.editor.rreferences;
+
+import org.eclipse.core.runtime.QualifiedName;
+
+public class RelativeFolderReferenceList extends ResourceReferenceList {
+ private static QualifiedName PROPERTY_NAME = new QualifiedName("", "org.jboss.tools.vpe.editor.css.RelativeFolder");
+ static RelativeFolderReferenceList instance = new RelativeFolderReferenceList();
+
+ public static RelativeFolderReferenceList getInstance() {
+ return instance;
+ }
+
+ protected QualifiedName getPropertyName() {
+ return PROPERTY_NAME;
+ }
+
+}
Copied: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/rreferences/ResourceReference.java (from rev 9834, trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/ResourceReference.java)
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/rreferences/ResourceReference.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/rreferences/ResourceReference.java 2008-08-22 10:13:16 UTC (rev 9858)
@@ -0,0 +1,109 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.editor.rreferences;
+
+public class ResourceReference {
+ public final static int FILE_SCOPE = 0;
+ public final static int FOLDER_SCOPE = 1;
+ public final static int PROJECT_SCOPE = 2;
+ public final static int GLOBAL_SCOPE = 3;
+
+ public final static String[] SCOPE_NAMES = new String[]{"Page", "Folder", "Project","Global"};
+
+ protected String location;
+ protected int scope;
+ protected int depth = 0;
+ protected String properties = "";
+
+ protected boolean isGlobal = false;
+
+ public boolean isGlobal() {
+ return isGlobal;
+ }
+
+ public void setGlobal(boolean isGlobal) {
+ this.isGlobal = isGlobal;
+ }
+
+ public ResourceReference(String location, int scope) {
+ this.location = location;
+ this.scope = scope;
+ int q = location.indexOf('%');
+ if(q >= 0) {
+ properties = location.substring(q + 1);
+ this.location = location.substring(0, q);
+ }
+ }
+
+ public String getLocation() {
+ return location;
+ }
+
+ public int getScope() {
+ return scope;
+ }
+
+ public void setLocation(String location) {
+ this.location = location;
+ }
+
+ public void setProperties(String properties) {
+ this.properties = properties;
+ }
+
+ public String getProperties() {
+ return properties;
+ }
+
+ public void setScope(int scope) {
+ this.scope = scope;
+ }
+
+ public String getScopeName() {
+ return SCOPE_NAMES[scope];
+ }
+
+ public void setDepth(int depth) {
+ this.depth = depth;
+ }
+
+ public int getDepth() {
+ return depth;
+ }
+
+ public String getLocationAndProperties() {
+ String v = location;
+ if(properties.length() > 0) {
+ v += "%" + properties;
+ }
+ return v;
+ }
+
+
+// public static ResourceReference createResourceReference(String location, int scope) {
+// ResourceReference rst = null;
+//
+// switch (scope) {
+// case FILE_SCOPE:
+// case FOLDER_SCOPE:
+// case PROJECT_SCOPE:
+// rst = new ResourceReference(location, scope);
+// break;
+// case GLOBAL_SCOPE:
+// rst = new GlobalResourceReference(location, scope);
+// break;
+// default:
+// throw new IllegalArgumentException("Illegal scope=" + scope);
+// }
+// return rst;
+// }
+
+}
Copied: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/rreferences/ResourceReferenceList.java (from rev 9834, trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/ResourceReferenceList.java)
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/rreferences/ResourceReferenceList.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/rreferences/ResourceReferenceList.java 2008-08-22 10:13:16 UTC (rev 9858)
@@ -0,0 +1,274 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.editor.rreferences;
+
+import java.io.File;
+import java.util.*;
+import org.eclipse.core.resources.*;
+import org.eclipse.core.runtime.*;
+import org.jboss.tools.common.model.plugin.ModelPlugin;
+import org.jboss.tools.common.model.util.XModelObjectUtil;
+
+public abstract class ResourceReferenceList {
+ ResourceReferenceListListener[] listeners = new ResourceReferenceListListener[0];
+
+ protected abstract QualifiedName getPropertyName();
+
+ public void addChangeListener(ResourceReferenceListListener listener) {
+ int i = getListenerIndex(listener);
+ if(i >= 0) return;
+ ResourceReferenceListListener[] ls = new ResourceReferenceListListener[listeners.length + 1];
+ System.arraycopy(listeners, 0, ls, 0, listeners.length);
+ ls[listeners.length] = listener;
+ listeners = ls;
+ }
+
+ public void removeChangeListener(ResourceReferenceListListener listener) {
+ int i = getListenerIndex(listener);
+ if(i < 0) return;
+ ResourceReferenceListListener[] ls = new ResourceReferenceListListener[listeners.length - 1];
+ if(i > 0) System.arraycopy(listeners, 0, ls, 0, i);
+ if(i < ls.length) System.arraycopy(listeners, i + 1, ls, i, ls.length - i);
+ listeners = ls;
+ }
+
+ private int getListenerIndex(ResourceReferenceListListener listener) {
+ for (int i = 0; i < listeners.length; i++) {
+ if(listeners[i] == listener) return i;
+ }
+ return -1;
+ }
+
+ public ResourceReference[] getAllResources(IFile file) {
+ Set locations = new HashSet();
+ List css = new ArrayList();
+ if(file.getProject() != null) {
+ String[] dcss = getDeclaredResources(file.getProject());
+ for (int i = 0; i < dcss.length; i++) {
+ ResourceReference ref = new ResourceReference(dcss[i], ResourceReference.PROJECT_SCOPE);
+ locations.add(dcss[i]);
+ css.add(ref);
+ }
+ }
+ IResource parent = file.getParent();
+ int depth = 0;
+ while(parent instanceof IFolder) {
+ String[] dcss = getDeclaredResources(parent);
+ for (int i = 0; i < dcss.length; i++) {
+ if(locations.contains(dcss[i])) continue;
+ ResourceReference ref = new ResourceReference(dcss[i], ResourceReference.FOLDER_SCOPE);
+ ref.setDepth(depth);
+ locations.add(dcss[i]);
+ css.add(ref);
+ }
+ parent = parent.getParent();
+ depth++;
+ }
+ String[] dcss = getDeclaredResources(file);
+ for (int i = 0; i < dcss.length; i++) {
+ if(locations.contains(dcss[i])) continue;
+ ResourceReference ref = new ResourceReference(dcss[i], ResourceReference.FILE_SCOPE);
+ locations.add(dcss[i]);
+ css.add(ref);
+ }
+ return (ResourceReference[])css.toArray(new ResourceReference[0]);
+ }
+
+ private String[] getDeclaredResources(IResource resource) {
+ String s = null;
+ try {
+ s = resource.getPersistentProperty(getPropertyName());
+ } catch (CoreException e) {
+ //ignore
+ }
+ if(s == null || s.length() == 0) return new String[0];
+ return XModelObjectUtil.asStringArray(s);
+ }
+
+ public void setAllResources(IFile file, ResourceReference[] entries) {
+ IResource changed = null;
+ boolean b = setDeclaredResources(file, entries, ResourceReference.FILE_SCOPE, 0);
+ if(b) changed = file;
+ IResource parent = file.getParent();
+ int depth = 0;
+ while(parent instanceof IFolder) {
+ b = setDeclaredResources(parent, entries, ResourceReference.FOLDER_SCOPE, depth);
+ if(b) changed = parent;
+ parent = parent.getParent();
+ depth++;
+ }
+ if(file.getProject() != null) {
+ int scope = ResourceReference.PROJECT_SCOPE;
+ if(file.getParent() == file.getProject()) scope = 10;
+ b = setDeclaredResources(file.getProject(), entries, scope, 0);
+ if(b) changed = file.getProject();
+ }
+ if(changed != null) fire(changed.getFullPath());
+ }
+
+ private boolean setDeclaredResources(IResource resource, ResourceReference[] entries, int scope, int depth) {
+ try {
+ String oldValue = resource.getPersistentProperty(getPropertyName());
+ if(oldValue == null) oldValue = "";
+ String newValue = encodeDeclaredResources(entries, scope, depth);
+ if(oldValue.equals(newValue)) return false;
+ resource.setPersistentProperty(getPropertyName(), newValue);
+ } catch (CoreException e) {
+ return false;
+ }
+ return true;
+ }
+
+ private String encodeDeclaredResources(ResourceReference[] entries, int scope, int depth) {
+ StringBuffer sb = new StringBuffer();
+ for (int i = 0; i < entries.length; i++) {
+ int s = entries[i].getScope();
+ if(scope < 10 && s != scope) continue;
+ if(scope == 10 && s == ResourceReference.FILE_SCOPE) continue;
+ if(scope == ResourceReference.FOLDER_SCOPE && entries[i].getDepth() != depth) continue;
+ if(sb.length() > 0) sb.append(";");
+ sb.append(entries[i].getLocationAndProperties());
+ }
+ return sb.toString();
+ }
+
+ void fire(IPath path) {
+ ResourceReferenceListListener[] ls = listeners;
+ for (int i = 0; i < ls.length; i++) {
+ IPath listenedPath = ls[i].getPath();
+ if(listenedPath != null && path.isPrefixOf(listenedPath)) {
+ ls[i].changed(this);
+ }
+ }
+ }
+
+ /*
+ * Handle opened external files
+ */
+ TreeMap allExternalResources = null;
+
+ private TreeMap getAllExternalResources() {
+ if(allExternalResources == null) {
+ allExternalResources = new TreeMap();
+ String s = null;
+ try {
+ s = ModelPlugin.getWorkspace().getRoot().getPersistentProperty(getPropertyName());
+ if(s != null) parseExternalResources(s);
+ } catch (CoreException e) {
+ //ignore
+ }
+ }
+ return allExternalResources;
+ }
+ private void parseExternalResources(String s) {
+ StringTokenizer st = new StringTokenizer(s, "#");
+ while(st.hasMoreTokens()) {
+ String t = st.nextToken();
+ int e = t.indexOf('=');
+ String path = t.substring(0, e);
+ String list = t.substring(e + 1);
+ if(new File(path).exists()) allExternalResources.put(path, list);
+ }
+ }
+
+ private void setAllExternalResources() {
+ StringBuffer sb = new StringBuffer();
+ Iterator it = allExternalResources.keySet().iterator();
+ while(it.hasNext()) {
+ String path = it.next().toString();
+ String list = (String)allExternalResources.get(path);
+ if(path != null && list != null && new File(path).exists()) {
+ if(sb.length() > 0) sb.append('#');
+ sb.append(path).append('=').append(list);
+ }
+ }
+ try {
+ ModelPlugin.getWorkspace().getRoot().setPersistentProperty(getPropertyName(), sb.toString());
+ } catch (CoreException e) {
+ //ignore
+ }
+ }
+
+ public ResourceReference[] getAllResources(IPath path) {
+ Set locations = new HashSet();
+ List css = new ArrayList();
+ IPath parent = path.removeLastSegments(1);
+ int depth = 0;
+ boolean isGlobal = path.equals(Platform.getLocation());
+ int setScope = isGlobal ? ResourceReference.GLOBAL_SCOPE : ResourceReference.FILE_SCOPE;
+ while(parent != null && parent.segmentCount() > 1) {
+ String[] dcss = getDeclaredResources(path);
+ for (int i = 0; i < dcss.length; i++) {
+ if(locations.contains(dcss[i])) continue;
+ ResourceReference ref = new ResourceReference(dcss[i],isGlobal ? ResourceReference.GLOBAL_SCOPE : ResourceReference.FOLDER_SCOPE);
+ if(isGlobal){
+ ref.setGlobal(true);
+ }
+ ref.setDepth(depth);
+ locations.add(dcss[i]);
+ css.add(ref);
+ }
+ parent = parent.removeLastSegments(1);
+ depth++;
+ }
+ String[] dcss = getDeclaredResources(path);
+ for (int i = 0; i < dcss.length; i++) {
+ if(locations.contains(dcss[i])) continue;
+ ResourceReference ref = new ResourceReference(dcss[i], setScope);
+ if(setScope == ResourceReference.GLOBAL_SCOPE){
+ ref.setGlobal(true);
+ }
+ locations.add(dcss[i]);
+ css.add(ref);
+ }
+ return (ResourceReference[])css.toArray(new ResourceReference[0]);
+ }
+
+ private String[] getDeclaredResources(IPath path) {
+ String s = (String)getAllExternalResources().get(path.toString());
+ return (s == null || s.length() == 0) ? new String[0] : XModelObjectUtil.asStringArray(s);
+ }
+
+ public void setAllResources(IPath path, ResourceReference[] entries) {
+ IPath changed = null;
+ boolean b = false;
+ int checkScope = path.equals(Platform.getLocation()) ? ResourceReference.GLOBAL_SCOPE : ResourceReference.FILE_SCOPE;
+
+ b = setDeclaredResources(path, entries, checkScope, 0);
+ if(b) changed = path;
+ IPath parent = path.removeLastSegments(1);
+ int depth = 0;
+ while(parent != null && parent.segmentCount() > 1) {
+ b = setDeclaredResources(parent, entries, ResourceReference.FOLDER_SCOPE, depth);
+ if(b) changed = parent;
+ parent = parent.removeLastSegments(1);
+ depth++;
+ }
+ if(changed != null) {
+ setAllExternalResources();
+ fire(changed);
+ }
+ }
+
+ private boolean setDeclaredResources(IPath path, ResourceReference[] entries, int scope, int depth) {
+ String oldValue = (String)getAllExternalResources().get(path.toString());
+ if(oldValue == null) oldValue = "";
+ String newValue = encodeDeclaredResources(entries, scope, depth);
+ if(oldValue.equals(newValue)) return false;
+ if(newValue == null || newValue.length() == 0) {
+ getAllExternalResources().remove(path.toString());
+ } else {
+ getAllExternalResources().put(path.toString(), newValue);
+ }
+ return true;
+ }
+
+}
Copied: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/rreferences/ResourceReferenceListListener.java (from rev 9834, trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/ResourceReferenceListListener.java)
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/rreferences/ResourceReferenceListListener.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/rreferences/ResourceReferenceListListener.java 2008-08-22 10:13:16 UTC (rev 9858)
@@ -0,0 +1,19 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.editor.rreferences;
+
+import org.eclipse.core.runtime.IPath;
+
+public interface ResourceReferenceListListener {
+ public IPath getPath();
+ public void changed(Object source);
+
+}
Copied: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/rreferences/ResourceReferencesComposite.java (from rev 9834, trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/ResourceReferencesComposite.java)
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/rreferences/ResourceReferencesComposite.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/rreferences/ResourceReferencesComposite.java 2008-08-22 10:13:16 UTC (rev 9858)
@@ -0,0 +1,210 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.editor.rreferences;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Group;
+import org.jboss.tools.common.meta.XAttribute;
+import org.jboss.tools.common.meta.XModelEntity;
+import org.jboss.tools.common.meta.constraint.impl.XAttributeConstraintFileFilter;
+import org.jboss.tools.common.meta.impl.XModelMetaDataImpl;
+import org.jboss.tools.common.model.ui.action.CommandBar;
+import org.jboss.tools.common.model.ui.action.CommandBarListener;
+import org.jboss.tools.common.model.ui.objecteditor.XTable;
+
+public abstract class ResourceReferencesComposite {
+ protected static String ADD = "Add";
+ protected static String EDIT = "Edit";
+ protected static String REMOVE = "Remove";
+ protected XTable table = new XTable();
+ protected CommandBar bar = new CommandBar();
+ protected ResourceReferencesTableProvider tableProvider;// = new TemplatesTableProvider();
+ protected IFile file;
+ protected IPath path;
+ protected List dataList = new ArrayList();
+
+ public ResourceReferencesComposite() {
+ init();
+ }
+
+ private void init() {
+ tableProvider = createTableProvider(dataList);
+ bar.getLayout().buttonWidth = 80;
+ bar.getLayout().direction = SWT.VERTICAL;
+ bar.setCommands(new String[]{ADD, EDIT, REMOVE});
+ bar.addCommandBarListener(new BarListener());
+ table.setTableProvider(tableProvider);
+ }
+
+ protected abstract ResourceReferencesTableProvider createTableProvider(List dataList);
+ protected abstract ResourceReferenceList getReferenceList();
+
+ /**
+ * Returned the label that will display in group.
+ *
+ * @return label displayed in group
+ * @see #createControl(Composite)
+ */
+ protected abstract String createGroupLabel();
+
+
+ public void setObject(Object object) {
+ Properties p = (Properties)object;
+ file = (IFile)p.get("file");
+ path = (IPath)p.get("path");
+ ResourceReference[] rs = (file != null) ? getReferenceList().getAllResources(file) :
+ (path != null) ? getReferenceList().getAllResources(path)
+ : new ResourceReference[0];
+ for (int i = 0; i < rs.length; i++) dataList.add(rs[i]);
+ }
+
+ public Control createControl(Composite parent) {
+ Composite c1 = new Composite(parent, SWT.NONE);
+
+ c1.setLayoutData(new GridData(GridData.FILL_BOTH));
+ c1.setLayout(new GridLayout(2,false));
+
+ final Group group = new Group(c1,SWT.NONE);
+
+ group.setText(createGroupLabel());
+ group.setLayoutData(new GridData(GridData.FILL_BOTH));
+ GridLayout g = new GridLayout(2, false);
+ group.setLayout(g);
+
+
+ Control slc = table.createControl(group);
+ slc.setLayoutData(new GridData(GridData.FILL_BOTH));
+ Control bc = bar.createControl(group);
+
+
+ GridData gd = new GridData(GridData.FILL_VERTICAL);
+ bc.setLayoutData(gd);
+ table.getTable().addSelectionListener(new SelectionListener() {
+ public void widgetSelected(SelectionEvent e) {
+ updateBars();
+ }
+ public void widgetDefaultSelected(SelectionEvent e) {
+ widgetSelected(e);
+ }
+ });
+ update();
+ return c1;
+ }
+
+ ResourceReference[] getReferenceArray() {
+ return (ResourceReference[])dataList.toArray(new ResourceReference[0]);
+ }
+
+ /**
+ * Clear all entries from table.
+ */
+ public void clearAll(){
+ if(this.dataList!=null){
+ this.dataList.clear();
+ }
+ }
+
+ public void commit() {
+ if(file != null) {
+ getReferenceList().setAllResources(file, getReferenceArray());
+ } else {
+ getReferenceList().setAllResources(path, getReferenceArray());
+ }
+ }
+ class BarListener implements CommandBarListener {
+ public void action(String command) {
+ int index = table.getSelectionIndex();
+ if(ADD.equals(command)) {
+ add(index);
+ } else if(EDIT.equals(command)) {
+ edit(index);
+ } else if(REMOVE.equals(command)) {
+ remove(index);
+ }
+ update();
+ }
+ }
+
+ protected void add(int index) {
+ ResourceReference css = getDefaultResourceReference();
+
+ initFilterInFileChooser();
+ boolean ok = VpeAddReferenceSupport.add(file, css, getReferenceArray(), getEntity());
+ if(!ok) return;
+ dataList.add(css);
+ update();
+ table.setSelection(dataList.size() - 1);
+ }
+
+ /**
+ * @return
+ */
+ protected ResourceReference getDefaultResourceReference() {
+ return new ResourceReference("", ResourceReference.FOLDER_SCOPE);
+ }
+
+ protected void edit(int index) {
+ if(index < 0) return;
+ ResourceReference css = getReferenceArray()[index];
+ initFilterInFileChooser();
+ boolean ok = VpeAddReferenceSupport.edit(file, css, getReferenceArray(), getEntity());
+ if(!ok) return;
+ update();
+ }
+
+ protected abstract String getEntity();
+
+ void remove(int index) {
+ if(index >= 0) dataList.remove(index);
+ }
+
+ public void update() {
+ if(table != null) table.update();
+ updateBars();
+ }
+
+ void updateBars() {
+ bar.setEnabled(EDIT, canModify());
+ bar.setEnabled(REMOVE, canModify());
+ }
+
+ private boolean canModify() {
+ return table.getSelectionIndex() >= 0;
+ }
+
+ private void initFilterInFileChooser() {
+ String entityName = getEntity();
+ XModelEntity entity = XModelMetaDataImpl.getInstance().getEntity(entityName);
+ if(entity != null && file != null && file.getProject() != null) {
+ XAttribute[] as = entity.getAttributes();
+ for (int i = 0; i < as.length; i++) {
+ if(as[i].getConstraint() instanceof XAttributeConstraintFileFilter) {
+ XAttributeConstraintFileFilter f = (XAttributeConstraintFileFilter)as[i].getConstraint();
+ f.getProperties().setProperty("filterFolder", file.getProject().getLocation().toFile().getAbsolutePath());
+ }
+ }
+ }
+ }
+
+
+}
Copied: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/rreferences/ResourceReferencesTableProvider.java (from rev 9834, trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/ResourceReferencesTableProvider.java)
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/rreferences/ResourceReferencesTableProvider.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/rreferences/ResourceReferencesTableProvider.java 2008-08-22 10:13:16 UTC (rev 9858)
@@ -0,0 +1,107 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.editor.rreferences;
+
+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;
+ }
+
+}
Copied: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/rreferences/TaglibReferenceList.java (from rev 9834, trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/TaglibReferenceList.java)
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/rreferences/TaglibReferenceList.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/rreferences/TaglibReferenceList.java 2008-08-22 10:13:16 UTC (rev 9858)
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.editor.rreferences;
+
+import org.eclipse.core.runtime.QualifiedName;
+
+public class TaglibReferenceList extends ResourceReferenceList {
+ private static QualifiedName PROPERTY_NAME = new QualifiedName("", "org.jboss.tools.vpe.editor.css.TLDList");
+ static TaglibReferenceList instance = new TaglibReferenceList();
+
+ public static TaglibReferenceList getInstance() {
+ return instance;
+ }
+
+ protected QualifiedName getPropertyName() {
+ return PROPERTY_NAME;
+ }
+
+}
Copied: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/rreferences/TaglibReferencesComposite.java (from rev 9834, trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/TaglibReferencesComposite.java)
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/rreferences/TaglibReferencesComposite.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/rreferences/TaglibReferencesComposite.java 2008-08-22 10:13:16 UTC (rev 9858)
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.editor.rreferences;
+
+import java.util.List;
+
+import org.jboss.tools.common.editor.messages.Messages;
+
+/**
+ *
+ * @author Eugene Stherbin
+ *
+ */
+public class TaglibReferencesComposite extends ResourceReferencesComposite {
+
+ protected String getEntity() {
+ return (file != null) ? "VPETLDReference" : "VPETLDReferenceExt"; //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ protected ResourceReferencesTableProvider createTableProvider(List dataList) {
+ return ResourceReferencesTableProvider.getTLDTableProvider(dataList);
+ }
+
+ protected ResourceReferenceList getReferenceList() {
+ return TaglibReferenceList.getInstance();
+ }
+
+ /**
+ * @see ResourceReferencesComposite#createGroupLabel()
+ */
+ @Override
+ protected String createGroupLabel() {
+ return Messages.INCLUDED_TAG_LIBS;
+ }
+
+
+
+}
Copied: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/rreferences/VpeAddReferenceSupport.java (from rev 9834, trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/VpeAddReferenceSupport.java)
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/rreferences/VpeAddReferenceSupport.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/rreferences/VpeAddReferenceSupport.java 2008-08-22 10:13:16 UTC (rev 9858)
@@ -0,0 +1,148 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.editor.rreferences;
+
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+import java.util.TreeSet;
+
+import org.eclipse.core.resources.IFile;
+import org.jboss.tools.common.meta.action.XActionInvoker;
+import org.jboss.tools.common.meta.action.impl.SpecialWizardSupport;
+import org.jboss.tools.common.meta.constraint.XAttributeConstraintL;
+import org.jboss.tools.common.model.XModel;
+import org.jboss.tools.common.model.XModelException;
+import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.options.PreferenceModelUtilities;
+import org.jboss.tools.common.model.project.IModelNature;
+import org.jboss.tools.common.model.util.EclipseResourceUtil;
+import org.jboss.tools.jst.web.project.WebProject;
+import org.jboss.tools.jst.web.tld.TaglibMapping;
+
+public class VpeAddReferenceSupport extends SpecialWizardSupport {
+
+ public static boolean add(IFile file, ResourceReference css, ResourceReference[] list, String entity) {
+ return run(file, css, list, "CreateActions.AddItem", entity); //$NON-NLS-1$
+ }
+
+ public static boolean edit(IFile file, ResourceReference css, ResourceReference[] list, String entity) {
+ return run(file, css, list, "EditActions.EditItem", entity); //$NON-NLS-1$
+ }
+
+ private static boolean run(IFile file, ResourceReference css, ResourceReference[] list, String action, String entity) {
+ XModel model = PreferenceModelUtilities.getPreferenceModel();
+ XModelObject object = model.createModelObject(entity, null);
+ object.setAttributeValue("location", css.getLocation()); //$NON-NLS-1$
+ if(object.getAttributeValue("prefix") != null) { //$NON-NLS-1$
+ object.setAttributeValue("prefix", css.getProperties()); //$NON-NLS-1$
+ }
+ Properties p = new Properties();
+ p.put("scope",Integer.valueOf(css.getScope())); //$NON-NLS-1$
+ p.put("list", list); //$NON-NLS-1$
+ if(file != null) p.put("file", file); //$NON-NLS-1$
+ XActionInvoker.invoke(action, object, p);
+ boolean ok = "true".equals(p.getProperty("okPressed")); //$NON-NLS-1$ //$NON-NLS-2$
+ if(ok) {
+ css.setLocation(object.getAttributeValue("location")); //$NON-NLS-1$
+ Integer scope = (Integer)p.get("scope"); //$NON-NLS-1$
+
+ css.setScope(scope.intValue());
+ if(css.isGlobal()){
+ css.setScope(ResourceReference.GLOBAL_SCOPE);
+ }
+ String properties = object.getAttributeValue("prefix"); //$NON-NLS-1$
+ if(properties != null) css.setProperties(properties);
+ }
+ return ok;
+ }
+
+ IFile file = null;
+ String initialLocation;
+ String initialPrefix;
+ ResourceReference[] list;
+ String[] scopeNames;
+
+ protected void reset() {
+ initialLocation = getTarget().getAttributeValue("location"); //$NON-NLS-1$
+ setAttributeValue(0, "location", initialLocation); //$NON-NLS-1$
+ initialPrefix = getTarget().getAttributeValue("prefix"); //$NON-NLS-1$
+ if(initialPrefix != null) {
+ setAttributeValue(0, "prefix", initialPrefix); //$NON-NLS-1$
+ }
+ final XAttributeConstraintL scopeAttribute = ((XAttributeConstraintL) getTarget().getModelEntity().getAttribute("scope") //$NON-NLS-1$
+ .getConstraint());
+ if (scopeAttribute != null) {
+ scopeNames = scopeAttribute.getValues();
+ }
+ int scopeIndex = ((Integer)getProperties().get("scope")).intValue(); //$NON-NLS-1$
+
+ if(scopeIndex == 1 && scopeNames.length == 1){
+ scopeIndex = 0;
+ }else if(scopeIndex > scopeNames.length){
+ scopeIndex = scopeNames.length -1;
+ }
+ String scope = scopeNames[scopeIndex];
+ setAttributeValue(0, "scope", scope); //$NON-NLS-1$
+ list = (ResourceReference[])getProperties().get("list"); //$NON-NLS-1$
+ file = (IFile)getProperties().get("file"); //$NON-NLS-1$
+ setURIList();
+ }
+
+ void setURIList() {
+ if(file == null) return;
+ if(getEntityData()[0].getModelEntity().getName().startsWith("VPETLD")) { //$NON-NLS-1$
+ Set set = new TreeSet();
+ IModelNature n = EclipseResourceUtil.getModelNature(file.getProject());
+ if(n == null) return;
+ XModel model = n.getModel();
+ TaglibMapping taglibs = WebProject.getInstance(model).getTaglibMapping();
+ Map map = taglibs.getTaglibObjects();
+ Iterator it = map.keySet().iterator();
+ while(it.hasNext()) {
+ String s = it.next().toString();
+ set.add(taglibs.resolveURI(s));
+ }
+ String[] uris = (String[])set.toArray(new String[0]);
+ setValueList(0, "location", uris); //$NON-NLS-1$
+ }
+ }
+
+ public void action(String name) throws XModelException {
+ if(OK.equals(name) || FINISH.equals(name)) {
+ execute();
+ setFinished(true);
+ getProperties().setProperty("okPressed", "true"); //$NON-NLS-1$ //$NON-NLS-2$
+ } else if(CANCEL.equals(name)) {
+ setFinished(true);
+ }
+ }
+
+ protected void execute() throws XModelException {
+ Properties p0 = extractStepData(0);
+ getTarget().setAttributeValue("location", p0.getProperty("location")); //$NON-NLS-1$ //$NON-NLS-2$
+ if(p0.containsKey("prefix")) { //$NON-NLS-1$
+ getTarget().setAttributeValue("prefix", p0.getProperty("prefix")); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ int scope = getSelectedScope(p0);
+ getProperties().put("scope", Integer.valueOf(scope)); //$NON-NLS-1$
+ }
+
+ int getSelectedScope(Properties p0) {
+ String scopeName = p0.getProperty("scope"); //$NON-NLS-1$
+ for (int i = 0; i < scopeNames.length; i++) {
+ if(scopeNames[i].equals(scopeName)) return i;
+ }
+ return 0;
+ }
+
+}
Property changes on: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/rreferences/VpeAddReferenceSupport.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
16 years, 4 months
JBoss Tools SVN: r9857 - trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor.
by jbosstools-commits@lists.jboss.org
Author: dsakovich
Date: 2008-08-21 12:06:40 -0400 (Thu, 21 Aug 2008)
New Revision: 9857
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2670
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-21 14:55:54 UTC (rev 9856)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2008-08-21 16:06:40 UTC (rev 9857)
@@ -1320,6 +1320,11 @@
}
}
}
+
+ /*
+ * JBIDE-2670
+ */
+ keyEvent.stopPropagation();
} catch (Exception e) {
VpePlugin.getPluginLog().logError(e);
visualRefresh();
16 years, 4 months
JBoss Tools SVN: r9856 - trunk/documentation/guides/GettingStartedGuide/en/modules.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2008-08-21 10:55:54 -0400 (Thu, 21 Aug 2008)
New Revision: 9856
Modified:
trunk/documentation/guides/GettingStartedGuide/en/modules/getting_started.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-296 - updating info about JBoss Tools installation
Modified: trunk/documentation/guides/GettingStartedGuide/en/modules/getting_started.xml
===================================================================
--- trunk/documentation/guides/GettingStartedGuide/en/modules/getting_started.xml 2008-08-21 13:21:39 UTC (rev 9855)
+++ trunk/documentation/guides/GettingStartedGuide/en/modules/getting_started.xml 2008-08-21 14:55:54 UTC (rev 9856)
@@ -18,9 +18,11 @@
required to use JBoss Developer Studio to develop on JBoss Enterprise Middleware and/or Red Hat
Linux. But, many find these pre-configured tools offer significant time-savings and value, making
them more productive and speeding time to deployment.</para>
- <para>This guide covers the first steps to get started working with JBoss Developer Studio. You will learn how to install and
- configure necessary software for your OS (currently Linux, Microsoft Windows or Mac OSX).</para>
- <para>Thus this guide will provide you with detailed info on how to start JDK, JBDS and JBoss Tools.</para>
+ <para>This guide covers the first steps to get started working with JBoss Developer Studio. You
+ will learn how to install and configure necessary software for your OS (currently Linux,
+ Microsoft Windows or Mac OSX).</para>
+ <para>Thus this guide will provide you with detailed info on how to start JDK, JBDS and JBoss
+ Tools.</para>
</section>
<section id="ConfigJavaEnvironment">
@@ -28,8 +30,8 @@
<title>Configuring Your Java Environment</title>
<para>You must have a working installation of JDK 5 before you install JBoss Developer Studio.
Currently it will only fully work with a 32-bit JVM, not a 64-bit JVM. On a 64-bit JVM the visual
- editor fails to launch because of feature of OS architecture. Thus in this guide we will show you how to install a 32-bit Sun JDK 5.0
- on a Linux Platform and Microsoft Windows Platform.</para>
+ editor fails to launch because of feature of OS architecture. Thus in this guide we will show you
+ how to install a 32-bit Sun JDK 5.0 on a Linux Platform and Microsoft Windows Platform.</para>
<section id="InstallJDK50onLinux">
<title>Installing and Configuring 32-bit Sun JDK 5.0 on Linux</title>
@@ -39,8 +41,8 @@
<para>Download the <ulink url="http://java.sun.com/javase/downloads/index_jdk5.jsp">Sun JDK 5.0
(Java 2 Development Kit)</ulink> from Sun's website. Choose "JDK 5.0 Update
<x>" (where "x" is the latest update number) for
- download and then select "Red Hat Package Manager in self-extracting" file for Linux. Read the
- instructions on Sun's website for installing the JDK.</para>
+ download and then select "Red Hat Package Manager in self-extracting" file
+ for Linux. Read the instructions on Sun's website for installing the JDK.</para>
</listitem>
<listitem>
<para>If you don't want to use SysV service scripts you can install the
@@ -152,7 +154,8 @@
</listitem>
<listitem>
<para>Create an environment variable called JAVA_HOME that points to the JDK installation
- directory, for example: <literallayout>
+ directory, for example:
+ <literallayout>
<emphasis>C:\Program Files\Java\jdk1.5.0_11\</emphasis>
</literallayout></para>
</listitem>
@@ -180,7 +183,7 @@
<section id="Instfromdownver">
<title>Installing from the downloaded version</title>
- <para>Let's start with the JBDS installation.</para>
+ <para>Let's start with the JBDS installation.</para>
<para>JBDS comes with a simple installer, bundled with tested/pre-configured versions of Eclipse,
WTP, JBossEAP, Seam, and SpringIDE. Thus, to start perform the next steps:</para>
@@ -236,7 +239,8 @@
<note>
<title>Note:</title>
- <para>JBoss Developer Studio needs Java 5 and "gij" isn't available on every platform.</para>
+ <para>JBoss Developer Studio needs Java 5 and "gij" isn't available
+ on every platform.</para>
</note>
<itemizedlist>
@@ -253,11 +257,11 @@
<figure>
<title>JBoss Enterprise Application Platform Installing</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/getting_started/getting_started_3.png"/>
- </imageobject>
- </mediaobject>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/getting_started/getting_started_3.png"/>
+ </imageobject>
+ </mediaobject>
</figure>
<para/>
<note>
@@ -282,11 +286,11 @@
<figure>
<title>Summary Information</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/getting_started/getting_started_4.png"/>
- </imageobject>
- </mediaobject>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/getting_started/getting_started_4.png"/>
+ </imageobject>
+ </mediaobject>
</figure>
</section>
@@ -322,7 +326,8 @@
<section id="JBossToolsInstall">
<title>JBoss Tools Installation</title>
- <para>Here, let's consider the installation of the JBoss Tools modules.</para>
+ <para>Here, let's consider the installation of the <property>JBoss Tools</property>
+ modules.</para>
<para>JBoss Tools is an umbrella project for the JBoss developed plugins that will make it into
JBoss Developer Studio. The JBoss Tools modules are:</para>
<itemizedlist>
@@ -350,25 +355,53 @@
<itemizedlist>
<listitem>
- <para>Get Eclipse 3.3.1 and Web Tools 2.0.1</para>
+ <para>Get Eclipse and Web Tools</para>
</listitem>
</itemizedlist>
- <para>The quickest way to get a WTP version is to download "Eclipse IDE for Java EE Developers"
- via <ulink url="http://www.eclipse.org">www.eclipse.org</ulink>.</para>
+ <para>The currant version of JBoss Tools (3.0.0 Alpha) targets at Eclipse 3.4/Ganymede and WTP
+ 3.0.</para>
+
+ <tip>
+ <title>Tip:</title>
+ <para>We recommend you do not use Eclipse.org update site to go from Eclipse 3.3 to Eclipse
+ 3.4. Instead we suggest that you download the full binary from <ulink
+ url="http://www.eclipse.org/downloads/">here</ulink>.</para>
+ </tip>
+
+ <para>If you can only use Eclipse 3.3 use <ulink
+ url="http://www.jboss.org/tools/download/index.html#stable">JBoss Tools 2.1.2</ulink>, but
+ JBoss Tools 2.x will not have any of the new features.</para>
+
<note>
<title>Note:</title>
<para>Remember to choose the download that matches your OS and use Java 5 when you run
it.</para>
</note>
+
<itemizedlist>
<listitem>
- <para>Get the <ulink url="http://labs.jboss.com/tools/download/index.html">JBoss Tools
- build</ulink></para>
+ <para>Get the <ulink
+ url="http://download.jboss.org/jbosstools/builds/nightly/latestBuild.html">latest JBoss
+ Tools build</ulink></para>
</listitem>
</itemizedlist>
- <para>You can also find the latest development release of JBossTools from <ulink
- url="http://download.jboss.org/jbosstools/updates/stable/">JBossTools Stable Update
- Site</ulink></para>
+
+ <para>Some of our newer plugins, like TPTP and BIRT, need additional drivers. On the left side of the download page
+ you can find all of the required drivers for chosen build and their versions.</para>
+ <para>Instead of downloading the nightly build version manually, it's also possible to
+ get the latest release of <property>JBoss Tools</property> from one of our update sites: <itemizedlist>
+ <listitem>
+ <para>Stable Updates: <ulink url="http://download.jboss.org/jbosstools/updates/stable"
+ >http://download.jboss.org/jbosstools/updates/stable</ulink></para>
+ </listitem>
+ <listitem>
+ <para> Development Updates: <ulink
+ url="http://download.jboss.org/jbosstools/updates/development"
+ >http://download.jboss.org/jbosstools/updates/development</ulink></para>
+ </listitem>
+ </itemizedlist>
+ </para>
+
<itemizedlist>
<listitem>
<para>Finally, install the build</para>
@@ -396,11 +429,11 @@
<figure>
<title>Welcome to JBoss Developer Studio</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/getting_started/getting_started_5.png"/>
- </imageobject>
- </mediaobject>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/getting_started/getting_started_5.png"/>
+ </imageobject>
+ </mediaobject>
</figure>
<para>With the help of its page you will be able:</para>
@@ -413,11 +446,11 @@
<figure>
<title>Getting Started Documentation</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/getting_started/getting_started_6.png"/>
- </imageobject>
- </mediaobject>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/getting_started/getting_started_6.png"/>
+ </imageobject>
+ </mediaobject>
</figure>
<itemizedlist>
@@ -429,11 +462,11 @@
<figure>
<title>Create New...</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/getting_started/getting_started_7.png"/>
- </imageobject>
- </mediaobject>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/getting_started/getting_started_7.png"/>
+ </imageobject>
+ </mediaobject>
</figure>
<itemizedlist>
@@ -445,11 +478,11 @@
<figure>
<title>Perspectives</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/getting_started/getting_started_8.png"/>
- </imageobject>
- </mediaobject>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/getting_started/getting_started_8.png"/>
+ </imageobject>
+ </mediaobject>
</figure>
<itemizedlist>
@@ -460,11 +493,11 @@
<figure>
<title>Web Resources</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/getting_started/getting_started_9.png" scale="90"/>
- </imageobject>
- </mediaobject>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/getting_started/getting_started_9.png" scale="90"/>
+ </imageobject>
+ </mediaobject>
</figure>
<para>Start work with JBoss Developer Studio by clicking on <emphasis>
@@ -483,9 +516,12 @@
<?dbhtml filename="Uninstalling.html"?>
<title>Uninstalling</title>
<itemizedlist>
- <listitem><para>Make sure JBoss Developer Studio is not running</para></listitem>
- <listitem><para>Uninstall your current version of JBoss Developer Studio by running
- uninstaller</para></listitem>
+ <listitem>
+ <para>Make sure JBoss Developer Studio is not running</para>
+ </listitem>
+ <listitem>
+ <para>Uninstall your current version of JBoss Developer Studio by running uninstaller</para>
+ </listitem>
</itemizedlist>
</section>
@@ -539,22 +575,39 @@
their machines.</para>
<orderedlist>
- <listitem><para>On Red Hat based Linux distributions install the xpLib.i386 package</para></listitem>
- <listitem><para>Type</para> <programlisting role="JAVA"><![CDATA[ln -s libstdc++.so.5.0.7 libstdc++.so.5
+ <listitem>
+ <para>On Red Hat based Linux distributions install the xpLib.i386 package</para>
+ </listitem>
+ <listitem>
+ <para>Type</para>
+ <programlisting role="JAVA"><![CDATA[ln -s libstdc++.so.5.0.7 libstdc++.so.5
]]></programlisting>
</listitem>
- <listitem><para>and/or use</para><programlisting role="JAVA"><![CDATA[yum install libXp
+ <listitem>
+ <para>and/or use</para>
+ <programlisting role="JAVA"><![CDATA[yum install libXp
]]></programlisting>
</listitem>
- <listitem><para>Open the JBDS perspective. If you see the Help view open, close it and restart JBDS</para></listitem>
- <listitem><para>If none of these work, do the following:</para><itemizedlist>
- <listitem><para>Clear the Eclipse log file,
- <emphasis><workspace>\.metadata\.log</emphasis></para></listitem>
- <listitem><para>Start Eclipse with the -debug option:</para> <programlisting role="JAVA"><![CDATA[eclipse -debug
+ <listitem>
+ <para>Open the JBDS perspective. If you see the Help view open, close it and restart
+ JBDS</para>
+ </listitem>
+ <listitem>
+ <para>If none of these work, do the following:</para>
+ <itemizedlist>
+ <listitem>
+ <para>Clear the Eclipse log file,
+ <emphasis><workspace>\.metadata\.log</emphasis></para>
+ </listitem>
+ <listitem>
+ <para>Start Eclipse with the -debug option:</para>
+ <programlisting role="JAVA"><![CDATA[eclipse -debug
]]></programlisting>
</listitem>
- <listitem><para>Post the Eclipse log file
- (<emphasis><workspace>\.metadata\.log</emphasis>) on the forums.</para></listitem>
+ <listitem>
+ <para>Post the Eclipse log file
+ (<emphasis><workspace>\.metadata\.log</emphasis>) on the forums.</para>
+ </listitem>
</itemizedlist>
</listitem>
</orderedlist>
@@ -631,8 +684,8 @@
<para>
<emphasis role="bold">How can I add my own tag library to the JBoss Tools Palette?</emphasis>
</para>
- <para>See <ulink url="&jsflink;#AddingCustomJSFTagsToTheRedHatPalette7433"
- >Adding Tag Libraries</ulink> in Visual Web Tools Guide.</para>
+ <para>See <ulink url="&jsflink;#AddingCustomJSFTagsToTheRedHatPalette7433">Adding Tag
+ Libraries</ulink> in Visual Web Tools Guide.</para>
</section>
</section>
@@ -646,8 +699,9 @@
url="http://www.jboss.com/index.html?module=bb&op=viewforum&f=258">JBoss
Forum</ulink></para>
<para>Download: <ulink url="http://www.jboss.com/products/devstudio">JBDS Download</ulink></para>
- <para>All JBoss Developer Studio/JBoss Tools documentation you can find <ulink url="http://www.jboss.com/products/devstudio/docs">here</ulink>.</para>
- <para>The latest documentation builds are available <ulink url="http://download.jboss.org/jbosstools/nightly-docs/">here</ulink>.</para>
+
+ <para>The latest documentation builds are available <ulink
+ url="http://download.jboss.org/jbosstools/nightly-docs/">here</ulink>.</para>
</section>
</chapter>
16 years, 4 months
JBoss Tools SVN: r9855 - trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util.
by jbosstools-commits@lists.jboss.org
Author: estherbin
Date: 2008-08-21 09:21:39 -0400 (Thu, 21 Aug 2008)
New Revision: 9855
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/FileUtil.java
Log:
Fix D. Golovin request.
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-21 13:05:12 UTC (rev 9854)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/FileUtil.java 2008-08-21 13:21:39 UTC (rev 9855)
@@ -103,7 +103,6 @@
// do nothing that means include will shown as text region with included file name
}
} else {
- try {
ResourceReference[] resources = RelativeFolderReferenceList.getInstance().getAllResources(includeFile);
if ((resources != null) && resources.length == 1) {
String location = resources[0].getLocation() + File.separator+fileName;
@@ -111,17 +110,10 @@
//new File(location);
return ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(path);//ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(path);
} else {
-
IPath currentFolder = includeFile.getParent().getFullPath();
IPath path = currentFolder.append(fileName);
file = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
- }
- } catch (Exception e) {
- if(VpeDebug.USE_PRINT_STACK_TRACE){
- e.printStackTrace();
- }
- return null;
- }
+ }
}
return file;
}
16 years, 4 months
JBoss Tools SVN: r9854 - trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor.
by jbosstools-commits@lists.jboss.org
Author: estherbin
Date: 2008-08-21 09:05:12 -0400 (Thu, 21 Aug 2008)
New Revision: 9854
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
Log:
Fix JBIDE-2443 issue.
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-21 13:04:05 UTC (rev 9853)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2008-08-21 13:05:12 UTC (rev 9854)
@@ -163,7 +163,9 @@
import org.mozilla.interfaces.nsISelection;
import org.mozilla.interfaces.nsISelectionListener;
import org.mozilla.interfaces.nsISupports;
+import org.mozilla.interfaces.nsISupportsCString;
import org.mozilla.xpcom.Mozilla;
+import org.mozilla.xpcom.XPCOMException;
import org.w3c.dom.Attr;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -2775,66 +2777,100 @@
return tagname;
}
+
+ /**
+ * Determine is nsIFile instance.
+ *
+ * @param support
+ * @return
+ */
+ private boolean isNsIFileInstance(nsISupports support) {
+ boolean rst = true;
- public void externalDrop(nsIDOMMouseEvent mouseEvent, String flavor,
- String data) {
+ try {
+ support.queryInterface(nsIFile.NS_IFILE_IID);
+ } catch (XPCOMException e) {
+ rst = false;
+ }
+ return rst;
+ }
+
+ private boolean isNsIStringInstance(nsISupports support) {
+ boolean rst = true;
+
+ try {
+ support.queryInterface(nsISupportsCString.NS_ISUPPORTSCSTRING_IID);
+ } catch (XPCOMException e) {
+ rst = false;
+ }
+ return rst;
+ }
+ public void externalDrop(nsIDOMMouseEvent mouseEvent, String flavor, String data) {
onHideTooltip();
- VpeVisualInnerDropInfo visualDropInfo = selectionBuilder
- .getInnerDropInfo(mouseEvent);
- Point range = selectionBuilder.getSourceSelectionRangeAtVisualNode(
- visualDropInfo.getDropContainer(), (int) visualDropInfo
- .getDropOffset());
+ VpeVisualInnerDropInfo visualDropInfo = selectionBuilder.getInnerDropInfo(mouseEvent);
+ Point range = selectionBuilder.getSourceSelectionRangeAtVisualNode(visualDropInfo.getDropContainer(), (int) visualDropInfo
+ .getDropOffset());
VpeSourceInnerDropInfo sourceDropInfo = null;
-// if (MODEL_FLAVOR.equals(flavor)) {
-// XModelObject object = PreferenceModelUtilities.getPreferenceModel()
-// .getModelBuffer().source();
-// if(object == null)
+ // if (MODEL_FLAVOR.equals(flavor)) {
+ // XModelObject object = PreferenceModelUtilities.getPreferenceModel()
+ // .getModelBuffer().source();
+ // if(object == null)
- nsIFile aFile = DnDUtil.getDnDFile(mouseEvent);
- if(aFile!=null){
- data = aFile.getPath();
- }
-// if (object.getFileType() == XModelObject.FILE
-// && !TLDUtil.isTaglib(object)) {
-// flavor = "application/x-moz-file"; //$NON-NLS-1$
-// IFile f = (IFile) EclipseResourceUtil.getResource(object);
-// try {
-// data = f.getLocation().toFile().toURL().toString();
-// } catch (Exception e) {
-// VpePlugin.getPluginLog().logError(e);
-// }
-// } else {
-// String tagname = getTagName(object);
-// if (tagname.indexOf("taglib") >= 0)tagname = "taglib"; //$NON-NLS-1$ //$NON-NLS-2$
-// Node sourceDragNode = ((Document) getModel().getAdapter(
-// Document.class)).createElement(tagname);
-// if (visualDropInfo.getDropContainer() != null) {
-// sourceDropInfo = visualBuilder.getSourceInnerDropInfo(
-// sourceDragNode, visualDropInfo, true);
-// range = selectionBuilder.getSourceSelectionRange(
-// sourceDropInfo.getContainer(), sourceDropInfo
-// .getOffset());
-// }
-// }
-
+ nsISupports aValue = DnDUtil.getDnDValue(mouseEvent);
+ String aFlavor = "";
+ if (isNsIFileInstance(aValue)) {
+ nsIFile aFile = (nsIFile) aValue.queryInterface(nsIFile.NS_IFILE_IID);
- if (visualDropInfo.getDropContainer() != null && data!=null) {
+ if (aValue != null) {
+ data = aFile.getPath();
+ aFlavor = DnDUtil.kFileMime;
+ }
+
+ } else if (isNsIStringInstance(aValue)) {
+ nsISupportsCString aString = (nsISupportsCString) aValue.queryInterface(nsISupportsCString.NS_ISUPPORTSCSTRING_IID);
+ data = aString.getData();
+ aFlavor = DnDUtil.kHTMLMime;
+ }
+
+ // if (object.getFileType() == XModelObject.FILE
+ // && !TLDUtil.isTaglib(object)) {
+ // flavor = "application/x-moz-file"; //$NON-NLS-1$
+ // IFile f = (IFile) EclipseResourceUtil.getResource(object);
+ // try {
+ // data = f.getLocation().toFile().toURL().toString();
+ // } catch (Exception e) {
+ // VpePlugin.getPluginLog().logError(e);
+ // }
+ // } else {
+ // String tagname = getTagName(object);
+ // if (tagname.indexOf("taglib") >= 0)tagname = "taglib"; //$NON-NLS-1$ //$NON-NLS-2$
+ // Node sourceDragNode = ((Document) getModel().getAdapter(
+ // Document.class)).createElement(tagname);
+ // if (visualDropInfo.getDropContainer() != null) {
+ // sourceDropInfo = visualBuilder.getSourceInnerDropInfo(
+ // sourceDragNode, visualDropInfo, true);
+ // range = selectionBuilder.getSourceSelectionRange(
+ // sourceDropInfo.getContainer(), sourceDropInfo
+ // .getOffset());
+ // }
+ // }
+
+ if (visualDropInfo.getDropContainer() != null && data != null) {
if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
- System.out
- .println(" drop! container: " + visualDropInfo.getDropContainer().getNodeName()); //$NON-NLS-1$
+ System.out.println(" drop! container: " + visualDropInfo.getDropContainer().getNodeName()); //$NON-NLS-1$
}
- externalDropAny(flavor, data, range, sourceDropInfo == null ? null
- : sourceDropInfo.getContainer());
-
- DropContext dropContext = new DropContext();
+ externalDropAny(aFlavor, data, range, sourceDropInfo == null ? null : sourceDropInfo.getContainer());
+
+ DropContext dropContext = new DropContext();
IDNDTextEditor textEditor = (IDNDTextEditor) VpeController.this.editPart.getSourceEditor();
-
- TypedEvent tEvent = new TypedEvent(mouseEvent);
- dropContext.setFlavor(DnDUtil.kFileMime);
- dropContext.setMimeData(data);
- DnDUtil.fireDnDEvent(dropContext, textEditor, tEvent);
+
+ // TypedEvent tEvent = new TypedEvent(mouseEvent);
+ // tEvent.data = data;
+ // dropContext.setFlavor(aFlavor);
+ // dropContext.setMimeData(data);
+ // DnDUtil.fireDnDEvent(dropContext, textEditor, tEvent);
}
}
16 years, 4 months
JBoss Tools SVN: r9853 - in trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui: editors/dnd and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: estherbin
Date: 2008-08-21 09:04:05 -0400 (Thu, 21 Aug 2008)
New Revision: 9853
Added:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/dnd/VpeTextDropAction.java
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/dnd/DnDUtil.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/DropCommandFactory.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/context/DropContext.java
Log:
Fix JBIDE-2443 issue.
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/dnd/DnDUtil.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/dnd/DnDUtil.java 2008-08-21 10:13:37 UTC (rev 9852)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/dnd/DnDUtil.java 2008-08-21 13:04:05 UTC (rev 9853)
@@ -24,11 +24,14 @@
import org.jboss.tools.vpe.xulrunner.XPCOM;
import org.mozilla.interfaces.nsIComponentManager;
import org.mozilla.interfaces.nsIDOMEvent;
+import org.mozilla.interfaces.nsIDOMText;
import org.mozilla.interfaces.nsIDragService;
import org.mozilla.interfaces.nsIDragSession;
import org.mozilla.interfaces.nsIFile;
import org.mozilla.interfaces.nsIServiceManager;
+import org.mozilla.interfaces.nsIStringInputStream;
import org.mozilla.interfaces.nsISupports;
+import org.mozilla.interfaces.nsISupportsCString;
import org.mozilla.interfaces.nsITransferable;
import org.mozilla.xpcom.Mozilla;
@@ -227,8 +230,7 @@
*
* @return the dn D file
*/
- public static nsIFile getDnDFile(nsIDOMEvent event) {
- nsIFile aFile = null;
+ public static nsISupports getDnDValue(nsIDOMEvent event) {
nsIServiceManager serviceManager = Mozilla.getInstance().getServiceManager();
nsIComponentManager componentManager = Mozilla.getInstance().getComponentManager();
nsIDragService dragService = (nsIDragService) serviceManager.getServiceByContractID("@mozilla.org/widget/dragservice;1", //$NON-NLS-1$
@@ -241,21 +243,15 @@
for (String flavor1 : FLAVORS) {
if (dragSession.isDataFlavorSupported(flavor1)) {
iTransferable.addDataFlavor(flavor1);
- System.out.println("\n->" + flavor1); //$NON-NLS-1$
}
}
String[] aFlavor = { "" }; //$NON-NLS-1$
long[] aDataLen = { 0 };
nsISupports[] aData = { null };
-
+
dragSession.getData(iTransferable, 0);
-
iTransferable.getAnyTransferData(aFlavor, aData, aDataLen);
- System.out.println("aData[0] className = " + aData[0].getClass().getName()); //$NON-NLS-1$
-
-
- aFile = (nsIFile) aData[0].queryInterface(nsIFile.NS_IFILE_IID);
- return aFile;
+ return aData[0];
}
}
Added: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/dnd/VpeTextDropAction.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/dnd/VpeTextDropAction.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/dnd/VpeTextDropAction.java 2008-08-21 13:04:05 UTC (rev 9853)
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.common.model.ui.dnd;
+
+import org.eclipse.swt.events.TypedEvent;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.wst.sse.ui.internal.TextDropAction;
+
+/**
+ * @author Evgenij Stherbin
+ *
+ */
+@SuppressWarnings("restriction")
+public class VpeTextDropAction extends TextDropAction {
+
+
+ public boolean run(TypedEvent event, IEditorPart targetEditor) {
+ return super.insert((String) event.data, targetEditor);
+ }
+
+}
Property changes on: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/dnd/VpeTextDropAction.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/DropCommandFactory.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/DropCommandFactory.java 2008-08-21 10:13:37 UTC (rev 9852)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/DropCommandFactory.java 2008-08-21 13:04:05 UTC (rev 9853)
@@ -12,54 +12,88 @@
import java.util.HashMap;
+import org.jboss.tools.common.model.ui.dnd.DnDUtil;
import org.jboss.tools.common.model.ui.dnd.ModelTransfer;
+/**
+ * The Class DropCommandFactory.
+ */
public class DropCommandFactory {
+ /** The Constant INSTANCE. */
private static final DropCommandFactory INSTANCE = new DropCommandFactory();
+ /** The Constant PLAIN_MIME_COMMAND. */
public static final IDropCommand PLAIN_MIME_COMMAND = new PlainTextDropCommand();
+
+ /** The Constant UNKNOWN_MIME_COMMAND. */
public static final IDropCommand UNKNOWN_MIME_COMMAND = new UnknownDropCommand();
- public static final String UNKNOWN_MIME_TYPE = "exadel/unknown";
+ /** The Constant UNKNOWN_MIME_TYPE. */
+ public static final String UNKNOWN_MIME_TYPE = "exadel/unknown"; //$NON-NLS-1$
+ /** The Constant fMimeCommandMap. */
public static final HashMap<String,String> fMimeCommandMap = new HashMap<String,String>();
////see nsITransferable
- public static final String kFileMime = "application/x-moz-file";
- public static final String kURLMime = "text/x-moz-url";
- public static final String kUnicodeMime = "text/unicode";
+ /** The Constant kFileMime. */
+ public static final String kFileMime = "application/x-moz-file"; //$NON-NLS-1$
- static String PACKAGE = "org.jboss.tools.common.model.ui.editors.dnd.";
+ /** The Constant kURLMime. */
+ public static final String kURLMime = "text/x-moz-url"; //$NON-NLS-1$
+
+ /** The Constant kUnicodeMime. */
+ public static final String kUnicodeMime = "text/unicode"; //$NON-NLS-1$
+
+ /** The Constant kHtmlText. */
+ public static final String kHtmlText = DnDUtil.kHTMLMime;
+
+ /** The PACKAGE. */
+ static String PACKAGE = "org.jboss.tools.common.model.ui.editors.dnd."; //$NON-NLS-1$
static {
fMimeCommandMap.put(
////nsITransferable.kFileMime
- kFileMime, PACKAGE + "FileDropCommand"
+ kFileMime, PACKAGE + "FileDropCommand" //$NON-NLS-1$
);
fMimeCommandMap.put(
////nsITransferable.kURLMime
- kURLMime, PACKAGE + "FileDropCommand"
+ kURLMime, PACKAGE + "FileDropCommand" //$NON-NLS-1$
);
fMimeCommandMap.put(
- ModelTransfer.MODEL, PACKAGE + "PaletteDropCommand"
+ ModelTransfer.MODEL, PACKAGE + "PaletteDropCommand" //$NON-NLS-1$
);
fMimeCommandMap.put(
- "text/plain", PACKAGE + "PlainTextDropCommand"
+ "text/plain", PACKAGE + "PlainTextDropCommand" //$NON-NLS-1$ //$NON-NLS-2$
);
fMimeCommandMap.put(
////nsITransferable.kUnicodeMime
- kUnicodeMime, PACKAGE + "PlainTextDropCommand"
+ kUnicodeMime, PACKAGE + "PlainTextDropCommand" //$NON-NLS-1$
);
+ fMimeCommandMap.put(kHtmlText,PACKAGE + "PlainTextDropCommand"); //$NON-NLS-1$
+
fMimeCommandMap.put(
- UNKNOWN_MIME_TYPE, PACKAGE + "UnknownDropCommand"
+ UNKNOWN_MIME_TYPE, PACKAGE + "UnknownDropCommand" //$NON-NLS-1$
);
}
+ /**
+ * Gets the instance.
+ *
+ * @return the instance
+ */
public static DropCommandFactory getInstance() {
return INSTANCE;
}
+ /**
+ * Gets the drop command.
+ *
+ * @param mimeType the mime type
+ * @param tagProposalFactory the tag proposal factory
+ *
+ * @return the drop command
+ */
public IDropCommand getDropCommand(String mimeType, ITagProposalFactory tagProposalFactory) {
IDropCommand fInstance = null;
try {
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/context/DropContext.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/context/DropContext.java 2008-08-21 10:13:37 UTC (rev 9852)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/context/DropContext.java 2008-08-21 13:04:05 UTC (rev 9853)
@@ -34,6 +34,7 @@
import org.jboss.tools.common.model.ui.ModelUIPlugin;
import org.jboss.tools.common.model.ui.dnd.ModelTransfer;
import org.jboss.tools.common.model.ui.dnd.VpeDnDEvent;
+import org.jboss.tools.common.model.ui.dnd.VpeTextDropAction;
import org.jboss.tools.common.model.ui.editors.dnd.FileTagProposalLoader;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.jst.web.tld.TLDUtil;
@@ -154,8 +155,8 @@
if(event == null) return;
if(getFlavor() == null) {
return;
- } else if (getFlavor().equals("text/html") && this.event instanceof DropTargetEvent) {
- new TextDropAction().run((DropTargetEvent) event, editor);
+ } else if (getFlavor().equals("text/html")) {
+ new VpeTextDropAction().run(event, editor);
} else {
editor.runDropCommand(getFlavor(), getMimeData());
}
16 years, 4 months
JBoss Tools SVN: r9852 - workspace/dart/release.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2008-08-21 06:13:37 -0400 (Thu, 21 Aug 2008)
New Revision: 9852
Added:
workspace/dart/release/smooks_tools_080821.zip
Log:
20080821
Added: workspace/dart/release/smooks_tools_080821.zip
===================================================================
(Binary files differ)
Property changes on: workspace/dart/release/smooks_tools_080821.zip
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
16 years, 4 months
JBoss Tools SVN: r9851 - in workspace/dart/plugins: org.jboss.tools.smooks.xml2java/META-INF and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2008-08-21 06:10:34 -0400 (Thu, 21 Aug 2008)
New Revision: 9851
Modified:
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksGraphicalFormPage.java
workspace/dart/plugins/org.jboss.tools.smooks.xml2java/META-INF/MANIFEST.MF
Log:
modify ui to show the generate error message
Modified: workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksGraphicalFormPage.java
===================================================================
--- workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksGraphicalFormPage.java 2008-08-21 09:52:23 UTC (rev 9850)
+++ workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksGraphicalFormPage.java 2008-08-21 10:10:34 UTC (rev 9851)
@@ -415,6 +415,7 @@
public void doSave(IProgressMonitor monitor) {
SmooksFileBuilder builder = this.getSmooksFileBuilder();
SmooksConfigurationFileGenerateContext context = createContext();
+ Exception exp = null;
try {
InputStream stream = builder.generateSmooksFile(context, monitor);
IFile file = ((IFileEditorInput) this.getEditorInput()).getFile();
@@ -422,12 +423,15 @@
file.setContents(stream, IResource.FORCE, monitor);
}
} catch (CoreException e) {
- e.printStackTrace();
+ exp = e;
} catch (SmooksAnalyzerException e) {
- e.printStackTrace();
+ exp = e;
} catch (IOException e) {
- e.printStackTrace();
+ exp = e;
}
+ if(exp != null){
+ MessageDialog.openError(getSite().getShell(), "Save Error", "Error! \n" + exp.getMessage());
+ }
super.doSave(monitor);
commandStackChanged = false;
getManagedForm().dirtyStateChanged();
Modified: workspace/dart/plugins/org.jboss.tools.smooks.xml2java/META-INF/MANIFEST.MF
===================================================================
--- workspace/dart/plugins/org.jboss.tools.smooks.xml2java/META-INF/MANIFEST.MF 2008-08-21 09:52:23 UTC (rev 9850)
+++ workspace/dart/plugins/org.jboss.tools.smooks.xml2java/META-INF/MANIFEST.MF 2008-08-21 10:10:34 UTC (rev 9851)
@@ -14,3 +14,5 @@
org.eclipse.emf.edit,
org.eclipse.emf
Eclipse-LazyStart: true
+Export-Package: org.jboss.tools.smooks.xml2java,
+ org.jboss.tools.smooks.xml2java.analyzer
16 years, 4 months