01: package net.sourceforge.squirrel_sql.plugins.hibernate;
02:
03: import net.sourceforge.squirrel_sql.fw.util.StringManager;
04: import net.sourceforge.squirrel_sql.fw.util.StringManagerFactory;
05: import net.sourceforge.squirrel_sql.client.session.ISQLEntryPanel;
06: import net.sourceforge.squirrel_sql.client.IApplication;
07:
08: import javax.swing.*;
09:
10: public class BookmarksAccessor {
11:
12: private static final StringManager s_stringMgr = StringManagerFactory
13: .getStringManager(BookmarksAccessor.class);
14:
15: private static BoomarksExternalService getService(
16: IApplication application) {
17: BoomarksExternalService si = (BoomarksExternalService) application
18: .getPluginManager().bindExternalPluginService(
19: "sqlbookmark", BoomarksExternalService.class);
20: if (null == si) {
21: // i18n[BookmarksAccessor.bookmarksPluginNeeded=Running bookmarks is only available with the Bookmarks Plugin.\nGet the plugin from www.squirrelsql.org. It's free.]
22: String msg = s_stringMgr
23: .getString("BookmarksAccessor.bookmarksPluginNeeded");
24: JOptionPane.showMessageDialog(application.getMainFrame(),
25: msg);
26: return null;
27: }
28: return si;
29: }
30:
31: public static void selectBookmark(ISQLEntryPanel entryPanel) {
32: getService(entryPanel.getSession().getApplication())
33: .selectBookmark(entryPanel);
34: }
35: }
|