예제 #1
0
 private FxNode handleEventContent(CharSequence content) {
   EventHandler eh = (EventHandler) nodeStack.peek();
   if (eh.isScript() && !eh.hasContent()) {
     if (content.length() == 0) {
       throw new UnsupportedOperationException();
     } else {
       if (content.charAt(0) == '#') {
         content = content.subSequence(1, content.length());
         eh = accessor.asMethodRef(eh);
       }
     }
   }
   accessor.addContent(eh, content);
   return eh;
 }
예제 #2
0
  @Override
  public void characterSequence(CharSequence seq) {

    addElementErrors();

    int length = seq.length();
    FxNode node = nodeStack.peek();
    FxNode addedNode = null;

    switch (node.getKind()) {
      case Event:
        addedNode = handleEventContent(seq);
        break;
      case Instance:
        addedNode = handleInstanceContent(seq);
        break;
      case Property:
        addedNode = handlePropertyContent(seq);
        break;

      default:
        addError(
            new ErrorMark(
                contentLocator.getElementOffset(),
                length,
                "unexpected-characters",
                ERR_unexpectedCharacters()));
    }
    if (addedNode != null) {
      i(addedNode).endsAt(contentLocator.getEndOffset());
    }
  }