use of net.sourceforge.pmd.eclipse.ui.views.cpd2.CPDView2 in project pmd-eclipse-plugin by pmd.
the class CPDCheckProjectAction method showView.
/**
* Shows the view.
* @param matches
*/
private CPDView2 showView() {
CPDView2 view = null;
try {
final IWorkbenchPage workbenchPage = targetPartSite().getPage();
view = (CPDView2) workbenchPage.showView(PMDUiConstants.ID_CPDVIEW2);
} catch (PartInitException pie) {
logError(getString(StringKeys.ERROR_VIEW_EXCEPTION), pie);
}
return view;
}
use of net.sourceforge.pmd.eclipse.ui.views.cpd2.CPDView2 in project pmd-eclipse-plugin by pmd.
the class CPDCheckProjectAction method detectCutAndPaste.
/**
* Run the DetectCutAndPaste command against the selected project
* and creates optionally the report file.
*
* @param project a project
* @param dialog the object of the dialog with the selected values
* @throws CommandException
*/
private void detectCutAndPaste(final IProject project, CPDCheckDialog dialog) {
final String selectedLanguage = dialog.getSelectedLanguage();
final int tilesize = dialog.getTileSize();
final boolean createReport = dialog.isCreateReportSelected();
final Renderer selectedRenderer = this.createRenderer(dialog.getSelectedFormat());
final String fileName = this.createFileName(dialog.getSelectedFormat());
final CPDView2 view = showView();
try {
final DetectCutAndPasteCmd detectCmd = new DetectCutAndPasteCmd();
detectCmd.setProject(project);
detectCmd.setCreateReport(createReport);
detectCmd.setLanguage(selectedLanguage);
detectCmd.setMinTileSize(tilesize);
detectCmd.setRenderer(selectedRenderer);
detectCmd.setReportName(fileName);
detectCmd.setUserInitiated(true);
detectCmd.addPropertyListener(view);
detectCmd.performExecute();
} catch (CommandException e) {
logError(getString(StringKeys.ERROR_PMD_EXCEPTION), e);
}
}
Aggregations