<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<!-- Generated by Apache Maven Doxia Site Renderer 1.3 at Oct 27, 2017 --> | |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=${outputEncoding}" /> | |
<title>CPD Results</title> | |
<style type="text/css" media="all"> | |
@import url("./css/maven-base.css"); | |
@import url("./css/maven-theme.css"); | |
@import url("./css/site.css"); | |
</style> | |
<link rel="stylesheet" href="./css/print.css" type="text/css" media="print" /> | |
<meta name="Date-Revision-yyyymmdd" content="20171027" /> | |
<meta http-equiv="Content-Language" content="en" /> | |
</head> | |
<body class="composite"> | |
<div id="banner"> | |
<div class="clear"> | |
<hr/> | |
</div> | |
</div> | |
<div id="breadcrumbs"> | |
<div class="xleft"> | |
<span id="publishDate">Last Published: 2017-10-27</span> | |
| <span id="projectVersion">Version: ${project.version}</span> | |
</div> | |
<div class="xright"> | |
</div> | |
<div class="clear"> | |
<hr/> | |
</div> | |
</div> | |
<div id="leftColumn"> | |
<div id="navcolumn"> | |
<a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy"> | |
<img class="poweredBy" alt="Built by Maven" src="./images/logos/maven-feather.png" /> | |
</a> | |
</div> | |
</div> | |
<div id="bodyColumn"> | |
<div id="contentBox"> | |
<div class="section"><h2>CPD Results<a name="CPD_Results"></a></h2><p>The following document contains the results of PMD's <a class="externalLink" href="http://pmd.sourceforge.net/cpd.html">CPD</a> 5.0.5.</p></div><div class="section"><h2>Duplications<a name="Duplications"></a></h2><table align="center" border="0" class="bodyTable"><tr class="a"><th>File</th><th>Line</th></tr><tr class="b"><td>org/eclipse/papyrus/designer/languages/cpp/reverse/ui/handler/ReverseToExistingUmlModelMerge.java</td><td><a href="./xref/org/eclipse/papyrus/designer/languages/cpp/reverse/ui/handler/ReverseToExistingUmlModelMerge.html#L48">48</a></td></tr><tr class="a"><td>org/eclipse/papyrus/designer/languages/cpp/reverse/ui/handler/ReverseToNewUmlModel.java</td><td><a href="./xref/org/eclipse/papyrus/designer/languages/cpp/reverse/ui/handler/ReverseToNewUmlModel.html#L50">50</a></td></tr><tr class="b"><td colspan='2'><div><pre>public class ReverseToExistingUmlModelMerge extends AbstractHandler { | |
@Override | |
public Object execute(ExecutionEvent event) throws ExecutionException { | |
try { | |
ISelection selection = HandlerUtil.getCurrentSelection(event); | |
if (selection instanceof ITextSelection) { | |
IEditorPart editorPart = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor(); | |
if (editorPart instanceof AbstractTextEditor) { | |
ITextEditor textEditor = (ITextEditor) editorPart; | |
if (textEditor != null) { | |
IFile resource = (IFile) textEditor.getEditorInput().getAdapter(IResource.class); | |
if (resource != null) { | |
scheduleReverse(resource.getProject()); | |
return Status.OK_STATUS; | |
} | |
} | |
} | |
} | |
if (selection instanceof IStructuredSelection) { | |
Object selectedObject = ((IStructuredSelection) selection).getFirstElement(); | |
if (selectedObject instanceof IResource) { | |
scheduleReverse(((IResource) selectedObject).getProject()); | |
return Status.OK_STATUS; | |
} | |
} | |
} catch (Exception e) { | |
Activator.log.error(e); | |
} | |
return null; | |
} | |
private void scheduleReverse(final IProject project) { | |
if (project != null) { | |
final ICProject cProject = CoreModel.getDefault().create(project); | |
Job job = new Job("Reversing project " + cProject.getElementName() + " to existing UML model (merge)") {</pre></div></td></tr></table><table align="center" border="0" class="bodyTable"><tr class="a"><th>File</th><th>Line</th></tr><tr class="b"><td>org/eclipse/papyrus/designer/languages/cpp/reverse/ui/handler/ReverseToExistingUmlModelMerge.java</td><td><a href="./xref/org/eclipse/papyrus/designer/languages/cpp/reverse/ui/handler/ReverseToExistingUmlModelMerge.html#L50">50</a></td></tr><tr class="a"><td>org/eclipse/papyrus/designer/languages/cpp/reverse/ui/handler/ReverseToExistingUmlModelOverwrite.java</td><td><a href="./xref/org/eclipse/papyrus/designer/languages/cpp/reverse/ui/handler/ReverseToExistingUmlModelOverwrite.html#L54">54</a></td></tr><tr class="b"><td>org/eclipse/papyrus/designer/languages/cpp/reverse/ui/handler/ReverseToNewUmlModel.java</td><td><a href="./xref/org/eclipse/papyrus/designer/languages/cpp/reverse/ui/handler/ReverseToNewUmlModel.html#L52">52</a></td></tr><tr class="a"><td colspan='2'><div><pre> @Override | |
public Object execute(ExecutionEvent event) throws ExecutionException { | |
try { | |
ISelection selection = HandlerUtil.getCurrentSelection(event); | |
if (selection instanceof ITextSelection) { | |
IEditorPart editorPart = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor(); | |
if (editorPart instanceof AbstractTextEditor) { | |
ITextEditor textEditor = (ITextEditor) editorPart; | |
if (textEditor != null) { | |
IFile resource = (IFile) textEditor.getEditorInput().getAdapter(IResource.class); | |
if (resource != null) { | |
scheduleReverse(resource.getProject()); | |
return Status.OK_STATUS; | |
} | |
} | |
} | |
} | |
if (selection instanceof IStructuredSelection) { | |
Object selectedObject = ((IStructuredSelection) selection).getFirstElement(); | |
if (selectedObject instanceof IResource) { | |
scheduleReverse(((IResource) selectedObject).getProject()); | |
return Status.OK_STATUS; | |
} | |
} | |
} catch (Exception e) { | |
Activator.log.error(e); | |
} | |
return null; | |
} | |
private void scheduleReverse(final IProject project) { | |
if (project != null) {</pre></div></td></tr></table></div> | |
</div> | |
</div> | |
<div class="clear"> | |
<hr/> | |
</div> | |
<div id="footer"> | |
<div class="xright"> | |
Copyright © All Rights Reserved. | |
</div> | |
<div class="clear"> | |
<hr/> | |
</div> | |
</div> | |
</body> | |
</html> |