cp = (ParamValue) it.next(); if (cp != null && cp.getName() != null && cp.getName().equals(JSF_CONFIG_CONTEXT_PARAM)) { foundCP = cp; found = true; pv.setName(JSF_CONFIG_CONTEXT_PARAM); pv.setValue(config.getStringProperty(IJSFFacetInstallDataModelProperties.CONFIG_PATH)); webApp.getContextParams().add(pv); } else { cp = foundCP; if (cp.getValue().indexOf(config.getStringProperty(IJSFFacetInstallDataModelProperties.CONFIG_PATH)) < 0) { String curVal = cp.getValue(); String val = config.getStringProperty(IJSFFacetInstallDataModelProperties.CONFIG_PATH); if (curVal != null || !curVal.trim().equals("")) { //$NON-NLS-1$ val = curVal + ",\n" + val; //$NON-NLS-1$ cp.setValue(val);
/** * This does the same thing as ITableLabelProvider.getColumnText. */ public String getColumnText(Object object, int columnIndex) { ParamValue initParam = (ParamValue) object; switch (columnIndex) { case 0 : return toDisplayString(initParam.getName()); case 1 : return toDisplayString(initParam.getValue()); case 2 : return toDisplayString(initParam.getDescription()); default : StringBuffer sb = new StringBuffer(); sb.append(initParam.getName()); sb.append("="); //$NON-NLS-1$ sb.append(initParam.getValue()); return sb.toString(); } }
/** * Tests if the passed ParamValue instance is the JSF CONFIG_FILES * context parameter. * * @param paramVal as EObject ParamValue instance. * @return true if the passed ParamValue instance is the JSF * CONFIG_FILES context parameter, else false */ protected boolean isConfigFilesParamValue(EObject paramVal) { boolean isConfigFiles = false; if (paramVal != null) { String name = null; if (paramVal instanceof ParamValue) name = ((ParamValue)paramVal).getName(); else if (paramVal instanceof org.eclipse.jst.javaee.core.ParamValue) name = ((org.eclipse.jst.javaee.core.ParamValue)paramVal).getParamName(); if (name != null && name.equals(JSFAppConfigUtils.CONFIG_FILES_CONTEXT_PARAM_NAME)) { isConfigFiles = true; } } return isConfigFiles; }
private void startLocatingJ2EEConfigs(WebApp webApp){ webApp.eAdapters().add(contextParamAdapter); EList contexts = webApp.getContexts(); if (contexts != null) { Iterator itContexts = contexts.iterator(); while (itContexts.hasNext()) { ContextParam contextParam = (ContextParam)itContexts.next(); contextParam.eAdapters().add(contextParamAdapter); } } EList contextParams = webApp.getContextParams(); if (contextParams != null) { Iterator itContextParams = contextParams.iterator(); while (itContextParams.hasNext()) { ParamValue paramValue = (ParamValue)itContextParams.next(); paramValue.eAdapters().add(contextParamAdapter); } } }
/** * This returns the label text for the adapted class. <!-- begin-user-doc --> <!-- end-user-doc * --> * * @generated */ public String getText(Object object) { String label = ((ParamValue) object).getName(); return label == null || label.length() == 0 ? CommonEditResourceHandler.getString("_UI_ParamValue_type") : //$NON-NLS-1$ CommonEditResourceHandler.getString("_UI_ParamValue_type") + " " + label; //$NON-NLS-1$ //$NON-NLS-2$ }
private void stopLocatingJ2EEConfigs(WebApp webApp) { webApp.eAdapters().remove(contextParamAdapter); EList contexts = webApp.getContexts(); if (contexts != null) { Iterator itContexts = contexts.iterator(); while (itContexts.hasNext()) { ContextParam contextParam = (ContextParam)itContexts.next(); contextParam.eAdapters().remove(contextParamAdapter); } } EList contextParams = webApp.getContextParams(); if (contextParams != null) { Iterator itContextParams = contextParams.iterator(); while (itContextParams.hasNext()) { ParamValue paramValue = (ParamValue)itContextParams.next(); paramValue.eAdapters().remove(contextParamAdapter); } } }