Search in sources :

Example 1 with InitialStateExistsCheckingResult

use of de.bmoth.checkers.initialstateexists.InitialStateExistsCheckingResult in project bmoth by hhu-stups.

the class AppView method handleInitialStateExists.

// </editor-fold>
public void handleInitialStateExists() {
    if (codeArea.getText().replaceAll("\\s+", "").length() > 0) {
        if (hasChanged || machineNode == null) {
            handleSave();
            try {
                machineNode = Parser.getMachineAsSemanticAst(codeArea.getText());
            } catch (ParserException e) {
                EventBus eventBus = EventBusProvider.getInstance().getEventBus();
                eventBus.post(new ErrorEvent("Parse error", e.toString(), e));
                return;
            }
        }
        InitialStateExistsCheckingResult result = InitialStateExistsChecker.doInitialStateExistsCheck(machineNode);
        showResultAlert(result.getResult());
    }
}
Also used : ParserException(de.bmoth.parser.ParserException) ErrorEvent(de.bmoth.eventbus.ErrorEvent) EventBus(com.google.common.eventbus.EventBus) InitialStateExistsCheckingResult(de.bmoth.checkers.initialstateexists.InitialStateExistsCheckingResult)

Aggregations

EventBus (com.google.common.eventbus.EventBus)1 InitialStateExistsCheckingResult (de.bmoth.checkers.initialstateexists.InitialStateExistsCheckingResult)1 ErrorEvent (de.bmoth.eventbus.ErrorEvent)1 ParserException (de.bmoth.parser.ParserException)1