IViewDescriptor descriptor = viewFactory.getViewRegistry().find(viewId);
if (!(descriptor instanceof IPluginContribution)) {
return;
}
IIdentifier identifier = support.getActivityManager().getIdentifier(
WorkbenchActivityHelper
.createUnifiedId((IPluginContribution) descriptor));
identifier.addIdentifierListener(new IIdentifierListener() {
/* (non-Javadoc)
* @see org.eclipse.ui.activities.IIdentifierListener#identifierChanged(org.eclipse.ui.activities.IdentifierEvent)
*/
public void identifierChanged(IdentifierEvent identifierEvent) {
if (identifierEvent.hasEnabledChanged()) {
IIdentifier thisIdentifier = identifierEvent
.getIdentifier();
if (thisIdentifier.isEnabled()) {
// show view
thisIdentifier.removeIdentifierListener(this);
IWorkbenchPage activePage = partPage
.getWorkbenchWindow().getActivePage();
if (partPage == activePage
&& partPerspective == activePage
.getPerspective()) {