KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > pde > internal > ui > editor > PropertiesAction


1 /*******************************************************************************
2  * Copyright (c) 2000, 2004 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.pde.internal.ui.editor;
12 import org.eclipse.jface.action.Action;
13 import org.eclipse.pde.internal.ui.*;
14 import org.eclipse.ui.*;
15 public class PropertiesAction extends Action {
16     private PDEFormEditor editor;
17     public PropertiesAction(PDEFormEditor editor) {
18         this.editor = editor;
19         setText(PDEUIMessages.Actions_properties_label);
20         setImageDescriptor(PDEPluginImages.DESC_PROPERTIES);
21         setDisabledImageDescriptor(PDEPluginImages.DESC_PROPERTIES_DISABLED);
22     }
23     public void run() {
24         try {
25             String JavaDoc viewId = IPageLayout.ID_PROP_SHEET;
26             IWorkbenchPage perspective = PDEPlugin.getActivePage();
27             IViewPart view = perspective.showView(viewId);
28             editor.updatePropertySheet(editor.getActivePageInstance());
29             perspective.activate(editor);
30             perspective.bringToTop(view);
31         } catch (PartInitException e) {
32             PDEPlugin.logException(e);
33         }
34     }
35 }
36
Popular Tags