@Override public String getId() { return preferenceNode.getId(); }
@Override public String getId() { return preferenceNode.getId(); }
public IPreferenceNode findSubNode(String id) { Assert.isNotNull(id); Assert.isTrue(id.length() > 0); if (subNodes == null) { return null; } int size = subNodes.size(); for (int i = 0; i < size; i++) { IPreferenceNode node = (IPreferenceNode) subNodes.get(i); if (id.equals(node.getId())) { return node; } } return null; }
@Override public IPreferenceNode findSubNode(String id) { Assert.isNotNull(id); Assert.isTrue(id.length() > 0); if (subNodes == null) { return null; } int size = subNodes.size(); for (int i = 0; i < size; i++) { IPreferenceNode node = subNodes.get(i); if (id.equals(node.getId())) { return node; } } return null; }
/** * Find the <code>IPreferenceNode</code> that has data the same id as the * supplied value. * * @param nodeId * the id to search for. * @return <code>IPreferenceNode</code> or <code>null</code> if not * found. */ protected IPreferenceNode findNodeMatching(String nodeId) { List<IPreferenceNode> nodes = preferenceManager.getElements(PreferenceManager.POST_ORDER); for (IPreferenceNode node : nodes) { if (node.getId().equals(nodeId)) { return node; } } return null; }
/** * Find the <code>IPreferenceNode</code> that has data the same id as the * supplied value. * * @param nodeId * the id to search for. * @return <code>IPreferenceNode</code> or <code>null</code> if not * found. */ protected IPreferenceNode findNodeMatching(String nodeId) { List nodes = preferenceManager.getElements(PreferenceManager.POST_ORDER); for (Iterator i = nodes.iterator(); i.hasNext();) { IPreferenceNode node = (IPreferenceNode) i.next(); if (node.getId().equals(nodeId)) { return node; } } return null; }
@Override public IPreferenceNode findSubNode(String id) { Assert.isNotNull(id); Assert.isTrue(id.length() > 0); if (subNodes == null) { return null; } int size = subNodes.size(); for (int i = 0; i < size; i++) { IPreferenceNode node = subNodes.get(i); if (id.equals(node.getId())) { return node; } } return null; }
/** * Find the <code>IPreferenceNode</code> that has data the same id as the * supplied value. * * @param nodeId * the id to search for. * @return <code>IPreferenceNode</code> or <code>null</code> if not * found. */ protected IPreferenceNode findNodeMatching(String nodeId) { List<IPreferenceNode> nodes = preferenceManager.getElements(PreferenceManager.POST_ORDER); for (Iterator<IPreferenceNode> i = nodes.iterator(); i.hasNext();) { IPreferenceNode node = i.next(); if (node.getId().equals(nodeId)) { return node; } } return null; }
/** * Find the parent of the provided node. Will search recursivly through the * preference tree. * * @param parent the possible parent node. * @param target the target child node. * @return the parent node of the child node. */ private IPreferenceNode findParent(IPreferenceNode parent, IPreferenceNode target) { if (parent.getId().equals(target.getId())) { return null; } IPreferenceNode found = parent.findSubNode(target.getId()); if (found != null) { return parent; } IPreferenceNode[] children = parent.getSubNodes(); for (int i = 0; i < children.length; i++) { found = findParent(children[i], target); if (found != null) { return found; } } return null; }
private IPreferenceNode getPreferenceNode(String pageId) { Iterator iterator = PlatformUI.getWorkbench().getPreferenceManager() .getElements(PreferenceManager.PRE_ORDER).iterator(); while (iterator.hasNext()) { IPreferenceNode next = (IPreferenceNode) iterator.next(); if (next.getId().equals(pageId)) return next; } return null; }
/** * Find the parent of the provided node. Will search recursivly through the * preference tree. * * @param parent the possible parent node. * @param target the target child node. * @return the parent node of the child node. */ private IPreferenceNode findParent(IPreferenceNode parent, IPreferenceNode target) { if (parent.getId().equals(target.getId())) { return null; } IPreferenceNode found = parent.findSubNode(target.getId()); if (found != null) { return parent; } IPreferenceNode[] children = parent.getSubNodes(); for (IPreferenceNode element : children) { found = findParent(element, target); if (found != null) { return found; } } return null; }
/** * Get the preference node with pageId. * * @param pageId * @return IPreferenceNode */ private IPreferenceNode getPreferenceNode(String pageId) { Iterator iterator = PlatformUI.getWorkbench().getPreferenceManager() .getElements(PreferenceManager.PRE_ORDER).iterator(); while (iterator.hasNext()) { IPreferenceNode next = (IPreferenceNode) iterator.next(); if (next.getId().equals(pageId)) { return next; } } return null; }
/** * Get the preference node with pageId. * * @param pageId * @return IPreferenceNode */ private static IPreferenceNode getPreferenceNode(String pageId) { Iterator iterator = PlatformUI.getWorkbench().getPreferenceManager() .getElements(PreferenceManager.PRE_ORDER).iterator(); while (iterator.hasNext()) { IPreferenceNode next = (IPreferenceNode) iterator.next(); if (next.getId().equals(pageId)) { return next; } } return null; }
/** * Check to see if the node or any of its children * have an id in the ids. * @param node WorkbenchPreferenceNode * @return boolean <code>true</code> if node or oe of its children * has an id in the ids. */ private boolean checkNodeAndChildren(IPreferenceNode node) { if(ids.contains(node.getId())) { return true; } for (IPreferenceNode subNode : node.getSubNodes()) { if(checkNodeAndChildren(subNode)) { return true; } } return false; }
@Override protected boolean showPage(IPreferenceNode node) { final boolean success = super.showPage(node); if (success) { history.addHistoryEntry(new PreferenceHistoryEntry(node.getId(), node.getLabelText(), null)); } return success; }
/** * Save the currently selected node. */ private void setSelectedNode() { String storeValue = null; IStructuredSelection selection = (IStructuredSelection) getTreeViewer().getSelection(); if (selection.size() == 1) { IPreferenceNode node = (IPreferenceNode) selection.getFirstElement(); storeValue = node.getId(); } setSelectedNodePreference(storeValue); }
/** * Save the currently selected node. */ private void setSelectedNode() { String storeValue = null; IStructuredSelection selection = getTreeViewer().getStructuredSelection(); if (selection.size() == 1) { IPreferenceNode node = (IPreferenceNode) selection.getFirstElement(); storeValue = node.getId(); } setSelectedNodePreference(storeValue); }
@Override public void execute() { IWorkbenchWindow window = PlatformUI.getWorkbench() .getActiveWorkbenchWindow(); if (window != null) { PropertyDialog dialog = PropertyDialog.createDialogOn(window .getShell(), preferenceNode.getId(), selectedElement); dialog.open(); } }
/** * Save the currently selected node. */ private void setSelectedNode() { String storeValue = null; IStructuredSelection selection = (IStructuredSelection) getTreeViewer().getSelection(); if (selection.size() == 1) { IPreferenceNode node = (IPreferenceNode) selection.getFirstElement(); storeValue = node.getId(); } setSelectedNodePreference(storeValue); }
@Override public void execute() { IWorkbenchWindow window = PlatformUI.getWorkbench() .getActiveWorkbenchWindow(); if (window != null) { WorkbenchPreferenceDialog dialog = WorkbenchPreferenceDialog .createDialogOn(window.getShell(), preferenceNode.getId()); dialog.open(); } }