Package org.evolizer.daforjava.plugin.selectionhandler

Examples of org.evolizer.daforjava.plugin.selectionhandler.AbstractSelectionHandler


                IStructuredSelection structuredSelection = (IStructuredSelection) selection;
                // Check if current graph shows the same project. If so, load whole project.
                if (isDisplayedProject(structuredSelection)) {
                    sLogger.info("DRAG AND DROP: add selected elements to graph");
                    // add selected elements to graph
                    AbstractSelectionHandler selectionHandler = SelectionHandlerFactory.getInstance().getSelectionHandler(selection);
                    List<AbstractFamixEntity> entities = selectionHandler.getSelectedEntities(fGraphPanel.getGraphLoader().getSnapshotAnalyzer());
                    AbstractGraphEditCommand command = new AddEntitiesCommand(entities, fGraphPanel.getGraphLoader(), fGraphPanel.getEdgeGrouper());
                    fGraphPanel.getCommandController().executeCommand(command);
                } else {
                    final String message = "Unable add elements to the current graph!";
                    final IWorkbench workbench = PlatformUI.getWorkbench();
View Full Code Here


        setSite(site);
        setInput(input);

        DAForJavaEditorInput eInput = (DAForJavaEditorInput) input;
        AbstractSelectionHandler selectionHandler = SelectionHandlerFactory.getInstance().getSelectionHandler(eInput.getSelection());
        setPartName(selectionHandler.getEditorTitle());

        try {
            // initialize db connection
            IJavaProject selectedProject = selectionHandler.getSelectedProject();
            String dbUrl = initDatabaseConfiguration(selectedProject.getProject());

            IEvolizerSession session = EvolizerSessionHandler.getHandler().getCurrentSession(dbUrl);
            SnapshotAnalyzer snapshotAnalyzer = new SnapshotAnalyzer(session);
            fGraphPanel = new DAForJavaGraphPanel(new GraphLoader(snapshotAnalyzer));
            fGraphPanel.initGraphPanel();

//            site.getWorkbenchWindow().getActivePage().addPartListener(fPartListener);
            initDragAndDrop();
//            setPartName(selectionHandler.getEditorTitle());

            List<AbstractFamixEntity> entities = selectionHandler.getSelectedEntities(snapshotAnalyzer);
            if (entities.size() == 0) {
                IProgressMonitor pm = Job.getJobManager().createProgressGroup();
                pm.beginTask("Extracting and storing the FAMIX model for further use ...", 10);

                List<IJavaElement> selection = new ArrayList<IJavaElement>();
                selection.add(selectedProject);
                FamixParserJob parseJob = new FamixParserJob(selection);
                parseJob.setUser(true);
                parseJob.setProgressGroup(pm, 5);
                parseJob.schedule();
                parseJob.join();

                Job storeModelJob = new FamixStoreModelJob(dbUrl, parseJob.getFamixModel());
                storeModelJob.setUser(true);
                storeModelJob.setProgressGroup(pm, 5);
                storeModelJob.schedule();
                storeModelJob.join();

                entities = selectionHandler.getSelectedEntities(snapshotAnalyzer);
            }
           
            AbstractGraphEditCommand command = new AddEntitiesCommand(entities, fGraphPanel.getGraphLoader(), fGraphPanel.getEdgeGrouper());
            fGraphPanel.getCommandController().executeCommand(command);
View Full Code Here

                if (editor instanceof DAForJavaGraphEditor) {
                    DAForJavaGraphEditor graphEditor = (DAForJavaGraphEditor) editor;
                    fMonitor.worked(10);
                    // AbstractSelectionHandler selectionHandler = new JavaElementSelectionHandler(graphEditor.getPanel().getGraphLoader().getSnapshotAnalyzer());
                    // List<AbstractFamixEntity> entities = selectionHandler.getSelectedEntities(fSelection);
                    AbstractSelectionHandler selectionHandler = SelectionHandlerFactory.getInstance().getSelectionHandler(fSelection);
                    List<AbstractFamixEntity> entities = selectionHandler.getSelectedEntities(graphEditor.getPanel().getGraphLoader().getSnapshotAnalyzer());
                    AbstractGraphEditCommand command = new AddEntitiesCommand(entities, graphEditor.getPanel().getGraphLoader(), graphEditor.getPanel().getEdgeGrouper());
                    graphEditor.getPanel().getCommandController().executeCommand(command);

                    fMonitor.worked(25);
                } else {
View Full Code Here

TOP

Related Classes of org.evolizer.daforjava.plugin.selectionhandler.AbstractSelectionHandler

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.