Author: scabanovich
Date: 2007-12-19 11:09:04 -0500 (Wed, 19 Dec 2007)
New Revision: 5374
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web/resources/meta/web.meta
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/context/IImportWebProjectContext.java
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/context/ImportWebDirProjectContext.java
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/context/ImportWebProjectContext.java
Log:
JBIDE-1223
Modified: trunk/jst/plugins/org.jboss.tools.jst.web/resources/meta/web.meta
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/resources/meta/web.meta 2007-12-19 15:50:21
UTC (rev 5373)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/resources/meta/web.meta 2007-12-19 16:09:04
UTC (rev 5374)
@@ -705,6 +705,13 @@
</Constraint>
<Editor name="FileChooser"/>
</XModelAttribute>
+ <XModelAttribute default="true" name="link">
+ <Constraint loader="List">
+ <value name="true"/>
+ <value name="false"/>
+ </Constraint>
+ <Editor name="CheckBox"/>
+ </XModelAttribute>
</XModelAttributes>
<XActionItem kind="list"/>
<XDependencies/>
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/context/IImportWebProjectContext.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/context/IImportWebProjectContext.java 2007-12-19
15:50:21 UTC (rev 5373)
+++
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/context/IImportWebProjectContext.java 2007-12-19
16:09:04 UTC (rev 5374)
@@ -36,4 +36,5 @@
public String SERVLET_VERSION_WARNING = WebUIMessages.SERVLET_VERSION_WARNING;
public boolean isServletVersionConsistentToWebXML();
public void convertWebXML(boolean backup);
+ public boolean isLinkingToProjectOutsideWorkspace();
}
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/context/ImportWebDirProjectContext.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/context/ImportWebDirProjectContext.java 2007-12-19
15:50:21 UTC (rev 5373)
+++
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/context/ImportWebDirProjectContext.java 2007-12-19
16:09:04 UTC (rev 5374)
@@ -31,6 +31,7 @@
public static final String ATTR_NAME = "name"; //$NON-NLS-1$
public static final String ATTR_LOCATON = "web.xml location"; //$NON-NLS-1$
+ public static final String ATTR_LINK = "link"; //$NON-NLS-1$
public static final String ATTR_CLASSES = "classes"; //$NON-NLS-1$
public static final String ATTR_LIB = "lib"; //$NON-NLS-1$
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/context/ImportWebProjectContext.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/context/ImportWebProjectContext.java 2007-12-19
15:50:21 UTC (rev 5373)
+++
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/context/ImportWebProjectContext.java 2007-12-19
16:09:04 UTC (rev 5374)
@@ -47,6 +47,7 @@
protected boolean addLibraries = false;
protected String servletVersion = null;
protected String templateVersion = null;
+ protected boolean isLinkingToProjectOutsideWorkspace = true;
public ImportWebProjectContext() {}
@@ -108,30 +109,30 @@
public String getApplicationName() {
return registry.getApplicationName();
}
-
+
public void setApplicationName(String value) {
registry.setApplicationName(value);
}
-
+
public String getClassesLocation() {
return classesLocation;
}
-
+
public void setClassesLocation(String value) {
classesLocation = value;
}
-
+
public String getLibLocation() {
if((libLocation == null || libLocation.trim().length() == 0) && addLibraries)
{
return getDefaultLibLocation();
}
return libLocation;
}
-
+
public void setLibLocation(String value) {
libLocation = value;
}
-
+
/**
* Called if libLocation is not set, but addLibraries flag is true.
* @return
@@ -139,19 +140,19 @@
public String getDefaultLibLocation() {
return webInfLocation == null ? "" : webInfLocation + "/lib";
}
-
+
public String getBuildXmlLocation() {
return buildXmlLocation;
}
-
+
public void setBuildXmlLocation(String value) {
buildXmlLocation = value;
}
-
+
public String getWebInfLocation() {
return webInfLocation;
}
-
+
public String getWebRootPath() {
String result = null;
for (int i = 0; i < modules.length && result == null; i++)
@@ -159,7 +160,7 @@
result = modules[i].getAttributeValue("root"); //$NON-NLS-1$
return result;
}
-
+
public String[] getJavaSources() {
ArrayList<String> list = new ArrayList<String>();
String path = null;
@@ -169,16 +170,16 @@
}
return list.toArray(new String[list.size()]);
}
-
+
private String getModuleName(XModelObject module) {
String n = module.getAttributeValue("name"); //$NON-NLS-1$
return (n.length() == 0) ? "<default>" : n; //$NON-NLS-1$
}
-
+
private String getJavaSource(XModelObject module) {
return module.getAttributeValue("java src"); //$NON-NLS-1$
}
-
+
public String[] getExistingSources() {
return existingSources;
}
@@ -186,28 +187,36 @@
public void setAddLibraries(boolean b) {
addLibraries = b;
}
-
+
public boolean getAddLibraries() {
return addLibraries;
}
-
+
public void setServletVersion(String version) {
this.servletVersion = version;
registry.setServletVersion(version);
}
-
+
public String getServletVersion() {
return servletVersion;
}
-
+
public void setTemplateVersion(String version) {
this.templateVersion = version;
}
-
+
public String getTemplateVersion() {
return templateVersion;
}
-
+
+ public boolean isLinkingToProjectOutsideWorkspace() {
+ return isLinkingToProjectOutsideWorkspace;
+ }
+
+ public void setLinkingToProjectOutsideWorkspace(boolean b) {
+ isLinkingToProjectOutsideWorkspace = b;
+ }
+
protected boolean isWebXMLUpToDate(String location) {
if(location == null) return webXmlLocation == null;
if(!location.equals(webXmlLocation)) return false;
@@ -219,7 +228,7 @@
return webXMLTimeStamp == -1;
}
}
-
+
protected void loadWebXML(String body, String location) throws Exception {
String entity =
getTarget().getModel().getEntityRecognizer().getEntityName("xml", body);
//$NON-NLS-1$
if(entity == null || !entity.startsWith("FileWebApp")) { //$NON-NLS-1$
@@ -242,9 +251,9 @@
throw new Exception(webXMLErrorMessage);
}
}
-
+
public abstract String getNatureID();
-
+
public boolean isServletVersionConsistentToWebXML() {
if(webxml == null) return true;
String entity = webxml.getModelEntity().getName();
@@ -253,7 +262,7 @@
if("2.5".equals(servletVersion) &&
!entity.equals("FileWebApp25")) return false; //$NON-NLS-1$ //$NON-NLS-2$
return true;
}
-
+
public void convertWebXML(boolean backup) {
if(webxml == null) return;
String entity = webxml.getModelEntity().getName();
@@ -273,7 +282,7 @@
public String getWebXMLVersion() {
return WebAppHelper.getServletVersion(webxml);
}
-
+
private void convertWebXML(String entity, boolean backup) {
if(backup) backUp();
XModelObject newweb = XModelObjectLoaderUtil.createValidObject(webxml.getModel(),
entity);
@@ -317,7 +326,7 @@
String text = ((FileAnyImpl)newweb).getAsText();
FileUtil.writeFile(new File(webXmlLocation), text);
}
-
+
private void backUp() {
if(webXmlLocation == null) return;
File source = new File(webXmlLocation);
Show replies by date