/** * Creates a new preference manager with the given * path separator. * * @param separatorChar */ public PreferenceManager(final char separatorChar) { this(separatorChar, new PreferenceNode(ROOT_NODE_ID)); }
/** * Adds the given preference node as a subnode of the * root. * * @param node the node to add, which must implement * <code>IPreferenceNode</code> */ public void addToRoot(IPreferenceNode node) { Assert.isNotNull(node); root.add(node); }
@Override public IPreferenceNode remove(String id) { IPreferenceNode node = findSubNode(id); if (node != null) { remove(node); } return node; }
public void createPage() { page = (IPreferencePage) createObject(classname); if (getLabelImage() != null) { page.setImageDescriptor(imageDescriptor); } page.setTitle(label); }
/** * Removes the given prefreence node if it is managed by * this contribution manager. * * @param node the node to remove * @return <code>true</code> if the node was removed, * and <code>false</code> otherwise */ public boolean remove(IPreferenceNode node) { Assert.isNotNull(node); return root.remove(node); }
@Override public IPreferenceNode findSubNode(String id) { return getNodeExpression(super.findSubNode(id)); }
@Override public void createPage() { page = (IPreferencePage) createObject(classname); if (getLabelImage() != null) { page.setImageDescriptor(imageDescriptor); } page.setTitle(label); }
/** * Removes the given prefreence node if it is managed by * this contribution manager. * * @param node the node to remove * @return <code>true</code> if the node was removed, * and <code>false</code> otherwise */ public boolean remove(IPreferenceNode node) { Assert.isNotNull(node); return root.remove(node); }
/** * Creates a new preference manager. */ public PreferenceManager() { this('.', new PreferenceNode(ROOT_NODE_ID)); }
@Override public IPreferenceNode remove(String id) { IPreferenceNode node = findSubNode(id); if (node != null) { remove(node); } return node; }
@Override public void createPage() { page = (IPreferencePage) createObject(classname); if (getLabelImage() != null) { page.setImageDescriptor(imageDescriptor); } page.setTitle(label); }
/** * Adds the given preference node as a subnode of the * root. * * @param node the node to add, which must implement * <code>IPreferenceNode</code> */ public void addToRoot(IPreferenceNode node) { Assert.isNotNull(node); root.add(node); }
/** * Removes the given prefreence node if it is managed by * this contribution manager. * * @param node the node to remove * @return <code>true</code> if the node was removed, * and <code>false</code> otherwise */ public boolean remove(IPreferenceNode node) { Assert.isNotNull(node); return root.remove(node); }
/** * Removes all contribution nodes known to this manager. */ public void removeAll() { root = new PreferenceNode("");//$NON-NLS-1$ } }
public IPreferenceNode remove(String id) { IPreferenceNode node = findSubNode(id); if (node != null) { remove(node); } return node; }
/** * Adds the given preference node as a subnode of the * root. * * @param node the node to add, which must implement * <code>IPreferenceNode</code> */ public void addToRoot(IPreferenceNode node) { Assert.isNotNull(node); root.add(node); }
/** * 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); }
/** * Creates a new preference manager with the given * path separator. * * @param separatorChar */ public PreferenceManager(final char separatorChar) { this(separatorChar, new PreferenceNode(ROOT_NODE_ID)); }
manager.addToRoot(child); } else { parent.add(child);
/** * 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); }