org.openide.nodes.Node.getValue()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(5.6k)|赞(0)|评价(0)|浏览(166)

本文整理了Java中org.openide.nodes.Node.getValue()方法的一些代码示例,展示了Node.getValue()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Node.getValue()方法的具体详情如下:
包路径:org.openide.nodes.Node
类名称:Node
方法名:getValue

Node.getValue介绍

暂无

代码示例

代码示例来源:origin: org.netbeans.api/org-openide-nodes

  1. @Override
  2. public Object getValue(String attributeName) {
  3. if (delegating(DELEGATE_GET_VALUE)) {
  4. return original.getValue(attributeName);
  5. } else {
  6. return super.getValue(attributeName);
  7. }
  8. }

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-cnd-makeproject

  1. protected final Project getProject(Node[] activatedNodes) {
  2. if (activatedNodes.length != 1) {
  3. return null;
  4. }
  5. Object project = activatedNodes[0].getValue("Project"); // NOI18N
  6. if (project == null || (!(project instanceof Project))) {
  7. return null;
  8. }
  9. return (Project)project;
  10. }

代码示例来源:origin: stackoverflow.com

  1. public void updateNode(int value) {
  2. if (value != this.value) {
  3. this.value = value;
  4. if (getParent() != null) {
  5. int sum = 0;
  6. for (Node n : getParent().getChildren()) {
  7. sum += n.getValue();
  8. }
  9. getParent.updateNode(sum);
  10. }
  11. }
  12. }

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide

  1. public Object getValue(String attributeName) {
  2. if (delegating (DELEGATE_GET_VALUE)) {
  3. return original.getValue (attributeName);
  4. } else {
  5. return super.getValue (attributeName);
  6. }
  7. }

代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide

  1. public Object getValue(String attributeName) {
  2. if (delegating (DELEGATE_GET_VALUE)) {
  3. return original.getValue (attributeName);
  4. } else {
  5. return super.getValue (attributeName);
  6. }
  7. }

代码示例来源:origin: stackoverflow.com

  1. private List<string> getSlidesFromDocument(Document doc)
  2. {
  3. NodeList nodeList = doc.getElementsByTagName("urlslide");
  4. List<String> slides = new ArrayList<String>();
  5. for(Node node : nodelist) slides.add(node.getValue());
  6. return slides;
  7. }

代码示例来源:origin: stackoverflow.com

  1. PriorityQueue<Node> queue = new PriorityQueue<Node>(10, new Comparator<Node>() {
  2. public int compare(Node left, Node right) {
  3. return left.getValue() - other.getValue();
  4. }
  5. });

代码示例来源:origin: stackoverflow.com

  1. List<Node> nodes = new DOMXPath("//p").selectNodes(document);
  2. for (Node node : nodes) {
  3. // do something with the matched nodes
  4. node.getValue();
  5. }

代码示例来源:origin: stackoverflow.com

  1. public int get(int index) throws IndexOutOfBoundsException {
  2. if (index < 0 || index > length) {
  3. throw new IndexOutOfBoundsException();
  4. } else {
  5. Node cursor = head;
  6. for (int i = 0; i < index; i++) {
  7. cursor = cursor.getNext();
  8. }
  9. return cursor.getValue();
  10. }
  11. }

代码示例来源:origin: stackoverflow.com

  1. public void recursionMethodTwo(Node n) {
  2. if (n == null) {
  3. // Standard way to exit a void function without executing remaing code
  4. // note that return null; doesn't compile
  5. return;
  6. }
  7. System.out.println(n.getValue());
  8. recursionMethodTwo(n.next());
  9. }

代码示例来源:origin: stackoverflow.com

  1. public static List traversePreRecursive(Node node) {
  2. if (node == null) return new ArrayList();
  3. List nodeValues = new ArrayList();
  4. nodeValues.add(node.getValue());
  5. nodeValues.addAll(traversePreRecursive(node.getLeft()));
  6. nodeValues.addAll(traversePreRecursive(node.getRight()));
  7. return nodeValues;
  8. }

代码示例来源:origin: stackoverflow.com

  1. Leaf b1 = new Leaf(5);
  2. Leaf b2 = new Leaf(5);
  3. Node b = new Node(b1, b2);
  4. Leaf c1 = new Leaf(3);
  5. Leaf c2 = new Leaf(7);
  6. Node c = new Node(c1, c2);
  7. Node a = new Node(b, c);
  8. System.out.println("a value = " + a.getValue());

代码示例来源:origin: stackoverflow.com

  1. Node previous = null;
  2. Node current = first;
  3. while (current != null && current.getValue() != searchedValue) {
  4. previous = current;
  5. current = current.getNext();
  6. }
  7. previous.setNext(newNode);
  8. newNode.setNext(current);

代码示例来源:origin: stackoverflow.com

  1. void traverse(Node root, String path) {
  2. path += root.getValue();
  3. for (Node child : root.getChildren())
  4. traverse(child, path);
  5. // end of current traversal
  6. if (root.getChildren().isEmpty())
  7. System.out.print(path + " ");
  8. }

代码示例来源:origin: stackoverflow.com

  1. private static List<Integer> extractValues(Node n) {
  2. List<Integer> result = new ArrayList<>();
  3. if (n.getLeft() != null) {
  4. result.addAll(extractValues(n.getLeft()));
  5. }
  6. if (n.getRight() != null) {
  7. result.addAll(extractValues(n.getRight()));
  8. }
  9. result.add(n.getValue());
  10. return result;
  11. }

代码示例来源:origin: org.netbeans.api/org-openide-explorer

  1. public void run() {
  2. //the following must run in EDT to avoid deadlocks, see #91371
  3. if (isDescriptionVisible() &&
  4. (Node.PROP_DISPLAY_NAME.equals(nm) || Node.PROP_SHORT_DESCRIPTION.equals(nm))) {
  5. //XXX SHOULD NOT BE FIRED TO NODELISTENERS
  6. Node n = (Node) evt.getSource();
  7. if (currNode == n) {
  8. String description = (String) n.getValue("nodeDescription"); //NOI18N
  9. psheet.setDescription(n.getDisplayName(), (description == null) ? n.getShortDescription() : description);
  10. table.setBeanName(n.getDisplayName());
  11. }
  12. }
  13. }
  14. };

代码示例来源:origin: org.codehaus.mevenide/nb-project

  1. void store(WizardDescriptor d) {
  2. if (manager.getSelectedNodes().length > 0) {
  3. d.putProperty(PROP_ARCHETYPE, manager.getSelectedNodes()[0].getValue(PROP_ARCHETYPE));
  4. }
  5. }

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-cnd-makeproject

  1. private static Node findItemNode(Node root, Item item) {
  2. Node parentNode = findFolderNode(root, item.getFolder());
  3. if (parentNode != null) {
  4. Node[] nodes = parentNode.getChildren().getNodes(true);
  5. for (int i = 0; i < nodes.length; i++) {
  6. if (nodes[i].getValue("Item") == item) { // NOI18N
  7. return nodes[i];
  8. }
  9. }
  10. }
  11. return null;
  12. }

代码示例来源:origin: stackoverflow.com

  1. private static int extractValues(Node n, int[] results, int index) {
  2. if (n.getLeft() != null) {
  3. index = extractValues(n.getLeft(), results, index);
  4. }
  5. if (n.getRight() != null) {
  6. index = extractValues(n.getRight(), results, index);
  7. }
  8. results[index] = n.getValue();
  9. return index + 1;
  10. }

代码示例来源:origin: stackoverflow.com

  1. public boolean contains(Node node, Integer value) {
  2. if(node != null && node.hasValue())
  3. if(value == node.getValue())
  4. return true;
  5. boolean found = false
  6. if(node.hasLeft())
  7. found = contains(node.getLeft(), value);
  8. if(!found && node.hasRight())
  9. found = contains(node.getRight(), value);
  10. return found;
  11. }

相关文章