private XModelObject validateLib(XModelObject object) { XModelObject lib = object.getChildByPath("lib"); // $NON-NLS-1$ if (lib == null) { XModelObject wi = object.getChildByPath("WEB-INF"); // $NON-NLS-1$ if (wi == null) return null; XModelObject lb = wi.getChildByPath("lib"); // $NON-NLS-1$ if (lb == null) return null; lib = wi.getModel().createModelObject(XModelObjectConstants.ENT_FILE_SYSTEM_FOLDER, null); lib.setAttributeValue(XModelObjectConstants.ATTR_NAME, "lib"); // $NON-NLS-1$ lib.setAttributeValue( XModelObjectConstants.ATTR_NAME_LOCATION, wi.getAttributeValue(XModelObjectConstants.ATTR_NAME_LOCATION) + "/lib"); // $NON-NLS-1$ object.addChild(lib); object.setModified(true); } return lib; }
private void setSelectedProperties(String[] s) { XModelObject[] cs = propertyListObject.getChildren(); for (int i = 0; i < cs.length; i++) cs[i].removeFromParent(); for (int i = 0; i < s.length; i++) { XModelObject c = propertyListObject .getModel() .createModelObject("JSFDataTableProperty", null); // $NON-NLS-1$ c.setAttributeValue("name", s[i]); // $NON-NLS-1$ propertyListObject.addChild(c); } propertyListEditor.update(); }