/** * Finds and returns the contribution node at the given path. * * @param path the path * @return the node, or <code>null</code> if none */ public IPreferenceNode find(String path) { return find(path,root); }
/** * Finds and returns the contribution node at the given path. * * @param path the path * @return the node, or <code>null</code> if none */ public IPreferenceNode find(String path) { return find(path,root); }
/** * Finds and returns the contribution node at the given path. * * @param path the path * @return the node, or <code>null</code> if none */ public IPreferenceNode find(String path) { return find(path,root); }
/** * Adds the given preference node as a subnode of the * node at the given path. * * @param path the path * @param node the node to add * @return <code>true</code> if the add was successful, * and <code>false</code> if there is no contribution at * the given path */ public boolean addTo(String path, IPreferenceNode node) { IPreferenceNode target = find(path); if (target == null) { return false; } target.add(node); return true; }
/** * Adds the given preference node as a subnode of the * node at the given path. * * @param path the path * @param node the node to add * @return <code>true</code> if the add was successful, * and <code>false</code> if there is no contribution at * the given path */ public boolean addTo(String path, IPreferenceNode node) { IPreferenceNode target = find(path); if (target == null) { return false; } target.add(node); return true; }
/** * Adds the given preference node as a subnode of the * node at the given path. * * @param path the path * @param node the node to add * @return <code>true</code> if the add was successful, * and <code>false</code> if there is no contribution at * the given path */ public boolean addTo(String path, IPreferenceNode node) { IPreferenceNode target = find(path); if (target == null) { return false; } target.add(node); return true; }
/** * Removes the preference node at the given path. * * @param path * the path * @return the node that was removed, or <code>null</code> if there was no * node at the given path */ public IPreferenceNode remove(String path) { Assert.isNotNull(path); int index = path.lastIndexOf(separator); if (index == -1) { return root.remove(path); } // Make sure that the last character in the string isn't the "." Assert.isTrue(index < path.length() - 1, "Path can not end with a dot");//$NON-NLS-1$ String parentPath = path.substring(0, index); String id = path.substring(index + 1); IPreferenceNode parentNode = find(parentPath); if (parentNode == null) { return null; } return parentNode.remove(id); }
/** * Removes the preference node at the given path. * * @param path * the path * @return the node that was removed, or <code>null</code> if there was no * node at the given path */ public IPreferenceNode remove(String path) { Assert.isNotNull(path); int index = path.lastIndexOf(separator); if (index == -1) { return root.remove(path); } // Make sure that the last character in the string isn't the "." Assert.isTrue(index < path.length() - 1, "Path can not end with a dot");//$NON-NLS-1$ String parentPath = path.substring(0, index); String id = path.substring(index + 1); IPreferenceNode parentNode = find(parentPath); if (parentNode == null) { return null; } return parentNode.remove(id); }
/** * Removes the preference node at the given path. * * @param path * the path * @return the node that was removed, or <code>null</code> if there was no * node at the given path */ public IPreferenceNode remove(String path) { Assert.isNotNull(path); int index = path.lastIndexOf(separator); if (index == -1) { return root.remove(path); } // Make sure that the last character in the string isn't the "." Assert.isTrue(index < path.length() - 1, "Path can not end with a dot");//$NON-NLS-1$ String parentPath = path.substring(0, index); String id = path.substring(index + 1); IPreferenceNode parentNode = find(parentPath); if (parentNode == null) { return null; } return parentNode.remove(id); }