eventBus_.fireEvent(new ConsoleInputEvent(commandText));
}
public void onSendToConsole(final SendToConsoleEvent event)
{
final InputEditorDisplay display = view_.getInputEditorDisplay();
// get anything already at the console
final String previousInput = StringUtil.notNull(display.getText());
// define code block we execute at finish
Command finishSendToConsole = new Command() {
@Override
public void execute()
{
if (event.shouldExecute())
{
processCommandEntry();
if (previousInput.length() > 0)
display.setText(previousInput);
}
if (!event.shouldExecute() || event.shouldFocus())
{
display.setFocus(true);
display.collapseSelection(false);
}
}
};
// do standrd finish if we aren't animating
if (!event.shouldAnimate())
{
display.clear();
display.setText(event.getCode());
finishSendToConsole.execute();
}
else
{
inputAnimator_.enque(event.getCode(), finishSendToConsole);