1 package com.sri.emo.dbobj.model_tree; 2 3 import com.jcorporate.expresso.core.controller.Transition; 4 5 import java.io.Serializable; 6 import java.util.List; 7 8 /*** 9 * <tt>Special Case</tt> instance for no parents in a model. Access through 10 * the {@link Model} interface instead of directly. 11 * 12 * @author Michael Rimov 13 */ 14 class NoParentNode implements ModelNode { 15 16 17 /*** 18 * Default constructor 19 */ 20 public NoParentNode() { 21 } 22 23 /*** 24 * Throws UnsupportedOperationException - not implemented for obvious reasons. 25 * 26 * @return nothing, throws UnsupportedOperationException 27 */ 28 public List getChildren() { 29 throw new java.lang.UnsupportedOperationException("NO_PARENT has no children"); 30 } 31 32 /*** 33 * Throws UnsupportedOperationException - not implemented for obvious reasons. 34 * 35 * @return nothing, throws UnsupportedOperationException 36 */ 37 public ModelNode getParent() { 38 throw new java.lang.UnsupportedOperationException("NO_PARENT has no parent"); 39 } 40 41 /*** 42 * Throws UnsupportedOperationException - not implemented for obvious reasons. 43 * 44 * @return nothing, throws UnsupportedOperationException 45 */ 46 public ModelVisitable getVisitable() { 47 throw new java.lang.UnsupportedOperationException("NO_PARENT has no 'viewable' object"); 48 } 49 50 /*** 51 * Retrieve the label assigned to the node. 52 * 53 * @return String label. 54 */ 55 public String getLabel() { 56 return "No Such Node"; 57 } 58 59 /*** 60 * Retrieve the link to get to the node for editing. (Similar to IViewable) 61 * 62 * @return Transition. 63 */ 64 public Transition getLink() { 65 return ModelNode.NO_LINK; 66 } 67 68 /*** 69 * Default implementation of fill status. 70 * 71 * @return ModelNode 72 */ 73 public ModelFillStatus getModelFillStatus() { 74 return ModelFillStatus.PARTIALLY_FILLED; 75 } 76 77 /*** 78 * Does nothing. 79 * 80 * @return Serializable 81 */ 82 public Serializable getAdditionalInfo() { 83 return null; 84 } 85 86 /*** 87 * {@inheritDoc} 88 * 89 * @param newInfo the new application-specific information. 90 */ 91 public void setAdditionalInfo(Serializable newInfo) { 92 throw new java.lang.UnsupportedOperationException("NO_PARENT has no slot for 'tag information'"); 93 } 94 95 /*** 96 * {@inheritDoc} 97 * 98 * @return NodeCompletionStatus 99 */ 100 public NodeCompletionStatus getNodeCompletionStatus() { 101 return NodeCompletionStatus.UNDEFINED_STATUS; 102 } 103 104 /*** 105 * Sets the node completion status. They can either be Undefined, Complete, 106 * or Recursive -- pointing to another model node in the tree. 107 * 108 * @param newStatus NodeCompletionStatus 109 * @see NodeCompletionStatus 110 */ 111 public void setNodeCompletionStatus(NodeCompletionStatus newStatus) { 112 113 } 114 115 }