equal
deleted
inserted
replaced
26 import org.eclipse.jface.viewers.IStructuredSelection; |
26 import org.eclipse.jface.viewers.IStructuredSelection; |
27 import org.eclipse.ui.IEditorPart; |
27 import org.eclipse.ui.IEditorPart; |
28 import org.eclipse.ui.IWorkbenchPart; |
28 import org.eclipse.ui.IWorkbenchPart; |
29 import org.eclipse.ui.handlers.HandlerUtil; |
29 import org.eclipse.ui.handlers.HandlerUtil; |
30 import org.symbian.tools.tmw.core.TMWCore; |
30 import org.symbian.tools.tmw.core.TMWCore; |
31 import org.symbian.tools.tmw.core.projects.IMTWProject; |
31 import org.symbian.tools.tmw.core.projects.ITMWProject; |
32 |
32 |
33 public class UIUtils { |
33 public class UIUtils { |
34 public static IMTWProject getProjectFromCommandContext(ExecutionEvent event) { |
34 public static ITMWProject getProjectFromCommandContext(ExecutionEvent event) { |
35 IResource resource = null; |
35 IResource resource = null; |
36 IWorkbenchPart activePart = HandlerUtil.getActivePart(event); |
36 IWorkbenchPart activePart = HandlerUtil.getActivePart(event); |
37 if (activePart instanceof IEditorPart) { |
37 if (activePart instanceof IEditorPart) { |
38 resource = (IResource) ((IEditorPart) activePart).getEditorInput().getAdapter(IResource.class); |
38 resource = (IResource) ((IEditorPart) activePart).getEditorInput().getAdapter(IResource.class); |
39 } else { |
39 } else { |