/** * */ public NodeViewerData() { this.setLayout(new BorderLayout()); this.dataArea = new JTextPane(); this.toolbar = new JToolBar(); this.toolbar.setFloatable(false); JScrollPane scroller = new JScrollPane(this.dataArea); scroller .setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); this.add(scroller, BorderLayout.CENTER); this.add(this.toolbar, BorderLayout.NORTH); JButton saveButton = new JButton(ZooInspectorIconResources .getSaveIcon()); saveButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { if (selectedNode != null) { if (JOptionPane.showConfirmDialog(NodeViewerData.this, "Are you sure you want to save this node?" + " (this action cannot be reverted)", "Confirm Save", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE) == JOptionPane.YES_OPTION) { zooInspectorManager.setData(selectedNode, dataArea .getText()); } } } }); this.toolbar.add(saveButton); }