Package org.opensolaris.opengrok.configuration

Examples of org.opensolaris.opengrok.configuration.Project


        this.historyReaderTimelimitField.setText(Integer.toString(config.getHistoryCacheTime()));

        List<Project> projects =  config.getProjects();
        DefaultTableModel model = new DefaultTableModel(projectTableHeaders,projects.size());

        Project defaultproj = config.getDefaultProject();
        int row = 0;
        for (Project proj:projects) {
           model.setValueAt(proj.getId(), row, 0);
           model.setValueAt(proj.getDescription(), row, 1);
           model.setValueAt(proj.getPath(), row, 2);
View Full Code Here


    public static void update(ExecutorService executor, IndexChangedListener listener, List<String> paths) throws IOException {
        RuntimeEnvironment env = RuntimeEnvironment.getInstance();
        List<IndexDatabase> dbs = new ArrayList<>();

        for (String path : paths) {
            Project project = Project.getProject(path);
            if (project == null && env.hasProjects()) {
                log.log(Level.WARNING, "Could not find a project for \"{0}\"", path);
            } else {
                IndexDatabase db;
View Full Code Here

                    IndexDatabase db = new IndexDatabase(project);
                    db.listFiles();
                }
            } else {
                for (String path : subFiles) {
                    Project project = Project.getProject(path);
                    if (project == null) {
                        log.log(Level.WARNING, "Warning: Could not find a project for \"{0}\"", path);
                    } else {
                        IndexDatabase db = new IndexDatabase(project);
                        db.listFiles();
View Full Code Here

                    IndexDatabase db = new IndexDatabase(project);
                    db.listTokens(4);
                }
            } else {
                for (String path : subFiles) {
                    Project project = Project.getProject(path);
                    if (project == null) {
                        log.log(Level.WARNING, "Warning: Could not find a project for \"{0}\"", path);
                    } else {
                        IndexDatabase db = new IndexDatabase(project);
                        db.listTokens(4);
View Full Code Here

        RuntimeEnvironment env = RuntimeEnvironment.getInstance();
        File indexDir = new File(env.getDataRootFile(), INDEX_DIR);

        if (env.hasProjects()) {
            Project p = Project.getProject(path);
            if (p == null) {
                return null;
            }
            indexDir = new File(indexDir, p.getPath());
        }
        try {
            FSDirectory fdir = FSDirectory.open(indexDir, NoLockFactory.getNoLockFactory());
            if (indexDir.exists() && DirectoryReader.indexExists(fdir)) {
                ret = DirectoryReader.open(fdir);
View Full Code Here

                    // new with default values.
                    projects.add(oldProjects.get(path));
                } else if (!name.startsWith(".") && file.isDirectory()) {
                    // Found a new directory with no matching project, so
                    // create a new project with default properties.
                    Project p = new Project();
                    p.setDescription(name);
                    p.setPath(path);
                    p.setTabSize(env.getConfiguration().getTabSize());
                    projects.add(p);
                }
            }

            // The projects should be sorted...
            Collections.sort(projects, new Comparator<Project>() {
                @Override
                public int compare(Project p1, Project p2) {
                    String s1 = p1.getDescription();
                    String s2 = p2.getDescription();

                    int ret;
                    if (s1 == null) {
                        ret = (s2 == null) ? 0 : 1;
                    } else {
                        ret = s1.compareTo(s2);
                    }
                    return ret;
                }
            });
        }

        if (defaultProject != null) {
            for (Project p : env.getProjects()) {
                if (p.getPath().equals(defaultProject)) {
                    env.setDefaultProject(p);
                    break;
                }
            }
        }
View Full Code Here

            }
        } else {
            List<IndexDatabase> dbs = new ArrayList<>();

            for (String path : subFiles) {
                Project project = Project.getProject(path);
                if (project == null && env.hasProjects()) {
                    log.log(Level.WARNING, "Could not find a project for \"{0}\"", path);
                } else {
                    IndexDatabase db;
                    if (project == null) {
View Full Code Here

        env.setCtags(System.getProperty(ctagsProperty, "ctags"));
        env.setSourceRoot(repository.getSourceRoot());
        env.setDataRoot(repository.getDataRoot());

        if (env.validateExuberantCtags()) {
            Project project = new Project();
            String ppath="bug3430";
            project.setPath("/"+ppath);           
            IndexDatabase idb = new IndexDatabase(project);
            assertNotNull(idb);
            MyIndexChangeListener listener = new MyIndexChangeListener();
            idb.addIndexChangedListener(listener);
            idb.update();
View Full Code Here

            executor = new Executor(new String[]{"mkfifo", repository.getSourceRoot() + "/testBug11896/FIFO"});
            executor.exec(true);

            if (env.validateExuberantCtags()) {
                Project project = new Project();
                project.setPath("/testBug11896");
                IndexDatabase idb = new IndexDatabase(project);
                assertNotNull(idb);
                MyIndexChangeListener listener = new MyIndexChangeListener();
                idb.addIndexChangedListener(listener);
                System.out.println("Trying to index a special file - FIFO in this case.");
View Full Code Here

                if (data.genre != Genre.PLAIN && data.genre != Genre.HTML) {
                    return data;
                }

                ArrayList<String> lines = new ArrayList<>();
                Project p = getProject();
                for (int i = 0; i < 2; i++) {
                    try (BufferedReader br = new BufferedReader(
                            ExpandTabsReader.wrap(new InputStreamReader(in[i]), p))) {
                        String line;
                        while ((line = br.readLine()) != null) {
View Full Code Here

TOP

Related Classes of org.opensolaris.opengrok.configuration.Project

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.