use of net.sourceforge.pmd.eclipse.runtime.cmd.DetectCutAndPasteCmd 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