JBoss Tools SVN: r15286 - trunk/jst/plugins/org.jboss.tools.jst.web.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-05-15 09:24:53 -0400 (Fri, 15 May 2009)
New Revision: 15286
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web/plugin.xml
Log:
https://jira.jboss.org/jira/browse/JBIDE-2808
Modified: trunk/jst/plugins/org.jboss.tools.jst.web/plugin.xml
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/plugin.xml 2009-05-15 13:24:01 UTC (rev 15285)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/plugin.xml 2009-05-15 13:24:53 UTC (rev 15286)
@@ -272,29 +272,4 @@
</extension>
- <extension
- id="kbbuilder"
- name="KB Builder"
- point="org.eclipse.core.resources.builders">
- <builder
- hasNature="false">
- <run
- class="org.jboss.tools.jst.web.kb.internal.KbBuilder">
- </run>
- </builder>
- </extension>
- <extension
- id="kbnature"
- name="KB Project Nature"
- point="org.eclipse.core.resources.natures">
- <runtime>
- <run
- class="org.jboss.tools.jst.web.kb.internal.KbProject">
- </run>
- </runtime>
- <builder
- id="org.jboss.tools.jst.web.kbbuilder">
- </builder>
- </extension>
-
</plugin>
15 years, 4 months
JBoss Tools SVN: r15285 - trunk/jst/tests/org.jboss.tools.jst.web.kb.test/META-INF.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2009-05-15 09:24:01 -0400 (Fri, 15 May 2009)
New Revision: 15285
Modified:
trunk/jst/tests/org.jboss.tools.jst.web.kb.test/META-INF/MANIFEST.MF
Log:
https://jira.jboss.org/jira/browse/JBIDE-2808
Modified: trunk/jst/tests/org.jboss.tools.jst.web.kb.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.web.kb.test/META-INF/MANIFEST.MF 2009-05-15 13:23:02 UTC (rev 15284)
+++ trunk/jst/tests/org.jboss.tools.jst.web.kb.test/META-INF/MANIFEST.MF 2009-05-15 13:24:01 UTC (rev 15285)
@@ -6,7 +6,7 @@
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.jboss.tools.jst.web.kb,
- org.junit;bundle-version="3.8.2"
+ org.junit
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-Vendor: %Bundle-Vendor.0
15 years, 4 months
JBoss Tools SVN: r15284 - in trunk/jst/tests/org.jboss.tools.jst.web.kb.test: .settings and 9 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2009-05-15 09:23:02 -0400 (Fri, 15 May 2009)
New Revision: 15284
Added:
trunk/jst/tests/org.jboss.tools.jst.web.kb.test/.classpath
trunk/jst/tests/org.jboss.tools.jst.web.kb.test/.project
trunk/jst/tests/org.jboss.tools.jst.web.kb.test/.settings/
trunk/jst/tests/org.jboss.tools.jst.web.kb.test/.settings/org.eclipse.jdt.core.prefs
trunk/jst/tests/org.jboss.tools.jst.web.kb.test/META-INF/
trunk/jst/tests/org.jboss.tools.jst.web.kb.test/META-INF/MANIFEST.MF
trunk/jst/tests/org.jboss.tools.jst.web.kb.test/build.properties
trunk/jst/tests/org.jboss.tools.jst.web.kb.test/plugin.properties
trunk/jst/tests/org.jboss.tools.jst.web.kb.test/src/
trunk/jst/tests/org.jboss.tools.jst.web.kb.test/src/org/
trunk/jst/tests/org.jboss.tools.jst.web.kb.test/src/org/jboss/
trunk/jst/tests/org.jboss.tools.jst.web.kb.test/src/org/jboss/tools/
trunk/jst/tests/org.jboss.tools.jst.web.kb.test/src/org/jboss/tools/jst/
trunk/jst/tests/org.jboss.tools.jst.web.kb.test/src/org/jboss/tools/jst/web/
trunk/jst/tests/org.jboss.tools.jst.web.kb.test/src/org/jboss/tools/jst/web/kb/
trunk/jst/tests/org.jboss.tools.jst.web.kb.test/src/org/jboss/tools/jst/web/kb/test/
trunk/jst/tests/org.jboss.tools.jst.web.kb.test/src/org/jboss/tools/jst/web/kb/test/JstWebKbAllTests.java
trunk/jst/tests/org.jboss.tools.jst.web.kb.test/src/org/jboss/tools/jst/web/kb/test/WebKbTest.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2808
Added: trunk/jst/tests/org.jboss.tools.jst.web.kb.test/.classpath
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.web.kb.test/.classpath (rev 0)
+++ trunk/jst/tests/org.jboss.tools.jst.web.kb.test/.classpath 2009-05-15 13:23:02 UTC (rev 15284)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Property changes on: trunk/jst/tests/org.jboss.tools.jst.web.kb.test/.classpath
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jst/tests/org.jboss.tools.jst.web.kb.test/.project
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.web.kb.test/.project (rev 0)
+++ trunk/jst/tests/org.jboss.tools.jst.web.kb.test/.project 2009-05-15 13:23:02 UTC (rev 15284)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.jst.web.kb.test</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Property changes on: trunk/jst/tests/org.jboss.tools.jst.web.kb.test/.project
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jst/tests/org.jboss.tools.jst.web.kb.test/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.web.kb.test/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ trunk/jst/tests/org.jboss.tools.jst.web.kb.test/.settings/org.eclipse.jdt.core.prefs 2009-05-15 13:23:02 UTC (rev 15284)
@@ -0,0 +1,8 @@
+#Fri May 15 16:50:56 MSD 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
Property changes on: trunk/jst/tests/org.jboss.tools.jst.web.kb.test/.settings/org.eclipse.jdt.core.prefs
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jst/tests/org.jboss.tools.jst.web.kb.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.web.kb.test/META-INF/MANIFEST.MF (rev 0)
+++ trunk/jst/tests/org.jboss.tools.jst.web.kb.test/META-INF/MANIFEST.MF 2009-05-15 13:23:02 UTC (rev 15284)
@@ -0,0 +1,13 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name.0
+Bundle-SymbolicName: org.jboss.tools.jst.web.kb.test
+Bundle-Version: 1.0.0
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.jboss.tools.jst.web.kb,
+ org.junit;bundle-version="3.8.2"
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-Vendor: %Bundle-Vendor.0
+Export-Package: org.jboss.tools.jst.web.kb.test
Property changes on: trunk/jst/tests/org.jboss.tools.jst.web.kb.test/META-INF/MANIFEST.MF
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jst/tests/org.jboss.tools.jst.web.kb.test/build.properties
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.web.kb.test/build.properties (rev 0)
+++ trunk/jst/tests/org.jboss.tools.jst.web.kb.test/build.properties 2009-05-15 13:23:02 UTC (rev 15284)
@@ -0,0 +1,5 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.properties
Property changes on: trunk/jst/tests/org.jboss.tools.jst.web.kb.test/build.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jst/tests/org.jboss.tools.jst.web.kb.test/plugin.properties
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.web.kb.test/plugin.properties (rev 0)
+++ trunk/jst/tests/org.jboss.tools.jst.web.kb.test/plugin.properties 2009-05-15 13:23:02 UTC (rev 15284)
@@ -0,0 +1,3 @@
+#Properties file for org.jboss.tools.jst.web.test
+Bundle-Vendor.0 = JBoss, a division of Red Hat
+Bundle-Name.0 = Tests Plug-in
\ No newline at end of file
Property changes on: trunk/jst/tests/org.jboss.tools.jst.web.kb.test/plugin.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jst/tests/org.jboss.tools.jst.web.kb.test/src/org/jboss/tools/jst/web/kb/test/JstWebKbAllTests.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.web.kb.test/src/org/jboss/tools/jst/web/kb/test/JstWebKbAllTests.java (rev 0)
+++ trunk/jst/tests/org.jboss.tools.jst.web.kb.test/src/org/jboss/tools/jst/web/kb/test/JstWebKbAllTests.java 2009-05-15 13:23:02 UTC (rev 15284)
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * Copyright (c) 2009 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.jst.web.kb.test;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class JstWebKbAllTests {
+
+ public static Test suite() {
+ TestSuite suite = new TestSuite(JstWebKbAllTests.class.getName());
+ suite.addTest(WebKbTest.suite());
+ return suite;
+ }
+}
\ No newline at end of file
Property changes on: trunk/jst/tests/org.jboss.tools.jst.web.kb.test/src/org/jboss/tools/jst/web/kb/test/JstWebKbAllTests.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jst/tests/org.jboss.tools.jst.web.kb.test/src/org/jboss/tools/jst/web/kb/test/WebKbTest.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.web.kb.test/src/org/jboss/tools/jst/web/kb/test/WebKbTest.java (rev 0)
+++ trunk/jst/tests/org.jboss.tools.jst.web.kb.test/src/org/jboss/tools/jst/web/kb/test/WebKbTest.java 2009-05-15 13:23:02 UTC (rev 15284)
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2009 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.kb.test;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class WebKbTest extends TestCase {
+
+ public void testKb() {
+ //TODO
+ }
+
+ public static Test suite() {
+ return new TestSuite(WebKbTest.class);
+ }
+}
\ No newline at end of file
Property changes on: trunk/jst/tests/org.jboss.tools.jst.web.kb.test/src/org/jboss/tools/jst/web/kb/test/WebKbTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15 years, 4 months
JBoss Tools SVN: r15282 - in trunk/jst/plugins/org.jboss.tools.jst.web.kb: src/org/jboss/tools/jst/web/kb and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2009-05-15 08:55:45 -0400 (Fri, 15 May 2009)
New Revision: 15282
Added:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/WebKbPlugin.java
Removed:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/Activator.java
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/META-INF/MANIFEST.MF
Log:
https://jira.jboss.org/jira/browse/JBIDE-2808
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/META-INF/MANIFEST.MF
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/META-INF/MANIFEST.MF 2009-05-15 12:54:50 UTC (rev 15281)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/META-INF/MANIFEST.MF 2009-05-15 12:55:45 UTC (rev 15282)
@@ -3,7 +3,7 @@
Bundle-Name: %Bundle-Name.0
Bundle-SymbolicName: org.jboss.tools.jst.web.kb;singleton:=true
Bundle-Version: 1.0.0
-Bundle-Activator: org.jboss.tools.jst.web.kb.Activator
+Bundle-Activator: org.jboss.tools.jst.web.kb.WebKbPlugin
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.jboss.tools.jst.web;bundle-version="2.0.0",
Deleted: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/Activator.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/Activator.java 2009-05-15 12:54:50 UTC (rev 15281)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/Activator.java 2009-05-15 12:55:45 UTC (rev 15282)
@@ -1,50 +0,0 @@
-package org.jboss.tools.jst.web.kb;
-
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class Activator extends AbstractUIPlugin {
-
- // The plug-in ID
- public static final String PLUGIN_ID = "org.jboss.tools.jst.web.kb";
-
- // The shared instance
- private static Activator plugin;
-
- /**
- * The constructor
- */
- public Activator() {
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
- plugin = this;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
- */
- public void stop(BundleContext context) throws Exception {
- plugin = null;
- super.stop(context);
- }
-
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static Activator getDefault() {
- return plugin;
- }
-
-}
Copied: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/WebKbPlugin.java (from rev 15273, trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/Activator.java)
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/WebKbPlugin.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/WebKbPlugin.java 2009-05-15 12:55:45 UTC (rev 15282)
@@ -0,0 +1,49 @@
+package org.jboss.tools.jst.web.kb;
+
+import org.jboss.tools.common.log.BaseUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class WebKbPlugin extends BaseUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.jboss.tools.jst.web.kb";
+
+ // The shared instance
+ private static WebKbPlugin plugin;
+
+ /**
+ * The constructor
+ */
+ public WebKbPlugin() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static WebKbPlugin getDefault() {
+ return plugin;
+ }
+}
\ No newline at end of file
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/WebKbPlugin.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15 years, 4 months
JBoss Tools SVN: r15281 - trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/helpers.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-05-15 08:54:50 -0400 (Fri, 15 May 2009)
New Revision: 15281
Added:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/helpers/InnerModelHelper.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2808
Added: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/helpers/InnerModelHelper.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/helpers/InnerModelHelper.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/helpers/InnerModelHelper.java 2009-05-15 12:54:50 UTC (rev 15281)
@@ -0,0 +1,111 @@
+/*******************************************************************************
+ * 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.model.helpers;
+
+import java.io.IOException;
+
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.wst.common.componentcore.ComponentCore;
+import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
+import org.eclipse.wst.common.componentcore.resources.IVirtualFolder;
+import org.jboss.tools.common.model.XModel;
+import org.jboss.tools.common.model.XModelConstants;
+import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.project.IModelNature;
+import org.jboss.tools.common.model.project.ProjectHome;
+import org.jboss.tools.common.model.util.EclipseResourceUtil;
+import org.jboss.tools.common.model.util.XModelObjectUtil;
+
+public class InnerModelHelper {
+
+ public static XModel createXModel(IProject project) {
+ IModelNature n = EclipseResourceUtil.getModelNature(project.getProject());
+ if(n != null) return n.getModel();
+
+ XModel model = EclipseResourceUtil.createObjectForResource(project.getProject()).getModel();
+ XModelObject webinf = model.getByPath("FileSystems/WEB-INF"); //$NON-NLS-1$
+ if(webinf != null) return model;
+
+ IPath webInfPath = getWebInfPath(project);
+
+ if(webInfPath == null) return model;
+
+ IFolder webInfFolder = ResourcesPlugin.getWorkspace().getRoot().getFolder(webInfPath);
+
+ model.getProperties().setProperty(XModelConstants.WORKSPACE, webInfFolder.getLocation().toString());
+ model.getProperties().setProperty(XModelConstants.WORKSPACE_OLD, webInfFolder.getLocation().toString());
+
+ XModelObject fs = model.getByPath("FileSystems"); //$NON-NLS-1$
+ webinf = model.createModelObject("FileSystemFolder", null); //$NON-NLS-1$
+ webinf.setAttributeValue("name", "WEB-INF"); //$NON-NLS-1$ //$NON-NLS-2$
+ webinf.setAttributeValue("location", XModelConstants.WORKSPACE_REF); //$NON-NLS-1$
+ fs.addChild(webinf);
+
+ String webInfLocation = XModelObjectUtil.expand(XModelConstants.WORKSPACE_REF, model, null);
+ String webRootLocation = getWebRootPath(project, webInfLocation);
+
+ XModelObject webroot = model.createModelObject("FileSystemFolder", null); //$NON-NLS-1$
+ webroot.setAttributeValue("name", "WEB-ROOT"); //$NON-NLS-1$ //$NON-NLS-2$
+ webroot.setAttributeValue("location", webRootLocation); //$NON-NLS-1$ //$NON-NLS-2$
+ fs.addChild(webroot);
+
+ XModelObject lib = model.createModelObject("FileSystemFolder", null); //$NON-NLS-1$
+ lib.setAttributeValue("name", "lib"); //$NON-NLS-1$ //$NON-NLS-2$
+ lib.setAttributeValue("location", XModelConstants.WORKSPACE_REF + "/lib"); //$NON-NLS-1$ //$NON-NLS-2$
+ fs.addChild(lib);
+
+ return model;
+ }
+
+ //Taken from J2EEUtils and modified
+ public static IPath getWebInfPath(IProject project) {
+ IVirtualComponent component = ComponentCore.createComponent(project);
+ if(component == null) return null;
+ IVirtualFolder webInfDir = component.getRootFolder().getFolder(new Path("/WEB-INF"));
+ IPath modulePath = webInfDir.getWorkspaceRelativePath();
+ return (!webInfDir.exists()) ? null : modulePath;
+ }
+
+ static String getWebRootPath(IProject project, String webInfLocation) {
+ String webRootLocation = XModelConstants.WORKSPACE_REF + "/..";
+
+ IPath wrp = ProjectHome.getFirstWebContentPath(project);
+ IPath wip = ProjectHome.getWebInfPath(project);
+
+ if(wrp == null || wip == null) {
+ return webRootLocation;
+ }
+
+ IResource wrpc = ResourcesPlugin.getWorkspace().getRoot().findMember(wrp);
+ IResource wipc = ResourcesPlugin.getWorkspace().getRoot().findMember(wip);
+ if(wrpc != null && wipc != null && wipc.isLinked()) {
+ IPath p = wrpc.getLocation();
+ if(p != null) {
+ try {
+ webRootLocation = p.toFile().getCanonicalPath().replace('\\', '/');
+ } catch (IOException e) {
+ }
+ String relative = org.jboss.tools.common.util.FileUtil.getRelativePath(webInfLocation, webRootLocation);
+ if(relative != null) {
+ webRootLocation = XModelConstants.WORKSPACE_REF + relative;
+ }
+ }
+ }
+ return webRootLocation;
+ }
+
+}
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/helpers/InnerModelHelper.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15 years, 4 months
JBoss Tools SVN: r15279 - trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2009-05-15 08:48:23 -0400 (Fri, 15 May 2009)
New Revision: 15279
Removed:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/IKbProject.java
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/internal/
Log:
https://jira.jboss.org/jira/browse/JBIDE-2808
Deleted: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/IKbProject.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/IKbProject.java 2009-05-15 12:46:55 UTC (rev 15278)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/IKbProject.java 2009-05-15 12:48:23 UTC (rev 15279)
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 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.kb;
-
-import org.eclipse.core.resources.IProjectNature;
-import org.jboss.tools.jst.web.kb.taglib.ITagLibrary;
-
-/**
- *
- * @author V.Kabanovich
- *
- */
-public interface IKbProject extends IProjectNature {
- public static String NATURE_ID = "org.jboss.tools.jst.web.kbnature"; //$NON-NLS-1$
-
- public ITagLibrary[] getTagLibraries();
-
-}
15 years, 4 months
JBoss Tools SVN: r15277 - in trunk/jst/plugins/org.jboss.tools.jst.web: src/org/jboss/tools/jst/web/kb and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2009-05-15 08:45:03 -0400 (Fri, 15 May 2009)
New Revision: 15277
Removed:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/IFaceletPageContext.java
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/IPageContext.java
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/IProposalProcessor.java
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/IResourceBundle.java
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/KbQuery.java
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/PageContextFactory.java
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/PageProcessor.java
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/internal/FaceletContextImpl.java
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/internal/JspContextImpl.java
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/internal/taglib/
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/taglib/
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web/META-INF/MANIFEST.MF
Log:
https://jira.jboss.org/jira/browse/JBIDE-2808
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 2009-05-15 12:44:23 UTC (rev 15276)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/META-INF/MANIFEST.MF 2009-05-15 12:45:03 UTC (rev 15277)
@@ -42,8 +42,6 @@
org.jboss.tools.jst.web.browser,
org.jboss.tools.jst.web.browser.wtp,
org.jboss.tools.jst.web.context,
- org.jboss.tools.jst.web.kb,
- org.jboss.tools.jst.web.kb.taglib,
org.jboss.tools.jst.web.launching.sourcelookup,
org.jboss.tools.jst.web.launching.sourcelookup.xpl,
org.jboss.tools.jst.web.messages.xpl,
Deleted: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/IFaceletPageContext.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/IFaceletPageContext.java 2009-05-15 12:44:23 UTC (rev 15276)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/IFaceletPageContext.java 2009-05-15 12:45:03 UTC (rev 15277)
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 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.kb;
-
-import java.util.Map;
-
-/**
- * @author Alexey Kazakov
- */
-public interface IFaceletPageContext extends IPageContext {
-
- /**
- * Returns parent page context. For example if some this facelet page is used in a template then
- * this method will return a page context for that template.
- * May return null.
- * @return
- */
- IFaceletPageContext getParentContext();
-
- /**
- * Returns parameters which are declared in the parent context and are available within this page.
- * Key - name of Parameter.
- * Value - value of Parameter.
- * @return
- */
- Map<String, String> getParams();
-}
\ No newline at end of file
Deleted: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/IPageContext.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/IPageContext.java 2009-05-15 12:44:23 UTC (rev 15276)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/IPageContext.java 2009-05-15 12:45:03 UTC (rev 15277)
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 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.kb;
-
-import org.eclipse.jface.text.IDocument;
-import org.jboss.tools.common.el.core.resolver.ELContext;
-import org.jboss.tools.common.el.core.resolver.ELResolver;
-import org.jboss.tools.common.el.core.resolver.Var;
-import org.jboss.tools.jst.web.kb.taglib.ITagLibrary;
-
-/**
- * Page context
- * @author Alexey Kazakov
- */
-public interface IPageContext extends ELContext {
-
- /**
- * Returns libraries which should be used in this context
- * @return
- */
- ITagLibrary[] getLibraries();
-
- /**
- * Returns EL Resolvers which are declared for this page
- * @return
- */
- ELResolver[] getElResolvers();
-
- /**
- * Returns resource bundles
- * @return
- */
- IResourceBundle[] getResourceBundles();
-
- /**
- * Returns IDocument for source file
- * @return
- */
- IDocument getDocument();
-
- /**
- * Returns "var" attributes which are available in particular offset.
- * @param offset
- * @return
- */
- Var[] getVars(int offset);
-}
\ No newline at end of file
Deleted: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/IProposalProcessor.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/IProposalProcessor.java 2009-05-15 12:44:23 UTC (rev 15276)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/IProposalProcessor.java 2009-05-15 12:45:03 UTC (rev 15277)
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 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.kb;
-
-import org.jboss.tools.common.text.TextProposal;
-
-/**
- * @author Alexey Kazakov
- */
-public interface IProposalProcessor {
-
- /**
- * @return proposals
- */
- TextProposal[] getProposals(KbQuery query, IPageContext context);
-
-}
\ No newline at end of file
Deleted: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/IResourceBundle.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/IResourceBundle.java 2009-05-15 12:44:23 UTC (rev 15276)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/IResourceBundle.java 2009-05-15 12:45:03 UTC (rev 15277)
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 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.kb;
-
-/**
- * @author Alexey Kazakov
- */
-public interface IResourceBundle {
-
- /**
- * @return var attribute value
- */
- String getVar();
-
- /**
- * @return basename attribute value
- */
- String getBasename();
-}
\ No newline at end of file
Deleted: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/KbQuery.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/KbQuery.java 2009-05-15 12:44:23 UTC (rev 15276)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/KbQuery.java 2009-05-15 12:45:03 UTC (rev 15277)
@@ -1,175 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 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.kb;
-
-/**
- * Query object is used to get info from Page Processors.
- * @author Alexey Kazakov
- */
-public class KbQuery {
-
- public static final String PREFIX_SEPARATOR = ":";
-
- private int offset;
- private String uri;
- private String[] parentTags;
- private String value;
- private String stringQuery;
- private boolean useAsMask;
- private String prefix;
- private Type type;
- private String parent;
-
- /**
- * Type of object for which we want to get info
- * @author Alexey Kazakov
- */
- public static enum Type {
- TEXT,
- TAG_NAME,
- ATTRIBUTE_NAME,
- ATTRIBUTE_VALUE
- }
-
- public KbQuery() {
- }
-
- /**
- * URI of tag library
- * @return
- */
- public String getUri() {
- return uri;
- }
-
- public void setUri(String uri) {
- this.uri = uri;
- }
-
- /**
- * The stack of parent tags
- * @return
- */
- public String[] getParentTags() {
- return parentTags;
- }
-
- /**
- * @param parentTags the stack of parent tags
- */
- public void setParentTags(String[] parentTags) {
- this.parentTags = parentTags;
- }
-
- /**
- * return the last parent tag
- */
- public String getLastParentTag() {
- if(parentTags.length>0) {
- return parentTags[parentTags.length-1];
- }
- return null;
- }
-
- /**
- * @return the name of parent tag (type==TAG_NAME) or attribute (type==ATTRIBUTE_NAME or type==ATTRIBUTE_VALE) to set
- */
- public String getParent() {
- if(type == Type.TAG_NAME) {
- return getLastParentTag();
- }
- return parent;
- }
-
- /**
- * @param name the name of parent tag or attribute to set
- */
- public void setParent(String name) {
- this.parent = name;
- }
-
- /**
- * Value of query. For example in case of ATTRIBUTE_NAME type it is an attribute name.
- * @return
- */
- public String getValue() {
- return value;
- }
-
- public void setValue(String value) {
- this.value = value;
- }
-
- /**
- * True if the value is a mask. For example we ask all tags which start with "<h:outputT" then the value "outputT" is a mask.
- * @return
- */
- public boolean isMask() {
- return useAsMask;
- }
-
- public void setMask(boolean useAsMask) {
- this.useAsMask = useAsMask;
- }
-
- /**
- * Returns type of value
- * @return
- */
- public Type getType() {
- return type;
- }
-
- public void setType(Type type) {
- this.type = type;
- }
-
- /**
- * @return offset
- */
- public int getOffset() {
- return offset;
- }
-
- public void setOffset(int offset) {
- this.offset = offset;
- }
-
- /**
- * @return the string representation of this query.
- * In case of tag name this method will return "<h:outputText"
- * but getValue() will return "outputText".
- */
- public String getStringQuery() {
- return stringQuery;
- }
-
- /**
- * @param stringQuery the stringQuery to set
- */
- public void setStringQuery(String stringQuery) {
- this.stringQuery = stringQuery;
- }
-
- /**
- * @return the tag prefix.
- */
- public String getPrefix() {
- return prefix;
- }
-
- /**
- * @param prefix the prefix to set
- */
- public void setPrefix(String prefix) {
- this.prefix = prefix;
- }
-}
\ No newline at end of file
Deleted: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/PageContextFactory.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/PageContextFactory.java 2009-05-15 12:44:23 UTC (rev 15276)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/PageContextFactory.java 2009-05-15 12:45:03 UTC (rev 15277)
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 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.kb;
-
-import org.eclipse.core.resources.IFile;
-
-/**
- * @author Alexey Kazakov
- */
-public class PageContextFactory {
-
- /**
- * Creates a page context for given resource and offset.
- * @param file
- * @param offset
- * @return
- */
- public static IPageContext createPageContext(IFile file, int offset) {
- // TODO
- return null;
- }
-}
\ No newline at end of file
Deleted: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/PageProcessor.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/PageProcessor.java 2009-05-15 12:44:23 UTC (rev 15276)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/PageProcessor.java 2009-05-15 12:45:03 UTC (rev 15277)
@@ -1,89 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 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.kb;
-
-import java.util.ArrayList;
-
-import org.jboss.tools.common.el.core.resolver.ELResolver;
-import org.jboss.tools.common.text.TextProposal;
-import org.jboss.tools.jst.web.kb.taglib.IAttribute;
-import org.jboss.tools.jst.web.kb.taglib.IComponent;
-import org.jboss.tools.jst.web.kb.taglib.ITagLibrary;
-
-/**
- * @author Alexey Kazakov
- */
-public class PageProcessor implements IProposalProcessor {
-
- /*
- * (non-Javadoc)
- * @see org.jboss.tools.jst.web.kb.ProposalProcessor#getProposals(org.jboss.tools.jst.web.kb.KbQuery, org.jboss.tools.jst.web.kb.PageContext)
- */
- public TextProposal[] getProposals(KbQuery query, IPageContext context) {
- ArrayList<TextProposal> proposals = new ArrayList<TextProposal>();
- ITagLibrary[] libs = context.getLibraries();
- for (int i = 0; i < libs.length; i++) {
- TextProposal[] libProposals = libs[i].getProposals(query, context);
- for (int j = 0; j < libProposals.length; j++) {
- proposals.add(libProposals[i]);
- }
- }
- if(query.getType() == KbQuery.Type.ATTRIBUTE_VALUE || query.getType() == KbQuery.Type.TEXT) {
- String value = query.getValue();
- //TODO convert value to EL string.
- String elString = value;
- ELResolver[] resolvers = context.getElResolvers();
- for (int i = 0; i < resolvers.length; i++) {
- proposals.addAll(resolvers[i].getCompletions(elString, !query.isMask(), query.getOffset(), context));
- }
- }
-
- return proposals.toArray(new TextProposal[proposals.size()]);
- }
-
- /**
- * Returns components
- * @param query
- * @param context
- * @return components
- */
- public IComponent[] getComponents(KbQuery query, IPageContext context) {
- ArrayList<IComponent> components = new ArrayList<IComponent>();
- ITagLibrary[] libs = context.getLibraries();
- for (int i = 0; i < libs.length; i++) {
- IComponent[] libComponents = libs[i].getComponents(query, context);
- for (int j = 0; j < libComponents.length; j++) {
- components.add(libComponents[i]);
- }
- }
- return components.toArray(new IComponent[components.size()]);
- }
-
- /**
- * Returns attributes
- * @param query
- * @param context
- * @return attributes
- */
- public IAttribute[] getAttributes(KbQuery query, IPageContext context) {
- ArrayList<IAttribute> attributes = new ArrayList<IAttribute>();
- if(query.getType() == KbQuery.Type.ATTRIBUTE_NAME || query.getType() == KbQuery.Type.ATTRIBUTE_VALUE) {
- IComponent[] components = getComponents(query, context);
- for (int i = 0; i < components.length; i++) {
- IAttribute[] libAttributess = components[i].getAttributes(query, context);
- for (int j = 0; j < libAttributess.length; j++) {
- attributes.add(libAttributess[i]);
- }
- }
- }
- return attributes.toArray(new IAttribute[attributes.size()]);
- }
-}
\ No newline at end of file
Deleted: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/internal/FaceletContextImpl.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/internal/FaceletContextImpl.java 2009-05-15 12:44:23 UTC (rev 15276)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/internal/FaceletContextImpl.java 2009-05-15 12:45:03 UTC (rev 15277)
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 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.kb.internal;
-
-import java.util.Map;
-
-import org.jboss.tools.jst.web.kb.IFaceletPageContext;
-
-/**
- * Facelet page context
- * @author Alexey Kazakov
- */
-public class FaceletContextImpl extends JspContextImpl implements IFaceletPageContext {
-
- private IFaceletPageContext parentContext;
- private Map<String, String> params;
-
- /*
- * (non-Javadoc)
- * @see org.jboss.tools.common.kb.text.FaceletPageContext#getParentContext()
- */
- public IFaceletPageContext getParentContext() {
- return parentContext;
- }
-
- public void setParentContext(IFaceletPageContext parentContext) {
- this.parentContext = parentContext;
- }
-
- /*
- * (non-Javadoc)
- * @see org.jboss.tools.common.kb.text.FaceletPageContext#getParams()
- */
- public Map<String, String> getParams() {
- return params;
- }
-
- public void setParams(Map<String, String> params) {
- this.params = params;
- }
-}
\ No newline at end of file
Deleted: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/internal/JspContextImpl.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/internal/JspContextImpl.java 2009-05-15 12:44:23 UTC (rev 15276)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/internal/JspContextImpl.java 2009-05-15 12:45:03 UTC (rev 15277)
@@ -1,165 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 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.kb.internal;
-
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.Region;
-import org.jboss.tools.common.el.core.resolver.ELResolver;
-import org.jboss.tools.common.el.core.resolver.ElVarSearcher;
-import org.jboss.tools.common.el.core.resolver.Var;
-import org.jboss.tools.jst.web.kb.IPageContext;
-import org.jboss.tools.jst.web.kb.IResourceBundle;
-import org.jboss.tools.jst.web.kb.taglib.ITagLibrary;
-
-/**
- * JSP page context
- * @author Alexey Kazakov
- */
-public class JspContextImpl implements IPageContext {
-
- private IFile resource;
- private IDocument document;
- private ElVarSearcher varSearcher;
- private ITagLibrary[] libs;
- private ELResolver[] elResolvers;
- private Map<Region, Var[]> vars = new HashMap<Region, Var[]>();
- private Set<Var> allVars = new HashSet<Var>();
-
- /*
- * (non-Javadoc)
- * @see org.jboss.tools.common.kb.text.PageContext#getResource()
- */
- public IFile getResource() {
- return resource;
- }
-
- public void setResource(IFile resource) {
- this.resource = resource;
- }
-
- /*
- * (non-Javadoc)
- * @see org.jboss.tools.common.kb.text.PageContext#getLibraries()
- */
- public ITagLibrary[] getLibraries() {
- return libs;
- }
-
- public void setLibraries(ITagLibrary[] libs) {
- this.libs = libs;
- }
-
- /*
- * (non-Javadoc)
- * @see org.jboss.tools.common.kb.text.PageContext#getElResolvers()
- */
- public ELResolver[] getElResolvers() {
- return elResolvers;
- }
-
- public void setElResolvers(ELResolver[] elResolvers) {
- this.elResolvers = elResolvers;
- }
-
- private final static Var[] EMPTY_VAR_ARRAY = new Var[0];
-
- /*
- * (non-Javadoc)
- * @see org.jboss.tools.common.kb.text.PageContext#getVars(int)
- */
- public Var[] getVars(int offset) {
- for (Region region : vars.keySet()) {
- if(offset>=region.getOffset() && offset<=region.getOffset() + region.getLength()) {
- return vars.get(region);
- }
- }
- return EMPTY_VAR_ARRAY;
- }
-
- /**
- * Adds new Var to the context
- * @param region
- * @param vars
- */
- public void addVars(Region region, Var[] vars) {
- this.vars.put(region, vars);
- for (int i = 0; i < vars.length; i++) {
- allVars.add(vars[i]);
- }
- }
-
- /*
- * (non-Javadoc)
- * @see org.jboss.tools.common.kb.text.PageContext#getResourceBundles()
- */
- public IResourceBundle[] getResourceBundles() {
- // TODO
- return null;
- }
-
- /**
- * @return the libs
- */
- public ITagLibrary[] getLibs() {
- return libs;
- }
-
- /**
- * @param libs the libs to set
- */
- public void setLibs(ITagLibrary[] libs) {
- this.libs = libs;
- }
-
- /**
- * @param document the document to set
- */
- public void setDocument(IDocument document) {
- this.document = document;
- }
-
- /**
- * @param varSearcher the varSearcher to set
- */
- public void setVarSearcher(ElVarSearcher varSearcher) {
- this.varSearcher = varSearcher;
- }
-
- /*
- * (non-Javadoc)
- * @see org.jboss.tools.jst.web.kb.PageContext#getDocument()
- */
- public IDocument getDocument() {
- return document;
- }
-
- /*
- * (non-Javadoc)
- * @see org.jboss.tools.common.el.core.resolver.ELContext#getVarSearcher()
- */
- public ElVarSearcher getVarSearcher() {
- return varSearcher;
- }
-
- /*
- * (non-Javadoc)
- * @see org.jboss.tools.common.el.core.resolver.ELContext#getVars()
- */
- public Var[] getVars() {
- return allVars.toArray(new Var[allVars.size()]);
- }
-}
\ No newline at end of file
15 years, 4 months