1 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 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 |