Ejemplo n.º 1
1
 public void insertString(FilterBypass fb, int offset, String string, AttributeSet attr)
     throws BadLocationException {
   StringBuilder builder = new StringBuilder(string);
   for (int i = builder.length() - 1; i >= 0; i--) {
     int cp = builder.codePointAt(i);
     if (!Character.isDigit(cp) && cp != '-') {
       builder.deleteCharAt(i);
       if (Character.isSupplementaryCodePoint(cp)) {
         i--;
         builder.deleteCharAt(i);
       }
     }
   }
   super.insertString(fb, offset, builder.toString(), attr);
 }
Ejemplo n.º 2
0
    @Override
    public void insertString(final int offs, final String str, final AttributeSet a)
        throws BadLocationException {
      // NavigatorLogger.printMessage("Offset:"+offs+" STr:"+str+"L:"+getLength()+"attr:"+a);

      if ((getLength() + str.length()) <= maxLength) {
        final char[] source = str.toCharArray();
        final char[] result = new char[source.length];
        int j = 0;

        for (int i = 0; i < result.length; i++) {
          if (Character.isDigit(source[i])) {
            result[j++] = source[i];
          } else {
            toolkit.beep();
            if (log.isDebugEnabled()) {
              log.debug("insertString: " + source[i]); // NOI18N
            }
          }
        }
        super.insertString(offs, new String(result, 0, j), a);
        checked = false;
      } else {
        toolkit.beep();
      }
      if ((getLength()) == maxLength) { // getLength() ist schon aktualisiert
        if (bringFocus2Next == true) {
          checked = true;
          nextField.requestFocus();
        }
        // NavigatorLogger.printMessage("Sprung");
        // NavigatorLogger.printMessage(nextField);
      }
    }
Ejemplo n.º 3
0
    public void processKeyEvent(KeyEvent evt) {
      evt = KeyEventWorkaround.processKeyEvent(evt);
      if (evt == null) return;

      switch (evt.getID()) {
        case KeyEvent.KEY_TYPED:
          char ch = evt.getKeyChar();
          if (!nonDigit && Character.isDigit(ch)) {
            super.processKeyEvent(evt);
            repeat = true;
            repeatCount = Integer.parseInt(action.getText());
          } else {
            nonDigit = true;
            if (repeat) {
              passToView(evt);
            } else super.processKeyEvent(evt);
          }
          break;
        case KeyEvent.KEY_PRESSED:
          int keyCode = evt.getKeyCode();
          if (evt.isActionKey()
              || evt.isControlDown()
              || evt.isAltDown()
              || evt.isMetaDown()
              || keyCode == KeyEvent.VK_BACK_SPACE
              || keyCode == KeyEvent.VK_DELETE
              || keyCode == KeyEvent.VK_ENTER
              || keyCode == KeyEvent.VK_TAB
              || keyCode == KeyEvent.VK_ESCAPE) {
            nonDigit = true;
            if (repeat) {
              passToView(evt);
              break;
            } else if (keyCode == KeyEvent.VK_TAB) {
              complete(true);
              evt.consume();
            } else if (keyCode == KeyEvent.VK_ESCAPE) {
              evt.consume();
              if (popup != null) {
                popup.dispose();
                popup = null;
                action.requestFocus();
              } else {
                if (temp) view.removeToolBar(ActionBar.this);
                view.getEditPane().focusOnTextArea();
              }
              break;
            } else if ((keyCode == KeyEvent.VK_UP || keyCode == KeyEvent.VK_DOWN)
                && popup != null) {
              popup.list.processKeyEvent(evt);
              break;
            }
          }
          super.processKeyEvent(evt);
          break;
      }
    }
Ejemplo n.º 4
0
  /**
   * Retrieves the word on which the mouse pointer is present
   *
   * @param evt - the MouseEvent which triggered this method
   */
  private String fetchPhrase(MouseEvent evt) {
    Messages.log("--handle Mouse Right Click--");
    int off = xyToOffset(evt.getX(), evt.getY());
    if (off < 0) return null;
    int line = getLineOfOffset(off);
    if (line < 0) return null;
    String s = getLineText(line);
    if (s == null) return null;
    else if (s.length() == 0) return null;
    else {
      int x = xToOffset(line, evt.getX()), x2 = x + 1, x1 = x - 1;
      int xLS = off - getLineStartNonWhiteSpaceOffset(line);
      Messages.log("x=" + x);
      if (x < 0 || x >= s.length()) return null;
      String word = s.charAt(x) + "";
      if (s.charAt(x) == ' ') return null;
      if (!(Character.isLetterOrDigit(s.charAt(x)) || s.charAt(x) == '_' || s.charAt(x) == '$'))
        return null;
      int i = 0;
      while (true) {
        i++;
        if (x1 >= 0 && x1 < s.length()) {
          if (Character.isLetter(s.charAt(x1)) || s.charAt(x1) == '_') {
            word = s.charAt(x1--) + word;
            xLS--;
          } else x1 = -1;
        } else x1 = -1;

        if (x2 >= 0 && x2 < s.length()) {
          if (Character.isLetterOrDigit(s.charAt(x2)) || s.charAt(x2) == '_' || s.charAt(x2) == '$')
            word = word + s.charAt(x2++);
          else x2 = -1;
        } else x2 = -1;

        if (x1 < 0 && x2 < 0) break;
        if (i > 200) {
          // time out!
          break;
        }
      }
      if (Character.isDigit(word.charAt(0))) {
        return null;
      }
      Messages.log("Mouse click, word: " + word.trim());
      ASTGenerator astGenerator = editor.getErrorChecker().getASTGenerator();
      synchronized (astGenerator) {
        astGenerator.setLastClickedWord(line, word, xLS);
      }
      return word.trim();
    }
  }
Ejemplo n.º 5
0
  /** Handle remove. */
  public void remove(int offs, int length) throws BadLocationException {
    int sourceLength = getLength();

    // Allow user to restore uninitialized state again by removing all

    if (offs == 0 && sourceLength == length) {
      super.remove(0, sourceLength);
      return;
    }

    // Do custom remove

    String sourceText = getText(0, sourceLength);
    StringBuffer strBuffer = new StringBuffer(sourceText.substring(0, offs));
    int counter;

    for (counter = offs; counter < offs + length; counter++) {
      // Only remove digits and intDelims

      char currChar = sourceText.charAt(counter);

      if (Character.isDigit(currChar) || currChar == intDelim) {
        continue;
      }

      strBuffer.append(currChar);
    }

    // Append last part of sourceText

    if (counter < sourceLength) {
      strBuffer.append(sourceText.substring(counter));
    }

    // Set text in field

    super.remove(0, sourceLength);
    insertString(0, strBuffer.toString(), (AttributeSet) getDefaultRootElement());

    // Set caret pos

    int newDiff = sourceLength - getLength() - 1;
    if (newDiff < 0) {
      newDiff = 0;
    }
    if (offs - newDiff < 0) {
      newDiff = 0;
    }
    textField.setCaretPosition(offs - newDiff);
  }
  /** Handle a key typed event. This inserts the key into the text area. */
  public void keyTyped(KeyEvent evt) {
    int modifiers = evt.getModifiers();
    char c = evt.getKeyChar();

    // this is the apple/cmd key on macosx.. so menu commands
    // were being passed through as legit keys.. added this line
    // in an attempt to prevent.
    if ((modifiers & KeyEvent.META_MASK) != 0) return;

    if (c != KeyEvent.CHAR_UNDEFINED) // &&
    //                (modifiers & KeyEvent.ALT_MASK) == 0)
    {
      if (c >= 0x20 && c != 0x7f) {
        KeyStroke keyStroke = KeyStroke.getKeyStroke(Character.toUpperCase(c));
        Object o = currentBindings.get(keyStroke);

        if (o instanceof Hashtable) {
          currentBindings = (Hashtable) o;
          return;
        } else if (o instanceof ActionListener) {
          currentBindings = bindings;
          executeAction((ActionListener) o, evt.getSource(), String.valueOf(c));
          return;
        }

        currentBindings = bindings;

        if (grabAction != null) {
          handleGrabAction(evt);
          return;
        }

        // 0-9 adds another 'digit' to the repeat number
        if (repeat && Character.isDigit(c)) {
          repeatCount *= 10;
          repeatCount += (c - '0');
          return;
        }

        executeAction(INSERT_CHAR, evt.getSource(), String.valueOf(evt.getKeyChar()));

        repeatCount = 0;
        repeat = false;
      }
    }
  }
Ejemplo n.º 7
0
 public void insertString(int offs, String str, AttributeSet a) throws BadLocationException {
   final boolean rgb = isRGBMode();
   char[] source = str.toCharArray();
   if (mySrc != null) {
     final int selected = mySrc.getSelectionEnd() - mySrc.getSelectionStart();
     int newLen = mySrc.getText().length() - selected + str.length();
     if (newLen > (myHex ? 6 : 3)) {
       Toolkit.getDefaultToolkit().beep();
       return;
     }
   }
   char[] result = new char[source.length];
   int j = 0;
   for (int i = 0; i < result.length; i++) {
     if (myHex
         ? "0123456789abcdefABCDEF".indexOf(source[i]) >= 0
         : Character.isDigit(source[i])) {
       result[j++] = source[i];
     } else {
       Toolkit.getDefaultToolkit().beep();
     }
   }
   final String toInsert = StringUtil.toUpperCase(new String(result, 0, j));
   final String res = new StringBuilder(mySrc.getText()).insert(offs, toInsert).toString();
   try {
     if (!myHex) {
       final int num = Integer.parseInt(res);
       if (rgb) {
         if (num > 255) {
           Toolkit.getDefaultToolkit().beep();
           return;
         }
       } else {
         if ((mySrc == myRed && num > 359)
             || ((mySrc == myGreen || mySrc == myBlue) && num > 100)) {
           Toolkit.getDefaultToolkit().beep();
           return;
         }
       }
     }
   } catch (NumberFormatException ignore) {
   }
   super.insertString(offs, toInsert, a);
 }
Ejemplo n.º 8
0
  public void actionPerformed(ActionEvent arg0) {
    //

    String s = arg0.getActionCommand();
    if (faxNumButton.isSelected()) {
      if (Character.isDigit(s.charAt(0))) faxNumberWork(s);
      if (s.equals("-")) faxNumberWork(s);
    } else {
      if (!(check_control_key(s))) {
        BroadcastDBWork(s);
      }
    }

    if (s.equals("Send")) {
      SendWork(s);
    } else if (s.equals("Clear")) {
      ClearWork(s);
    } else if (s.equals("Cancel")) {
      CancelWork(s);
    }
  }
  /** Handle a key typed event. This inserts the key into the text area. */
  @Override
  @SuppressWarnings("unchecked")
  public void keyTyped(KeyEvent evt) {
    int modifiers = evt.getModifiers();
    char c = evt.getKeyChar();
    if (c != KeyEvent.CHAR_UNDEFINED && (modifiers & InputEvent.ALT_MASK) == 0) {
      if (c >= 0x20 && c != 0x7f) {
        KeyStroke keyStroke = KeyStroke.getKeyStroke(Character.toUpperCase(c));
        Object o = currentBindings.get(keyStroke);

        if (o instanceof Hashtable) {
          currentBindings = (Hashtable) o;
          return;
        } else if (o instanceof ActionListener) {
          currentBindings = bindings;
          executeAction((ActionListener) o, evt.getSource(), String.valueOf(c));
          return;
        }

        currentBindings = bindings;

        if (grabAction != null) {
          handleGrabAction(evt);
          return;
        }

        // 0-9 adds another 'digit' to the repeat number
        if (repeat && Character.isDigit(c)) {
          repeatCount *= 10;
          repeatCount += (c - '0');
          return;
        }

        executeAction(INSERT_CHAR, evt.getSource(), String.valueOf(evt.getKeyChar()));

        repeatCount = 0;
        repeat = false;
      }
    }
  }
Ejemplo n.º 10
0
  /** Remove delimiters */
  public String getRealString(String oldString) {
    char addChar;
    String newString = "";
    realDelimFound = false;

    int length = oldString.length();
    for (int i = 0; i < length; i++) {
      addChar = oldString.charAt(i);
      if (Character.isDigit(addChar)) {
        newString += addChar;
      } else if (addChar == realDelim) {
        if (realDelimFound == true) {
          break;
        }

        realDelimFound = true;
        newString += ".";
      }
    }

    return newString;
  }
Ejemplo n.º 11
0
    @Override
    public void replace(
        DocumentFilter.FilterBypass fp, int offset, int length, String string, AttributeSet aset)
        throws BadLocationException {
      Document doc = fp.getDocument();
      String oldText = doc.getText(0, doc.getLength());
      StringBuilder sb = new StringBuilder(oldText);
      sb.replace(offset, offset + length, oldText);

      int len = string.length();
      boolean isValidInteger = true;

      for (int i = 0; i < len; i++) {
        if (!Character.isDigit(string.charAt(i))) {
          isValidInteger = false;
          break;
        }
      }
      if (isValidInteger && verifyText(sb.toString())) {
        super.replace(fp, offset, length, string, aset);
      } else Toolkit.getDefaultToolkit().beep();
    }
Ejemplo n.º 12
0
  private DarkBotMCSpambot(
      DarkBot darkBot,
      String server,
      String username,
      String password,
      String sessionId,
      String loginProxy,
      String proxy,
      String owner) {
    synchronized (bots) {
      bots.add(this);
      // slotsTaken.incrementAndGet();
      synchronized (slotsTaken) {
        slotsTaken.notifyAll();
      }
    }
    MinecraftBotData.Builder builder = MinecraftBotData.builder();
    // botData.nickname = "";
    // for(int i = 0; i < 10; i++)
    // botData.nickname += alphas[random.nextInt(alphas.length)];
    if (proxy != null && !proxy.isEmpty()) {
      int port = 80;
      ProxyType type = ProxyType.SOCKS;
      if (proxy.contains(":")) {
        String[] parts = proxy.split(":");
        proxy = parts[0];
        port = Integer.parseInt(parts[1]);
        if (parts.length > 2) type = ProxyType.values()[Integer.parseInt(parts[2]) - 1];
      }
      builder.withSocksProxy(new ProxyData(proxy, port, type));
      this.proxy = new Proxy(Proxy.Type.SOCKS, new InetSocketAddress(proxy, port));
    }
    if (loginProxy != null && !loginProxy.isEmpty()) {
      int port = 80;
      if (loginProxy.contains(":")) {
        String[] parts = loginProxy.split(":");
        loginProxy = parts[0];
        port = Integer.parseInt(parts[1]);
      }
      builder.withHttpProxy(new ProxyData(loginProxy, port, ProxyType.HTTP));
      this.loginProxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(loginProxy, port));
    }
    builder.withUsername(username);
    if (sessionId != null) builder.withSessionId(sessionId);
    else builder.withPassword(password);
    if (server != null && !server.isEmpty()) {
      int port = 25565;
      if (server.contains(":")) {
        String[] parts = server.split(":");
        server = parts[0];
        port = Integer.parseInt(parts[1]);
      }
      builder.withServer(server).withPort(port);
    } else throw new IllegalArgumentException("Unknown server!");

    this.owner = owner;
    MinecraftBotData botData = builder.build();
    System.setProperty("socksProxyHost", "");
    System.setProperty("socksProxyPort", "");
    System.out.println("[" + username + "] Connecting...");
    bot = new MinecraftBot(darkBot, botData);
    bot.setMovementDisabled(true);
    connectionHandler = bot.getConnectionHandler();
    Session session = bot.getSession();
    // System.gc();
    System.out.println("[" + username + "] Done! (" + amountJoined.incrementAndGet() + ")");
    bot.getEventManager().registerListener(this);
    bot.getGameHandler().registerListener(this);

    long lastShoutTime = System.currentTimeMillis();
    while (bot.isConnected()) {
      if (die) {
        connectionHandler.sendPacket(new Packet255KickDisconnect("Goodbye"));
        return;
      }
      try {
        Thread.sleep(3000 + random.nextInt(1000));
      } catch (InterruptedException exception) {
        exception.printStackTrace();
      }
      if (!bot.hasSpawned()) continue;
      connectionHandler.sendPacket(new Packet0KeepAlive(random.nextInt()));
      if (spamMessage == null || !canSpam) continue;
      String message = spamMessage;
      if (message.contains("%skill")) message = message.replace("%skill", skills[nextSkill++]);
      if (nextSkill >= skills.length) nextSkill = 0;
      if (message.contains("%bot")) {
        synchronized (bots) {
          message =
              message.replace(
                  "%bot",
                  bots.get(nextBot > bots.size() ? (nextBot = 0) * 0 : nextBot++)
                      .bot
                      .getSession()
                      .getUsername());
        }
      }
      if (message.contains("%spamlist"))
        message = message.replace("%spamlist", spamList[nextSpamList++]);
      if (nextSpamList >= spamList.length) nextSpamList = 0;
      if (message.contains("%rnd")) {
        int length = 1;
        int index = message.indexOf("%rnd") + "%rnd".length();
        int lastIndex;
        for (lastIndex = index; lastIndex < message.length(); lastIndex++)
          if (Character.isDigit(message.charAt(lastIndex))) lastIndex++;
          else break;
        if (lastIndex > message.length()) lastIndex--;
        try {
          System.out.println(index + "," + lastIndex + "," + message.length());
          length = Integer.parseInt(message.substring(index, lastIndex));
        } catch (Exception exception) {
        }

        String randomChars = "";
        for (int i = 0; i < length; i++) randomChars += alphas[random.nextInt(alphas.length)];
        message = message.replace("%rnd", randomChars);
      }
      if (message.contains("%msg"))
        message = "/msg " + msgChars[nextMsgChar++] + " " + message.replace("%msg", "");
      if (message.contains("%ernd")) {
        message = message.replace("%ernd", "");
        int extraMessageLength = 15 + random.nextInt(6);
        message = message.substring(0, Math.min(100 - extraMessageLength, message.length())) + " [";
        extraMessageLength -= 3;
        for (int i = 0; i < extraMessageLength; i++)
          message += alphas[random.nextInt(alphas.length)];
        message += "]";
      } else message = message.substring(0, Math.min(100, message.length()));
      connectionHandler.sendPacket(new Packet3Chat(message));
    }
    synchronized (bots) {
      bots.remove(this);
    }
    amountJoined.decrementAndGet();
    slotsTaken.decrementAndGet();
    synchronized (slotsTaken) {
      slotsTaken.notifyAll();
    }
  }
Ejemplo n.º 13
0
  protected static String parsePhrase(final String lineText) {

    boolean overloading = false;

    { // Check if we can provide suggestions for this phrase ending
      String trimmedLineText = lineText.trim();
      if (trimmedLineText.length() == 0) return null;

      char lastChar = trimmedLineText.charAt(trimmedLineText.length() - 1);
      if (lastChar == '.') {
        trimmedLineText = trimmedLineText.substring(0, trimmedLineText.length() - 1).trim();
        if (trimmedLineText.length() == 0) return null;
        lastChar = trimmedLineText.charAt(trimmedLineText.length() - 1);
        switch (lastChar) {
          case ')':
          case ']':
          case '"':
            break; // We can suggest for these
          default:
            if (!Character.isJavaIdentifierPart(lastChar)) {
              return null; // Not something we can suggest
            }
            break;
        }
      } else if (lastChar == '(') {
        overloading = true; // We can suggest overloaded methods
      } else if (!Character.isJavaIdentifierPart(lastChar)) {
        return null; // Not something we can suggest
      }
    }

    final int currentCharIndex = lineText.length() - 1;

    { // Check if the caret is in the comment
      int commentStart = lineText.indexOf("//", 0);
      if (commentStart >= 0 && currentCharIndex > commentStart) {
        return null;
      }
    }

    // Index the line
    BitSet isInLiteral = new BitSet(lineText.length());
    BitSet isInBrackets = new BitSet(lineText.length());

    { // Mark parts in literals
      boolean inString = false;
      boolean inChar = false;
      boolean inEscaped = false;

      for (int i = 0; i < lineText.length(); i++) {
        if (!inEscaped) {
          switch (lineText.charAt(i)) {
            case '\"':
              if (!inChar) inString = !inString;
              break;
            case '\'':
              if (!inString) inChar = !inChar;
              break;
            case '\\':
              if (inString || inChar) {
                inEscaped = true;
              }
              break;
          }
        } else {
          inEscaped = false;
        }
        isInLiteral.set(i, inString || inChar);
      }
    }

    if (isInLiteral.get(currentCharIndex)) return null;

    { // Mark parts in top level brackets
      int depth = overloading ? 1 : 0;
      int bracketStart = overloading ? lineText.length() : 0;
      int squareDepth = 0;
      int squareBracketStart = 0;

      bracketLoop:
      for (int i = lineText.length() - 1; i >= 0; i--) {
        if (!isInLiteral.get(i)) {
          switch (lineText.charAt(i)) {
            case ')':
              if (depth == 0) bracketStart = i;
              depth++;
              break;
            case '(':
              depth--;
              if (depth == 0) {
                isInBrackets.set(i, bracketStart);
              } else if (depth < 0) {
                break bracketLoop;
              }
              break;
            case ']':
              if (squareDepth == 0) squareBracketStart = i;
              squareDepth++;
              break;
            case '[':
              squareDepth--;
              if (squareDepth == 0) {
                isInBrackets.set(i, squareBracketStart);
              } else if (squareDepth < 0) {
                break bracketLoop;
              }
              break;
          }
        }
      }

      if (depth > 0) isInBrackets.set(0, bracketStart);
      if (squareDepth > 0) isInBrackets.set(0, squareBracketStart);
    }

    // Walk the line from the end while it makes sense
    int position = currentCharIndex;
    parseLoop:
    while (position >= 0) {
      int currChar = lineText.charAt(position);
      switch (currChar) {
        case '.': // Grab it
          position--;
          break;
        case '[':
          break parseLoop; // End of scope
        case ']': // Grab the whole region in square brackets
          position = isInBrackets.previousClearBit(position - 1);
          break;
        case '(':
          if (isInBrackets.get(position)) {
            position--; // This checks for first bracket while overloading
            break;
          }
          break parseLoop; // End of scope
        case ')': // Grab the whole region in brackets
          position = isInBrackets.previousClearBit(position - 1);
          break;
        case '"': // Grab the whole literal and quit
          position = isInLiteral.previousClearBit(position - 1);
          break parseLoop;
        default:
          if (Character.isJavaIdentifierPart(currChar)) {
            position--; // Grab the identifier
          } else if (Character.isWhitespace(currChar)) {
            position--; // Grab whitespace too
          } else {
            break parseLoop; // Got a char ending the phrase
          }
          break;
      }
    }

    position++;

    // Extract phrase
    String phrase = lineText.substring(position, lineText.length()).trim();
    Messages.log(phrase);

    if (phrase.length() == 0 || Character.isDigit(phrase.charAt(0))) {
      return null; // Can't suggest for numbers or empty phrases
    }

    return phrase;
  }
Ejemplo n.º 14
0
    public void keyTyped(KeyEvent e) {
      char c = e.getKeyChar();

      // as a coding convenience, create a reference to the text component
      // that is typecast to JTextComponent.  this is not essential, as we
      // could typecast every reference, but this makes the code cleaner
      JTextComponent _theComponent = (JTextComponent) DataTypeByte.this._textComponent;
      String text = _theComponent.getText();

      // look for illegal chars
      if (!DataTypeByte.this._isSigned && c == '-') {
        // cannot use '-' when unsigned
        _beepHelper.beep(_theComponent);
        e.consume();
      }

      // tabs and newlines get put into the text before this check,
      // so remove them
      // This only applies to Popup editing since these chars are
      // not passed to this level by the in-cell editor.
      if (c == KeyEvent.VK_TAB || c == KeyEvent.VK_ENTER) {
        // remove all instances of the offending char
        int index = text.indexOf(c);
        if (index != -1) {
          if (index == text.length() - 1) {
            text = text.substring(0, text.length() - 1); // truncate string
          } else {
            text = text.substring(0, index) + text.substring(index + 1);
          }
          ((IRestorableTextComponent) _theComponent).updateText(text);
          _beepHelper.beep(_theComponent);
        }
        e.consume();
      }

      if (!(Character.isDigit(c)
          || (c == '-')
          || (c == KeyEvent.VK_BACK_SPACE)
          || (c == KeyEvent.VK_DELETE))) {
        _beepHelper.beep(_theComponent);
        e.consume();
      }

      // check for max size reached (only works when DB provides non-zero scale info
      if (DataTypeByte.this._scale > 0
          && text.length() == DataTypeByte.this._scale
          && c != KeyEvent.VK_BACK_SPACE
          && c != KeyEvent.VK_DELETE) {
        // max size reached
        e.consume();
        _beepHelper.beep(_theComponent);
      }

      // handle cases of null
      // The processing is different when nulls are allowed and when they are not.
      //

      if (DataTypeByte.this._isNullable) {

        // user enters something when field is null
        if (text.equals("<null>")) {
          if ((c == KeyEvent.VK_BACK_SPACE) || (c == KeyEvent.VK_DELETE)) {
            // delete when null => original value
            DataTypeByte.this._textComponent.restoreText();
            e.consume();
          } else {
            // non-delete when null => clear field and add text
            DataTypeByte.this._textComponent.updateText("");
            // fall through to normal processing of this key stroke
          }
        } else {
          // check for user deletes last thing in field
          if ((c == KeyEvent.VK_BACK_SPACE) || (c == KeyEvent.VK_DELETE)) {
            if (text.length() <= 1) {
              // about to delete last thing in field, so replace with null
              DataTypeByte.this._textComponent.updateText("<null>");
              e.consume();
            }
          }
        }
      } else {
        // field is not nullable
        //
        handleNotNullableField(text, c, e, _textComponent);
      }
    }