public void init() { super.init(); }
public Set getPropertyNames() { Set names = super.getPropertyNames(); names.add(EAR_PROJECT_NAME); names.add(ADD_TO_EAR); names.add(MODULE_URI); return names; }
public Set getPropertyNames() { Set names = super.getPropertyNames(); names.add(RUNTIME_TARGET_ID); names.add(FACET_RUNTIME); // added for jee projects that make deployment descriptors optional names.add(GENERATE_DD); return names; }
private void installUtilityFacets(IProject aProject, String specVersion, boolean existing) { replaceDeployablesOutputIfNecessary(project); IDataModel dm = DataModelFactory.createDataModel(new FacetProjectCreationDataModelProvider()); dm.setProperty(IFacetProjectCreationDataModelProperties.FACET_PROJECT_NAME, aProject.getName()); FacetDataModelMap facetDMs = (FacetDataModelMap) dm.getProperty(IFacetProjectCreationDataModelProperties.FACET_DM_MAP); facetDMs.add(setupJavaInstallAction(aProject,existing,"src")); IDataModel newModel = setupUtilInstallAction(aProject,specVersion); facetDMs.add(newModel); try { /** * Warning cleanup 12/07/2005 */ //IStatus stat = dm.getDefaultOperation().execute(null,null); dm.getDefaultOperation().execute(null,null); } catch (ExecutionException e) { Throwable realException = e.getCause(); if (realException != null && realException instanceof CoreException) { IStatus st = ((CoreException)realException).getStatus(); if (st != null) System.out.println(st); realException.printStackTrace(); } } }
public void init() { super.init(); FacetDataModelMap map = (FacetDataModelMap) getProperty(FACET_DM_MAP); IDataModel earFacet = DataModelFactory.createDataModel(new EarFacetInstallDataModelProvider()); map.add(earFacet); Collection requiredFacets = new ArrayList(); requiredFacets.add(ProjectFacetsManager.getProjectFacet(earFacet.getStringProperty(IFacetDataModelProperties.FACET_ID))); setProperty(REQUIRED_FACETS_COLLECTION, requiredFacets); } }
/** * Creates an instance of the <code>FacetProjectCreationDataModelProvider</code> * for BPEL projects. Used to associate common facet information such as * runtimes with particular a project. * * @see <code>FacetProjectCreationDataModelProvider</code> * @return <code>IDataModel</code> */ protected IDataModel createDataModel() { /* * There does not seem to be a need for any custom implementation for * BPEL projects at this stage. May have to reconsider at some point and * build a BPELFacetProjectCreationDataModelProvider. */ return DataModelFactory.createDataModel(new FacetProjectCreationDataModelProvider()); }
@Override public IStatus validate(String name) { if (PLATFORM_ID.equals(name)) { return validatePlatform(getStringProperty(name)); } else if (CONNECTION.equals(name)) { return validateConnection(getStringProperty(name)); } else if (USE_SERVER_JPA_IMPLEMENTATION.equals(name) || JPA_LIBRARY.equals(name)) { return validateJpaLibrary(); } else if (DISCOVER_ANNOTATED_CLASSES.equals(name)) { return validatePersistentClassManagement(); } else { return super.validate(name); } }
return getDefaultImplementationLibrary(); return super.getDefaultProperty(propertyName);
@Override public boolean propertySet(String propertyName, Object propertyValue) { boolean ok = super.propertySet(propertyName, propertyValue); if (RUNTIME.equals(propertyName)) { model.notifyPropertyChange(USE_SERVER_JPA_IMPLEMENTATION, IDataModel.DEFAULT_CHG); model.notifyPropertyChange(DISCOVER_ANNOTATED_CLASSES, IDataModel.DEFAULT_CHG); } return ok; }
public Object getDefaultProperty(String propertyName) { if (EAR_PROJECT_NAME.equals(propertyName)) { IDataModel nestedJ2EEFacetDataModel = getJ2EEFacetModel(); if (nestedJ2EEFacetDataModel!=null) return nestedJ2EEFacetDataModel.getProperty(IJ2EEModuleFacetInstallDataModelProperties.EAR_PROJECT_NAME); } return super.getDefaultProperty(propertyName); }
public DataModelPropertyDescriptor[] getValidPropertyDescriptors(String propertyName) { if (FACET_RUNTIME.equals(propertyName) && getBooleanProperty(ADD_TO_EAR)) { DataModelPropertyDescriptor[] descriptors = super.getValidPropertyDescriptors(propertyName); List list = new ArrayList(); for (int i = 0; i < descriptors.length; i++) { IRuntime rt = (IRuntime) descriptors[i].getPropertyValue(); if (rt == null || rt.supports(EARFacetUtils.EAR_FACET)) { list.add(descriptors[i]); } } descriptors = new DataModelPropertyDescriptor[list.size()]; for (int i = 0; i < descriptors.length; i++) { descriptors[i] = (DataModelPropertyDescriptor) list.get(i); } return descriptors; } return super.getValidPropertyDescriptors(propertyName); }
@Override public DataModelPropertyDescriptor[] getValidPropertyDescriptors(String propertyName) { if (JPA_LIBRARY.equals(propertyName)) { String[] libraries = JavaCore.getUserLibraryNames(); Arrays.sort(libraries); DataModelPropertyDescriptor[] descriptors = new DataModelPropertyDescriptor[libraries.length + 1]; descriptors[0] = new DataModelPropertyDescriptor("", WTPCommonPlugin.getResourceString(WTPCommonMessages.RUNTIME_NONE, null)); int i = 1; for (String library : libraries) { descriptors[i++] = new DataModelPropertyDescriptor(library, library); } return descriptors; } return super.getValidPropertyDescriptors(propertyName); }
public IStatus validate(String propertyName) { if (ADD_TO_EAR.equals(propertyName) || EAR_PROJECT_NAME.equals(propertyName) || FACET_PROJECT_NAME.equals(propertyName)) { if (model.getBooleanProperty(ADD_TO_EAR)) { IStatus status = validateEAR(model.getStringProperty(EAR_PROJECT_NAME)); if (!status.isOK()) return status; if (getStringProperty(IFacetProjectCreationDataModelProperties.FACET_PROJECT_NAME).equals(getStringProperty(EAR_PROJECT_NAME))) { String errorMessage = WTPCommonPlugin.getResourceString(WTPCommonMessages.SAME_MODULE_AND_EAR_NAME, new Object[]{getStringProperty(EAR_PROJECT_NAME)}); return WTPCommonPlugin.createErrorStatus(errorMessage); } } } return super.validate(propertyName); }
public boolean isPropertyEnabled(String propertyName) { if (FACET_RUNTIME.equals(propertyName)) { if (getBooleanProperty(ADD_TO_EAR)) { IStatus status = validateEAR(model.getStringProperty(EAR_PROJECT_NAME)); if (status.isOK()) { IProject earProject = ProjectUtilities.getProject(getStringProperty(EAR_PROJECT_NAME)); if (earProject != null) { IFacetedProject facetdEarProject; try { facetdEarProject = ProjectFacetsManager.create(earProject); if (facetdEarProject != null) { return false; } } catch (CoreException e) { e.printStackTrace(); } } } } return true; } return super.isPropertyEnabled(propertyName); }
private void installEARFacets(IProject aProject, String specVersion, boolean existing) { IDataModel dm = DataModelFactory.createDataModel(new FacetProjectCreationDataModelProvider()); dm.setProperty(IFacetProjectCreationDataModelProperties.FACET_PROJECT_NAME, aProject.getName()); FacetDataModelMap facetDMs = (FacetDataModelMap) dm.getProperty(IFacetProjectCreationDataModelProperties.FACET_DM_MAP); IDataModel newModel = setupEarInstallAction(aProject,specVersion); facetDMs.add(newModel); try { /** * Warning cleanup 12/07/2005 */ //IStatus stat = dm.getDefaultOperation().execute(null,null); dm.getDefaultOperation().execute(null,null); } catch (ExecutionException e) { Throwable realException = e.getCause(); if (realException != null && realException instanceof CoreException) { IStatus st = ((CoreException)realException).getStatus(); if (st != null) System.out.println(st); realException.printStackTrace(); } } }
@Override public Set getPropertyNames() { Set propertyNames = super.getPropertyNames(); propertyNames.add(PLATFORM_ID); propertyNames.add(CONNECTION); propertyNames.add(RUNTIME); propertyNames.add(USE_SERVER_JPA_IMPLEMENTATION); propertyNames.add(JPA_LIBRARY); propertyNames.add(DISCOVER_ANNOTATED_CLASSES); propertyNames.add(CREATE_ORM_XML); return propertyNames; }
public IStatus validate(String name) { errorMessage = null; if (name.equals(IMPLEMENTATION_TYPE_PROPERTY_NAME)) { if (getProperty(IMPLEMENTATION_TYPE_PROPERTY_NAME) == IMPLEMENTATION_TYPE.UNKNOWN) { return createErrorStatus(Messages.JSFFacetInstallDataModelProvider_INITIAL_VALIDATION_IMPL_TYPE); } } else if (name.equals(IMPLEMENTATION)) { if (getProperty(IMPLEMENTATION_TYPE_PROPERTY_NAME) == IMPLEMENTATION_TYPE.CLIENT_SUPPLIED) { JSFLibraryInternalReference lib = (JSFLibraryInternalReference)getProperty(IMPLEMENTATION); IStatus status = validateImpl(lib.getLibrary()); if (!OK_STATUS.equals(status)) return status; return validateClasspath(); } } else if (name.equals(CONFIG_PATH)) { return validateConfigLocation(getStringProperty(CONFIG_PATH)); } else if (name.equals(SERVLET_NAME)) { return validateServletName(getStringProperty(SERVLET_NAME)); } else if (name.equals(COMPONENT_LIBRARIES)) { return validateClasspath(); } return super.validate(name); }
return super.getDefaultProperty(propertyName);
IDataModel dm = DataModelFactory.createDataModel(new FacetProjectCreationDataModelProvider()); dm.setProperty(IFacetProjectCreationDataModelProperties.FACET_PROJECT_NAME, model.getStringProperty(PROJECT_NAME)); map.add(jdm); map.add(udm);
public Set getPropertyNames() { Set names = super.getPropertyNames(); names.add(IMPLEMENTATION_TYPE_PROPERTY_NAME); names.add(IMPLEMENTATION); names.add(DEPLOY_IMPLEMENTATION); names.add(CONFIG_PATH); names.add(SERVLET_NAME); names.add(SERVLET_CLASSNAME); names.add(SERVLET_URL_PATTERNS); names.add(WEBCONTENT_DIR); names.add(IMPLEMENTATION_LIBRARIES); names.add(COMPONENT_LIBRARIES); names.add(DEFAULT_IMPLEMENTATION_LIBRARY); return names; }