@Override public boolean applies(Token t) { retVal = false; if (this.param.equals(t.getWOCR()) & !t.isCorrected()) { retVal = true; } else { retVal = false; } return retVal; }
public void processEdit(ComboBoxEntry cbe) { if (cbe.getType() == ComboBoxEntryType.NORMAL) { endTokenEditing(box.getEditor().getItem().toString()); } else if (cbe.getType() == ComboBoxEntryType.MERGE) { abortTokenEditing(); MainController.findInstance().mergeRightward(tokenID); MainController.findInstance() .addToLog( MainController.findInstance().getLastFocusedTCName() + " # merge # " + " # " + temptoken.getWOCR() + " # " + temptoken.getWOCR()); } else if (cbe.getType() == ComboBoxEntryType.SETCORRECTED) { abortTokenEditing(); if (!temptoken.isCorrected()) { MainController.findInstance().setCorrected(tokenID, true); } instance.revalidate(); MainController.findInstance() .addToLog( MainController.findInstance().getLastFocusedTCName() + " # set as corrected # " + temptoken.getWOCR()); // if delete, check if prev and next token are spaces, if the case delete one of them to not // produce sequent spaces } else if (cbe.getType() == ComboBoxEntryType.DELETE) { abortTokenEditing(); MainController.findInstance().deleteToken(tokenID); } else if (cbe.getType() == ComboBoxEntryType.FOCUS_IN_MAIN) { abortTokenEditing(); MessageCenter.getInstance() .fireTokenNavigationEvent( new TokenNavigationEvent(this, tokenID, TokenNavigationType.FOCUS_IN_MAIN)); } }