/*******************************************************************************
- * Copyright (c) 2009, 2015 Ericsson
+ * Copyright (c) 2009, 2016 Ericsson
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
import org.eclipse.tracecompass.tmf.core.component.ITmfComponent;
import org.eclipse.tracecompass.tmf.core.signal.TmfSignal;
import org.eclipse.tracecompass.tmf.core.signal.TmfSignalManager;
+import org.eclipse.ui.IActionBars;
import org.eclipse.ui.IPartListener;
+import org.eclipse.ui.IViewSite;
import org.eclipse.ui.IWorkbenchActionConstants;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.part.ViewPart;
@Override
public void dispose() {
TmfSignalManager.deregister(this);
+
+ /* Workaround for Bug 490400: Clear the action bars */
+ IActionBars bars = getViewSite().getActionBars();
+ bars.getToolBarManager().removeAll();
+ bars.getMenuManager().removeAll();
+
super.dispose();
}
public Composite getParentComposite() {
return fParentComposite;
}
+
+ /**
+ * Return the Eclipse view ID in the format <Primary ID>:<Secondary ID> or
+ * simply <Primary ID> if secondary ID is null
+ *
+ * @return This view's view ID
+ * @since 2.2
+ */
+ protected String getViewId() {
+ IViewSite viewSite = getViewSite();
+ String secondaryId = viewSite.getSecondaryId();
+ if (secondaryId == null) {
+ return viewSite.getId();
+ }
+ return viewSite.getId() + ':' + secondaryId;
+ }
}