private void showGui() { if (view == null) { view = new JDFeedMeView(); view.getBroadcaster() .addListener( new SwitchPanelListener() { @Override public void onPanelEvent(SwitchPanelEvent event) { /* CODE_FOR_INTERFACE_5_START if (event.getID() == SwitchPanelEvent.ON_REMOVE) showAction.setSelected(false); CODE_FOR_INTERFACE_5_END */ /* CODE_FOR_INTERFACE_7_START */ if (event.getEventID() == SwitchPanelEvent.ON_REMOVE) showAction.setSelected(false); /* CODE_FOR_INTERFACE_7_END */ } }); // gui = new JDFeedMeGui(getPluginConfig()); gui = new JDFeedMeGui(); view.setContent(gui); } showAction.setSelected(true); JDGui.getInstance().setContent(view); }
@Override public void actionPerformed(ActionEvent e) { if (e.getSource() == showAction) { if (showAction.isSelected()) { showGui(); } else { if (view != null) view.close(); } } }
@Override public boolean initAddon() { showAction = new MenuAction("feedme", 0); showAction.setActionListener(this); /* CODE_FOR_INTERFACE_5_START showAction.setTitle("JD FeedMe"); CODE_FOR_INTERFACE_5_END */ /* CODE_FOR_INTERFACE_7_START */ showAction.putValue(javax.swing.Action.NAME, "JD FeedMe"); /* CODE_FOR_INTERFACE_7_END */ showAction.setIcon(this.getIconKey()); showAction.setSelected(false); logger.info("JDFeedMe is running"); running = true; thread = new JDFeedMeThread(); thread.start(); return true; }