|
Lines 31-41
Link Here
|
| 31 |
import org.eclipse.jst.j2ee.project.facet.J2EEModuleFacetInstallDataModelProvider; |
31 |
import org.eclipse.jst.j2ee.project.facet.J2EEModuleFacetInstallDataModelProvider; |
| 32 |
import org.eclipse.wst.common.componentcore.ComponentCore; |
32 |
import org.eclipse.wst.common.componentcore.ComponentCore; |
| 33 |
import org.eclipse.wst.common.componentcore.ModuleCoreNature; |
33 |
import org.eclipse.wst.common.componentcore.ModuleCoreNature; |
|
|
34 |
import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetProjectCreationDataModelProperties; |
| 34 |
import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; |
35 |
import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; |
| 35 |
import org.eclipse.wst.common.componentcore.resources.IVirtualFolder; |
36 |
import org.eclipse.wst.common.componentcore.resources.IVirtualFolder; |
| 36 |
import org.eclipse.wst.common.frameworks.datamodel.IDataModel; |
37 |
import org.eclipse.wst.common.frameworks.datamodel.IDataModel; |
| 37 |
import org.eclipse.wst.common.frameworks.internal.plugin.WTPCommonPlugin; |
38 |
import org.eclipse.wst.common.frameworks.internal.plugin.WTPCommonPlugin; |
| 38 |
import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion; |
39 |
import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion; |
|
|
40 |
import org.eclipse.wst.common.project.facet.core.runtime.IRuntime; |
| 39 |
import org.eclipse.wst.project.facet.ProductManager; |
41 |
import org.eclipse.wst.project.facet.ProductManager; |
| 40 |
|
42 |
|
| 41 |
import com.ibm.icu.text.UTF16; |
43 |
import com.ibm.icu.text.UTF16; |
|
Lines 106-114
Link Here
|
| 106 |
return Boolean.TRUE; |
108 |
return Boolean.TRUE; |
| 107 |
}else if (propertyName.equals(INSTALL_WEB_LIBRARY)){ |
109 |
}else if (propertyName.equals(INSTALL_WEB_LIBRARY)){ |
| 108 |
return J2EEComponentClasspathContainerUtils.getDefaultUseWebAppLibraries(); |
110 |
return J2EEComponentClasspathContainerUtils.getDefaultUseWebAppLibraries(); |
|
|
111 |
} |
| 112 |
else if (propertyName.equals(ADD_TO_EAR)) { |
| 113 |
Object result = super.getDefaultProperty(propertyName); |
| 114 |
if (result instanceof Boolean) { |
| 115 |
return ((Boolean) result).booleanValue() && isEARDefaultForRuntime(); |
| 116 |
} |
| 109 |
} |
117 |
} |
| 110 |
return super.getDefaultProperty(propertyName); |
118 |
return super.getDefaultProperty(propertyName); |
| 111 |
} |
119 |
} |
|
|
120 |
|
| 121 |
private boolean isEARDefaultForRuntime() { |
| 122 |
boolean result = true; |
| 123 |
IRuntime rt = (IRuntime) model.getProperty(IFacetProjectCreationDataModelProperties.FACET_RUNTIME); |
| 124 |
if (rt != null && rt.getName() != null) { |
| 125 |
for(String excluded : |
| 126 |
J2EEPlugin.getDefault().getJ2EEPreferences().getString(J2EEPreferences.Keys.ADD_TO_EAR_RUNTIME_EXCEPTIONS).split(",")) { //$NON-NLS-1$ |
| 127 |
|
| 128 |
if (rt.getName().equals(excluded)) { |
| 129 |
|
| 130 |
result = false; |
| 131 |
break; |
| 132 |
} |
| 133 |
} |
| 134 |
} |
| 135 |
|
| 136 |
return result; |
| 137 |
} |
| 112 |
|
138 |
|
| 113 |
@Override |
139 |
@Override |
| 114 |
public boolean propertySet(String propertyName, Object propertyValue) { |
140 |
public boolean propertySet(String propertyName, Object propertyValue) { |