Package com.intellij.find

Examples of com.intellij.find.FindModel


            }

            FindManager findManager = getFindManager();
            if (allowedToChangedEditorSelection) {
                findManager.setFindWasPerformed();
                FindModel copy = new FindModel();
                copy.copyFrom(findModel);
                copy.setReplaceState(false);
                findManager.setFindNextModel(copy);
            }

            searchResultController.updateResult(findModel);
        }
View Full Code Here


        super.update(e);
    }

    @Override
    public void setSelected(AnActionEvent e, boolean state) {
        final FindModel findModel = getEditorSearchComponent().getFindModel();
        findModel.setRegularExpressions(state);
        if (state) {
            findModel.setWholeWordsOnly(false);
        }
        FindSettings.getInstance().setLocalRegularExpressions(state);
    }
View Full Code Here

        PsiDocumentManager.getInstance(project).commitAllDocuments();

        final DataContext dataContext = e.getDataContext();

        final FindManager findManager = FindManager.getInstance(project);
        final FindModel findModel = (FindModel) findManager.getFindInFileModel().clone();


        final List<AngularItem> validResults = new ArrayList<AngularItem>();

        findModel.setRegularExpressions(true);
        findModel.setFileFilter("*.js, *.html");

        findModel.setStringToFind("\\.(controller|filter|service|factory|module|value|constant|directive|provider)\\(\\s*(\"|')([^(\"|')]+)(\"|')");
        findModel.setStringToReplace("$3");
        final Collection<Usage> moduleMethodUsages = getAngularUsages(project, dataContext, findModel);
        List<AngularItem> moduleMethodResults = getValidResults(project, findModel, moduleMethodUsages, MODULE_METHODS);
        validResults.addAll(moduleMethodResults);

        findModel.setStringToFind("Ctrl\\(\\s*\\$scope");
        findModel.setStringToReplace("$0");
        final Collection<Usage> ctrlByConventionUsages = getAngularUsages(project, dataContext, findModel);
        List<AngularItem> ctrlByConventionResults = getValidResults(project, findModel, ctrlByConventionUsages, CTRL_CONVENTIONS);
        validResults.addAll(ctrlByConventionResults);


        findModel.setStringToFind("ng\\-controller\\=\"([^(\"]+)\"");
        findModel.setStringToReplace("$1");
        final Collection<Usage> ngControllerUsages = getAngularUsages(project, dataContext, findModel);
        List<AngularItem> ngControllerResults = getValidResults(project, findModel, ngControllerUsages, NG_CONTROLLER);
        validResults.addAll(ngControllerResults);


View Full Code Here


        String s = "\\$scope\\.(\\w*)";

        final FindManager findManager = FindManager.getInstance(project);
        final FindModel findModel = (FindModel) findManager.getFindInFileModel().clone();


        findModel.setRegularExpressions(true);
        findModel.setFileFilter("*.js, *.html");

        findModel.setStringToFind(s);
        findModel.setStringToReplace("$1");

        CommonProcessors.CollectProcessor<Usage> collectProcessor = new CommonProcessors.CollectProcessor<Usage>();

        PsiDirectory directory = PsiManager.getInstance(project).findDirectory(project.getBaseDir());
        FindInProjectUtil.findUsages(findModel, directory, project,
View Full Code Here

        searchBox.findText(0);
    }


    protected FindModel createFindModel(FindManager findManager) {
        FindModel clone = (FindModel) findManager.getFindInFileModel().clone();
        clone.setFindAll(true);
        clone.setFromCursor(true);
        clone.setForward(true);
        clone.setRegularExpressions(false);
        clone.setWholeWordsOnly(false);
        clone.setCaseSensitive(false);
        clone.setSearchHighlighters(true);
        clone.setPreserveCase(false);

        return clone;
    }
View Full Code Here

TOP

Related Classes of com.intellij.find.FindModel

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.