Jelajahi Sumber

ZOOKEEPER-1769. ZooInspector can't display node data/metadata/ACLs (Benjamin Jaton via phunt)

git-svn-id: https://svn.apache.org/repos/asf/zookeeper/trunk@1527908 13f79535-47bb-0310-9956-ffa450edef68
Patrick D. Hunt 11 tahun lalu
induk
melakukan
4e82aebecc

+ 3 - 0
CHANGES.txt

@@ -392,6 +392,9 @@ BUGFIXES:
   ZOOKEEPER-1696. Fail to run zookeeper client on Weblogic application server.
   (Jeffrey Zhong via mahadev)
 
+  ZOOKEEPER-1769. ZooInspector can't display node data/metadata/ACLs
+  (Benjamin Jaton via phunt)
+
 IMPROVEMENTS:
 
   ZOOKEEPER-1170. Fix compiler (eclipse) warnings: unused imports,

+ 5 - 1
src/contrib/zooinspector/src/java/org/apache/zookeeper/inspector/ZooInspector.java

@@ -33,6 +33,9 @@ import org.apache.zookeeper.inspector.manager.ZooInspectorManagerImpl;
  * 
  */
 public class ZooInspector {
+	
+	public static IconResource iconResource;
+	
     /**
      * @param args
      *            - not used. The value of these parameters will have no effect
@@ -43,8 +46,9 @@ public class ZooInspector {
             UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
             JFrame frame = new JFrame("ZooInspector");
             frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+            iconResource = new IconResource();
             final ZooInspectorPanel zooInspectorPanel = new ZooInspectorPanel(
-                    new ZooInspectorManagerImpl(), new IconResource());
+                    new ZooInspectorManagerImpl(), iconResource);
             frame.addWindowListener(new WindowAdapter() {
                 @Override
                 public void windowClosed(WindowEvent e) {

+ 3 - 2
src/contrib/zooinspector/src/java/org/apache/zookeeper/inspector/gui/nodeviewer/NodeViewerData.java

@@ -30,6 +30,7 @@ import javax.swing.JTextPane;
 import javax.swing.JToolBar;
 import javax.swing.SwingWorker;
 
+import org.apache.zookeeper.inspector.ZooInspector;
 import org.apache.zookeeper.inspector.gui.IconResource;
 import org.apache.zookeeper.inspector.logger.LoggerFactory;
 import org.apache.zookeeper.inspector.manager.ZooInspectorNodeManager;
@@ -43,7 +44,7 @@ public class NodeViewerData extends ZooInspectorNodeViewer {
     private final JToolBar toolbar;
     private String selectedNode;
 
-    public NodeViewerData(IconResource iconResource) {
+    public NodeViewerData() {
         this.setLayout(new BorderLayout());
         this.dataArea = new JTextPane();
         this.toolbar = new JToolBar();
@@ -53,7 +54,7 @@ public class NodeViewerData extends ZooInspectorNodeViewer {
                 .setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
         this.add(scroller, BorderLayout.CENTER);
         this.add(this.toolbar, BorderLayout.NORTH);
-        JButton saveButton = new JButton(iconResource.get(IconResource.ICON_SAVE,""));
+        JButton saveButton = new JButton(ZooInspector.iconResource.get(IconResource.ICON_SAVE,""));
         saveButton.addActionListener(new ActionListener() {
 
             public void actionPerformed(ActionEvent e) {

+ 1 - 1
src/contrib/zooinspector/src/java/org/apache/zookeeper/inspector/manager/ZooInspectorManagerImpl.java

@@ -84,7 +84,7 @@ public class ZooInspectorManagerImpl implements ZooInspectorManager {
     public static final String DATA_ENCRYPTION_MANAGER = "encryptionManager";
 
     private static final File defaultNodeViewersFile = new File(
-            "./config/defaultNodeVeiwers.cfg");
+            "./config/defaultNodeViewers.cfg");
     private static final File defaultConnectionFile = new File(
             "./config/defaultConnectionSettings.cfg");