1 19 24 25 package org.netbeans.modules.java.navigation.actions; 26 27 import java.awt.Container ; 28 import java.awt.Point ; 29 import java.beans.PropertyChangeEvent ; 30 import java.beans.PropertyChangeListener ; 31 import java.util.List ; 32 import javax.lang.model.element.Element; 33 import javax.swing.JEditorPane ; 34 import org.netbeans.api.java.source.ElementHandle; 35 import org.netbeans.api.java.source.UiUtils; 36 import org.openide.awt.*; 37 import org.openide.awt.StatusDisplayer; 38 import org.openide.cookies.*; 39 import org.openide.cookies.EditorCookie; 40 import org.openide.filesystems.FileObject; 41 import org.openide.loaders.DataObject; 42 import org.openide.nodes.*; 43 import org.openide.text.PositionBounds; 44 import org.openide.util.*; 45 46 import javax.swing.*; 47 import java.awt.event.*; 48 import org.openide.windows.TopComponent; 49 50 56 public final class OpenAction extends AbstractAction { 57 58 private ElementHandle<? extends Element> elementHandle; 59 private FileObject fileObject; 60 61 public OpenAction( ElementHandle<? extends Element> elementHandle, FileObject fileObject ) { 62 this.elementHandle = elementHandle; 63 this.fileObject = fileObject; 64 putValue ( Action.NAME, NbBundle.getMessage ( OpenAction.class, "LBL_Goto" ) ); } 66 67 public void actionPerformed (ActionEvent ev) { 68 UiUtils.open(fileObject, elementHandle); 69 } 92 93 public boolean isEnabled () { 94 return true; 95 } 96 97 98 214 215 } 216 | Popular Tags |