diff options
author | kh5325.kim <kh5325.kim@samsung.com> | 2013-09-04 19:26:46 +0900 |
---|---|---|
committer | kh5325.kim <kh5325.kim@samsung.com> | 2013-09-04 19:26:46 +0900 |
commit | d7e20cc8628882b340707c8fbf60e502566764ad (patch) | |
tree | 3b8110045b3535469e91a4e5cc501be5f84fe259 /org.tizen.common | |
parent | 014488fede6ab362c79473e2c57772eea363327f (diff) | |
download | common-eplugin-d7e20cc8628882b340707c8fbf60e502566764ad.tar.gz common-eplugin-d7e20cc8628882b340707c8fbf60e502566764ad.tar.bz2 common-eplugin-d7e20cc8628882b340707c8fbf60e502566764ad.zip |
Added SWTUtil#getActivePerspectiveId()
Diffstat (limited to 'org.tizen.common')
-rw-r--r-- | org.tizen.common/schema/org.tizen.common.project.exsd | 2 | ||||
-rwxr-xr-x | org.tizen.common/src/org/tizen/common/util/SWTUtil.java | 16 |
2 files changed, 17 insertions, 1 deletions
diff --git a/org.tizen.common/schema/org.tizen.common.project.exsd b/org.tizen.common/schema/org.tizen.common.project.exsd index 71de1e451..72dabc8a8 100644 --- a/org.tizen.common/schema/org.tizen.common.project.exsd +++ b/org.tizen.common/schema/org.tizen.common.project.exsd @@ -1,7 +1,7 @@ <?xml version='1.0' encoding='UTF-8'?>
<!-- Schema file written by PDE -->
<schema targetNamespace="org.tizen.common" xmlns="http://www.w3.org/2001/XMLSchema">
-<annotation>
+ <annotation>
<appinfo>
<meta.schema plugin="org.tizen.common" id="org.tizen.common.project.adapter" name="ITizenProject Adapter"/>
</appinfo>
diff --git a/org.tizen.common/src/org/tizen/common/util/SWTUtil.java b/org.tizen.common/src/org/tizen/common/util/SWTUtil.java index 97157543a..8a2ab3fb9 100755 --- a/org.tizen.common/src/org/tizen/common/util/SWTUtil.java +++ b/org.tizen.common/src/org/tizen/common/util/SWTUtil.java @@ -79,8 +79,11 @@ import org.eclipse.swt.widgets.Widget; import org.eclipse.ui.IEditorPart; import org.eclipse.ui.IEditorReference; import org.eclipse.ui.IFileEditorInput; +import org.eclipse.ui.IPerspectiveDescriptor; +import org.eclipse.ui.IWorkbench; import org.eclipse.ui.IWorkbenchPage; import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.PlatformUI; import org.eclipse.ui.internal.ide.IDEWorkbenchPlugin; import org.tizen.common.Cabinet; import org.tizen.common.ui.TableToolTipListener; @@ -883,4 +886,17 @@ public class SWTUtil { if (blueHexadecimal.length() == 1) blueHexadecimal = "0" + blueHexadecimal; return "#" + redHexadecimal + greenHexadecimal + blueHexadecimal; } + + /** + * Returns the active perspective id. + * + * @return the active perspective id + */ + public static String getActivePerspectiveId() { + IWorkbench wb = PlatformUI.getWorkbench(); + IWorkbenchWindow win = wb.getActiveWorkbenchWindow(); + IWorkbenchPage page = win.getActivePage(); + IPerspectiveDescriptor perspective = page.getPerspective(); + return perspective.getId(); + } } |