Package org.python.pydev.refactoring.coderefactoring.extractlocal

Examples of org.python.pydev.refactoring.coderefactoring.extractlocal.ExtractLocalRequestProcessor


                data.sourceSelection.getLength());
        IGrammarVersionProvider versionProvider = createVersionProvider();
        RefactoringInfo info = new RefactoringInfo(document, selection, versionProvider);
        ExtractLocalRefactoring refactoring = new ExtractLocalRefactoring(info);

        ExtractLocalRequestProcessor requestProcessor = refactoring.getRequestProcessor();
        requestProcessor.setVariableName("extracted_variable");
        requestProcessor.setReplaceDuplicates(true);

        NullProgressMonitor monitor = new NullProgressMonitor();
        RefactoringStatus result = refactoring.checkAllConditions(monitor);

        assertTrue("Refactoring is not ok: " + result.getMessageMatchingSeverity(RefactoringStatus.WARNING),
View Full Code Here


        Text text = createTextInputField(result);
        text.selectAll();
        text.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

        replaceDuplicates = new Button(result, SWT.CHECK);
        ExtractLocalRequestProcessor requestProcessor = getRequestProcessor();
        replaceDuplicates.setText(com.aptana.shared_core.string.StringUtils.format("Also replace &duplicates (%s references)?",
                requestProcessor.getDuplicatesSize()));

        IPreferenceStore preferences = PydevPrefs.getPreferences();
        boolean replace = preferences.getBoolean(EXTRACT_LOCAL_REPLACE_DUPLICATES);
        replaceDuplicates.setSelection(replace);
        requestProcessor.setReplaceDuplicates(replace);
        replaceDuplicates.addSelectionListener(new SelectionAdapter() {
            public void widgetSelected(SelectionEvent e) {
                getRequestProcessor().setReplaceDuplicates(replaceDuplicates.getSelection());
                IPreferenceStore preferences = PydevPrefs.getPreferences();
                preferences.setValue(EXTRACT_LOCAL_REPLACE_DUPLICATES, replaceDuplicates.getSelection());
View Full Code Here

TOP

Related Classes of org.python.pydev.refactoring.coderefactoring.extractlocal.ExtractLocalRequestProcessor

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.