1 19 20 package org.netbeans.modules.db.sql.editor.ui.actions; 21 22 import java.awt.Toolkit ; 23 import org.netbeans.api.db.explorer.ConnectionManager; 24 import org.netbeans.api.db.explorer.DatabaseConnection; 25 import org.netbeans.modules.db.api.sql.execute.SQLExecution; 26 import org.openide.util.NbBundle; 27 28 32 public class SelectInExplorerAction extends SQLExecutionBaseAction { 33 34 private static final String ICON_PATH = "org/netbeans/modules/db/sql/editor/resources/showinexplorer.gif"; 36 protected String getIconBase() { 37 return ICON_PATH; 38 } 39 40 protected String getDisplayName(SQLExecution sqlExecution) { 41 return NbBundle.getMessage(SelectInExplorerAction.class, "LBL_SelectInExplorerAction"); 42 } 43 44 protected boolean enable(SQLExecution sqlExecution) { 45 return true; 46 } 47 48 protected void actionPerformed(SQLExecution sqlExecution) { 49 DatabaseConnection dbconn = sqlExecution.getDatabaseConnection(); 50 if (dbconn != null) { 51 ConnectionManager.getDefault().selectConnectionInExplorer(dbconn); 52 } else { 53 notifyNoDatabaseConnection(); 54 } 55 } 56 } 57 | Popular Tags |