Package org.jboss.aesh.edit.actions

Examples of org.jboss.aesh.edit.actions.Operation


                //if we have a command hooked in the input goes there
                if(command != null)
                    command.processOperation(new CommandOperation(input));
                //the input is parsed by æsh
                else {
                    Operation operation = editMode.parseInput(inc, buffer.getLine());
                    if(inc != Key.UNKNOWN)
                        operation.setInput(inc.getKeyValues());
                    else
                        operation.setInput(new int[]{input[position]});
                    String result = parseOperation(operation, buffer.getPrompt().getMask());
                    if(result != null)
                        processOperationResult(result);
                }
            }
View Full Code Here


                return saveAction(Operation.REPLACE);
            }
        }


        Operation operation = currentOperation.getOperation();
        Action workingMode = currentOperation.getWorkingMode();

        //if ctrl-d is pressed on an empty line we need to return logout
        //else return new_line
        if(operation == Operation.EXIT) {
View Full Code Here

                    return Operation.SEARCH_INPUT;
                }
        } // end search mode
        else {
            // process if we have any hits...
            Operation operation = currentOperation.getOperation();
            if(operation == Operation.SEARCH_PREV ||
                    operation == Operation.SEARCH_NEXT_WORD)
                mode = Action.SEARCH;

            //if ctrl-d is pressed on an empty line we need to return logout
View Full Code Here

            return false;
        }
    }

    private void processInternalOperation(CommandOperation commandOperation) throws IOException {
        Operation operation = editMode.parseInput(commandOperation.getInputKey(), buffer.getLine());
        if(commandOperation.getInputKey() != Key.UNKNOWN)
            operation.setInput(commandOperation.getInputKey().getKeyValues());
        else
            operation.setInput(new int[]{ commandOperation.getInput()[commandOperation.getPosition()]});
        String result = parseOperation(operation, buffer.getPrompt().getMask());
        if(result != null)
            processOperationResult(result);
    }
View Full Code Here

                    return Operation.SEARCH_INPUT;
                }
        } // end search mode
        else {
            // process if we have any hits...
            Operation operation = currentOperation.getOperation();
            if(operation == Operation.SEARCH_PREV ||
                    operation == Operation.SEARCH_NEXT_WORD)
                mode = Action.SEARCH;

            //if ctrl-d is pressed on an empty line we need to return logout
View Full Code Here

                executorService.shutdown();
                running = false;
                //consoleCallback.readConsoleOutput(null);
                return;
            }
            Operation operation = editMode.parseInput(in, buffer.getLine());
            operation.setInput(in);

            String result = null;
            //if we have a command hooked in the input goes there
            if(command != null)
                command.processOperation(operation);
            //the input is parsed by æsh
            else
                result = parseOperation(operation, buffer.getPrompt().getMask());

            if(operation.equals(Operation.NEW_LINE) && buffer.isMultiLine())
                result = buffer.getMultiLineBuffer() + result;

            if(result != null) {
                // if the line ends with: \ we create a new line
                if(!buffer.getPrompt().isMasking() && endsWithBackslashPattern.matcher(result).find()) {
View Full Code Here

                    }
                }
            }
            //a "normal" line, no paste etc...
            else {
                Operation operation = editMode.parseInput(in, buffer.getLine());
                operation.setInput(in);

                //if we have a command hooked in the input goes there
                if(command != null)
                    command.processOperation(operation);
                    //the input is parsed by æsh
View Full Code Here

            else
                return Operation.NO_ACTION;
        }

        else if(currentOperations.size() == 1) {
            Operation operation = currentOperations.get(0).getOperation();
            Action workingMode = currentOperations.get(0).getWorkingMode();
            operationLevel = 0;
            currentOperations.clear();

            //if ctrl-d is pressed on an empty line we need to return logout
View Full Code Here

                    level = in.length;
                if(currentOperations.get(0).getKeyValues().length > level) {
                    operationLevel++;
                    return Operation.NO_ACTION;
                }
                Operation currentOperation = currentOperations.get(0).getOperation();
                if(currentOperation == Operation.SEARCH_PREV ||
                        currentOperation == Operation.SEARCH_NEXT_WORD)
                    mode = Action.SEARCH;

                operationLevel = 0;
                currentOperations.clear();

                //if ctrl-d is pressed on an empty line we need to return logout
                //else return delete next char
                if(currentOperation.equals(Operation.EXIT)) {
                    if(buffer.isEmpty())
                        return currentOperation;
                    else
                        return Operation.DELETE_NEXT_CHAR;
                }
View Full Code Here

                return saveAction(Operation.REPLACE);
            }
        }


        Operation operation = currentOperation.getOperation();
        Action workingMode = currentOperation.getWorkingMode();

        //if ctrl-d is pressed on an empty line we need to return logout
        //else return new_line
        if(operation == Operation.EXIT) {
View Full Code Here

TOP

Related Classes of org.jboss.aesh.edit.actions.Operation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.