1 11 12 package org.eclipse.pde.internal.ui.editor; 13 14 import org.eclipse.jface.action.Action; 15 import org.eclipse.pde.internal.ui.PDEPlugin; 16 import org.eclipse.pde.internal.ui.PDEPluginImages; 17 import org.eclipse.pde.internal.ui.PDEUIMessages; 18 19 25 public class ToggleLinkWithEditorAction extends Action { 26 27 PDEFormEditor fEditor; 28 29 public ToggleLinkWithEditorAction(PDEFormEditor editor) { 30 super(PDEUIMessages.ToggleLinkWithEditorAction_label); 31 boolean isLinkingEnabled = PDEPlugin.getDefault().getPreferenceStore() 32 .getBoolean("ToggleLinkWithEditorAction.isChecked"); setChecked(isLinkingEnabled); 34 fEditor = editor; 35 setToolTipText(PDEUIMessages.ToggleLinkWithEditorAction_toolTip); 36 setDescription(PDEUIMessages.ToggleLinkWithEditorAction_description); 37 setImageDescriptor(PDEPluginImages.DESC_LINK_WITH_EDITOR); 38 setDisabledImageDescriptor(PDEPluginImages.DESC_LINK_WITH_EDITOR_DISABLED); 39 } 40 41 public void run() { 42 PDEPlugin.getDefault().getPreferenceStore().setValue( 43 "ToggleLinkWithEditorAction.isChecked", isChecked()); if (isChecked()) 45 fEditor.synchronizeOutlinePage(); 46 } 47 } 48 | Popular Tags |