EMMA Coverage Report (generated Sun Feb 05 10:43:15 CET 2012)
[all classes][de.uka.ipd.sdq.cip.runtime.runconfig.tabs]

COVERAGE SUMMARY FOR SOURCE FILE [AbstractCipLaunchConfigurationTab.java]

nameclass, %method, %block, %line, %
AbstractCipLaunchConfigurationTab.java0%   (0/1)0%   (0/4)0%   (0/70)0%   (0/23)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class AbstractCipLaunchConfigurationTab0%   (0/1)0%   (0/4)0%   (0/70)0%   (0/23)
AbstractCipLaunchConfigurationTab (): void 0%   (0/1)0%   (0/3)0%   (0/1)
getFeatureConfig (): IResource [] 0%   (0/1)0%   (0/2)0%   (0/1)
getSelectedProject (): IProject 0%   (0/1)0%   (0/10)0%   (0/3)
getSelectedResource (): IResource 0%   (0/1)0%   (0/55)0%   (0/18)

1package de.uka.ipd.sdq.cip.runtime.runconfig.tabs;
2 
3import org.eclipse.core.resources.IProject;
4import org.eclipse.core.resources.IResource;
5import org.eclipse.core.runtime.IAdaptable;
6import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
7import org.eclipse.jface.viewers.ISelection;
8import org.eclipse.jface.viewers.IStructuredSelection;
9import org.eclipse.ui.IWorkbench;
10import org.eclipse.ui.IWorkbenchPage;
11import org.eclipse.ui.IWorkbenchWindow;
12import org.eclipse.ui.PlatformUI;
13 
14public abstract class AbstractCipLaunchConfigurationTab extends
15                AbstractLaunchConfigurationTab {
16 
17        protected IResource getSelectedResource() {
18                IWorkbench iworkbench = PlatformUI.getWorkbench();
19                if (iworkbench == null) return null;
20                IWorkbenchWindow iworkbenchwindow = iworkbench.getActiveWorkbenchWindow();
21                if (iworkbenchwindow == null) return null;
22                IWorkbenchPage iworkbenchpage = iworkbenchwindow.getActivePage();
23                if (iworkbenchpage == null) return null;
24                //the current selection in the entire page
25                ISelection selection = iworkbenchpage.getSelection();
26                if (!(selection instanceof IStructuredSelection))
27                 return null;
28                IStructuredSelection ss = (IStructuredSelection) selection;
29            Object element = ss.getFirstElement();
30            if (element instanceof IResource)
31               return (IResource) element;
32            if (!(element instanceof IAdaptable))
33               return null;
34              IAdaptable adaptable = (IAdaptable)element;
35              Object adapter = adaptable.getAdapter(IResource.class);
36              return (IResource) adapter;
37        }
38        
39        protected IProject getSelectedProject() {
40                IResource resource = getSelectedResource();
41                if(resource == null) return null;
42                return resource.getProject();
43        }
44        
45        protected IResource[] getFeatureConfig() {
46                return null;
47        }
48}

[all classes][de.uka.ipd.sdq.cip.runtime.runconfig.tabs]
EMMA 2.0.9414 (unsupported private build) (C) Vladimir Roubtsov