38
38
import org.eclipse.swt.widgets.Shell;
39
39
import org.eclipse.ui.IActionBars;
40
40
import org.eclipse.ui.IMemento;
41
import org.eclipse.ui.IPerspectiveDescriptor;
41
42
import org.eclipse.ui.IViewReference;
42
43
import org.eclipse.ui.IViewSite;
43
44
import org.eclipse.ui.IWorkbenchActionConstants;
45
import org.eclipse.ui.IWorkbenchPage;
44
46
import org.eclipse.ui.IWorkbenchPart;
45
47
import org.eclipse.ui.PartInitException;
46
48
import org.eclipse.ui.PlatformUI;
520
522
oneYearAction.setChecked(true);
528
protected void fireSelection(SelectionChangedEvent event) {
529
IStructuredSelection selection = (IStructuredSelection) event
531
Object obj = selection.getFirstElement();
532
String perspId = null;
533
if (obj instanceof SlideShowImpl) {
534
perspId = ((SlideShowImpl) obj).getPerspective();
536
perspId = "com.bdaum.zoom.SlidesPerspective"; //$NON-NLS-1$
537
} else if (obj instanceof ExhibitionImpl) {
538
perspId = ((ExhibitionImpl) obj).getPerspective();
540
perspId = "com.bdaum.zoom.ExhibitionPerspective"; //$NON-NLS-1$
541
} else if (obj instanceof WebGalleryImpl) {
542
perspId = ((WebGalleryImpl) obj).getPerspective();
544
perspId = "com.bdaum.zoom.WebGalleryPerspective"; //$NON-NLS-1$
545
} else if (obj instanceof SmartCollectionImpl) {
546
perspId = ((SmartCollectionImpl) obj).getPerspective();
548
perspId = "com.bdaum.zoom.rcp.LightboxPerspective"; //$NON-NLS-1$
550
if (perspId != null) {
551
IWorkbenchPage page = getViewSite().getPage();
552
if (!page.getPerspective().getId().equals(perspId)) {
553
IPerspectiveDescriptor perspective = PlatformUI.getWorkbench()
554
.getPerspectiveRegistry()
555
.findPerspectiveWithId(perspId);
556
if (perspective != null)
557
page.setPerspective(perspective);
560
super.fireSelection(event);
526
563
private void contributeToActionBars() {