1 /**********************************************************************
2 * Copyright (c) 2012 Ericsson
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 * Bernd Hufmann - Initial API and implementation
11 **********************************************************************/
12 package org
.eclipse
.linuxtools
.internal
.lttng2
.ui
.views
.control
.handlers
;
14 import java
.util
.concurrent
.locks
.ReentrantLock
;
16 import org
.eclipse
.core
.commands
.AbstractHandler
;
17 import org
.eclipse
.linuxtools
.internal
.lttng2
.ui
.views
.control
.ControlView
;
18 import org
.eclipse
.ui
.IWorkbenchPage
;
19 import org
.eclipse
.ui
.IWorkbenchPart
;
20 import org
.eclipse
.ui
.IWorkbenchWindow
;
21 import org
.eclipse
.ui
.PlatformUI
;
24 * <b><u>BaseControlViewHandler</u></b>
26 * Abstract Command handler implementation for all control view handlers.
29 abstract public class BaseControlViewHandler
extends AbstractHandler
{
31 // ------------------------------------------------------------------------
33 // ------------------------------------------------------------------------
35 * The synchronization lock.
37 protected ReentrantLock fLock
= new ReentrantLock();
39 // ------------------------------------------------------------------------
41 // ------------------------------------------------------------------------
43 * @return returns the workbench page for the Control View
45 protected IWorkbenchPage
getWorkbenchPage() {
46 // Check if we are closing down
47 IWorkbenchWindow window
= PlatformUI
.getWorkbench().getActiveWorkbenchWindow();
52 // Check if we are in the Project View
53 IWorkbenchPage page
= window
.getActivePage();
58 IWorkbenchPart part
= page
.getActivePart();
59 if (!(part
instanceof ControlView
)) {
This page took 0.033836 seconds and 6 git commands to generate.