public ProjectConfigFileManagerImpl(Project project) { this.project = project; auxConfig = ProjectUtils.getAuxiliaryConfiguration(project); }
public DSTracker(Project proj) { this.project = proj ; projectAux = ProjectUtils.getAuxiliaryConfiguration(project); restoreHardcodedDataSources() ; }
/** * Checks whether given project has an Application subclass stored in its * auxiliary configuration (i.e. a quick check if it is an application - * without checking the application class really exists in the project). * @param project * @return true if the project appears as app framework-based application */ static boolean isApplicationProject(Project project) { AuxiliaryConfiguration ac = ProjectUtils.getAuxiliaryConfiguration(project); return ac.getConfigurationFragment(SWINGAPP_ELEMENT, SWINGAPP_NS, true) != null; // [would be better to check for presence of valid application class in ac] }
public static synchronized DictionaryImpl getProjectDictionary(Project p, Locale locale) { Reference<DictionaryImpl> r = project2Reference.get(p); DictionaryImpl d = r != null ? r.get() : null; if (d == null) { AuxiliaryConfiguration ac = ProjectUtils.getAuxiliaryConfiguration(p); project2Reference.put(p, new WeakReference<DictionaryImpl>(d = new DictionaryImpl(p, ac, locale))); } return d; }
private Element getConfigurationFragment() { AuxiliaryConfiguration aux = ProjectUtils.getAuxiliaryConfiguration(project); Element data = aux.getConfigurationFragment(CodeAssistanceData, namespace, shared); if (data == null) { data = createDocument(namespace, shared ? "project" : "project-private").createElementNS(namespace, CodeAssistanceData); //NOI18N } if (data == null) { System.err.println("CodeAssistanceOptions: Failed to load and create configuration fragment (" + CodeAssistanceData + " : " + namespace + ")"); //NOI18N } return data; }
static String getAppClassNameFromProjectConfig(Project project) { AuxiliaryConfiguration ac = ProjectUtils.getAuxiliaryConfiguration(project); org.w3c.dom.Element appEl = ac.getConfigurationFragment(SWINGAPP_ELEMENT, SWINGAPP_NS, true); if (appEl != null) { org.w3c.dom.NodeList children = appEl.getChildNodes(); for (int i=0; i < children.getLength(); i++) { org.w3c.dom.Node n = children.item(i); if (n.getNodeType() == org.w3c.dom.Node.ELEMENT_NODE && n.getNodeName().equals(APP_CLASS_ELEMENT)) { return ((org.w3c.dom.Element)n).getAttribute(APP_CLASS_NAME_ATTR); } } return ""; // somewhat misconfigured // NOI18N } return null; }
private boolean isVisualWebLegacyProject() { boolean isLegacyProject = false; // Check if Web module is a visualweb 5.5.x or Creator project AuxiliaryConfiguration ac = ProjectUtils.getAuxiliaryConfiguration(project); Element auxElement = ac.getConfigurationFragment("creator-data", "http://www.sun.com/creator/ns", true); //NOI18N // if project is a visualweb or creator project then find out whether it is a legacy project if (auxElement != null) { String version = auxElement.getAttribute("jsf.project.version"); //NOI18N if (version != null) { if (!version.equals("4.0")) { //NOI18N isLegacyProject = true; } } } return isLegacyProject; }
public Object getProjectData(String key) { if (userData.containsKey(key)) { Object result = userData.get(key); return String.valueOf(result); } // if (JsfProjectUtils.isEnabled()) { AuxiliaryConfiguration config = ProjectUtils.getAuxiliaryConfiguration(project); Element element = config.getConfigurationFragment(PROJECTDATA_ELEMENT_KEY_PREFIX + key, PROJECTDATA_ELEMENT_NAMESPACE, false); if (element == null) return null; String result = element.getFirstChild().getNodeValue(); userData.put(key, result); return result; // } // return project.getProperty(key); }
public void setProjectData(String key, Object data) { userData.put(key, data); // PROJECTTODO2: Still need to put this on project save not on set. AuxiliaryConfiguration config = ProjectUtils.getAuxiliaryConfiguration(project); DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance(); try { // !EAT TODO move this to flushProjectData() DocumentBuilder builder = docFactory.newDocumentBuilder(); Document doc = builder.newDocument(); Element element = doc.createElementNS(PROJECTDATA_ELEMENT_NAMESPACE, PROJECTDATA_ELEMENT_KEY_PREFIX + key) ; String string = data != null ? data.toString() : null; Node node = doc.createCDATASection(string); element.appendChild(node); doc.appendChild(element); config.putConfigurationFragment(element, false); } catch (Exception e) { throw new RuntimeException(e); } return; }
public GizmoProjectOptions(Project project, boolean shared) { this.shared = shared; aux = ProjectUtils.getAuxiliaryConfiguration(project); NativeProjectType antPrj = (project.getLookup().lookup(NativeProjectType.class)); namespace = antPrj.getPrimaryConfigurationDataElementNamespace(shared); }
private static void putProjectProperty(Project project, String propName, String value, String oldval) { if (isWebProject(project)) { AuxiliaryConfiguration ac = ProjectUtils.getAuxiliaryConfiguration(project);
public static String getProjectProperty(Project project, String propName) { if (isWebProject(project)) { AuxiliaryConfiguration ac = ProjectUtils.getAuxiliaryConfiguration(project); Element auxElement = ac.getConfigurationFragment(RAVE_AUX_NAME, RAVE_AUX_NAMESPACE, true); if (auxElement == null) { // Creator 2 project return getCreatorProperty(project, propName); } String value = auxElement.getAttribute(propName); if (value == null || value.equals("")) { // Creator 2 project return getCreatorProperty(project, propName); } return value; } else return ""; }
public static boolean supportProjectProperty(Project project) { if (isWebProject(project)) { AuxiliaryConfiguration ac = ProjectUtils.getAuxiliaryConfiguration(project); Element auxElement = ac.getConfigurationFragment(RAVE_AUX_NAME, RAVE_AUX_NAMESPACE, true); if (auxElement != null) { return true; } DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); try { DocumentBuilder builder = factory.newDocumentBuilder(); Document xmlDoc = builder.newDocument(); auxElement = xmlDoc.createElementNS(RAVE_AUX_NAMESPACE, RAVE_AUX_NAME); } catch (ParserConfigurationException e) { ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, e); return false; } ac.putConfigurationFragment(auxElement, true); auxElement = ac.getConfigurationFragment(RAVE_AUX_NAME, RAVE_AUX_NAMESPACE, true); if (auxElement != null) { return true; } } return false; }
AuxiliaryConfiguration ac = ProjectUtils.getAuxiliaryConfiguration(project); org.w3c.dom.Document xml = XMLUtil.createDocument(SWINGAPP_ELEMENT, SWINGAPP_NS, null, null); org.w3c.dom.Element appEl = xml.createElementNS(SWINGAPP_NS, SWINGAPP_ELEMENT); AuxiliaryConfiguration ac = ProjectUtils.getAuxiliaryConfiguration(project); ac.removeConfigurationFragment(SWINGAPP_ELEMENT, SWINGAPP_NS, true); storedInProject = false;