system/src/sc/lang/java/JavaSemanticNode.java
public JavaSemanticNode refreshNode() {
      JavaModel myModel = getJavaModel();
      if (myModel != null) {
         JavaModel newModel = (JavaModel) myModel.getLayeredSystem().getAnnotatedModel(myModel.getSrcFile());
         // Our file model is not the current one managed by the system so we need to find the corresponding node.
         if (newModel != myModel && newModel != null) {
            IParseNode origParseNode = getParseNode();
            if (origParseNode != null) {
               int startIx = origParseNode.getStartIndex();
               if (startIx != -1) {
                  IParseNode newParseNode = newModel.getParseNode();
                  IParseNode newNode = newParseNode == null ? null : newParseNode.findParseNode(startIx, origParseNode.getParselet(), true);
                  if (newNode != null) {
                     Object semValue = newNode.getSemanticValue();
                     if (semValue != null && semValue.getClass() == getClass())
                        return (JavaSemanticNode) semValue;
                  }
               }
            }
         }
      }
      return this;
   }
/**
    * Needs to be implemented for IDE support on nodes which can be referenced outside of the same file.  If the model
    * in which this references lives has been removed (or really replaced by another version of the same model), we need
    * to find the node in the other model that corresponds to this node and return it.
    */
Needs to be implemented for IDE support on nodes which can be referenced outside of the same file.  If the model
in which this references lives has been removed (or really replaced by another version of the same model), we need
to find the node in the other model that corresponds to this node and return it.
Needs to be implemented for IDE support on nodes which can be referenced outside of the same file . If the model in which this references lives has been removed ( or really replaced by another version of the same model ) we need to find the node in the other model that corresponds to this node and return it .
public JavaSemanticNode refreshNode() {
      JavaModel myModel = getJavaModel();
      if (myModel != null) {
         JavaModel newModel = (JavaModel) myModel.getLayeredSystem().getAnnotatedModel(myModel.getSrcFile());
         if (newModel != myModel && newModel != null) {
            IParseNode origParseNode = getParseNode();
            if (origParseNode != null) {
               int startIx = origParseNode.getStartIndex();
               if (startIx != -1) {
                  IParseNode newParseNode = newModel.getParseNode();
                  IParseNode newNode = newParseNode == null ? null : newParseNode.findParseNode(startIx, origParseNode.getParselet(), true);
                  if (newNode != null) {
                     Object semValue = newNode.getSemanticValue();
                     if (semValue != null && semValue.getClass() == getClass())
                        return (JavaSemanticNode) semValue;
                  }
               }
            }
         }
      }
      return this;
   }
public JavaSemanticNode refreshNode ( ) { JavaModel myModel = getJavaModel ( ) ; if ( myModel != null ) { JavaModel newModel = ( JavaModel ) myModel . getLayeredSystem ( ) . getAnnotatedModel ( myModel . getSrcFile ( ) ) ; if ( newModel != myModel && newModel != null ) { IParseNode origParseNode = getParseNode ( ) ; if ( origParseNode != null ) { int startIx = origParseNode . getStartIndex ( ) ; if ( startIx != - 1 ) { IParseNode newParseNode = newModel . getParseNode ( ) ; IParseNode newNode = newParseNode == null ? null : newParseNode . findParseNode ( startIx , origParseNode . getParselet ( ) , true ) ; if ( newNode != null ) { Object semValue = newNode . getSemanticValue ( ) ; if ( semValue != null && semValue . getClass ( ) == getClass ( ) ) return ( JavaSemanticNode ) semValue ; } } } } } return this ; }
Needs to be implemented for IDE support on nodes which can be referenced outside of the same file.
Needs to be implemented for IDE support on nodes which can be referenced outside of the same file .
// Our file model is not the current one managed by the system so we need to find the corresponding node.