1 11 package org.eclipse.pde.internal.runtime.registry; 12 13 import org.eclipse.jface.action.*; 14 import org.eclipse.pde.internal.runtime.*; 15 16 17 25 public class TogglePropertiesAction extends Action { 26 private RegistryBrowser fViewer; 27 private int fOrientation; 28 29 public TogglePropertiesAction(RegistryBrowser view, int orientation) { 30 super("", AS_RADIO_BUTTON); setRegistryBrowser(view); 32 setOrientation(orientation); 33 34 if (orientation == RegistryBrowser.VERTICAL_ORIENTATION) { 35 setText(PDERuntimeMessages.RegistryView_verticalOrientation_label); setToolTipText(PDERuntimeMessages.RegistryView_verticalOrientation_tooltip); setDescription(PDERuntimeMessages.RegistryView_verticalOrientation_desc); setImageDescriptor(PDERuntimePluginImages.DESC_VERTICAL_VIEW); 39 setDisabledImageDescriptor(PDERuntimePluginImages.DESC_VERTICAL_VIEW_DISABLED); 40 } else if (orientation == RegistryBrowser.HORIZONTAL_ORIENTATION) { 41 setText(PDERuntimeMessages.RegistryView_horizontalOrientation_label); setToolTipText(PDERuntimeMessages.RegistryView_horizontalOrientation_tooltip); setDescription(PDERuntimeMessages.RegistryView_horizontalOrientation_desc); setImageDescriptor(PDERuntimePluginImages.DESC_HORIZONTAL_VIEW); 45 setDisabledImageDescriptor(PDERuntimePluginImages.DESC_HORIZONTAL_VIEW_DISABLED); 46 } else { 47 setText(PDERuntimeMessages.RegistryView_showPropertiesSheet_label); 48 setToolTipText(PDERuntimeMessages.RegistryView_showPropertiesSheet_tooltip); setDescription(PDERuntimeMessages.RegistryView_showPropertiesSheet_desc); setImageDescriptor(PDERuntimePluginImages.DESC_HIDE_PANE); 51 } 52 53 } 54 55 58 public void run() { getRegistryBrowser().setViewOrientation(getOrientation()); 60 } 61 62 private RegistryBrowser getRegistryBrowser() { 63 return fViewer; 64 } 65 66 private void setRegistryBrowser(RegistryBrowser view) { 67 fViewer = view; 68 } 69 70 private void setOrientation(int orientation) { 71 fOrientation = orientation; 72 } 73 74 public int getOrientation() { 75 return fOrientation; 76 } 77 } 78 79 | Popular Tags |