|
Lines 105-111
Link Here
|
| 105 |
if (propertyName.equals(PROHIBIT_ADD_TO_EAR)) { |
105 |
if (propertyName.equals(PROHIBIT_ADD_TO_EAR)) { |
| 106 |
return Boolean.FALSE; |
106 |
return Boolean.FALSE; |
| 107 |
} else if (propertyName.equals(ADD_TO_EAR)) { |
107 |
} else if (propertyName.equals(ADD_TO_EAR)) { |
| 108 |
return new Boolean( J2EEPlugin.getDefault().getJ2EEPreferences().getBoolean(J2EEPreferences.Keys.ADD_TO_EAR_BY_DEFAULT) && isEARSupportedByRuntime()); |
108 |
return new Boolean( J2EEPlugin.getDefault().getJ2EEPreferences().getBoolean(J2EEPreferences.Keys.ADD_TO_EAR_BY_DEFAULT) |
|
|
109 |
&& isEARSupportedByRuntime() && isEARDefaultForRuntime()); |
| 109 |
} else if (propertyName.equals(EAR_PROJECT_NAME)) { |
110 |
} else if (propertyName.equals(EAR_PROJECT_NAME)) { |
| 110 |
DataModelPropertyDescriptor[] descs = getValidPropertyDescriptors(EAR_PROJECT_NAME); |
111 |
DataModelPropertyDescriptor[] descs = getValidPropertyDescriptors(EAR_PROJECT_NAME); |
| 111 |
if (model.isPropertySet(LAST_EAR_NAME)) { |
112 |
if (model.isPropertySet(LAST_EAR_NAME)) { |
|
Lines 274-280
Link Here
|
| 274 |
@Override |
275 |
@Override |
| 275 |
public boolean isPropertyEnabled(String propertyName) { |
276 |
public boolean isPropertyEnabled(String propertyName) { |
| 276 |
if (ADD_TO_EAR.equals(propertyName)) { |
277 |
if (ADD_TO_EAR.equals(propertyName)) { |
| 277 |
return !getBooleanProperty(PROHIBIT_ADD_TO_EAR) && isEARSupportedByRuntime(); |
278 |
return !getBooleanProperty(PROHIBIT_ADD_TO_EAR) && isEARSupportedByRuntime() && isEARDefaultForRuntime(); |
| 278 |
} |
279 |
} |
| 279 |
if (EAR_PROJECT_NAME.equals(propertyName)) { |
280 |
if (EAR_PROJECT_NAME.equals(propertyName)) { |
| 280 |
return !getBooleanProperty(PROHIBIT_ADD_TO_EAR) && isEARSupportedByRuntime() && getBooleanProperty(ADD_TO_EAR); |
281 |
return !getBooleanProperty(PROHIBIT_ADD_TO_EAR) && isEARSupportedByRuntime() && getBooleanProperty(ADD_TO_EAR); |
|
Lines 372-381
Link Here
|
| 372 |
private boolean isEARSupportedByRuntime() { |
373 |
private boolean isEARSupportedByRuntime() { |
| 373 |
boolean ret = true; |
374 |
boolean ret = true; |
| 374 |
IRuntime rt = (IRuntime) model.getProperty(IFacetProjectCreationDataModelProperties.FACET_RUNTIME); |
375 |
IRuntime rt = (IRuntime) model.getProperty(IFacetProjectCreationDataModelProperties.FACET_RUNTIME); |
| 375 |
if (rt != null) |
376 |
|
|
|
377 |
if (rt != null) { |
| 376 |
ret = rt.supports(IJ2EEFacetConstants.ENTERPRISE_APPLICATION_FACET); |
378 |
ret = rt.supports(IJ2EEFacetConstants.ENTERPRISE_APPLICATION_FACET); |
|
|
379 |
} |
| 380 |
|
| 377 |
return ret; |
381 |
return ret; |
| 378 |
} |
382 |
} |
|
|
383 |
|
| 384 |
private boolean isEARDefaultForRuntime() { |
| 385 |
boolean result = true; |
| 386 |
IRuntime rt = (IRuntime) model.getProperty(IFacetProjectCreationDataModelProperties.FACET_RUNTIME); |
| 387 |
|
| 388 |
|
| 389 |
if (rt != null && rt.getName() != null) { |
| 390 |
for(String excluded : |
| 391 |
J2EEPlugin.getDefault().getJ2EEPreferences().getString(J2EEPreferences.Keys.ADD_TO_EAR_RUNTIME_EXCLUSIONS).split(",")) { //$NON-NLS-1$ |
| 392 |
if (rt.getName().equals(excluded)) { |
| 393 |
result = false; |
| 394 |
break; |
| 395 |
} |
| 396 |
} |
| 397 |
} |
| 398 |
|
| 399 |
return result; |
| 400 |
} |
| 379 |
|
401 |
|
| 380 |
@Override |
402 |
@Override |
| 381 |
protected int convertFacetVersionToJ2EEVersion( IProjectFacetVersion version ) |
403 |
protected int convertFacetVersionToJ2EEVersion( IProjectFacetVersion version ) |