MainButtonsPanel( RemoteCollector remoteCollector, Range selectedRange, final URL monitoringUrl, boolean collectorServer) { super(remoteCollector, new BorderLayout()); this.collectorServer = collectorServer; setOpaque(true); setBackground(BACKGROUND); final JPanel centerPanel = new JPanel(new FlowLayout(FlowLayout.CENTER)); centerPanel.setOpaque(false); add(centerPanel, BorderLayout.CENTER); final CustomPeriodPanel customPeriodPanel = new CustomPeriodPanel(remoteCollector, selectedRange); add(customPeriodPanel, BorderLayout.SOUTH); final MButton refreshButton = createRefreshButton(); final MButton pdfButton = createPdfButton(); // on ne peut pas instancier defaultSerializable ici car sinon, // les données ne seraient plus à jour après une actualisation, donc on passe la valeur spéciale // null final MButton xmlJsonButton = createXmlJsonButton(null); final MButton onlineHelpButton = createOnlineHelpButton(); final MButton monitoringButton = new MButton(getString("Monitoring"), MONITORING_ICON); monitoringButton.setToolTipText( getFormattedString("Monitoring_sur", remoteCollector.getApplication())); centerPanel.add(refreshButton); centerPanel.add(pdfButton); centerPanel.add(xmlJsonButton); centerPanel.add(onlineHelpButton); centerPanel.add(monitoringButton); addPeriodButtons(centerPanel, customPeriodPanel); refreshButton.addActionListener( new ActionListener() { @Override public void actionPerformed(ActionEvent e) { actionRefresh(); } }); pdfButton.addActionListener( new ActionListener() { @Override public void actionPerformed(ActionEvent e) { try { actionPdf(); } catch (final Exception ex) { showException(ex); } } }); monitoringButton.addActionListener( new ActionListener() { @Override public void actionPerformed(ActionEvent e) { try { Desktop.getDesktop().browse(new URI(monitoringUrl.toExternalForm())); } catch (final Exception ex) { showException(ex); } } }); onlineHelpButton.addActionListener( new ActionListener() { @Override public void actionPerformed(ActionEvent e) { try { Desktop.getDesktop() .browse( new URI( monitoringUrl.toExternalForm() + "?resource=" + getString("help_url"))); } catch (final Exception ex) { showException(ex); } } }); }