Author: dgolovin
Date: 2008-08-27 21:32:18 -0400 (Wed, 27 Aug 2008)
New Revision: 9930
Added:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/preferences/ELVariablesPreferencePage.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/el/
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/el/ELReferenceList.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/el/ElVariablesComposite.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/el/GlobalELReferenceList.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/el/GlobalElVariablesComposite.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/el/messages/
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/el/messages/Messages.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/el/messages/messages.properties
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/AbsoluteFolderReferenceComposite.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/AbsoluteFolderReferenceList.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/CSSReferenceList.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/CssReferencesComposite.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/FolderReferenceComposite.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/GlobalResourceReference.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/RelativeFolderReferenceComposite.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/RelativeFolderReferenceList.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/ResourceReference.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/ResourceReferenceList.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/ResourceReferenceListListener.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/ResourceReferencesComposite.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/ResourceReferencesDialogView.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/ResourceReferencesTableProvider.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/TaglibReferenceList.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/TaglibReferencesComposite.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/VpeAddReferenceSupport.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/VpeCssReferencesDialog.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/VpeResourcesDialog.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/VpeResourcesDialogView.java
Removed:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/ELVariablesPreferencePage.java
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/el/
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/messages/Messages.java
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/messages/messages.properties
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/rreferences/
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/META-INF/MANIFEST.MF
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/CommonJBIDE2010Test.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2594Test.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2624.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE924Test.java
trunk/jst/plugins/org.jboss.tools.jst.web.ui/META-INF/MANIFEST.MF
trunk/jst/plugins/org.jboss.tools.jst.web.ui/plugin.xml
trunk/jst/plugins/org.jboss.tools.jst.web/META-INF/MANIFEST.MF
trunk/jst/tests/org.jboss.tools.jst.jsp.test/META-INF/MANIFEST.MF
trunk/vpe/plugins/org.jboss.tools.vpe/META-INF/MANIFEST.MF
trunk/vpe/plugins/org.jboss.tools.vpe/plugin.xml
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/context/VpePageContext.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionSrc.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/ElService.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/FileUtil.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/VpeStyleUtil.java
Log:
VPE code moved back to VPE. Web module dependency from web.ui
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/META-INF/MANIFEST.MF 2008-08-28
00:57:10 UTC (rev 9929)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/META-INF/MANIFEST.MF 2008-08-28
01:32:18 UTC (rev 9930)
@@ -24,7 +24,6 @@
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Export-Package: org.jboss.tools.jsf.vpe.jsf.test
-Import-Package: org.jboss.tools.jst.web.rreferences
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/CommonJBIDE2010Test.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/CommonJBIDE2010Test.java 2008-08-28
00:57:10 UTC (rev 9929)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/CommonJBIDE2010Test.java 2008-08-28
01:32:18 UTC (rev 9930)
@@ -17,8 +17,8 @@
import java.util.Map.Entry;
import org.eclipse.core.resources.IFile;
-import org.jboss.tools.jst.web.el.ELReferenceList;
-import org.jboss.tools.jst.web.rreferences.ResourceReference;
+import org.jboss.tools.vpe.el.ELReferenceList;
+import org.jboss.tools.vpe.rreferences.ResourceReference;
import org.jboss.tools.vpe.ui.test.TestUtil;
import org.jboss.tools.vpe.ui.test.VpeTest;
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2594Test.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2594Test.java 2008-08-28
00:57:10 UTC (rev 9929)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2594Test.java 2008-08-28
01:32:18 UTC (rev 9930)
@@ -19,9 +19,9 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Platform;
import org.jboss.tools.jsf.vpe.jsf.test.CommonJBIDE2010Test;
-import org.jboss.tools.jst.web.el.GlobalELReferenceList;
-import org.jboss.tools.jst.web.rreferences.ResourceReference;
import org.jboss.tools.vpe.editor.util.ElService;
+import org.jboss.tools.vpe.el.GlobalELReferenceList;
+import org.jboss.tools.vpe.rreferences.ResourceReference;
/**
* Test case for testing global El expression substitution
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2624.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2624.java 2008-08-28
00:57:10 UTC (rev 9929)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2624.java 2008-08-28
01:32:18 UTC (rev 9930)
@@ -23,10 +23,10 @@
import org.eclipse.ui.part.FileEditorInput;
import org.jboss.tools.jsf.vpe.jsf.test.JsfAllTests;
import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
-import org.jboss.tools.jst.web.rreferences.RelativeFolderReferenceList;
-import org.jboss.tools.jst.web.rreferences.ResourceReference;
import org.jboss.tools.vpe.editor.VpeController;
import org.jboss.tools.vpe.editor.util.HTML;
+import org.jboss.tools.vpe.rreferences.RelativeFolderReferenceList;
+import org.jboss.tools.vpe.rreferences.ResourceReference;
import org.jboss.tools.vpe.ui.test.TestUtil;
import org.jboss.tools.vpe.ui.test.VpeTest;
import org.mozilla.interfaces.nsIDOMDocument;
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE924Test.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE924Test.java 2008-08-28
00:57:10 UTC (rev 9929)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE924Test.java 2008-08-28
01:32:18 UTC (rev 9930)
@@ -18,10 +18,10 @@
import org.eclipse.ui.part.FileEditorInput;
import org.jboss.tools.jsf.vpe.jsf.test.JsfAllTests;
import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
-import org.jboss.tools.jst.web.rreferences.AbsoluteFolderReferenceList;
-import org.jboss.tools.jst.web.rreferences.ResourceReference;
import org.jboss.tools.vpe.editor.VpeController;
import org.jboss.tools.vpe.editor.util.HTML;
+import org.jboss.tools.vpe.rreferences.AbsoluteFolderReferenceList;
+import org.jboss.tools.vpe.rreferences.ResourceReference;
import org.jboss.tools.vpe.ui.test.TestUtil;
import org.jboss.tools.vpe.ui.test.VpeTest;
import org.mozilla.interfaces.nsIDOMDocument;
Modified: trunk/jst/plugins/org.jboss.tools.jst.web/META-INF/MANIFEST.MF
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/META-INF/MANIFEST.MF 2008-08-28 00:57:10 UTC
(rev 9929)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/META-INF/MANIFEST.MF 2008-08-28 01:32:18 UTC
(rev 9930)
@@ -1,19 +1,46 @@
Manifest-Version: 1.0
-Eclipse-LazyStart: true
+Bundle-ManifestVersion: 2
Bundle-Name: Web
Bundle-ClassPath: web.jar
Bundle-Activator: org.jboss.tools.jst.web.WebModelPlugin
Bundle-Vendor: %providerName
Bundle-SymbolicName: org.jboss.tools.jst.web;singleton:=true
Bundle-Localization: plugin
-Provide-Package: org.jboss.tools.common.meta.impl.adapters,
+Require-Bundle: org.jboss.tools.common.model;visibility:=reexport,
+ org.jboss.tools.common.projecttemplates;visibility:=reexport,
+ org.eclipse.jdt.core,
+ org.eclipse.ui,
+ org.eclipse.debug.core,
+ org.eclipse.jdt.launching,
+ org.eclipse.jdt.ui,
+ org.eclipse.debug.ui,
+ org.eclipse.jdt.debug,
+ org.eclipse.wst.server.core,
+ org.eclipse.wst.sse.core,
+ org.eclipse.wst.web,
+ org.eclipse.jst.j2ee.web,
+ org.eclipse.jst.j2ee,
+ org.eclipse.wst.common.frameworks,
+ org.eclipse.jst.server.tomcat.core,
+ org.eclipse.ltk.core.refactoring,
+ org.eclipse.ltk.ui.refactoring,
+ org.eclipse.jst.jsp.core,
+ org.eclipse.wst.xml.core,
+ org.eclipse.core.resources,
+ org.eclipse.pde.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.ant.ui,
+ org.eclipse.ui.externaltools,
+ org.jboss.tools.common.kb,
+ org.eclipse.wst.common.project.facet.core
+Bundle-Version: 2.0.0
+Export-Package:
org.jboss.tools.jst.web,
org.jboss.tools.jst.web.browser,
org.jboss.tools.jst.web.browser.wtp,
org.jboss.tools.jst.web.context,
org.jboss.tools.jst.web.launching.sourcelookup,
org.jboss.tools.jst.web.launching.sourcelookup.xpl,
- org.jboss.tools.jst.web.messages,
org.jboss.tools.jst.web.messages.xpl,
org.jboss.tools.jst.web.model,
org.jboss.tools.jst.web.model.handlers,
@@ -29,45 +56,11 @@
org.jboss.tools.jst.web.project.list,
org.jboss.tools.jst.web.project.version,
org.jboss.tools.jst.web.refactoring,
- org.jboss.tools.jst.web.registration,
org.jboss.tools.jst.web.server,
org.jboss.tools.jst.web.tld,
org.jboss.tools.jst.web.tld.model,
org.jboss.tools.jst.web.tld.model.handlers,
org.jboss.tools.jst.web.tld.model.helpers,
org.jboss.tools.jst.web.tomcat,
- org.jboss.tools.jst.web.util,
org.jboss.tools.jst.web.webapp.model,
org.jboss.tools.jst.web.webapp.model.handlers
-Require-Bundle: org.jboss.tools.common.model;visibility:=reexport,
- org.jboss.tools.common.projecttemplates;visibility:=reexport,
- org.eclipse.jdt.core,
- org.eclipse.ui,
- org.eclipse.debug.core,
- org.eclipse.jdt.launching,
- org.eclipse.jdt.ui,
- org.eclipse.debug.ui,
- org.eclipse.jdt.debug,
- org.eclipse.wst.server.core,
- org.eclipse.wst.sse.core,
- org.eclipse.wst.web,
- org.eclipse.jst.j2ee.web,
- org.eclipse.jst.j2ee,
- org.eclipse.wst.common.frameworks,
- org.eclipse.jst.server.tomcat.core,
- org.eclipse.ltk.core.refactoring,
- org.eclipse.ltk.ui.refactoring,
- org.eclipse.jst.jsp.core,
- org.eclipse.wst.xml.core,
- org.eclipse.core.resources,
- org.eclipse.pde.ui,
- org.eclipse.core.runtime,
- org.eclipse.ant.ui,
- org.eclipse.ui.externaltools,
- org.jboss.tools.common.kb,
- org.eclipse.wst.common.project.facet.core,
- org.jboss.tools.common.model.ui
-Bundle-Version: 2.0.0
-Export-Package: org.jboss.tools.jst.web.el,
- org.jboss.tools.jst.web.rreferences
-
Deleted:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/messages/Messages.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/messages/Messages.java 2008-08-28
00:57:10 UTC (rev 9929)
+++
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/messages/Messages.java 2008-08-28
01:32:18 UTC (rev 9930)
@@ -1,44 +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.jst.web.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.jst.web.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;
-}
Deleted:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/messages/messages.properties
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/messages/messages.properties 2008-08-28
00:57:10 UTC (rev 9929)
+++
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/messages/messages.properties 2008-08-28
01:32:18 UTC (rev 9930)
@@ -1,175 +0,0 @@
-CANNOT_RUN_SELECTION_WITHOUT_AVAILABLE_SERVER=Cannot run selection without available
server
-CANNOT_FIND_PROJECT_VERSIONS_DESCRIPTORFILE=Cannot find project versions descriptor file
-CANNOT_PARSE_PROJECT_VERSIONS_DESCRIPTORFILE=Cannot parse project versions descriptor
file
-CANNOT_READ_PROJECT_VERSIONS_DESCRIPTORFILE=Cannot read project versions descriptor file
-PLEASE_CREATE_A_SERVER_AND_SELECT_IT_ON_TOOLBAR=Please create a server and select it on
toolbar.
-WARNING=Warning
-WARNING=Warning
-CLOSE=Close
-ERROR=Error
-INCORRECT_URL=Incorrect URL: {0}.
-OK=OK
-APPLICATION_ISNOT_REGISTERED_IN_SELECTED_SERVER=Application {0} is not registered in
selected server.
-FILE_DOESNOT_EXIST=File does not exist.
-FILE_DOESNOT_EXIST_P=File {0} does not exist
-FILE_ISNOT_CORRECT=File {0} is not correct *.war file.
-FILE_ISNOT_RECOGNIZED=File {0} is not recognized as web descriptor file.
-FILE_DOESNOT_CONTAIN_WEBXML=File {0} does not contain web.xml.
-FILE_DOMAINXML_IS_CORRUPTED=File domain.xml is corrupted.
-FILE_ISNOT_RECOGNIZED_AS_WEBDESCRIPTOR_FILE=File is not recognized as web descriptor
file.
-WAR_LOCATION_MUST_BE_SET=*.war location must be set.
-CANNOT_READ_WEBXML=Cannot read web.xml from {0}.
-CANNOT_START_SERVER=Cannot start server:
-CANNOT_FIND_TOOLSJAR=Cannot find tools.jar for the specified jvm environment. It may
result in jsp compilation problems.
-NAME_MUST_BE_SET=Name must be set.
-PROJECT_ALREADY_EXISTS_IN_THE_WORKSPACE=Project {0} already exists in the workspace.
-CANNOT_LOAD_WEBDESCRIPTOR=Cannot load web descriptor file {0}.
-WEBDESCRIPTOR_FILE_IS_CORRUPTED=Web descriptor file is corrupted {0}.
-SERVLET_VERSION_WARNING=Servlet version is not consistent with web.xml version.
-SERVLET_VERSION_ISNOT_CONSISTENT_WITH_WEBXML_VERSION=You have selected a different
servlet version than in project's web.xml file. Click Yes if you would like to convert
the current web.xml file to servlet version {0}. Please note that during conversion you
might lose some web.xml information that is not available in the new version as well as
formatting or comments.
-SAVE_OLD_SERVLET=Do you want to save a copy of your current web.xml file? It will be
saved as web.xml.{0}.old
-J2EE_ROOT_DIRECTORY_ISNOT_FOUND=J2ee root directory is not found.
-DOMAINS_DIRECTORY_ISNOT_FOUND=Domains directory is not found.
-DOMAIN_ISNOT_FOUND=Domain {0} is not found
-CONFIGURATION_FILE_DOMAINXML_ISNOT_FOUND=Configuration file domain.xml is not found.
-CONFIGURATION_FILE_DOMAINXML_IS_READONLY=Configuration file domain.xml is read-only.
-DOCUMENT_DOMAINXML_MUST_HAVE_ELEMENT_DOMAIN=Document domain.xml must have element
'domain' as root element.
-RUNTIME_IS_REQUIRED=Runtime is required.
-SPECIFIED_RUNTIME_DOESNOT_EXIST=Specified runtime does not exist.
-SPECIFIED_FOLDER_DOESNOT_EXIST=Specified folder does not exist.
-SPECIFIED_FOLDER_ISNOT_JVMHOME=Specified folder is not JVM home.
-APPLICATION_IS_ALREADY_REGISTERED=Application {0} is already registered in {1}
-APPLICATION_IS_ALREADY_REGISTERED=Application is already registered.
-APPLICATION_HAS_BEEN_UNREGISTERED_FROM=Application {0} has been unregistered from {1}.
-SERVERS_DIRECTORY_ISNOT_FOUND=Servers directory is not found.
-SERVER_ISNOT_FOUND=Server {0} is not found
-SERVER_ISNOT_SELECTED=Server is not selected.
-ITEM_ISNOT_REFERENCED=This item is not referenced.
-CANCEL=Cancel
-CANCEL=Cancel
-DELETE_REFERENCE_FROM_WEBDESCRIPTOR=Delete reference from web descriptor
-DELETE_REFERENCE_FROM_STRUTS_CONFIGURATION_FILE=Delete reference from struts
configuration file
-DELETE=Delete
-MESSAGE=Message
-LIBRARY_SET_IS_ALREADY_ADDED=Library set {0} is already added.
-LIBRARY_SET_ALREADY_EXISTS=Library set {0} already exists.
-LIBRARY_SET_ISNOT_FOUND=Library set {0} is not found.
-LIBRARYSET_CONTAINS=Library set contains {0}. Do you want to replace it?
-PROJECT_TEMPLATE_ALREADY_EXISTS=Project template {0} already exists.
-PROJECT_EXISTS_IN_WORKSPACE=Project {0} exists in workspace and is closed. To use the
project, please open it.
-LIBRARY_SET_NAME_MUST_BE_A_VALID_FOLDERNAME=Library set name must be a valid folder
name.
-LIBRARY_SET_NAME_MUST_BE_A_VALID_FOLDER_NAME=Library set name must be a valid folder
name.
-MUST_NOT_CONTAIN_CHARACTER=Library set name must be a valid folder name. It must not
contain character {0} .
-TEMPLATE_PAGE_ALREADY_EXISTS=Template page {0} already exists.
-PAGE_PATH_ISNOT_CORRECT=Page path is not correct.
-IMPLEMENTATION_ALREADY_EXISTS=Implementation {0} already exists.
-DEFINE_COMMON_TEMPLATE_PROPERTIES=Define Common Template Properties
-SELECT_FOLDERS_AND_FILES=Select Folders and Files
-SELECT_FILES_THAT_ARE_VELOCITY_TEMPLATES=Select Files That Are Velocity Templates
-SET_VELOCITY_PROPERTIES=Set Velocity Properties
-CANNOT_CREATE_TEMPLATE_FOR_PROJECT=Cannot create template for project {0}.
-CANNOT_FIND_MODULE_FOR_THE_PROJECT=Cannot find module for the project.
-CANNOT_REGISTER_IN_THIS_SERVER=Cannot register in this server.
-YOU_WANT_TO_DELETE_TEMPLATE=Do you want to delete template {0} from {1}?
-YOU_WANT_TO_DELETE_PAGE_TEMPLATE=Do you want to delete page template {0}?
-YOU_WANT_TO_DELETE_FROM_LIBRARYSET=Do you want to delete {0} from library set {1}?
-YOU_WANT_TO_DELETE_IMPLEMENTATION=Do you want to delete implementation {0}?
-YOU_WANT_TO_SET_CORRECT_VALUE_NOW=Do you want to set correct value now?
-YOU_WANT_TO_DELETE_LIBRARYSET=Do you want to delete library set {0}?
-YOU_WANT_TO_DELETE_LIBRARY=Do you want to delete library {0}?
-YOU_WANT_TO_DELETE_LINK_TO=Do you want to delete link to
-YOU_WANT_CO_CONVERT_WEBXML=\ Do you want co convert web.xml?
-YOU_WANT_TO_REARRANGE_THE_DIAGRAM_ELEMENTS=Are you sure, you want to rearrange the
diagram elements?
-CONFIRMATION=Confirmation
-CORE_LIBRARY_LOCATION_ISNOT_SET_FOR_VERSION=Core library location is not set for version
{0}.
-CORE_LIBRARY_LOCATION_FOR_VERSION_ISNOT_CORRECT=Core library location for version {0} is
not correct.
-COMMON_LIBRARY_LOCATION_FOR_VERSION_ISNOT_CORRECT=Common library location for version {0}
is not correct.
-TEMPLATES_LOCATION_ISNOT_SET_FOR_VERSION=Templates location is not set for version {0}.
-TEMPLATES_LOCATION_FOR_VERSION_ISNOT_CORRECT=Templates location for version {0} is not
correct.
-WEBXML_CHANGES=Web.xml Changes
-JSP_REFACTORING=JSP refactoring
-DELETE_VALIDATOR_NODE_FROM_XML=Delete <validator> node from xml?
-PARENT_GROUP_MUST_BE_SPECIFIED=Parent group must be specified.
-PALETTE_ALREADY_CONTAINS_TAB=Palette already contains tab {0}.
-PALETTE_ALREADY_CONTAINS_TAB_2P=Palette already contains tab {0} {1}.
-PATH_TO_TLD_ISNOT_CORRECT=Path to tld is not correct.
-PATH_TO_JVM_IS_EMPTY=Path to JVM is empty.
-START_TOMCAT_SERVER=Start Tomcat Server
-START_TOMCAT_SERVER=Start Tomcat Server
-START_IN_DEBUG_MODE=Start {0} in Debug Mode
-ROOT_ISNOT_FOUND=J2EE 1.4 SDK root is not found.\n
-EITHER_OR_MUST_BE_SET=Either {0} or {1} must be set
-YOU_MAY_SET_ONLY_ONE=You may set only one of {0} and {1} attributes
-ADD_JSP_BREAKPOINT=Add JSP Breakpoint
-REMOVE_JSP_BREAKPOINT=Remove JSP Breakpoint
-NOT_RESOLVED=Not Resolved
-VALUE_NOT_RESOLVED== Value Not Resolved
-STRUTS=Struts
-EDIT_FILTER=Edit Filter
-ENTER_NEW_FILTER=Enter new filter
-TILES_EDITOR=Tiles Editor
-DIAGRAM=Diagram
-PRINT_DIAGRAM=Print Diagram
-PRINT_PREVIEW=Print Preview
-TILES_CONFIG_DESCRIPTION=Tiles Config Description
-DEFINITIONS=Definitions
-BASIC=Basic
-ADVANCED=Advanced
-DEPRECATED=Deprecated
-PUT=Put
-PUTLIST=Putlist
-ATTRIBUTES=Attributes
-ADD=Add
-ITEM=Item
-BEAN=Bean
-SET_PROPERTIES=Set-properties
-SELECTED_PAGES=Selected Pages
-SECURITY_ROLES=Security Roles
-SECURITY_CONSTRAINT=Security Constraint
-SET_PROPERTY=Set-property
-STRUTS_MODEL=Struts Model
-START_SERVER=Start {0} Server {1}
-PRINT=Print
-ZOOM=Zoom
-ALL=All
-SELECT_ALL=Select All
-UNSELECT_ALL=Unselect All
-REFRESH=Refresh
-STOP=Stop
-RUNTIME_REFERENCED_HAS_BEEN_REMOVED=Runtime referenced by the server has been removed.
Please create the runtime or select another server.
-RUN_SERVER=Run Server
-RUN=Run
-START=Start
-REFRESH_SERVER=Refresh {0} Server
-CHANGE_TIME_STAMP=Change Timestamp of
-STOP_SERVER=Stop {0} Server
-START_SERVER_IN_DEBUG_MODE=Start {0} Server in Debug Mode: {1}
-REDHAT_TAG_LIBRARY_EDITOR=JBoss Tools Tag Library Editor
-SERVLET=Servlet
-AUTH_CONSTRAINT=Auth Constraint
-TAGLIBS=Taglibs
-PROPERTY_GROUPS=Property Groups
-JSP_CONFIG=JSP Config
-PROPERTY_GROUP=Property Group
-PROJECT_EXISTS=Project {0} exists. The wizard will try to make it {1} project.
-INITPARAMS=Init Params
-FILTER=Filter
-RESOURCE_COLLECTIONS=Resource Collections
-LOCALE_ENCODING_MAPPINGS=Locale Encoding Mappings
-WELCOME_FILES=Welcome Files
-CONTEXT_IS_ALREADY_REGISTERED_IN_SERVERXML=Context {0} is already registered in
server.xml. Do you want to overwrite it?
-REGISTERING_WEB_CONTEXT_IN_SERVERXML=Registering Web Context in server.xml
-YES=Yes
-YES=Yes
-NO=No
-NO=No
-ADD_TO_EXISTING_GROUP=Add to Existing Group
-CREATE_NEW_GROUP=Create New Group
-JAVA_PROJECT_EXISTS=Java project {0} exists. The wizard will make it {1} project
-CHECK_JVM=Check JVM
-CONTEXT_ROOT_CANNOT_CONTAIN_CHARACTER=Context root cannot contain character {0}.
-WEB_RESOURCES=Web Resources
-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
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/META-INF/MANIFEST.MF 2008-08-28 00:57:10
UTC (rev 9929)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/META-INF/MANIFEST.MF 2008-08-28 01:32:18
UTC (rev 9930)
@@ -6,7 +6,8 @@
Bundle-Vendor: %providerName
Bundle-SymbolicName: org.jboss.tools.jst.web.ui;singleton:=true
Bundle-Localization: plugin
-Provide-Package: org.jboss.tools.jst.web.ui.internal.preferences,
+Provide-Package: org.jboss.tools.common.model.ui.texteditors.preferences,
+ org.jboss.tools.jst.jsp.jspeditor.jsppreview,
org.jboss.tools.jst.web.ui,
org.jboss.tools.jst.web.ui.action,
org.jboss.tools.jst.web.ui.action.adf,
@@ -14,20 +15,20 @@
org.jboss.tools.jst.web.ui.attribute.adapter,
org.jboss.tools.jst.web.ui.editors,
org.jboss.tools.jst.web.ui.editors.forms,
+ org.jboss.tools.jst.web.ui.editors.webapp.form,
+ org.jboss.tools.jst.web.ui.internal.preferences,
+ org.jboss.tools.jst.web.ui.messages,
org.jboss.tools.jst.web.ui.navigator,
org.jboss.tools.jst.web.ui.navigator.decorator,
org.jboss.tools.jst.web.ui.operation,
+ org.jboss.tools.jst.web.ui.registration,
org.jboss.tools.jst.web.ui.wizards.appregister,
org.jboss.tools.jst.web.ui.wizards.links,
org.jboss.tools.jst.web.ui.wizards.newfile,
org.jboss.tools.jst.web.ui.wizards.palette,
org.jboss.tools.jst.web.ui.wizards.process,
org.jboss.tools.jst.web.ui.wizards.project,
- org.jboss.tools.jst.web.ui.registration,
org.jboss.tools.jst.web.ui.wizards.tomcatvm,
- org.jboss.tools.jst.jsp.jspeditor.jsppreview,
- org.jboss.tools.common.model.ui.texteditors.preferences,
- org.jboss.tools.jst.web.ui.editors.webapp.form,
org.jboss.tools.vpe
Require-Bundle: org.jboss.tools.common,
org.eclipse.ui.ide,
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.ui/plugin.xml
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/plugin.xml 2008-08-28 00:57:10 UTC (rev
9929)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/plugin.xml 2008-08-28 01:32:18 UTC (rev
9930)
@@ -41,8 +41,6 @@
<extension point="org.eclipse.ui.preferencePages">
<page category="org.jboss.tools.common.model.ui"
class="org.jboss.tools.jst.web.ui.internal.preferences.LibrarySetsPreferencePage"
id="org.jboss.tools.common.xstudio.libsets" name="Library Sets">
</page>
- <page category="org.jboss.tools.common.model.ui"
class="org.jboss.tools.jst.web.ui.internal.preferences.ELVariablesPreferencePage"
id="org.jboss.tools.common.xstudio.elvariables" name="El
Variables">
- </page>
</extension>
<extension point="org.eclipse.ui.editors">
<editor
Deleted:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/ELVariablesPreferencePage.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/ELVariablesPreferencePage.java 2008-08-28
00:57:10 UTC (rev 9929)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/ELVariablesPreferencePage.java 2008-08-28
01:32:18 UTC (rev 9930)
@@ -1,123 +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.jst.web.ui.internal.preferences;
-
-import java.util.Properties;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.preference.PreferencePage;
-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.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.jboss.tools.common.model.options.PreferenceModelUtilities;
-import org.jboss.tools.jst.web.el.GlobalElVariablesComposite;
-import org.jboss.tools.jst.web.rreferences.ResourceReference;
-import org.jboss.tools.jst.web.rreferences.VpeResourcesDialog;
-
-/**
- * Page for the El preferences.
- *
- * @author Evgenij Stherbin
- */
-public class ELVariablesPreferencePage extends PreferencePage implements
IWorkbenchPreferencePage {
-
-
- private static final ResourceReference[] EMPTY_RESOURCE = new ResourceReference[0];
- /** The el. */
- private GlobalElVariablesComposite el = new GlobalElVariablesComposite();
-
- @Override
- protected void performApply() {
- super.performApply();
- this.performOk();
- }
-
- @Override
- protected void performDefaults() {
- super.performDefaults();
- el.clearAll();
- el.update();
- }
-
- /**
- * Creates the contents.
- *
- * @param parent the parent
- *
- * @return the control
- *
- * @see
org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
- */
- @Override
- protected Control createContents(Composite parent) {
-
- GridData data;
- Composite c = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout(1, false);
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- c.setLayout(layout);
-
- setUpVariableComposite(el);
- data = new GridData(GridData.FILL_BOTH);
- final Control elControl = el.createControl(c);
- elControl.setLayoutData(data);
-
- return c;
- }
-
- /**
- * Perform ok.
- *
- * @return true, if perform ok
- */
- @Override
- public boolean performOk() {
- boolean rst = super.performOk();
-
- el.commit();
- return rst;
- }
-
- /**
- * Sets the up variable composite.
- *
- * @param el the el
- */
- private void setUpVariableComposite(GlobalElVariablesComposite el){
- final VpeResourcesDialog dialog = new VpeResourcesDialog();
- final Properties p = new Properties();
-
- p.setProperty("help", "VpeResourcesDialog"); //$NON-NLS-1$
//$NON-NLS-2$
- p.put("path", Platform.getLocation()); //$NON-NLS-1$
- p.put("model", PreferenceModelUtilities.getPreferenceModel());
//$NON-NLS-1$
- dialog.setObject(p);
- el.setObject(p);
- }
-
- /**
- * Init.
- *
- * @param workbench the workbench
- *
- * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
- */
- public void init(IWorkbench workbench) {
- // TODO Auto-generated method stub
-
- }
-
-}
Modified: trunk/jst/tests/org.jboss.tools.jst.jsp.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.jsp.test/META-INF/MANIFEST.MF 2008-08-28 00:57:10
UTC (rev 9929)
+++ trunk/jst/tests/org.jboss.tools.jst.jsp.test/META-INF/MANIFEST.MF 2008-08-28 01:32:18
UTC (rev 9930)
@@ -17,6 +17,7 @@
org.jboss.tools.common.text.ext,
org.jboss.tools.jst.web,
org.jboss.tools.vpe.ui.test
-Export-Package: org.jboss.tools.jst.jsp.test,
+Export-Package:
+ org.jboss.tools.jst.jsp.test,
org.jboss.tools.jst.jsp.test.ca
Bundle-ClassPath: jst-jsp-test.jar
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/META-INF/MANIFEST.MF
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/META-INF/MANIFEST.MF 2008-08-28 00:57:10 UTC
(rev 9929)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/META-INF/MANIFEST.MF 2008-08-28 01:32:18 UTC
(rev 9930)
@@ -6,7 +6,9 @@
Bundle-Vendor: %providerName
Bundle-SymbolicName: org.jboss.tools.vpe;singleton:=true
Bundle-Localization: plugin
-Provide-Package: org.jboss.tools.vpe,
+Provide-Package: meta,
+ org.jboss.tools.vpe,
+ org.jboss.tools.vpe.dnd,
org.jboss.tools.vpe.editor,
org.jboss.tools.vpe.editor.bundle,
org.jboss.tools.vpe.editor.context,
@@ -14,8 +16,10 @@
org.jboss.tools.vpe.editor.dnd,
org.jboss.tools.vpe.editor.dnd.composite,
org.jboss.tools.vpe.editor.dnd.context,
+ org.jboss.tools.vpe.editor.dnd.context.xpl,
org.jboss.tools.vpe.editor.mapping,
org.jboss.tools.vpe.editor.menu,
+ org.jboss.tools.vpe.editor.menu.xpl,
org.jboss.tools.vpe.editor.mozilla,
org.jboss.tools.vpe.editor.preferences,
org.jboss.tools.vpe.editor.selection,
@@ -29,7 +33,12 @@
org.jboss.tools.vpe.editor.toolbar.format.css,
org.jboss.tools.vpe.editor.toolbar.format.handler,
org.jboss.tools.vpe.editor.util,
- org.jboss.tools.vpe.messages,meta
+ org.jboss.tools.vpe.editor.xpl,
+ org.jboss.tools.vpe.el,
+ org.jboss.tools.vpe.el.messages,
+ org.jboss.tools.vpe.messages,
+ org.jboss.tools.vpe.rreferences,
+ org.jboss.tools.vpe.selbar
Require-Bundle: org.jboss.tools.common.model.ui,
org.eclipse.jface.text,
org.eclipse.jdt.core,
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/plugin.xml
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/plugin.xml 2008-08-28 00:57:10 UTC (rev 9929)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/plugin.xml 2008-08-28 01:32:18 UTC (rev 9930)
@@ -28,11 +28,17 @@
/>
</extension>
<extension point="org.jboss.tools.common.model.classes">
- <xclass
id="org.jboss.tools.jst.web.rreferences.VpeAddReferenceSupport"
- class="org.jboss.tools.jst.web.rreferences.VpeAddReferenceSupport"/>
+ <xclass
id="org.jboss.tools.jst.web.ui.rreferences.VpeAddReferenceSupport"
+ class="org.jboss.tools.vpe.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>
+ <page
+ category="org.jboss.tools.common.model.ui"
+
class="org.jboss.tools.vpe.editor.preferences.ELVariablesPreferencePage"
+ id="org.jboss.tools.common.xstudio.elvariables"
+ name="El Variables">
+ </page>
</extension>
<extension
point="org.eclipse.ui.contexts">
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-28
00:57:10 UTC (rev 9929)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2008-08-28
01:32:18 UTC (rev 9930)
@@ -109,12 +109,6 @@
import org.jboss.tools.jst.jsp.editor.IJSPTextEditor;
import org.jboss.tools.jst.jsp.editor.IVisualController;
import org.jboss.tools.jst.jsp.preferences.VpePreference;
-import org.jboss.tools.jst.web.el.ELReferenceList;
-import org.jboss.tools.jst.web.rreferences.AbsoluteFolderReferenceList;
-import org.jboss.tools.jst.web.rreferences.CSSReferenceList;
-import org.jboss.tools.jst.web.rreferences.RelativeFolderReferenceList;
-import org.jboss.tools.jst.web.rreferences.ResourceReferenceListListener;
-import org.jboss.tools.jst.web.rreferences.TaglibReferenceList;
import org.jboss.tools.jst.web.tld.TLDToPaletteHelper;
import org.jboss.tools.jst.web.tld.TLDUtil;
import org.jboss.tools.jst.web.tld.URIConstants;
@@ -148,7 +142,13 @@
import org.jboss.tools.vpe.editor.util.SelectionUtil;
import org.jboss.tools.vpe.editor.util.VisualDomUtil;
import org.jboss.tools.vpe.editor.util.VpeDndUtil;
+import org.jboss.tools.vpe.el.ELReferenceList;
import org.jboss.tools.vpe.messages.VpeUIMessages;
+import org.jboss.tools.vpe.rreferences.AbsoluteFolderReferenceList;
+import org.jboss.tools.vpe.rreferences.CSSReferenceList;
+import org.jboss.tools.vpe.rreferences.RelativeFolderReferenceList;
+import org.jboss.tools.vpe.rreferences.ResourceReferenceListListener;
+import org.jboss.tools.vpe.rreferences.TaglibReferenceList;
import org.jboss.tools.vpe.selbar.SelectionBar;
import org.jboss.tools.vpe.xulrunner.browser.util.DOMTreeDumper;
import org.jboss.tools.vpe.xulrunner.editor.XulRunnerEditor;
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2008-08-28
00:57:10 UTC (rev 9929)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2008-08-28
01:32:18 UTC (rev 9930)
@@ -45,8 +45,6 @@
import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.jst.jsp.preferences.VpePreference;
import org.jboss.tools.jst.web.model.helpers.WebAppHelper;
-import org.jboss.tools.jst.web.rreferences.CSSReferenceList;
-import org.jboss.tools.jst.web.rreferences.ResourceReference;
import org.jboss.tools.vpe.VpeDebug;
import org.jboss.tools.vpe.VpePlugin;
import org.jboss.tools.vpe.dnd.VpeDnD;
@@ -74,6 +72,8 @@
import org.jboss.tools.vpe.editor.util.TextUtil;
import org.jboss.tools.vpe.editor.util.VisualDomUtil;
import org.jboss.tools.vpe.editor.util.VpeStyleUtil;
+import org.jboss.tools.vpe.rreferences.CSSReferenceList;
+import org.jboss.tools.vpe.rreferences.ResourceReference;
import org.jboss.tools.vpe.xulrunner.editor.XulRunnerEditor;
import org.jboss.tools.vpe.xulrunner.editor.XulRunnerVpeUtils;
import org.mozilla.interfaces.nsIDOMAttr;
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/context/VpePageContext.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/context/VpePageContext.java 2008-08-28
00:57:10 UTC (rev 9929)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/context/VpePageContext.java 2008-08-28
01:32:18 UTC (rev 9930)
@@ -30,11 +30,6 @@
import org.jboss.tools.common.kb.wtp.WtpKbConnector;
import org.jboss.tools.jst.jsp.editor.IVisualContext;
import org.jboss.tools.jst.jsp.preferences.VpePreference;
-import org.jboss.tools.jst.web.rreferences.AbsoluteFolderReferenceList;
-import org.jboss.tools.jst.web.rreferences.CSSReferenceList;
-import org.jboss.tools.jst.web.rreferences.RelativeFolderReferenceList;
-import org.jboss.tools.jst.web.rreferences.ResourceReference;
-import org.jboss.tools.jst.web.rreferences.TaglibReferenceList;
import org.jboss.tools.jst.web.tld.TaglibData;
import org.jboss.tools.jst.web.tld.VpeTaglibListener;
import org.jboss.tools.vpe.VpePlugin;
@@ -46,6 +41,11 @@
import org.jboss.tools.vpe.editor.template.VpeTemplateManager;
import org.jboss.tools.vpe.editor.util.FileUtil;
import org.jboss.tools.vpe.editor.util.XmlUtil;
+import org.jboss.tools.vpe.rreferences.AbsoluteFolderReferenceList;
+import org.jboss.tools.vpe.rreferences.CSSReferenceList;
+import org.jboss.tools.vpe.rreferences.RelativeFolderReferenceList;
+import org.jboss.tools.vpe.rreferences.ResourceReference;
+import org.jboss.tools.vpe.rreferences.TaglibReferenceList;
import org.mozilla.interfaces.nsIDOMNode;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java 2008-08-28
00:57:10 UTC (rev 9929)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java 2008-08-28
01:32:18 UTC (rev 9930)
@@ -48,7 +48,6 @@
import org.eclipse.ui.browser.IWorkbenchBrowserSupport;
import org.eclipse.ui.editors.text.ILocationProvider;
import org.eclipse.ui.part.EditorPart;
-import org.jboss.tools.jst.web.rreferences.VpeResourcesDialog;
import org.jboss.tools.vpe.VpePlugin;
import org.jboss.tools.vpe.editor.VpeController;
import org.jboss.tools.vpe.editor.preferences.VpeEditorPreferencesPage;
@@ -59,6 +58,7 @@
import org.jboss.tools.vpe.editor.util.DocTypeUtil;
import org.jboss.tools.vpe.editor.util.HTML;
import org.jboss.tools.vpe.messages.VpeUIMessages;
+import org.jboss.tools.vpe.rreferences.VpeResourcesDialog;
import org.jboss.tools.vpe.xulrunner.XPCOM;
import org.jboss.tools.vpe.xulrunner.XulRunnerException;
import org.jboss.tools.vpe.xulrunner.editor.XulRunnerEditor;
Added:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/preferences/ELVariablesPreferencePage.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/preferences/ELVariablesPreferencePage.java
(rev 0)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/preferences/ELVariablesPreferencePage.java 2008-08-28
01:32:18 UTC (rev 9930)
@@ -0,0 +1,123 @@
+/*******************************************************************************
+ * 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.preferences;
+
+import java.util.Properties;
+
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jface.preference.PreferencePage;
+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.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.jboss.tools.common.model.options.PreferenceModelUtilities;
+import org.jboss.tools.vpe.el.GlobalElVariablesComposite;
+import org.jboss.tools.vpe.rreferences.ResourceReference;
+import org.jboss.tools.vpe.rreferences.VpeResourcesDialog;
+
+/**
+ * Page for the El preferences.
+ *
+ * @author Evgenij Stherbin
+ */
+public class ELVariablesPreferencePage extends PreferencePage implements
IWorkbenchPreferencePage {
+
+
+ private static final ResourceReference[] EMPTY_RESOURCE = new ResourceReference[0];
+ /** The el. */
+ private GlobalElVariablesComposite el = new GlobalElVariablesComposite();
+
+ @Override
+ protected void performApply() {
+ super.performApply();
+ this.performOk();
+ }
+
+ @Override
+ protected void performDefaults() {
+ super.performDefaults();
+ el.clearAll();
+ el.update();
+ }
+
+ /**
+ * Creates the contents.
+ *
+ * @param parent the parent
+ *
+ * @return the control
+ *
+ * @see
org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
+ protected Control createContents(Composite parent) {
+
+ GridData data;
+ Composite c = new Composite(parent, SWT.NONE);
+ GridLayout layout = new GridLayout(1, false);
+ layout.marginWidth = 0;
+ layout.marginHeight = 0;
+ c.setLayout(layout);
+
+ setUpVariableComposite(el);
+ data = new GridData(GridData.FILL_BOTH);
+ final Control elControl = el.createControl(c);
+ elControl.setLayoutData(data);
+
+ return c;
+ }
+
+ /**
+ * Perform ok.
+ *
+ * @return true, if perform ok
+ */
+ @Override
+ public boolean performOk() {
+ boolean rst = super.performOk();
+
+ el.commit();
+ return rst;
+ }
+
+ /**
+ * Sets the up variable composite.
+ *
+ * @param el the el
+ */
+ private void setUpVariableComposite(GlobalElVariablesComposite el){
+ final VpeResourcesDialog dialog = new VpeResourcesDialog();
+ final Properties p = new Properties();
+
+ p.setProperty("help", "VpeResourcesDialog"); //$NON-NLS-1$
//$NON-NLS-2$
+ p.put("path", Platform.getLocation()); //$NON-NLS-1$
+ p.put("model", PreferenceModelUtilities.getPreferenceModel());
//$NON-NLS-1$
+ dialog.setObject(p);
+ el.setObject(p);
+ }
+
+ /**
+ * Init.
+ *
+ * @param workbench the workbench
+ *
+ * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
+ */
+ public void init(IWorkbench workbench) {
+ // TODO Auto-generated method stub
+
+ }
+
+}
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-28
00:57:10 UTC (rev 9929)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionSrc.java 2008-08-28
01:32:18 UTC (rev 9930)
@@ -31,12 +31,12 @@
import org.jboss.tools.common.model.project.IModelNature;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.jst.web.project.WebProject;
-import org.jboss.tools.jst.web.rreferences.ResourceReference;
import org.jboss.tools.jst.web.tld.IFilePathEncoder;
import org.jboss.tools.vpe.VpePlugin;
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.template.VpeCreatorUtil;
import org.jboss.tools.vpe.editor.util.ElService;
+import org.jboss.tools.vpe.rreferences.ResourceReference;
import org.w3c.dom.Node;
public class VpeFunctionSrc extends VpeFunction {
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/ElService.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/ElService.java 2008-08-28
00:57:10 UTC (rev 9929)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/ElService.java 2008-08-28
01:32:18 UTC (rev 9930)
@@ -16,11 +16,11 @@
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Platform;
-import org.jboss.tools.jst.web.el.ELReferenceList;
-import org.jboss.tools.jst.web.el.GlobalELReferenceList;
-import org.jboss.tools.jst.web.rreferences.ResourceReference;
import org.jboss.tools.vpe.editor.bundle.BundleMap;
import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.el.ELReferenceList;
+import org.jboss.tools.vpe.el.GlobalELReferenceList;
+import org.jboss.tools.vpe.rreferences.ResourceReference;
import org.w3c.dom.Attr;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/FileUtil.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/FileUtil.java 2008-08-28
00:57:10 UTC (rev 9929)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/FileUtil.java 2008-08-28
01:32:18 UTC (rev 9930)
@@ -32,10 +32,10 @@
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.project.IModelNature;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
-import org.jboss.tools.jst.web.rreferences.AbsoluteFolderReferenceList;
-import org.jboss.tools.jst.web.rreferences.RelativeFolderReferenceList;
-import org.jboss.tools.jst.web.rreferences.ResourceReference;
import org.jboss.tools.vpe.VpePlugin;
+import org.jboss.tools.vpe.rreferences.AbsoluteFolderReferenceList;
+import org.jboss.tools.vpe.rreferences.RelativeFolderReferenceList;
+import org.jboss.tools.vpe.rreferences.ResourceReference;
public class FileUtil {
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/VpeStyleUtil.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/VpeStyleUtil.java 2008-08-28
00:57:10 UTC (rev 9929)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/VpeStyleUtil.java 2008-08-28
01:32:18 UTC (rev 9930)
@@ -26,11 +26,11 @@
import org.jboss.tools.common.model.project.IModelNature;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.jst.web.project.WebProject;
-import org.jboss.tools.jst.web.rreferences.ResourceReference;
import org.jboss.tools.vpe.VpePlugin;
import org.jboss.tools.vpe.editor.VpeVisualDomBuilder;
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.mapping.VpeElementMapping;
+import org.jboss.tools.vpe.rreferences.ResourceReference;
import org.mozilla.interfaces.nsIDOMNode;
import org.mozilla.interfaces.nsIDOMNodeList;
import org.w3c.dom.Element;
Added:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/el/ELReferenceList.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/el/ELReferenceList.java
(rev 0)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/el/ELReferenceList.java 2008-08-28
01:32:18 UTC (rev 9930)
@@ -0,0 +1,36 @@
+package org.jboss.tools.vpe.el;
+
+
+import org.eclipse.core.runtime.QualifiedName;
+import org.jboss.tools.vpe.rreferences.ResourceReferenceList;
+
+
+/**
+ * The Class ELReferenceList.
+ */
+public class ELReferenceList extends ResourceReferenceList {
+
+ /** The PROPERT y_ NAME. */
+ private static QualifiedName PROPERTY_NAME = new QualifiedName("",
"org.jboss.tools.vpe.editor.css.ELReference");
+
+ /** The instance. */
+ static ELReferenceList instance = new ELReferenceList();
+
+ /**
+ * Gets the instance.
+ *
+ * @return the instance
+ */
+ public static ELReferenceList getInstance() {
+ return instance;
+ }
+
+ /**
+ * Gets the property name.
+ *
+ * @return the property name
+ */
+ protected QualifiedName getPropertyName() {
+ return PROPERTY_NAME;
+ }
+}
Added:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/el/ElVariablesComposite.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/el/ElVariablesComposite.java
(rev 0)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/el/ElVariablesComposite.java 2008-08-28
01:32:18 UTC (rev 9930)
@@ -0,0 +1,58 @@
+package org.jboss.tools.vpe.el;
+
+import java.util.List;
+
+import org.jboss.tools.vpe.el.messages.Messages;
+import org.jboss.tools.vpe.rreferences.ResourceReferenceList;
+import org.jboss.tools.vpe.rreferences.ResourceReferencesComposite;
+import org.jboss.tools.vpe.rreferences.ResourceReferencesTableProvider;
+
+/**
+ * The Class ElVariablesComposite.
+ */
+public class ElVariablesComposite extends ResourceReferencesComposite {
+
+ /**
+ * Creates the table provider.
+ *
+ * @param dataList the data list
+ * g
+ * @return the resource references table provider
+ */
+ @Override
+ protected ResourceReferencesTableProvider createTableProvider(List dataList) {
+ return ResourceReferencesTableProvider.getELTableProvider(dataList);
+ };
+
+
+ /**
+ * Gets the entity.
+ *
+ * @return the entity
+ */
+ @Override
+ protected String getEntity() {
+ return (file != null) ? "VPEElReference" :
"VPEElReferenceExt";
+ }
+
+ /**c
+ * Gets the reference list.
+ *
+ * @return the reference list
+ */
+ @Override
+ protected ResourceReferenceList getReferenceList() {
+ return ELReferenceList.getInstance();
+ }
+
+ /**
+ * @see ResourceReferencesComposite#createGroupLabel()
+ */
+ @Override
+ protected String createGroupLabel() {
+ return Messages.SUBSTITUTED_EL_EXPRESSIONS;
+ }
+
+
+
+}
Added:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/el/GlobalELReferenceList.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/el/GlobalELReferenceList.java
(rev 0)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/el/GlobalELReferenceList.java 2008-08-28
01:32:18 UTC (rev 9930)
@@ -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.vpe.el;
+
+import org.eclipse.core.runtime.QualifiedName;
+import org.jboss.tools.vpe.rreferences.ResourceReferenceList;
+
+/**
+ * @author Evgenij Stherbin
+ *
+ */
+public class GlobalELReferenceList extends ResourceReferenceList {
+ /** The PROPERT y_ NAME. */
+ private static QualifiedName PROPERTY_NAME = new QualifiedName("",
"org.jboss.tools.vpe.editor.css.GlobalELReference");
+
+ /** The instance. */
+ private static GlobalELReferenceList instance = new GlobalELReferenceList();
+
+ /**
+ * Gets the instance.
+ *
+ * @return the instance
+ */
+ public synchronized static GlobalELReferenceList getInstance() {
+ return instance;
+ }
+
+ private GlobalELReferenceList() {
+ super();
+ }
+
+ /**
+ * Gets the property name.
+ *
+ * @return the property name
+ */
+ protected QualifiedName getPropertyName() {
+ return PROPERTY_NAME;
+ }
+
+
+}
Added:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/el/GlobalElVariablesComposite.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/el/GlobalElVariablesComposite.java
(rev 0)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/el/GlobalElVariablesComposite.java 2008-08-28
01:32:18 UTC (rev 9930)
@@ -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.vpe.el;
+
+import java.util.List;
+
+import org.jboss.tools.vpe.rreferences.ResourceReference;
+import org.jboss.tools.vpe.rreferences.ResourceReferenceList;
+import org.jboss.tools.vpe.rreferences.ResourceReferencesComposite;
+import org.jboss.tools.vpe.rreferences.ResourceReferencesTableProvider;
+
+
+/**
+ * Composite class for the global el variables.
+ * @author Evgenij Stherbin
+ *
+ */
+public class GlobalElVariablesComposite extends ResourceReferencesComposite {
+
+ /**
+ * @see
org.jboss.tools.vpe.rreferences.ResourceReferencesComposite#createGroupLabel()
+ */
+ @Override
+ protected String createGroupLabel() {
+ return "";
+ }
+
+ /**
+ * @see
org.jboss.tools.vpe.rreferences.ResourceReferencesComposite#createTableProvider(java.util.List)
+ */
+ @Override
+ protected ResourceReferencesTableProvider createTableProvider(List dataList) {
+ return ResourceReferencesTableProvider.getGlobalELTableProvider(dataList);
+ }
+
+ /**
+ * @see org.jboss.tools.vpe.rreferences.ResourceReferencesComposite#getEntity()
+ */
+ @Override
+ protected String getEntity() {
+ return (file != null) ? "VPEGlobalElReference" :
"VPEGlobalElReferenceExt";
+ }
+
+ /**
+ * @see
org.jboss.tools.vpe.rreferences.ResourceReferencesComposite#getReferenceList()
+ */
+ @Override
+ protected ResourceReferenceList getReferenceList() {
+ return GlobalELReferenceList.getInstance();
+ }
+
+ @Override
+ protected ResourceReference getDefaultResourceReference() {
+ ResourceReference rf = new ResourceReference("",
ResourceReference.GLOBAL_SCOPE);
+ rf.setGlobal(true);
+ return rf;
+ }
+
+}
Added:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/el/messages/Messages.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/el/messages/Messages.java
(rev 0)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/el/messages/Messages.java 2008-08-28
01:32:18 UTC (rev 9930)
@@ -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.vpe.el.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.jst.web.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;
+}
Added:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/el/messages/messages.properties
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/el/messages/messages.properties
(rev 0)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/el/messages/messages.properties 2008-08-28
01:32:18 UTC (rev 9930)
@@ -0,0 +1,175 @@
+CANNOT_RUN_SELECTION_WITHOUT_AVAILABLE_SERVER=Cannot run selection without available
server
+CANNOT_FIND_PROJECT_VERSIONS_DESCRIPTORFILE=Cannot find project versions descriptor file
+CANNOT_PARSE_PROJECT_VERSIONS_DESCRIPTORFILE=Cannot parse project versions descriptor
file
+CANNOT_READ_PROJECT_VERSIONS_DESCRIPTORFILE=Cannot read project versions descriptor file
+PLEASE_CREATE_A_SERVER_AND_SELECT_IT_ON_TOOLBAR=Please create a server and select it on
toolbar.
+WARNING=Warning
+WARNING=Warning
+CLOSE=Close
+ERROR=Error
+INCORRECT_URL=Incorrect URL: {0}.
+OK=OK
+APPLICATION_ISNOT_REGISTERED_IN_SELECTED_SERVER=Application {0} is not registered in
selected server.
+FILE_DOESNOT_EXIST=File does not exist.
+FILE_DOESNOT_EXIST_P=File {0} does not exist
+FILE_ISNOT_CORRECT=File {0} is not correct *.war file.
+FILE_ISNOT_RECOGNIZED=File {0} is not recognized as web descriptor file.
+FILE_DOESNOT_CONTAIN_WEBXML=File {0} does not contain web.xml.
+FILE_DOMAINXML_IS_CORRUPTED=File domain.xml is corrupted.
+FILE_ISNOT_RECOGNIZED_AS_WEBDESCRIPTOR_FILE=File is not recognized as web descriptor
file.
+WAR_LOCATION_MUST_BE_SET=*.war location must be set.
+CANNOT_READ_WEBXML=Cannot read web.xml from {0}.
+CANNOT_START_SERVER=Cannot start server:
+CANNOT_FIND_TOOLSJAR=Cannot find tools.jar for the specified jvm environment. It may
result in jsp compilation problems.
+NAME_MUST_BE_SET=Name must be set.
+PROJECT_ALREADY_EXISTS_IN_THE_WORKSPACE=Project {0} already exists in the workspace.
+CANNOT_LOAD_WEBDESCRIPTOR=Cannot load web descriptor file {0}.
+WEBDESCRIPTOR_FILE_IS_CORRUPTED=Web descriptor file is corrupted {0}.
+SERVLET_VERSION_WARNING=Servlet version is not consistent with web.xml version.
+SERVLET_VERSION_ISNOT_CONSISTENT_WITH_WEBXML_VERSION=You have selected a different
servlet version than in project's web.xml file. Click Yes if you would like to convert
the current web.xml file to servlet version {0}. Please note that during conversion you
might lose some web.xml information that is not available in the new version as well as
formatting or comments.
+SAVE_OLD_SERVLET=Do you want to save a copy of your current web.xml file? It will be
saved as web.xml.{0}.old
+J2EE_ROOT_DIRECTORY_ISNOT_FOUND=J2ee root directory is not found.
+DOMAINS_DIRECTORY_ISNOT_FOUND=Domains directory is not found.
+DOMAIN_ISNOT_FOUND=Domain {0} is not found
+CONFIGURATION_FILE_DOMAINXML_ISNOT_FOUND=Configuration file domain.xml is not found.
+CONFIGURATION_FILE_DOMAINXML_IS_READONLY=Configuration file domain.xml is read-only.
+DOCUMENT_DOMAINXML_MUST_HAVE_ELEMENT_DOMAIN=Document domain.xml must have element
'domain' as root element.
+RUNTIME_IS_REQUIRED=Runtime is required.
+SPECIFIED_RUNTIME_DOESNOT_EXIST=Specified runtime does not exist.
+SPECIFIED_FOLDER_DOESNOT_EXIST=Specified folder does not exist.
+SPECIFIED_FOLDER_ISNOT_JVMHOME=Specified folder is not JVM home.
+APPLICATION_IS_ALREADY_REGISTERED=Application {0} is already registered in {1}
+APPLICATION_IS_ALREADY_REGISTERED=Application is already registered.
+APPLICATION_HAS_BEEN_UNREGISTERED_FROM=Application {0} has been unregistered from {1}.
+SERVERS_DIRECTORY_ISNOT_FOUND=Servers directory is not found.
+SERVER_ISNOT_FOUND=Server {0} is not found
+SERVER_ISNOT_SELECTED=Server is not selected.
+ITEM_ISNOT_REFERENCED=This item is not referenced.
+CANCEL=Cancel
+CANCEL=Cancel
+DELETE_REFERENCE_FROM_WEBDESCRIPTOR=Delete reference from web descriptor
+DELETE_REFERENCE_FROM_STRUTS_CONFIGURATION_FILE=Delete reference from struts
configuration file
+DELETE=Delete
+MESSAGE=Message
+LIBRARY_SET_IS_ALREADY_ADDED=Library set {0} is already added.
+LIBRARY_SET_ALREADY_EXISTS=Library set {0} already exists.
+LIBRARY_SET_ISNOT_FOUND=Library set {0} is not found.
+LIBRARYSET_CONTAINS=Library set contains {0}. Do you want to replace it?
+PROJECT_TEMPLATE_ALREADY_EXISTS=Project template {0} already exists.
+PROJECT_EXISTS_IN_WORKSPACE=Project {0} exists in workspace and is closed. To use the
project, please open it.
+LIBRARY_SET_NAME_MUST_BE_A_VALID_FOLDERNAME=Library set name must be a valid folder
name.
+LIBRARY_SET_NAME_MUST_BE_A_VALID_FOLDER_NAME=Library set name must be a valid folder
name.
+MUST_NOT_CONTAIN_CHARACTER=Library set name must be a valid folder name. It must not
contain character {0} .
+TEMPLATE_PAGE_ALREADY_EXISTS=Template page {0} already exists.
+PAGE_PATH_ISNOT_CORRECT=Page path is not correct.
+IMPLEMENTATION_ALREADY_EXISTS=Implementation {0} already exists.
+DEFINE_COMMON_TEMPLATE_PROPERTIES=Define Common Template Properties
+SELECT_FOLDERS_AND_FILES=Select Folders and Files
+SELECT_FILES_THAT_ARE_VELOCITY_TEMPLATES=Select Files That Are Velocity Templates
+SET_VELOCITY_PROPERTIES=Set Velocity Properties
+CANNOT_CREATE_TEMPLATE_FOR_PROJECT=Cannot create template for project {0}.
+CANNOT_FIND_MODULE_FOR_THE_PROJECT=Cannot find module for the project.
+CANNOT_REGISTER_IN_THIS_SERVER=Cannot register in this server.
+YOU_WANT_TO_DELETE_TEMPLATE=Do you want to delete template {0} from {1}?
+YOU_WANT_TO_DELETE_PAGE_TEMPLATE=Do you want to delete page template {0}?
+YOU_WANT_TO_DELETE_FROM_LIBRARYSET=Do you want to delete {0} from library set {1}?
+YOU_WANT_TO_DELETE_IMPLEMENTATION=Do you want to delete implementation {0}?
+YOU_WANT_TO_SET_CORRECT_VALUE_NOW=Do you want to set correct value now?
+YOU_WANT_TO_DELETE_LIBRARYSET=Do you want to delete library set {0}?
+YOU_WANT_TO_DELETE_LIBRARY=Do you want to delete library {0}?
+YOU_WANT_TO_DELETE_LINK_TO=Do you want to delete link to
+YOU_WANT_CO_CONVERT_WEBXML=\ Do you want co convert web.xml?
+YOU_WANT_TO_REARRANGE_THE_DIAGRAM_ELEMENTS=Are you sure, you want to rearrange the
diagram elements?
+CONFIRMATION=Confirmation
+CORE_LIBRARY_LOCATION_ISNOT_SET_FOR_VERSION=Core library location is not set for version
{0}.
+CORE_LIBRARY_LOCATION_FOR_VERSION_ISNOT_CORRECT=Core library location for version {0} is
not correct.
+COMMON_LIBRARY_LOCATION_FOR_VERSION_ISNOT_CORRECT=Common library location for version {0}
is not correct.
+TEMPLATES_LOCATION_ISNOT_SET_FOR_VERSION=Templates location is not set for version {0}.
+TEMPLATES_LOCATION_FOR_VERSION_ISNOT_CORRECT=Templates location for version {0} is not
correct.
+WEBXML_CHANGES=Web.xml Changes
+JSP_REFACTORING=JSP refactoring
+DELETE_VALIDATOR_NODE_FROM_XML=Delete <validator> node from xml?
+PARENT_GROUP_MUST_BE_SPECIFIED=Parent group must be specified.
+PALETTE_ALREADY_CONTAINS_TAB=Palette already contains tab {0}.
+PALETTE_ALREADY_CONTAINS_TAB_2P=Palette already contains tab {0} {1}.
+PATH_TO_TLD_ISNOT_CORRECT=Path to tld is not correct.
+PATH_TO_JVM_IS_EMPTY=Path to JVM is empty.
+START_TOMCAT_SERVER=Start Tomcat Server
+START_TOMCAT_SERVER=Start Tomcat Server
+START_IN_DEBUG_MODE=Start {0} in Debug Mode
+ROOT_ISNOT_FOUND=J2EE 1.4 SDK root is not found.\n
+EITHER_OR_MUST_BE_SET=Either {0} or {1} must be set
+YOU_MAY_SET_ONLY_ONE=You may set only one of {0} and {1} attributes
+ADD_JSP_BREAKPOINT=Add JSP Breakpoint
+REMOVE_JSP_BREAKPOINT=Remove JSP Breakpoint
+NOT_RESOLVED=Not Resolved
+VALUE_NOT_RESOLVED== Value Not Resolved
+STRUTS=Struts
+EDIT_FILTER=Edit Filter
+ENTER_NEW_FILTER=Enter new filter
+TILES_EDITOR=Tiles Editor
+DIAGRAM=Diagram
+PRINT_DIAGRAM=Print Diagram
+PRINT_PREVIEW=Print Preview
+TILES_CONFIG_DESCRIPTION=Tiles Config Description
+DEFINITIONS=Definitions
+BASIC=Basic
+ADVANCED=Advanced
+DEPRECATED=Deprecated
+PUT=Put
+PUTLIST=Putlist
+ATTRIBUTES=Attributes
+ADD=Add
+ITEM=Item
+BEAN=Bean
+SET_PROPERTIES=Set-properties
+SELECTED_PAGES=Selected Pages
+SECURITY_ROLES=Security Roles
+SECURITY_CONSTRAINT=Security Constraint
+SET_PROPERTY=Set-property
+STRUTS_MODEL=Struts Model
+START_SERVER=Start {0} Server {1}
+PRINT=Print
+ZOOM=Zoom
+ALL=All
+SELECT_ALL=Select All
+UNSELECT_ALL=Unselect All
+REFRESH=Refresh
+STOP=Stop
+RUNTIME_REFERENCED_HAS_BEEN_REMOVED=Runtime referenced by the server has been removed.
Please create the runtime or select another server.
+RUN_SERVER=Run Server
+RUN=Run
+START=Start
+REFRESH_SERVER=Refresh {0} Server
+CHANGE_TIME_STAMP=Change Timestamp of
+STOP_SERVER=Stop {0} Server
+START_SERVER_IN_DEBUG_MODE=Start {0} Server in Debug Mode: {1}
+REDHAT_TAG_LIBRARY_EDITOR=JBoss Tools Tag Library Editor
+SERVLET=Servlet
+AUTH_CONSTRAINT=Auth Constraint
+TAGLIBS=Taglibs
+PROPERTY_GROUPS=Property Groups
+JSP_CONFIG=JSP Config
+PROPERTY_GROUP=Property Group
+PROJECT_EXISTS=Project {0} exists. The wizard will try to make it {1} project.
+INITPARAMS=Init Params
+FILTER=Filter
+RESOURCE_COLLECTIONS=Resource Collections
+LOCALE_ENCODING_MAPPINGS=Locale Encoding Mappings
+WELCOME_FILES=Welcome Files
+CONTEXT_IS_ALREADY_REGISTERED_IN_SERVERXML=Context {0} is already registered in
server.xml. Do you want to overwrite it?
+REGISTERING_WEB_CONTEXT_IN_SERVERXML=Registering Web Context in server.xml
+YES=Yes
+YES=Yes
+NO=No
+NO=No
+ADD_TO_EXISTING_GROUP=Add to Existing Group
+CREATE_NEW_GROUP=Create New Group
+JAVA_PROJECT_EXISTS=Java project {0} exists. The wizard will make it {1} project
+CHECK_JVM=Check JVM
+CONTEXT_ROOT_CANNOT_CONTAIN_CHARACTER=Context root cannot contain character {0}.
+WEB_RESOURCES=Web Resources
+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
Added:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/AbsoluteFolderReferenceComposite.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/AbsoluteFolderReferenceComposite.java
(rev 0)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/AbsoluteFolderReferenceComposite.java 2008-08-28
01:32:18 UTC (rev 9930)
@@ -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.vpe.rreferences;
+
+import org.jboss.tools.vpe.el.messages.Messages;
+
+public class AbsoluteFolderReferenceComposite extends FolderReferenceComposite {
+
+ protected ResourceReferenceList getReferenceList() {
+ return AbsoluteFolderReferenceList.getInstance();
+ }
+
+ protected String getTitle() {
+ return Messages.ACTUAL_RUN_TIME_ABSOLUTE_FOLDER;
+ }
+
+}
Added:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/AbsoluteFolderReferenceList.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/AbsoluteFolderReferenceList.java
(rev 0)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/AbsoluteFolderReferenceList.java 2008-08-28
01:32:18 UTC (rev 9930)
@@ -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.vpe.rreferences;
+
+import org.eclipse.core.runtime.QualifiedName;
+
+public class AbsoluteFolderReferenceList extends ResourceReferenceList {
+ private static QualifiedName PROPERTY_NAME = new QualifiedName("",
"org.jboss.tools.vpe.editor.css.AbsoluteFolder");
+ static AbsoluteFolderReferenceList instance = new AbsoluteFolderReferenceList();
+
+ public static AbsoluteFolderReferenceList getInstance() {
+ return instance;
+ }
+
+ protected QualifiedName getPropertyName() {
+ return PROPERTY_NAME;
+ }
+}
Added:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/CSSReferenceList.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/CSSReferenceList.java
(rev 0)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/CSSReferenceList.java 2008-08-28
01:32:18 UTC (rev 9930)
@@ -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.vpe.rreferences;
+
+import org.eclipse.core.runtime.QualifiedName;
+
+public class CSSReferenceList extends ResourceReferenceList {
+ private static QualifiedName PROPERTY_NAME = new QualifiedName("",
"org.jboss.tools.vpe.editor.css.CSSList");
+ static CSSReferenceList instance = new CSSReferenceList();
+
+ public static CSSReferenceList getInstance() {
+ return instance;
+ }
+
+ protected QualifiedName getPropertyName() {
+ return PROPERTY_NAME;
+ }
+
+}
Added:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/CssReferencesComposite.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/CssReferencesComposite.java
(rev 0)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/CssReferencesComposite.java 2008-08-28
01:32:18 UTC (rev 9930)
@@ -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.vpe.rreferences;
+
+import java.util.List;
+
+import org.jboss.tools.vpe.el.messages.Messages;
+
+public class CssReferencesComposite extends ResourceReferencesComposite {
+
+ protected String getEntity() {
+ return (file != null) ? "VPECSSReference" : "VPECSSReferenceExt";
+ }
+
+ protected ResourceReferencesTableProvider createTableProvider(List dataList) {
+ return ResourceReferencesTableProvider.getCSSTableProvider(dataList);
+ }
+
+ protected ResourceReferenceList getReferenceList() {
+ return CSSReferenceList.getInstance();
+ }
+
+
+ /**
+ * @see ResourceReferencesComposite#createGroupLabel()
+ */
+ @Override
+ protected String createGroupLabel() {
+ return Messages.INCLUDED_CSS_FILES;
+ }
+
+
+}
Added:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/FolderReferenceComposite.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/FolderReferenceComposite.java
(rev 0)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/FolderReferenceComposite.java 2008-08-28
01:32:18 UTC (rev 9930)
@@ -0,0 +1,124 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.vpe.rreferences;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Group;
+import org.jboss.tools.common.meta.action.XEntityData;
+import org.jboss.tools.common.meta.action.impl.XEntityDataImpl;
+import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.options.PreferenceModelUtilities;
+import org.jboss.tools.common.model.ui.attribute.XAttributeSupport;
+import org.jboss.tools.common.model.ui.attribute.editor.DirectoryFieldEditorEx;
+
+public abstract class FolderReferenceComposite {
+ XAttributeSupport support = new XAttributeSupport();
+ XModelObject object;
+ IFile file;
+ IPath path;
+ ResourceReference[] rs;
+ ResourceReference current;
+ XEntityData data;
+
+ public FolderReferenceComposite() {
+ object = PreferenceModelUtilities.getPreferenceModel().createModelObject(getEntity(),
new Properties());
+ }
+
+ public void setObject(Properties p) {
+ file = (IFile)p.get("file");
+ path = (IPath)p.get("path");
+ rs = (file != null) ? getReferenceList().getAllResources(file) :
+ (path != null) ? getReferenceList().getAllResources(path)
+ : new ResourceReference[0];
+ if(rs.length == 0) {
+ rs = new ResourceReference[1];
+ rs[0] = new ResourceReference("", ResourceReference.FILE_SCOPE);
+ }
+ current = rs[0];
+ object.setAttributeValue("location", current.getLocation());
+ object.setAttributeValue("scope", current.getScopeName());
+
+ data = XEntityDataImpl.create(new String[][]{
+ {getEntity(), "yes"},
+ {"location", "no"},
+ {"scope", "no"}
+ });
+
+ data.getAttributeData()[0].setValue(current.getLocation());
+ data.getAttributeData()[1].setValue(current.getScopeName());
+
+ support.init(object, data);
+// support.addPropertyChangeListener(new PropertyChangeListener() {
+// public void propertyChange(PropertyChangeEvent evt) {
+// }
+// });
+ }
+
+ protected String getEntity() {
+ return (file != null) ? "VPEFolderReference" :
"VPEFolderReferenceExt";
+ }
+
+ protected abstract ResourceReferenceList getReferenceList();
+ protected abstract String getTitle();
+
+ public Control createControl(Composite parent) {
+ Group g = new Group(parent, SWT.SHADOW_ETCHED_IN);
+ GridLayout layout = new GridLayout(1, false);
+ g.setLayout(layout);
+ g.setText(getTitle());
+ Control c = support.createControl(g);
+ if(file != null) {
+ DirectoryFieldEditorEx f =
(DirectoryFieldEditorEx)support.getFieldEditorByName("location");
+ f.setLastPath(file.getProject().getLocation().toString());
+ }
+ GridData data = new GridData(GridData.FILL_BOTH);
+ c.setLayoutData(data);
+ return g;
+ }
+
+ public void commit() {
+ support.store();
+ current.setLocation(data.getAttributeData()[0].getValue());
+ current.setScope(getNewScope());
+ List l = new ArrayList();
+ for (int i = rs.length - 2; i >= 0; i--) {
+ if(rs[i].getLocation().equals(current.getLocation())) continue;
+ if(rs[i].getScope() == current.getScope()) continue;
+ l.add(rs[i]);
+ }
+ l.add(current);
+ rs = (ResourceReference[])l.toArray(new ResourceReference[0]);
+ if(file != null) {
+ getReferenceList().setAllResources(file, rs);
+ } else {
+ getReferenceList().setAllResources(path, rs);
+ }
+ }
+
+ int getNewScope() {
+ String s = data.getAttributeData()[1].getValue();
+ for (int i = 0; i < ResourceReference.SCOPE_NAMES.length; i++) {
+ if(ResourceReference.SCOPE_NAMES[i].equals(s)) return i;
+ }
+ return ResourceReference.FILE_SCOPE;
+ }
+
+}
Added:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/GlobalResourceReference.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/GlobalResourceReference.java
(rev 0)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/GlobalResourceReference.java 2008-08-28
01:32:18 UTC (rev 9930)
@@ -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.vpe.rreferences;
+
+
+/**
+ * Global resource reference
+ * @author Evgenij Stherbin
+ *
+ */
+public class GlobalResourceReference extends ResourceReference {
+
+ /**
+ * @param location
+ * @param scope
+ */
+ public GlobalResourceReference(String location, int scope) {
+ super(location, scope);
+ }
+
+}
Added:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/RelativeFolderReferenceComposite.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/RelativeFolderReferenceComposite.java
(rev 0)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/RelativeFolderReferenceComposite.java 2008-08-28
01:32:18 UTC (rev 9930)
@@ -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.vpe.rreferences;
+
+
+public class RelativeFolderReferenceComposite extends FolderReferenceComposite {
+
+ protected ResourceReferenceList getReferenceList() {
+ return RelativeFolderReferenceList.getInstance();
+ }
+
+ protected String getTitle() {
+ return "Actual Run-Time Relative Folder";
+ }
+
+}
Added:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/RelativeFolderReferenceList.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/RelativeFolderReferenceList.java
(rev 0)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/RelativeFolderReferenceList.java 2008-08-28
01:32:18 UTC (rev 9930)
@@ -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.vpe.rreferences;
+
+import org.eclipse.core.runtime.QualifiedName;
+
+public class RelativeFolderReferenceList extends ResourceReferenceList {
+ private static QualifiedName PROPERTY_NAME = new QualifiedName("",
"org.jboss.tools.vpe.editor.css.RelativeFolder");
+ static RelativeFolderReferenceList instance = new RelativeFolderReferenceList();
+
+ public static RelativeFolderReferenceList getInstance() {
+ return instance;
+ }
+
+ protected QualifiedName getPropertyName() {
+ return PROPERTY_NAME;
+ }
+
+}
Added:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/ResourceReference.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/ResourceReference.java
(rev 0)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/ResourceReference.java 2008-08-28
01:32:18 UTC (rev 9930)
@@ -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.vpe.rreferences;
+
+public class ResourceReference {
+ public final static int FILE_SCOPE = 0;
+ public final static int FOLDER_SCOPE = 1;
+ public final static int PROJECT_SCOPE = 2;
+ public final static int GLOBAL_SCOPE = 3;
+
+ public final static String[] SCOPE_NAMES = new String[]{"Page",
"Folder", "Project","Global"};
+
+ protected String location;
+ protected int scope;
+ protected int depth = 0;
+ protected String properties = "";
+
+ protected boolean isGlobal = false;
+
+ public boolean isGlobal() {
+ return isGlobal;
+ }
+
+ public void setGlobal(boolean isGlobal) {
+ this.isGlobal = isGlobal;
+ }
+
+ public ResourceReference(String location, int scope) {
+ this.location = location;
+ this.scope = scope;
+ int q = location.indexOf('%');
+ if(q >= 0) {
+ properties = location.substring(q + 1);
+ this.location = location.substring(0, q);
+ }
+ }
+
+ public String getLocation() {
+ return location;
+ }
+
+ public int getScope() {
+ return scope;
+ }
+
+ public void setLocation(String location) {
+ this.location = location;
+ }
+
+ public void setProperties(String properties) {
+ this.properties = properties;
+ }
+
+ public String getProperties() {
+ return properties;
+ }
+
+ public void setScope(int scope) {
+ this.scope = scope;
+ }
+
+ public String getScopeName() {
+ return SCOPE_NAMES[scope];
+ }
+
+ public void setDepth(int depth) {
+ this.depth = depth;
+ }
+
+ public int getDepth() {
+ return depth;
+ }
+
+ public String getLocationAndProperties() {
+ String v = location;
+ if(properties.length() > 0) {
+ v += "%" + properties;
+ }
+ return v;
+ }
+
+
+// public static ResourceReference createResourceReference(String location, int scope) {
+// ResourceReference rst = null;
+//
+// switch (scope) {
+// case FILE_SCOPE:
+// case FOLDER_SCOPE:
+// case PROJECT_SCOPE:
+// rst = new ResourceReference(location, scope);
+// break;
+// case GLOBAL_SCOPE:
+// rst = new GlobalResourceReference(location, scope);
+// break;
+// default:
+// throw new IllegalArgumentException("Illegal scope=" + scope);
+// }
+// return rst;
+// }
+
+}
Added:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/ResourceReferenceList.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/ResourceReferenceList.java
(rev 0)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/ResourceReferenceList.java 2008-08-28
01:32:18 UTC (rev 9930)
@@ -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.vpe.rreferences;
+
+import java.io.File;
+import java.util.*;
+import org.eclipse.core.resources.*;
+import org.eclipse.core.runtime.*;
+import org.jboss.tools.common.model.plugin.ModelPlugin;
+import org.jboss.tools.common.model.util.XModelObjectUtil;
+
+public abstract class ResourceReferenceList {
+ ResourceReferenceListListener[] listeners = new ResourceReferenceListListener[0];
+
+ protected abstract QualifiedName getPropertyName();
+
+ public void addChangeListener(ResourceReferenceListListener listener) {
+ int i = getListenerIndex(listener);
+ if(i >= 0) return;
+ ResourceReferenceListListener[] ls = new ResourceReferenceListListener[listeners.length
+ 1];
+ System.arraycopy(listeners, 0, ls, 0, listeners.length);
+ ls[listeners.length] = listener;
+ listeners = ls;
+ }
+
+ public void removeChangeListener(ResourceReferenceListListener listener) {
+ int i = getListenerIndex(listener);
+ if(i < 0) return;
+ ResourceReferenceListListener[] ls = new ResourceReferenceListListener[listeners.length
- 1];
+ if(i > 0) System.arraycopy(listeners, 0, ls, 0, i);
+ if(i < ls.length) System.arraycopy(listeners, i + 1, ls, i, ls.length - i);
+ listeners = ls;
+ }
+
+ private int getListenerIndex(ResourceReferenceListListener listener) {
+ for (int i = 0; i < listeners.length; i++) {
+ if(listeners[i] == listener) return i;
+ }
+ return -1;
+ }
+
+ public ResourceReference[] getAllResources(IFile file) {
+ Set locations = new HashSet();
+ List css = new ArrayList();
+ if(file.getProject() != null) {
+ String[] dcss = getDeclaredResources(file.getProject());
+ for (int i = 0; i < dcss.length; i++) {
+ ResourceReference ref = new ResourceReference(dcss[i],
ResourceReference.PROJECT_SCOPE);
+ locations.add(dcss[i]);
+ css.add(ref);
+ }
+ }
+ IResource parent = file.getParent();
+ int depth = 0;
+ while(parent instanceof IFolder) {
+ String[] dcss = getDeclaredResources(parent);
+ for (int i = 0; i < dcss.length; i++) {
+ if(locations.contains(dcss[i])) continue;
+ ResourceReference ref = new ResourceReference(dcss[i],
ResourceReference.FOLDER_SCOPE);
+ ref.setDepth(depth);
+ locations.add(dcss[i]);
+ css.add(ref);
+ }
+ parent = parent.getParent();
+ depth++;
+ }
+ String[] dcss = getDeclaredResources(file);
+ for (int i = 0; i < dcss.length; i++) {
+ if(locations.contains(dcss[i])) continue;
+ ResourceReference ref = new ResourceReference(dcss[i], ResourceReference.FILE_SCOPE);
+ locations.add(dcss[i]);
+ css.add(ref);
+ }
+ return (ResourceReference[])css.toArray(new ResourceReference[0]);
+ }
+
+ private String[] getDeclaredResources(IResource resource) {
+ String s = null;
+ try {
+ s = resource.getPersistentProperty(getPropertyName());
+ } catch (CoreException e) {
+ //ignore
+ }
+ if(s == null || s.length() == 0) return new String[0];
+ return XModelObjectUtil.asStringArray(s);
+ }
+
+ public void setAllResources(IFile file, ResourceReference[] entries) {
+ IResource changed = null;
+ boolean b = setDeclaredResources(file, entries, ResourceReference.FILE_SCOPE, 0);
+ if(b) changed = file;
+ IResource parent = file.getParent();
+ int depth = 0;
+ while(parent instanceof IFolder) {
+ b = setDeclaredResources(parent, entries, ResourceReference.FOLDER_SCOPE, depth);
+ if(b) changed = parent;
+ parent = parent.getParent();
+ depth++;
+ }
+ if(file.getProject() != null) {
+ int scope = ResourceReference.PROJECT_SCOPE;
+ if(file.getParent() == file.getProject()) scope = 10;
+ b = setDeclaredResources(file.getProject(), entries, scope, 0);
+ if(b) changed = file.getProject();
+ }
+ if(changed != null) fire(changed.getFullPath());
+ }
+
+ private boolean setDeclaredResources(IResource resource, ResourceReference[] entries,
int scope, int depth) {
+ try {
+ String oldValue = resource.getPersistentProperty(getPropertyName());
+ if(oldValue == null) oldValue = "";
+ String newValue = encodeDeclaredResources(entries, scope, depth);
+ if(oldValue.equals(newValue)) return false;
+ resource.setPersistentProperty(getPropertyName(), newValue);
+ } catch (CoreException e) {
+ return false;
+ }
+ return true;
+ }
+
+ private String encodeDeclaredResources(ResourceReference[] entries, int scope, int
depth) {
+ StringBuffer sb = new StringBuffer();
+ for (int i = 0; i < entries.length; i++) {
+ int s = entries[i].getScope();
+ if(scope < 10 && s != scope) continue;
+ if(scope == 10 && s == ResourceReference.FILE_SCOPE) continue;
+ if(scope == ResourceReference.FOLDER_SCOPE && entries[i].getDepth() != depth)
continue;
+ if(sb.length() > 0) sb.append(";");
+ sb.append(entries[i].getLocationAndProperties());
+ }
+ return sb.toString();
+ }
+
+ void fire(IPath path) {
+ ResourceReferenceListListener[] ls = listeners;
+ for (int i = 0; i < ls.length; i++) {
+ IPath listenedPath = ls[i].getPath();
+ if(listenedPath != null && path.isPrefixOf(listenedPath)) {
+ ls[i].changed(this);
+ }
+ }
+ }
+
+ /*
+ * Handle opened external files
+ */
+ TreeMap allExternalResources = null;
+
+ private TreeMap getAllExternalResources() {
+ if(allExternalResources == null) {
+ allExternalResources = new TreeMap();
+ String s = null;
+ try {
+ s = ModelPlugin.getWorkspace().getRoot().getPersistentProperty(getPropertyName());
+ if(s != null) parseExternalResources(s);
+ } catch (CoreException e) {
+ //ignore
+ }
+ }
+ return allExternalResources;
+ }
+ private void parseExternalResources(String s) {
+ StringTokenizer st = new StringTokenizer(s, "#");
+ while(st.hasMoreTokens()) {
+ String t = st.nextToken();
+ int e = t.indexOf('=');
+ String path = t.substring(0, e);
+ String list = t.substring(e + 1);
+ if(new File(path).exists()) allExternalResources.put(path, list);
+ }
+ }
+
+ private void setAllExternalResources() {
+ StringBuffer sb = new StringBuffer();
+ Iterator it = allExternalResources.keySet().iterator();
+ while(it.hasNext()) {
+ String path = it.next().toString();
+ String list = (String)allExternalResources.get(path);
+ if(path != null && list != null && new File(path).exists()) {
+ if(sb.length() > 0) sb.append('#');
+ sb.append(path).append('=').append(list);
+ }
+ }
+ try {
+ ModelPlugin.getWorkspace().getRoot().setPersistentProperty(getPropertyName(),
sb.toString());
+ } catch (CoreException e) {
+ //ignore
+ }
+ }
+
+ public ResourceReference[] getAllResources(IPath path) {
+ Set locations = new HashSet();
+ List css = new ArrayList();
+ IPath parent = path.removeLastSegments(1);
+ int depth = 0;
+ boolean isGlobal = path.equals(Platform.getLocation());
+ int setScope = isGlobal ? ResourceReference.GLOBAL_SCOPE :
ResourceReference.FILE_SCOPE;
+ while(parent != null && parent.segmentCount() > 1) {
+ String[] dcss = getDeclaredResources(path);
+ for (int i = 0; i < dcss.length; i++) {
+ if(locations.contains(dcss[i])) continue;
+ ResourceReference ref = new ResourceReference(dcss[i],isGlobal ?
ResourceReference.GLOBAL_SCOPE : ResourceReference.FOLDER_SCOPE);
+ if(isGlobal){
+ ref.setGlobal(true);
+ }
+ ref.setDepth(depth);
+ locations.add(dcss[i]);
+ css.add(ref);
+ }
+ parent = parent.removeLastSegments(1);
+ depth++;
+ }
+ String[] dcss = getDeclaredResources(path);
+ for (int i = 0; i < dcss.length; i++) {
+ if(locations.contains(dcss[i])) continue;
+ ResourceReference ref = new ResourceReference(dcss[i], setScope);
+ if(setScope == ResourceReference.GLOBAL_SCOPE){
+ ref.setGlobal(true);
+ }
+ locations.add(dcss[i]);
+ css.add(ref);
+ }
+ return (ResourceReference[])css.toArray(new ResourceReference[0]);
+ }
+
+ private String[] getDeclaredResources(IPath path) {
+ String s = (String)getAllExternalResources().get(path.toString());
+ return (s == null || s.length() == 0) ? new String[0] :
XModelObjectUtil.asStringArray(s);
+ }
+
+ public void setAllResources(IPath path, ResourceReference[] entries) {
+ IPath changed = null;
+ boolean b = false;
+ int checkScope = path.equals(Platform.getLocation()) ? ResourceReference.GLOBAL_SCOPE :
ResourceReference.FILE_SCOPE;
+
+ b = setDeclaredResources(path, entries, checkScope, 0);
+ if(b) changed = path;
+ IPath parent = path.removeLastSegments(1);
+ int depth = 0;
+ while(parent != null && parent.segmentCount() > 1) {
+ b = setDeclaredResources(parent, entries, ResourceReference.FOLDER_SCOPE, depth);
+ if(b) changed = parent;
+ parent = parent.removeLastSegments(1);
+ depth++;
+ }
+ if(changed != null) {
+ setAllExternalResources();
+ fire(changed);
+ }
+ }
+
+ private boolean setDeclaredResources(IPath path, ResourceReference[] entries, int scope,
int depth) {
+ String oldValue = (String)getAllExternalResources().get(path.toString());
+ if(oldValue == null) oldValue = "";
+ String newValue = encodeDeclaredResources(entries, scope, depth);
+ if(oldValue.equals(newValue)) return false;
+ if(newValue == null || newValue.length() == 0) {
+ getAllExternalResources().remove(path.toString());
+ } else {
+ getAllExternalResources().put(path.toString(), newValue);
+ }
+ return true;
+ }
+
+}
Added:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/ResourceReferenceListListener.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/ResourceReferenceListListener.java
(rev 0)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/ResourceReferenceListListener.java 2008-08-28
01:32:18 UTC (rev 9930)
@@ -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.vpe.rreferences;
+
+import org.eclipse.core.runtime.IPath;
+
+public interface ResourceReferenceListListener {
+ public IPath getPath();
+ public void changed(Object source);
+
+}
Added:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/ResourceReferencesComposite.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/ResourceReferencesComposite.java
(rev 0)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/ResourceReferencesComposite.java 2008-08-28
01:32:18 UTC (rev 9930)
@@ -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.vpe.rreferences;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Group;
+import org.jboss.tools.common.meta.XAttribute;
+import org.jboss.tools.common.meta.XModelEntity;
+import org.jboss.tools.common.meta.constraint.impl.XAttributeConstraintFileFilter;
+import org.jboss.tools.common.meta.impl.XModelMetaDataImpl;
+import org.jboss.tools.common.model.ui.action.CommandBar;
+import org.jboss.tools.common.model.ui.action.CommandBarListener;
+import org.jboss.tools.common.model.ui.objecteditor.XTable;
+
+public abstract class ResourceReferencesComposite {
+ protected static String ADD = "Add";
+ protected static String EDIT = "Edit";
+ protected static String REMOVE = "Remove";
+ protected XTable table = new XTable();
+ protected CommandBar bar = new CommandBar();
+ protected ResourceReferencesTableProvider tableProvider;// = new
TemplatesTableProvider();
+ protected IFile file;
+ protected IPath path;
+ protected List dataList = new ArrayList();
+
+ public ResourceReferencesComposite() {
+ init();
+ }
+
+ private void init() {
+ tableProvider = createTableProvider(dataList);
+ bar.getLayout().buttonWidth = 80;
+ bar.getLayout().direction = SWT.VERTICAL;
+ bar.setCommands(new String[]{ADD, EDIT, REMOVE});
+ bar.addCommandBarListener(new BarListener());
+ table.setTableProvider(tableProvider);
+ }
+
+ protected abstract ResourceReferencesTableProvider createTableProvider(List dataList);
+ protected abstract ResourceReferenceList getReferenceList();
+
+ /**
+ * Returned the label that will display in group.
+ *
+ * @return label displayed in group
+ * @see #createControl(Composite)
+ */
+ protected abstract String createGroupLabel();
+
+
+ public void setObject(Object object) {
+ Properties p = (Properties)object;
+ file = (IFile)p.get("file");
+ path = (IPath)p.get("path");
+ ResourceReference[] rs = (file != null) ? getReferenceList().getAllResources(file) :
+ (path != null) ? getReferenceList().getAllResources(path)
+ : new ResourceReference[0];
+ for (int i = 0; i < rs.length; i++) dataList.add(rs[i]);
+ }
+
+ public Control createControl(Composite parent) {
+ Composite c1 = new Composite(parent, SWT.NONE);
+
+ c1.setLayoutData(new GridData(GridData.FILL_BOTH));
+ c1.setLayout(new GridLayout(2,false));
+
+ final Group group = new Group(c1,SWT.NONE);
+
+ group.setText(createGroupLabel());
+ group.setLayoutData(new GridData(GridData.FILL_BOTH));
+ GridLayout g = new GridLayout(2, false);
+ group.setLayout(g);
+
+
+ Control slc = table.createControl(group);
+ slc.setLayoutData(new GridData(GridData.FILL_BOTH));
+ Control bc = bar.createControl(group);
+
+
+ GridData gd = new GridData(GridData.FILL_VERTICAL);
+ bc.setLayoutData(gd);
+ table.getTable().addSelectionListener(new SelectionListener() {
+ public void widgetSelected(SelectionEvent e) {
+ updateBars();
+ }
+ public void widgetDefaultSelected(SelectionEvent e) {
+ widgetSelected(e);
+ }
+ });
+ update();
+ return c1;
+ }
+
+ ResourceReference[] getReferenceArray() {
+ return (ResourceReference[])dataList.toArray(new ResourceReference[0]);
+ }
+
+ /**
+ * Clear all entries from table.
+ */
+ public void clearAll(){
+ if(this.dataList!=null){
+ this.dataList.clear();
+ }
+ }
+
+ public void commit() {
+ if(file != null) {
+ getReferenceList().setAllResources(file, getReferenceArray());
+ } else {
+ getReferenceList().setAllResources(path, getReferenceArray());
+ }
+ }
+ class BarListener implements CommandBarListener {
+ public void action(String command) {
+ int index = table.getSelectionIndex();
+ if(ADD.equals(command)) {
+ add(index);
+ } else if(EDIT.equals(command)) {
+ edit(index);
+ } else if(REMOVE.equals(command)) {
+ remove(index);
+ }
+ update();
+ }
+ }
+
+ protected void add(int index) {
+ ResourceReference css = getDefaultResourceReference();
+
+ initFilterInFileChooser();
+ boolean ok = VpeAddReferenceSupport.add(file, css, getReferenceArray(), getEntity());
+ if(!ok) return;
+ dataList.add(css);
+ update();
+ table.setSelection(dataList.size() - 1);
+ }
+
+ /**
+ * @return
+ */
+ protected ResourceReference getDefaultResourceReference() {
+ return new ResourceReference("", ResourceReference.FOLDER_SCOPE);
+ }
+
+ protected void edit(int index) {
+ if(index < 0) return;
+ ResourceReference css = getReferenceArray()[index];
+ initFilterInFileChooser();
+ boolean ok = VpeAddReferenceSupport.edit(file, css, getReferenceArray(), getEntity());
+ if(!ok) return;
+ update();
+ }
+
+ protected abstract String getEntity();
+
+ void remove(int index) {
+ if(index >= 0) dataList.remove(index);
+ }
+
+ public void update() {
+ if(table != null) table.update();
+ updateBars();
+ }
+
+ void updateBars() {
+ bar.setEnabled(EDIT, canModify());
+ bar.setEnabled(REMOVE, canModify());
+ }
+
+ private boolean canModify() {
+ return table.getSelectionIndex() >= 0;
+ }
+
+ private void initFilterInFileChooser() {
+ String entityName = getEntity();
+ XModelEntity entity = XModelMetaDataImpl.getInstance().getEntity(entityName);
+ if(entity != null && file != null && file.getProject() != null) {
+ XAttribute[] as = entity.getAttributes();
+ for (int i = 0; i < as.length; i++) {
+ if(as[i].getConstraint() instanceof XAttributeConstraintFileFilter) {
+ XAttributeConstraintFileFilter f =
(XAttributeConstraintFileFilter)as[i].getConstraint();
+ f.getProperties().setProperty("filterFolder",
file.getProject().getLocation().toFile().getAbsolutePath());
+ }
+ }
+ }
+ }
+
+
+}
Added:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/ResourceReferencesDialogView.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/ResourceReferencesDialogView.java
(rev 0)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/ResourceReferencesDialogView.java 2008-08-28
01:32:18 UTC (rev 9930)
@@ -0,0 +1,159 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.vpe.rreferences;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.jboss.tools.common.model.ui.action.CommandBar;
+import org.jboss.tools.common.model.ui.action.CommandBarListener;
+import org.jboss.tools.common.model.ui.objecteditor.XTable;
+import org.jboss.tools.common.model.ui.wizards.query.AbstractQueryWizardView;
+
+public abstract class ResourceReferencesDialogView extends AbstractQueryWizardView {
+ static String ADD = "Add";
+ static String EDIT = "Edit";
+ static String REMOVE = "Remove";
+ protected XTable table = new XTable();
+ protected CommandBar bar = new CommandBar();
+ protected ResourceReferencesTableProvider tableProvider;// = new
TemplatesTableProvider();
+ IFile file;
+ IPath path;
+ protected List dataList = new ArrayList();
+
+ public ResourceReferencesDialogView() {
+ init();
+ }
+
+ private void init() {
+// changed = false;
+ tableProvider = createTableProvider(dataList);
+///ResourceReferencesTableProvider.getCSSTableProvider(dataList);
+ bar.getLayout().buttonWidth = 80;
+ bar.getLayout().direction = SWT.VERTICAL;
+ bar.setCommands(new String[]{ADD, EDIT, REMOVE});
+ bar.addCommandBarListener(new BarListener());
+ table.setTableProvider(tableProvider);
+ }
+
+ protected abstract ResourceReferencesTableProvider createTableProvider(List dataList);
+ protected abstract ResourceReferenceList getReferenceList();
+
+ public void setObject(Object object) {
+ super.setObject(object);
+ Properties p = findProperties(object);
+ file = (IFile)p.get("file");
+ path = (IPath)p.get("path");
+ ResourceReference[] rs = (file != null) ? getReferenceList().getAllResources(file) :
+ (path != null) ? getReferenceList().getAllResources(path)
+ : new ResourceReference[0];
+ for (int i = 0; i < rs.length; i++) dataList.add(rs[i]);
+ }
+
+ public Control createControl(Composite parent) {
+ Composite c = new Composite(parent, SWT.NONE);
+ c.setLayoutData(new GridData(GridData.FILL_BOTH));
+ GridLayout g = new GridLayout(2, false);
+ c.setLayout(g);
+ Control slc = table.createControl(c);
+ slc.setLayoutData(new GridData(GridData.FILL_BOTH));
+ Control bc = bar.createControl(c);
+ GridData gd = new GridData(GridData.FILL_VERTICAL);
+ bc.setLayoutData(gd);
+ table.getTable().addSelectionListener(new SelectionListener() {
+ public void widgetSelected(SelectionEvent e) {
+ updateBars();
+ }
+ public void widgetDefaultSelected(SelectionEvent e) {
+ widgetSelected(e);
+ }
+ });
+ update();
+ return c;
+ }
+
+ ResourceReference[] getReferenceArray() {
+ return (ResourceReference[])dataList.toArray(new ResourceReference[0]);
+ }
+
+ public void action(String command) {
+ stopEditing();
+ if(OK.equalsIgnoreCase(command)) {
+ if(file != null) {
+ getReferenceList().setAllResources(file, getReferenceArray());
+ } else {
+ getReferenceList().setAllResources(path, getReferenceArray());
+ }
+ }
+ super.action(command);
+ }
+ class BarListener implements CommandBarListener {
+ public void action(String command) {
+ int index = table.getSelectionIndex();
+ if(ADD.equals(command)) {
+ add(index);
+ } else if(EDIT.equals(command)) {
+ edit(index);
+ } else if(REMOVE.equals(command)) {
+ remove(index);
+ }
+ update();
+ }
+ }
+
+ protected void add(int index) {
+ ResourceReference css = new ResourceReference("",
ResourceReference.FOLDER_SCOPE);
+ boolean ok = VpeAddReferenceSupport.add(file, css, getReferenceArray(), getEntity());
+ if(!ok) return;
+ dataList.add(css);
+ update();
+ table.setSelection(dataList.size() - 1);
+ }
+
+ protected void edit(int index) {
+ if(index < 0) return;
+ ResourceReference css = getReferenceArray()[index];
+ boolean ok = VpeAddReferenceSupport.edit(file, css, getReferenceArray(), getEntity());
+ if(!ok) return;
+ update();
+ }
+
+ protected abstract String getEntity();
+
+ void remove(int index) {
+ if(index >= 0) dataList.remove(index);
+ }
+
+ public void update() {
+ if(table != null) table.update();
+ updateBars();
+ }
+
+ void updateBars() {
+ bar.setEnabled(EDIT, canModify());
+ bar.setEnabled(REMOVE, canModify());
+ }
+
+ private boolean canModify() {
+ return table.getSelectionIndex() >= 0;
+ }
+
+}
Added:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/ResourceReferencesTableProvider.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/ResourceReferencesTableProvider.java
(rev 0)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/ResourceReferencesTableProvider.java 2008-08-28
01:32:18 UTC (rev 9930)
@@ -0,0 +1,110 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.vpe.rreferences;
+
+import java.util.List;
+
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Image;
+import org.jboss.tools.common.model.ui.objecteditor.XTableImageProvider;
+import org.jboss.tools.common.model.ui.objecteditor.XTableProvider;
+
+public class ResourceReferencesTableProvider implements XTableProvider,
XTableImageProvider {
+ static String[] CSS_COLUMNS = new String[]{"Scope", "CSS File
Path"};
+ static String[] IMG_COLUMNS = new String[]{"Scope", "Image Folder
Path"};
+ static String[] TLD_COLUMNS = new String[]{"Scope", "URI",
"Prefix"};
+ static String[] EL_COLUMNS = new String[]{"Scope", "El Expression",
"Value"};
+ private final static String[] GLOBAL_EL_COLUMNS = new
String[]{"Scope","El Expression", "Value"};
+
+ int[] widths = new int[]{50, 200};
+ List dataList;
+ String[] columns;
+
+ public static ResourceReferencesTableProvider getCSSTableProvider(List dataList) {
+ ResourceReferencesTableProvider p = new ResourceReferencesTableProvider(dataList);
+ p.columns = CSS_COLUMNS;
+ return p;
+ }
+
+ public static ResourceReferencesTableProvider getImageTableProvider(List dataList) {
+ ResourceReferencesTableProvider p = new ResourceReferencesTableProvider(dataList);
+ p.columns = IMG_COLUMNS;
+ return p;
+ }
+
+ public static ResourceReferencesTableProvider getTLDTableProvider(List dataList) {
+ ResourceReferencesTableProvider p = new ResourceReferencesTableProvider(dataList);
+ p.columns = TLD_COLUMNS;
+ p.widths = new int[]{50, 150, 50};
+ return p;
+ }
+
+ public static ResourceReferencesTableProvider getELTableProvider(List dataList) {
+ ResourceReferencesTableProvider p = new
ResourceReferencesTableProvider(dataList);
+ p.columns = EL_COLUMNS;
+ p.widths = new int[]{50, 150, 50};
+ return p;
+ }
+
+
+ public static ResourceReferencesTableProvider getGlobalELTableProvider(final List
dataList) {
+ ResourceReferencesTableProvider p = new
ResourceReferencesTableProvider(dataList);
+
+ p.columns = GLOBAL_EL_COLUMNS;
+ p.widths = new int[]{50,150, 50};
+ return p;
+ }
+
+
+
+
+ private ResourceReferencesTableProvider(List dataList) {
+ this.dataList = dataList;
+ }
+
+ public int getColumnCount() {
+ return columns.length;
+ }
+
+ public int getRowCount() {
+ if(dataList == null) return 0;
+ return dataList.size();
+ }
+
+ public String getColumnName(int c) {
+ return columns[c];
+ }
+
+ public String getValueAt(int r, int c) {
+ ResourceReference css = (ResourceReference)dataList.get(r);
+ return (c == 0) ? css.getScopeName() : (c == 2) ? css.getProperties() :
css.getLocation();
+ }
+
+ public Object getDataAt(int r) {
+ return null;
+ }
+
+ public Color getColor(int r) {
+ return null;
+ }
+
+ public int getWidthHint(int c) {
+ return widths[c];
+ }
+
+ public void dispose() {
+ }
+
+ public Image getImage(int r) {
+ return null;
+ }
+
+}
Added:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/TaglibReferenceList.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/TaglibReferenceList.java
(rev 0)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/TaglibReferenceList.java 2008-08-28
01:32:18 UTC (rev 9930)
@@ -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.vpe.rreferences;
+
+import org.eclipse.core.runtime.QualifiedName;
+
+public class TaglibReferenceList extends ResourceReferenceList {
+ private static QualifiedName PROPERTY_NAME = new QualifiedName("",
"org.jboss.tools.vpe.editor.css.TLDList");
+ static TaglibReferenceList instance = new TaglibReferenceList();
+
+ public static TaglibReferenceList getInstance() {
+ return instance;
+ }
+
+ protected QualifiedName getPropertyName() {
+ return PROPERTY_NAME;
+ }
+
+}
Added:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/TaglibReferencesComposite.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/TaglibReferencesComposite.java
(rev 0)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/TaglibReferencesComposite.java 2008-08-28
01:32:18 UTC (rev 9930)
@@ -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.vpe.rreferences;
+
+import java.util.List;
+
+import org.jboss.tools.vpe.el.messages.Messages;
+
+/**
+ *
+ * @author Eugene Stherbin
+ *
+ */
+public class TaglibReferencesComposite extends ResourceReferencesComposite {
+
+ protected String getEntity() {
+ return (file != null) ? "VPETLDReference" : "VPETLDReferenceExt";
//$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ protected ResourceReferencesTableProvider createTableProvider(List dataList) {
+ return ResourceReferencesTableProvider.getTLDTableProvider(dataList);
+ }
+
+ protected ResourceReferenceList getReferenceList() {
+ return TaglibReferenceList.getInstance();
+ }
+
+ /**
+ * @see ResourceReferencesComposite#createGroupLabel()
+ */
+ @Override
+ protected String createGroupLabel() {
+ return Messages.INCLUDED_TAG_LIBS;
+ }
+
+
+
+}
Added:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/VpeAddReferenceSupport.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/VpeAddReferenceSupport.java
(rev 0)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/VpeAddReferenceSupport.java 2008-08-28
01:32:18 UTC (rev 9930)
@@ -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.vpe.rreferences;
+
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+import java.util.TreeSet;
+
+import org.eclipse.core.resources.IFile;
+import org.jboss.tools.common.meta.action.XActionInvoker;
+import org.jboss.tools.common.meta.action.impl.SpecialWizardSupport;
+import org.jboss.tools.common.meta.constraint.XAttributeConstraintL;
+import org.jboss.tools.common.model.XModel;
+import org.jboss.tools.common.model.XModelException;
+import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.options.PreferenceModelUtilities;
+import org.jboss.tools.common.model.project.IModelNature;
+import org.jboss.tools.common.model.util.EclipseResourceUtil;
+import org.jboss.tools.jst.web.project.WebProject;
+import org.jboss.tools.jst.web.tld.TaglibMapping;
+
+public class VpeAddReferenceSupport extends SpecialWizardSupport {
+
+ public static boolean add(IFile file, ResourceReference css, ResourceReference[] list,
String entity) {
+ return run(file, css, list, "CreateActions.AddItem", entity); //$NON-NLS-1$
+ }
+
+ public static boolean edit(IFile file, ResourceReference css, ResourceReference[] list,
String entity) {
+ return run(file, css, list, "EditActions.EditItem", entity); //$NON-NLS-1$
+ }
+
+ private static boolean run(IFile file, ResourceReference css, ResourceReference[] list,
String action, String entity) {
+ XModel model = PreferenceModelUtilities.getPreferenceModel();
+ XModelObject object = model.createModelObject(entity, null);
+ object.setAttributeValue("location", css.getLocation()); //$NON-NLS-1$
+ if(object.getAttributeValue("prefix") != null) { //$NON-NLS-1$
+ object.setAttributeValue("prefix", css.getProperties()); //$NON-NLS-1$
+ }
+ Properties p = new Properties();
+ p.put("scope",Integer.valueOf(css.getScope())); //$NON-NLS-1$
+ p.put("list", list); //$NON-NLS-1$
+ if(file != null) p.put("file", file); //$NON-NLS-1$
+ XActionInvoker.invoke(action, object, p);
+ boolean ok = "true".equals(p.getProperty("okPressed"));
//$NON-NLS-1$ //$NON-NLS-2$
+ if(ok) {
+ css.setLocation(object.getAttributeValue("location")); //$NON-NLS-1$
+ Integer scope = (Integer)p.get("scope"); //$NON-NLS-1$
+
+ css.setScope(scope.intValue());
+ if(css.isGlobal()){
+ css.setScope(ResourceReference.GLOBAL_SCOPE);
+ }
+ String properties = object.getAttributeValue("prefix"); //$NON-NLS-1$
+ if(properties != null) css.setProperties(properties);
+ }
+ return ok;
+ }
+
+ IFile file = null;
+ String initialLocation;
+ String initialPrefix;
+ ResourceReference[] list;
+ String[] scopeNames;
+
+ protected void reset() {
+ initialLocation = getTarget().getAttributeValue("location"); //$NON-NLS-1$
+ setAttributeValue(0, "location", initialLocation); //$NON-NLS-1$
+ initialPrefix = getTarget().getAttributeValue("prefix"); //$NON-NLS-1$
+ if(initialPrefix != null) {
+ setAttributeValue(0, "prefix", initialPrefix); //$NON-NLS-1$
+ }
+ final XAttributeConstraintL scopeAttribute = ((XAttributeConstraintL)
getTarget().getModelEntity().getAttribute("scope") //$NON-NLS-1$
+ .getConstraint());
+ if (scopeAttribute != null) {
+ scopeNames = scopeAttribute.getValues();
+ }
+ int scopeIndex = ((Integer)getProperties().get("scope")).intValue();
//$NON-NLS-1$
+
+ if(scopeIndex == 1 && scopeNames.length == 1){
+ scopeIndex = 0;
+ }else if(scopeIndex > scopeNames.length){
+ scopeIndex = scopeNames.length -1;
+ }
+ String scope = scopeNames[scopeIndex];
+ setAttributeValue(0, "scope", scope); //$NON-NLS-1$
+ list = (ResourceReference[])getProperties().get("list"); //$NON-NLS-1$
+ file = (IFile)getProperties().get("file"); //$NON-NLS-1$
+ setURIList();
+ }
+
+ void setURIList() {
+ if(file == null) return;
+ if(getEntityData()[0].getModelEntity().getName().startsWith("VPETLD")) {
//$NON-NLS-1$
+ Set set = new TreeSet();
+ IModelNature n = EclipseResourceUtil.getModelNature(file.getProject());
+ if(n == null) return;
+ XModel model = n.getModel();
+ TaglibMapping taglibs = WebProject.getInstance(model).getTaglibMapping();
+ Map map = taglibs.getTaglibObjects();
+ Iterator it = map.keySet().iterator();
+ while(it.hasNext()) {
+ String s = it.next().toString();
+ set.add(taglibs.resolveURI(s));
+ }
+ String[] uris = (String[])set.toArray(new String[0]);
+ setValueList(0, "location", uris); //$NON-NLS-1$
+ }
+ }
+
+ public void action(String name) throws XModelException {
+ if(OK.equals(name) || FINISH.equals(name)) {
+ execute();
+ setFinished(true);
+ getProperties().setProperty("okPressed", "true"); //$NON-NLS-1$
//$NON-NLS-2$
+ } else if(CANCEL.equals(name)) {
+ setFinished(true);
+ }
+ }
+
+ protected void execute() throws XModelException {
+ Properties p0 = extractStepData(0);
+ getTarget().setAttributeValue("location",
p0.getProperty("location")); //$NON-NLS-1$ //$NON-NLS-2$
+ if(p0.containsKey("prefix")) { //$NON-NLS-1$
+ getTarget().setAttributeValue("prefix", p0.getProperty("prefix"));
//$NON-NLS-1$ //$NON-NLS-2$
+ }
+ int scope = getSelectedScope(p0);
+ getProperties().put("scope", Integer.valueOf(scope)); //$NON-NLS-1$
+ }
+
+ int getSelectedScope(Properties p0) {
+ String scopeName = p0.getProperty("scope"); //$NON-NLS-1$
+ for (int i = 0; i < scopeNames.length; i++) {
+ if(scopeNames[i].equals(scopeName)) return i;
+ }
+ return 0;
+ }
+
+}
Added:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/VpeCssReferencesDialog.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/VpeCssReferencesDialog.java
(rev 0)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/VpeCssReferencesDialog.java 2008-08-28
01:32:18 UTC (rev 9930)
@@ -0,0 +1,67 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.vpe.rreferences;
+
+import java.util.List;
+import java.util.Properties;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.IPath;
+import org.jboss.tools.common.model.options.PreferenceModelUtilities;
+import org.jboss.tools.common.model.ui.wizards.query.AbstractQueryWizard;
+
+public class VpeCssReferencesDialog extends AbstractQueryWizard {
+
+ public static boolean run(IFile file) {
+ VpeCssReferencesDialog dialog = new VpeCssReferencesDialog();
+ Properties p = new Properties();
+ p.setProperty("help", "VpeCssReferencesDialog");
+ p.put("file", file);
+ p.put("model", PreferenceModelUtilities.getPreferenceModel());
+ dialog.setObject(p);
+ int code = dialog.execute();
+ return code == 0;
+ }
+
+ public static boolean run(IPath path) {
+ VpeCssReferencesDialog dialog = new VpeCssReferencesDialog();
+ Properties p = new Properties();
+ p.setProperty("help", "VpeCssReferencesDialog");
+ p.put("path", path);
+ p.put("model", PreferenceModelUtilities.getPreferenceModel());
+ dialog.setObject(p);
+ int code = dialog.execute();
+ return code == 0;
+ }
+
+ public VpeCssReferencesDialog() {
+ setView(new VpeCssReferencesDialogView());
+ }
+
+}
+
+class VpeCssReferencesDialogView extends ResourceReferencesDialogView {
+
+ public VpeCssReferencesDialogView() {}
+
+ protected String getEntity() {
+ return (file != null) ? "VPECSSReference" : "VPECSSReferenceExt";
+ }
+
+ protected ResourceReferencesTableProvider createTableProvider(List dataList) {
+ return ResourceReferencesTableProvider.getCSSTableProvider(dataList);
+ }
+
+ protected ResourceReferenceList getReferenceList() {
+ return CSSReferenceList.getInstance();
+ }
+
+}
Added:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/VpeResourcesDialog.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/VpeResourcesDialog.java
(rev 0)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/VpeResourcesDialog.java 2008-08-28
01:32:18 UTC (rev 9930)
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.vpe.rreferences;
+
+import java.util.Properties;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.IPath;
+import org.jboss.tools.common.model.options.PreferenceModelUtilities;
+import org.jboss.tools.common.model.ui.wizards.query.AbstractQueryWizard;
+
+public class VpeResourcesDialog extends AbstractQueryWizard {
+
+ public static boolean run(IFile file) {
+ VpeResourcesDialog dialog = new VpeResourcesDialog();
+ Properties p = new Properties();
+ p.setProperty("help", "VpeResourcesDialog");
+ p.put("file", file);
+ p.put("model", PreferenceModelUtilities.getPreferenceModel());
+ dialog.setObject(p);
+ int code = dialog.execute();
+ return code == 0;
+ }
+
+ public static boolean run(IPath path) {
+ VpeResourcesDialog dialog = new VpeResourcesDialog();
+ Properties p = new Properties();
+ p.setProperty("help", "VpeResourcesDialog");
+ p.put("path", path);
+ p.put("model", PreferenceModelUtilities.getPreferenceModel());
+ dialog.setObject(p);
+ int code = dialog.execute();
+ return code == 0;
+ }
+
+ public VpeResourcesDialog() {
+ setView(new VpeResourcesDialogView());
+ }
+
+}
Added:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/VpeResourcesDialogView.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/VpeResourcesDialogView.java
(rev 0)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/rreferences/VpeResourcesDialogView.java 2008-08-28
01:32:18 UTC (rev 9930)
@@ -0,0 +1,104 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.vpe.rreferences;
+
+import java.util.Properties;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.jboss.tools.common.model.ui.wizards.query.AbstractQueryWizardView;
+import org.jboss.tools.vpe.el.ElVariablesComposite;
+
+public class VpeResourcesDialogView extends AbstractQueryWizardView {
+ IFile file;
+ IPath path;
+ CssReferencesComposite css = new CssReferencesComposite();
+ //changed by estherbin
+ //http://jira.jboss.com/jira/browse/JBIDE-2010
+ ElVariablesComposite el = new ElVariablesComposite();
+ TaglibReferencesComposite tld = new TaglibReferencesComposite();
+ AbsoluteFolderReferenceComposite absFolder = new AbsoluteFolderReferenceComposite();
+ RelativeFolderReferenceComposite relFolder = new RelativeFolderReferenceComposite();
+
+ public void setObject(Object object) {
+ super.setObject(object);
+ Properties p = findProperties(object);
+ file = (IFile)p.get("file");
+ path = (IPath)p.get("path");
+
+ css.setObject(object);
+ //changed by estherbin
+ //http://jira.jboss.com/jira/browse/JBIDE-2010
+ el.setObject(object);
+ tld.setObject(object);
+ absFolder.setObject(p);
+ relFolder.setObject(p);
+ }
+
+ public Control createControl(Composite parent) {
+ GridData data;
+ Composite c = new Composite(parent, SWT.NONE);
+ GridLayout layout = new GridLayout(1, false);
+ layout.marginWidth = 0;
+ layout.marginHeight = 0;
+ c.setLayout(layout);
+
+ Control absControl = absFolder.createControl(c);
+ data = new GridData(GridData.FILL_HORIZONTAL);
+ absControl.setLayoutData(data);
+
+ Control relControl = relFolder.createControl(c);
+ data = new GridData(GridData.FILL_HORIZONTAL);
+ relControl.setLayoutData(data);
+
+ Control cssControl = css.createControl(c);
+ data = new GridData(GridData.FILL_BOTH);
+ cssControl.setLayoutData(data);
+ Control tldControl = tld.createControl(c);
+ data = new GridData(GridData.FILL_BOTH);
+ tldControl.setLayoutData(data);
+
+ //changed by estherbin
+ //http://jira.jboss.com/jira/browse/JBIDE-2010
+ Control elControl = el.createControl(c);
+ data = new GridData(GridData.FILL_BOTH);
+ elControl.setLayoutData(data);
+ return c;
+ }
+
+ public void action(String command) {
+ if(OK.equals(command)) {
+ absFolder.commit();
+ relFolder.commit();
+ el.commit();
+ css.commit();
+ tld.commit();
+ }
+ super.action(command);
+ }
+
+ public Point getPreferredSize() {
+ //changed by estherbin
+ //http://jira.jboss.com/jira/browse/JBIDE-2010
+ String os_name = System.getProperty("os.name");
+ if(os_name != null && os_name.indexOf("Windows") >= 0) return new
Point(800, 600);
+ //changed by estherbin
+ //http://jira.jboss.com/jira/browse/JBIDE-2010
+ return new Point(600, 700);
+ }
+
+}