1 19 package org.netbeans.modules.editor.hints; 20 21 import java.awt.event.ActionEvent ; 22 import javax.swing.AbstractAction ; 23 import javax.swing.Action ; 24 import javax.swing.text.JTextComponent ; 25 import org.netbeans.editor.ImplementationProvider; 26 import org.openide.util.NbBundle; 27 28 32 public class FixAction extends AbstractAction { 33 34 public FixAction() { 35 setEnabled(true); 36 putValue(NAME, NbBundle.getMessage(FixAction.class, "NM_FixAction")); 37 } 38 39 public void actionPerformed(ActionEvent e) { 40 if (!HintsUI.getDefault().invokeDefaultAction()) { 41 Action actions[] = ImplementationProvider.getDefault().getGlyphGutterActions((JTextComponent ) e.getSource()); 42 43 if (actions == null) 44 return ; 45 46 int nextAction = 0; 47 48 while (nextAction < actions.length && actions[nextAction] != this) 49 nextAction++; 50 51 nextAction++; 52 53 if (actions.length > nextAction) { 54 Action a = actions[nextAction]; if (a!=null && a.isEnabled()){ 56 a.actionPerformed(e); 57 } 58 } 59 } 60 } 61 62 } 63 64 | Popular Tags |