Package org.quorum.vm.implementation

Examples of org.quorum.vm.implementation.QuorumVirtualMachine


    }

    private static void vmSingleton() {
        if(virtualMachine == null) {
            QuorumStandardLibrary.overrideStandardLibraryPath(getRootFolder(), getIndexFile());
            virtualMachine = new QuorumVirtualMachine();
            SodbeansConsole console = new SodbeansConsole();
            VirtualMachineErrorAction.setConsole(console);
            ConsolePlugin.setConsole(console);
            addPlugins(virtualMachine);
           
View Full Code Here


    public void run(Result result, SchedulerEvent event) {
        try {
            QuorumParserResult res = (QuorumParserResult) result;
            File file = org.openide.filesystems.FileUtil.toFile(
                    res.getSnapshot().getSource().getFileObject());
            QuorumVirtualMachine vm = res.getVirtualMachine();
            Iterator<CompilerError> errors =
                    vm.getCompilerErrors().iterator(file.getAbsolutePath());
            Document document = result.getSnapshot().getSource().getDocument(false);
            List<ErrorDescription> nbErrors = new ArrayList<ErrorDescription>();
            while(errors.hasNext()) {
                ErrorDescription errorDescription;
                CompilerError error = errors.next();
View Full Code Here

*/
public class QuorumInstantRenamer implements InstantRenamer{

    public boolean isRenameAllowed(ParserResult pr, int caretPosition, String[] strings) {
        QuorumParserResult qpr = (QuorumParserResult)pr;
        QuorumVirtualMachine vm = qpr.getVirtualMachine();
        boolean identifierFound = false;
        int currentPosition = caretPosition;
        int endPosition = -1;
        int startPosition = -1;
       
        //find end
        identifierFound = Character.isJavaIdentifierPart(qpr.getSnapshot().getText().charAt(currentPosition));
       
        //is it the start or end
        if(!identifierFound && Character.isJavaIdentifierPart(qpr.getSnapshot().getText().charAt(currentPosition + 1))){
            startPosition = caretPosition;
            identifierFound = true;
            //find the end
            while(identifierFound){
                currentPosition++;
                identifierFound = Character.isJavaIdentifierPart(qpr.getSnapshot().getText().charAt(currentPosition));

                if(!identifierFound){
                    endPosition = currentPosition;
                }
            }
        }else if(!identifierFound && Character.isJavaIdentifierPart(qpr.getSnapshot().getText().charAt(currentPosition - 1))){
            endPosition = caretPosition;
            identifierFound = true;
            //find the start
            while(identifierFound){
                currentPosition--;
                identifierFound = Character.isJavaIdentifierPart(qpr.getSnapshot().getText().charAt(currentPosition));

                if(!identifierFound){
                    startPosition = currentPosition;
                }
            }
        }else{
            //if we haven't found it, find the end.
            while(identifierFound){
                currentPosition++;
                identifierFound = Character.isJavaIdentifierPart(qpr.getSnapshot().getText().charAt(currentPosition));

                if(!identifierFound){
                    endPosition = currentPosition;
                }
            }

            //if we haven't found it, find the end.
            currentPosition = caretPosition;
            identifierFound = Character.isJavaIdentifierPart(qpr.getSnapshot().getText().charAt(currentPosition));

            while(identifierFound){
                currentPosition--;
                identifierFound = Character.isJavaIdentifierPart(qpr.getSnapshot().getText().charAt(currentPosition));

                if(!identifierFound){
                    startPosition = currentPosition;
                }
            }
        }
        //get the subSequence that is highlighted
        CharSequence subSequence = pr.getSnapshot().getText().subSequence(startPosition+1, endPosition);
        FileDescriptor file = vm.getSymbolTable().getFileDescriptor(FileUtil.toFile(qpr.getSnapshot().getSource().getFileObject()).getAbsolutePath());
        Iterator<ClassDescriptor> classes = file.getClassIterator();
        ClassDescriptor clazz = null;
        while(classes.hasNext()) {
            clazz = classes.next();
        }
View Full Code Here

        CharSequence text = this.snapshot.getText();
        String editorText = text.toString();

        File file = org.openide.filesystems.FileUtil.toFile(currentFileInEditor);

        QuorumVirtualMachine machine = (QuorumVirtualMachine) QuorumCompiler.getVirtualMachine();
       
        //don't recompile if the debugger is running
        if(compiler.isDebuggerActive()) {
            return;
        }
       
        Date date = new Date();
        long startTime = date.getTime();
        if(compiler.hasBuiltAllOnce()) {
            machine.buildSingle(file, editorText);
        }
        else {
            Project project = FileOwnerQuery.getOwner(currentFileInEditor);
            compiler.compile(project); //ignore failure
        }
       
        date = new Date();
        long endTime = date.getTime();
        addSuccessfulBuildLog(startTime, endTime, machine.getCompilerErrors().isCompilationErrorFree(), machine.getCompilerErrors().getNumberSyntaxErrors());
        Iterator<CompilerErrorDescriptor> iterator = compiler.getCompilerErrorManager().iterator();
        while(iterator.hasNext()){
                CompilerErrorDescriptor next = iterator.next();
                addCompilerErrorBuildLog(next);
        }
View Full Code Here

TOP

Related Classes of org.quorum.vm.implementation.QuorumVirtualMachine

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.