|
16 | 16 | import org.openide.awt.ActionReference; |
17 | 17 | import org.openide.util.Exceptions; |
18 | 18 | import org.openide.util.Lookup; |
| 19 | +import org.openide.util.NbBundle; |
19 | 20 | import org.openide.windows.TopComponent; |
20 | 21 |
|
21 | 22 | /** |
22 | 23 | * |
23 | 24 | * @author totetmatt |
24 | 25 | */ |
25 | | - |
26 | 26 | @TopComponent.Description(preferredID = "BlueskyGephiMainPanel", |
27 | | - iconBase = "fr/totetmatt/gephi/twitter/twitterlogo.png" |
28 | | -) |
29 | | - |
30 | | - |
31 | | -@ActionReference(path = "Menu/Window", position = 334) |
32 | | -@TopComponent.OpenActionRegistration(displayName = "Bluesky Gephi", |
33 | | - preferredID = "MainTwitterStreamerWindow") |
| 27 | + persistenceType = TopComponent.PERSISTENCE_ALWAYS) |
| 28 | +@TopComponent.Registration(mode = "layoutmode", openAtStartup = true, roles = {"overview"}, position = 2) |
34 | 29 | @ActionID(category = "Window", id = "fr.totetmatt.blueskygephi.BlueskyGephiMainPanel") |
35 | | -@TopComponent.Registration(mode = "layoutmode", openAtStartup = true, position=2) |
| 30 | +@ActionReference(path = "Menu/Window", position = 334) |
| 31 | +@TopComponent.OpenActionRegistration(displayName = "#CTL_BlueskyGephiMainPanel", |
| 32 | + preferredID = "BlueskyGephiMainPanel") |
36 | 33 | public class BlueskyGephiMainPanel extends TopComponent { |
37 | 34 | protected static final Logger consoleLogger = Logger.getLogger(BlueskyGephiMainPanel.class.getName()); |
38 | | - private final BlueskyGephi blueskyGephi; |
| 35 | + private static final Logger logger = Logger.getLogger(BlueskyGephiMainPanel.class.getName()); |
| 36 | + private BlueskyGephi blueskyGephi; |
39 | 37 | /** |
40 | 38 | * Creates new form BlueskyGephiMainPanel |
41 | 39 | */ |
42 | 40 | public BlueskyGephiMainPanel() { |
43 | 41 | initComponents(); |
44 | | - blueskyGephi = Lookup.getDefault().lookup(BlueskyGephi.class); |
| 42 | + setName(NbBundle.getMessage(BlueskyGephiMainPanel.class, "CTL_BlueskyGephiMainPanel")); |
| 43 | + setToolTipText(NbBundle.getMessage(BlueskyGephiMainPanel.class, "HINT_BlueskyGephiMainPanel")); |
| 44 | + blueskyGephi = Lookup.getDefault().lookup(BlueskyGephi.class); |
| 45 | + if (blueskyGephi == null) { |
| 46 | + logger.warning("BlueskyGephi service not available"); |
| 47 | + return; |
| 48 | + } |
45 | 49 | credentialsHostField.setText(blueskyGephi.getHost()); |
46 | 50 | credentialsHandleField.setText(blueskyGephi.getHandle()); |
47 | 51 | credentialsPasswordField.setText(blueskyGephi.getPassword()); |
|
0 commit comments