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); } }
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(); } } }
private void installStaticWebFacets(IProject project2, String specVersion, boolean existing) { IDataModel dm = DataModelFactory.createDataModel(new FacetProjectCreationDataModelProvider()); dm.setProperty(IFacetProjectCreationDataModelProperties.FACET_PROJECT_NAME, project2.getName()); FacetDataModelMap facetDMs = (FacetDataModelMap) dm.getProperty(IFacetProjectCreationDataModelProperties.FACET_DM_MAP); //facetDMs.add(setupJavaInstallAction(webProj,existing,CreationConstants.DEFAULT_WEB_SOURCE_FOLDER)); IDataModel newModel = setupStaticWebInstallAction(project2); facetDMs.add(newModel); //setRuntime(webProj,dm); //Setting runtime property 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(); } } }
dm.setProperty(IFacetProjectCreationDataModelProperties.FACET_PROJECT_NAME, webProj.getName()); FacetDataModelMap facetDMs = (FacetDataModelMap) dm.getProperty(IFacetProjectCreationDataModelProperties.FACET_DM_MAP); facetDMs.add(setupJavaInstallAction(webProj,existing, CommonFrameworksPlugin.getDefault().getPluginPreferences().getString(CommonFrameworksPlugin.DEFAULT_SOURCE_FOLDER))); IDataModel newModel = setupWebInstallAction(webProj,specVersion); facetDMs.add(newModel);
public void init() { super.init(); FacetDataModelMap map = (FacetDataModelMap) getProperty(FACET_DM_MAP); IDataModel javaFacet = DataModelFactory.createDataModel(new JavaFacetInstallDataModelProvider()); // If applicable, keep project structure optimized by making output directory the same as the content root if (ProductManager.shouldUseSingleRootStructure()) javaFacet.setProperty(IJavaFacetInstallDataModelProperties.DEFAULT_OUTPUT_FOLDER_NAME, javaFacet.getStringProperty(IJavaFacetInstallDataModelProperties.SOURCE_FOLDER_NAME)); map.add(javaFacet); IDataModel utilFacet = DataModelFactory.createDataModel(new UtilityFacetInstallDataModelProvider()); map.add(utilFacet); utilFacet.addListener(new IDataModelListener() { public void propertyChanged(DataModelEvent event) { if (IJ2EEModuleFacetInstallDataModelProperties.EAR_PROJECT_NAME.equals(event.getPropertyName())) { if (isPropertySet(EAR_PROJECT_NAME)) setProperty(EAR_PROJECT_NAME, event.getProperty()); else model.notifyPropertyChange(EAR_PROJECT_NAME, IDataModel.DEFAULT_CHG); }else if (IJ2EEModuleFacetInstallDataModelProperties.ADD_TO_EAR.equals(event.getPropertyName())) { setProperty(ADD_TO_EAR, event.getProperty()); } } }); Collection requiredFacets = new ArrayList(); requiredFacets.add(ProjectFacetsManager.getProjectFacet(javaFacet.getStringProperty(IFacetDataModelProperties.FACET_ID))); requiredFacets.add(ProjectFacetsManager.getProjectFacet(utilFacet.getStringProperty(IFacetDataModelProperties.FACET_ID))); setProperty(REQUIRED_FACETS_COLLECTION, requiredFacets); }
FacetDataModelMap map = (FacetDataModelMap) getProperty(FACET_DM_MAP); IDataModel javaFacet = DataModelFactory.createDataModel(new JavaFacetInstallDataModelProvider()); map.add(javaFacet); IDataModel ejbFacet = DataModelFactory.createDataModel(new EjbFacetInstallDataModelProvider()); map.add(ejbFacet); String ejbRoot = ejbFacet.getStringProperty(IJ2EEModuleFacetInstallDataModelProperties.CONFIG_FOLDER); javaFacet.setProperty(IJavaFacetInstallDataModelProperties.SOURCE_FOLDER_NAME, ejbRoot);
FacetDataModelMap map = (FacetDataModelMap) getProperty(FACET_DM_MAP); IDataModel javaFacet = DataModelFactory.createDataModel(new JavaFacetInstallDataModelProvider()); map.add(javaFacet); IDataModel appClientFacet = DataModelFactory.createDataModel(new AppClientFacetInstallDataModelProvider()); map.add(appClientFacet); String appClientRoot = appClientFacet.getStringProperty(IJ2EEModuleFacetInstallDataModelProperties.CONFIG_FOLDER); javaFacet.setProperty(IJavaFacetInstallDataModelProperties.SOURCE_FOLDER_NAME, appClientRoot);
private void installEJBFacets(IProject ejbProject2,String ejbVersion, boolean existing) { replaceDeployablesOutputIfNecessary(project); IDataModel dm = DataModelFactory.createDataModel(new FacetProjectCreationDataModelProvider()); dm.setProperty(IFacetProjectCreationDataModelProperties.FACET_PROJECT_NAME, ejbProject2.getName()); FacetDataModelMap facetDMs = (FacetDataModelMap) dm.getProperty(IFacetProjectCreationDataModelProperties.FACET_DM_MAP); facetDMs.add(setupJavaInstallAction(ejbProject2,existing,J2EEPlugin.getDefault().getJ2EEPreferences().getString(J2EEPreferences.Keys.EJB_CONTENT_FOLDER))); IDataModel newModel = setupEjbInstallAction(ejbProject2,ejbVersion,existing); facetDMs.add(newModel); //setRuntime(ejbProject2,dm); //Setting runtime property 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(); } } } private void installWEBFacets(IProject webProj,String specVersion, boolean existing) {
private void installAppClientFacets(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,J2EEPlugin.getDefault().getJ2EEPreferences().getString(J2EEPreferences.Keys.APP_CLIENT_CONTENT_FOLDER))); IDataModel newModel = setupAppClientInstallAction(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(); } } }
private void installConnectorFacets(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,J2EEPlugin.getDefault().getJ2EEPreferences().getString(J2EEPreferences.Keys.JCA_CONTENT_FOLDER))); IDataModel newModel = setupConnectorInstallAction(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(); } } }
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 Object getConfig(IProjectFacetVersion fv, Type type, String pjname) throws CoreException { FacetDataModelMap map = (FacetDataModelMap) model.getProperty(FACET_DM_MAP); IDataModel configDM = (IDataModel) map.get(fv.getProjectFacet().getId()); if (configDM == null) { final Object config = fv.createActionConfig(type, pjname); if (config == null || !(config instanceof IDataModel)) return null; configDM = (IDataModel) config; map.add(configDM); } configDM.setProperty(IFacetDataModelProperties.FACET_VERSION, fv); return configDM; }