Return-Path: X-Original-To: apmail-zookeeper-commits-archive@www.apache.org Delivered-To: apmail-zookeeper-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5457411C56 for ; Fri, 4 Apr 2014 01:30:53 +0000 (UTC) Received: (qmail 89541 invoked by uid 500); 4 Apr 2014 01:30:51 -0000 Delivered-To: apmail-zookeeper-commits-archive@zookeeper.apache.org Received: (qmail 89496 invoked by uid 500); 4 Apr 2014 01:30:50 -0000 Mailing-List: contact commits-help@zookeeper.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ Delivered-To: mailing list commits@zookeeper.apache.org Received: (qmail 89480 invoked by uid 99); 4 Apr 2014 01:30:49 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Apr 2014 01:30:49 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Apr 2014 01:30:47 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id EE2BA2388A56; Fri, 4 Apr 2014 01:30:26 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1584500 [4/9] - in /zookeeper/branches/branch-3.4: bin/ src/c/ src/contrib/loggraph/web/org/apache/zookeeper/graph/resources/ src/contrib/zooinspector/ src/contrib/zooinspector/lib/ src/contrib/zooinspector/src/java/org/apache/zookeeper/in... Date: Fri, 04 Apr 2014 01:30:25 -0000 To: commits@zookeeper.apache.org From: michim@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20140404013026.EE2BA2388A56@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Modified: zookeeper/branches/branch-3.4/src/contrib/zooinspector/src/java/org/apache/zookeeper/inspector/gui/ZooInspectorConnectionPropertiesDialog.java URL: http://svn.apache.org/viewvc/zookeeper/branches/branch-3.4/src/contrib/zooinspector/src/java/org/apache/zookeeper/inspector/gui/ZooInspectorConnectionPropertiesDialog.java?rev=1584500&r1=1584499&r2=1584500&view=diff ============================================================================== --- zookeeper/branches/branch-3.4/src/contrib/zooinspector/src/java/org/apache/zookeeper/inspector/gui/ZooInspectorConnectionPropertiesDialog.java (original) +++ zookeeper/branches/branch-3.4/src/contrib/zooinspector/src/java/org/apache/zookeeper/inspector/gui/ZooInspectorConnectionPropertiesDialog.java Fri Apr 4 01:30:24 2014 @@ -1,321 +1,321 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.zookeeper.inspector.gui; - -import java.awt.BorderLayout; -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.Insets; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.io.File; -import java.io.FileReader; -import java.io.IOException; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Properties; -import java.util.Map.Entry; - -import javax.swing.JButton; -import javax.swing.JComboBox; -import javax.swing.JComponent; -import javax.swing.JDialog; -import javax.swing.JFileChooser; -import javax.swing.JLabel; -import javax.swing.JOptionPane; -import javax.swing.JPanel; -import javax.swing.JTextField; - -import org.apache.zookeeper.inspector.logger.LoggerFactory; -import org.apache.zookeeper.inspector.manager.Pair; - -/** - * The connection properties dialog. This is used to determine the settings for - * connecting to a zookeeper instance - */ -public class ZooInspectorConnectionPropertiesDialog extends JDialog { - - private final HashMap components; - - /** - * @param lastConnectionProps - * - the last connection properties used. if this is the first - * conneciton since starting the applications this will be the - * default settings - * @param connectionPropertiesTemplateAndLabels - * - the connection properties and labels to show in this dialog - * @param zooInspectorPanel - * - the {@link ZooInspectorPanel} linked to this dialog - */ - public ZooInspectorConnectionPropertiesDialog( - Properties lastConnectionProps, - Pair>, Map> connectionPropertiesTemplateAndLabels, - final ZooInspectorPanel zooInspectorPanel) { - final Map> connectionPropertiesTemplate = connectionPropertiesTemplateAndLabels - .getKey(); - final Map connectionPropertiesLabels = connectionPropertiesTemplateAndLabels - .getValue(); - this.setLayout(new BorderLayout()); - this.setTitle("Connection Settings"); - this.setModal(true); - this.setAlwaysOnTop(true); - this.setResizable(false); - final JPanel options = new JPanel(); - final JFileChooser fileChooser = new JFileChooser(); - options.setLayout(new GridBagLayout()); - int i = 0; - components = new HashMap(); - for (Entry> entry : connectionPropertiesTemplate - .entrySet()) { - int rowPos = 2 * i + 1; - JLabel label = new JLabel(connectionPropertiesLabels.get(entry - .getKey())); - GridBagConstraints c1 = new GridBagConstraints(); - c1.gridx = 0; - c1.gridy = rowPos; - c1.gridwidth = 1; - c1.gridheight = 1; - c1.weightx = 0; - c1.weighty = 0; - c1.anchor = GridBagConstraints.WEST; - c1.fill = GridBagConstraints.HORIZONTAL; - c1.insets = new Insets(5, 5, 5, 5); - c1.ipadx = 0; - c1.ipady = 0; - options.add(label, c1); - if (entry.getValue().size() == 0) { - JTextField text = new JTextField(); - GridBagConstraints c2 = new GridBagConstraints(); - c2.gridx = 2; - c2.gridy = rowPos; - c2.gridwidth = 1; - c2.gridheight = 1; - c2.weightx = 0; - c2.weighty = 0; - c2.anchor = GridBagConstraints.WEST; - c2.fill = GridBagConstraints.HORIZONTAL; - c2.insets = new Insets(5, 5, 5, 5); - c2.ipadx = 0; - c2.ipady = 0; - options.add(text, c2); - components.put(entry.getKey(), text); - } else if (entry.getValue().size() == 1) { - JTextField text = new JTextField(entry.getValue().get(0)); - GridBagConstraints c2 = new GridBagConstraints(); - c2.gridx = 2; - c2.gridy = rowPos; - c2.gridwidth = 1; - c2.gridheight = 1; - c2.weightx = 0; - c2.weighty = 0; - c2.anchor = GridBagConstraints.WEST; - c2.fill = GridBagConstraints.HORIZONTAL; - c2.insets = new Insets(5, 5, 5, 5); - c2.ipadx = 0; - c2.ipady = 0; - options.add(text, c2); - components.put(entry.getKey(), text); - } else { - List list = entry.getValue(); - JComboBox combo = new JComboBox(list.toArray(new String[list - .size()])); - combo.setSelectedItem(list.get(0)); - GridBagConstraints c2 = new GridBagConstraints(); - c2.gridx = 2; - c2.gridy = rowPos; - c2.gridwidth = 1; - c2.gridheight = 1; - c2.weightx = 0; - c2.weighty = 0; - c2.anchor = GridBagConstraints.WEST; - c2.fill = GridBagConstraints.HORIZONTAL; - c2.insets = new Insets(5, 5, 5, 5); - c2.ipadx = 0; - c2.ipady = 0; - options.add(combo, c2); - components.put(entry.getKey(), combo); - } - i++; - } - loadConnectionProps(lastConnectionProps); - JPanel buttonsPanel = new JPanel(); - buttonsPanel.setLayout(new GridBagLayout()); - JButton loadPropsFileButton = new JButton("Load from file"); - loadPropsFileButton.addActionListener(new ActionListener() { - - public void actionPerformed(ActionEvent e) { - int result = fileChooser - .showOpenDialog(ZooInspectorConnectionPropertiesDialog.this); - if (result == JFileChooser.APPROVE_OPTION) { - File propsFilePath = fileChooser.getSelectedFile(); - Properties props = new Properties(); - try { - FileReader reader = new FileReader(propsFilePath); - try { - props.load(reader); - loadConnectionProps(props); - } finally { - reader.close(); - } - } catch (IOException ex) { - LoggerFactory - .getLogger() - .error( - "An Error occurred loading connection properties from file", - ex); - JOptionPane - .showMessageDialog( - ZooInspectorConnectionPropertiesDialog.this, - "An Error occurred loading connection properties from file", - "Error", JOptionPane.ERROR_MESSAGE); - } - options.revalidate(); - options.repaint(); - } - - } - }); - GridBagConstraints c3 = new GridBagConstraints(); - c3.gridx = 0; - c3.gridy = 0; - c3.gridwidth = 1; - c3.gridheight = 1; - c3.weightx = 0; - c3.weighty = 1; - c3.anchor = GridBagConstraints.SOUTHWEST; - c3.fill = GridBagConstraints.NONE; - c3.insets = new Insets(5, 5, 5, 5); - c3.ipadx = 0; - c3.ipady = 0; - buttonsPanel.add(loadPropsFileButton, c3); - JButton saveDefaultPropsFileButton = new JButton("Set As Default"); - saveDefaultPropsFileButton.addActionListener(new ActionListener() { - - public void actionPerformed(ActionEvent e) { - - Properties connectionProps = getConnectionProps(); - try { - zooInspectorPanel - .setdefaultConnectionProps(connectionProps); - } catch (IOException ex) { - LoggerFactory - .getLogger() - .error( - "An Error occurred saving the default connection properties file", - ex); - JOptionPane - .showMessageDialog( - ZooInspectorConnectionPropertiesDialog.this, - "An Error occurred saving the default connection properties file", - "Error", JOptionPane.ERROR_MESSAGE); - } - } - }); - GridBagConstraints c6 = new GridBagConstraints(); - c6.gridx = 1; - c6.gridy = 0; - c6.gridwidth = 1; - c6.gridheight = 1; - c6.weightx = 1; - c6.weighty = 1; - c6.anchor = GridBagConstraints.SOUTHWEST; - c6.fill = GridBagConstraints.NONE; - c6.insets = new Insets(5, 5, 5, 5); - c6.ipadx = 0; - c6.ipady = 0; - buttonsPanel.add(saveDefaultPropsFileButton, c6); - JButton okButton = new JButton("OK"); - okButton.addActionListener(new ActionListener() { - - public void actionPerformed(ActionEvent e) { - ZooInspectorConnectionPropertiesDialog.this.dispose(); - Properties connectionProps = getConnectionProps(); - zooInspectorPanel.connect(connectionProps); - } - }); - GridBagConstraints c4 = new GridBagConstraints(); - c4.gridx = 2; - c4.gridy = 0; - c4.gridwidth = 1; - c4.gridheight = 1; - c4.weightx = 0; - c4.weighty = 1; - c4.anchor = GridBagConstraints.SOUTH; - c4.fill = GridBagConstraints.HORIZONTAL; - c4.insets = new Insets(5, 5, 5, 5); - c4.ipadx = 0; - c4.ipady = 0; - buttonsPanel.add(okButton, c4); - JButton cancelButton = new JButton("Cancel"); - cancelButton.addActionListener(new ActionListener() { - - public void actionPerformed(ActionEvent e) { - ZooInspectorConnectionPropertiesDialog.this.dispose(); - } - }); - GridBagConstraints c5 = new GridBagConstraints(); - c5.gridx = 3; - c5.gridy = 0; - c5.gridwidth = 1; - c5.gridheight = 1; - c5.weightx = 0; - c5.weighty = 1; - c5.anchor = GridBagConstraints.SOUTH; - c5.fill = GridBagConstraints.HORIZONTAL; - c5.insets = new Insets(5, 5, 5, 5); - c5.ipadx = 0; - c5.ipady = 0; - buttonsPanel.add(cancelButton, c5); - this.add(options, BorderLayout.CENTER); - this.add(buttonsPanel, BorderLayout.SOUTH); - this.pack(); - } - - private void loadConnectionProps(Properties props) { - if (props != null) { - for (Object key : props.keySet()) { - String propsKey = (String) key; - if (components.containsKey(propsKey)) { - JComponent component = components.get(propsKey); - String value = props.getProperty(propsKey); - if (component instanceof JTextField) { - ((JTextField) component).setText(value); - } else if (component instanceof JComboBox) { - ((JComboBox) component).setSelectedItem(value); - } - } - } - } - } - - private Properties getConnectionProps() { - Properties connectionProps = new Properties(); - for (Entry entry : components.entrySet()) { - String value = null; - JComponent component = entry.getValue(); - if (component instanceof JTextField) { - value = ((JTextField) component).getText(); - } else if (component instanceof JComboBox) { - value = ((JComboBox) component).getSelectedItem().toString(); - } - connectionProps.put(entry.getKey(), value); - } - return connectionProps; - } -} +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.zookeeper.inspector.gui; + +import java.awt.BorderLayout; +import java.awt.GridBagConstraints; +import java.awt.GridBagLayout; +import java.awt.Insets; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.io.File; +import java.io.FileReader; +import java.io.IOException; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.Map.Entry; + +import javax.swing.JButton; +import javax.swing.JComboBox; +import javax.swing.JComponent; +import javax.swing.JDialog; +import javax.swing.JFileChooser; +import javax.swing.JLabel; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JTextField; + +import org.apache.zookeeper.inspector.logger.LoggerFactory; +import org.apache.zookeeper.inspector.manager.Pair; + +/** + * The connection properties dialog. This is used to determine the settings for + * connecting to a zookeeper instance + */ +public class ZooInspectorConnectionPropertiesDialog extends JDialog { + + private final HashMap components; + + /** + * @param lastConnectionProps + * - the last connection properties used. if this is the first + * conneciton since starting the applications this will be the + * default settings + * @param connectionPropertiesTemplateAndLabels + * - the connection properties and labels to show in this dialog + * @param zooInspectorPanel + * - the {@link ZooInspectorPanel} linked to this dialog + */ + public ZooInspectorConnectionPropertiesDialog( + Properties lastConnectionProps, + Pair>, Map> connectionPropertiesTemplateAndLabels, + final ZooInspectorPanel zooInspectorPanel) { + final Map> connectionPropertiesTemplate = connectionPropertiesTemplateAndLabels + .getKey(); + final Map connectionPropertiesLabels = connectionPropertiesTemplateAndLabels + .getValue(); + this.setLayout(new BorderLayout()); + this.setTitle("Connection Settings"); + this.setModal(true); + this.setAlwaysOnTop(true); + this.setResizable(false); + final JPanel options = new JPanel(); + final JFileChooser fileChooser = new JFileChooser(); + options.setLayout(new GridBagLayout()); + int i = 0; + components = new HashMap(); + for (Entry> entry : connectionPropertiesTemplate + .entrySet()) { + int rowPos = 2 * i + 1; + JLabel label = new JLabel(connectionPropertiesLabels.get(entry + .getKey())); + GridBagConstraints c1 = new GridBagConstraints(); + c1.gridx = 0; + c1.gridy = rowPos; + c1.gridwidth = 1; + c1.gridheight = 1; + c1.weightx = 0; + c1.weighty = 0; + c1.anchor = GridBagConstraints.WEST; + c1.fill = GridBagConstraints.HORIZONTAL; + c1.insets = new Insets(5, 5, 5, 5); + c1.ipadx = 0; + c1.ipady = 0; + options.add(label, c1); + if (entry.getValue().size() == 0) { + JTextField text = new JTextField(); + GridBagConstraints c2 = new GridBagConstraints(); + c2.gridx = 2; + c2.gridy = rowPos; + c2.gridwidth = 1; + c2.gridheight = 1; + c2.weightx = 0; + c2.weighty = 0; + c2.anchor = GridBagConstraints.WEST; + c2.fill = GridBagConstraints.HORIZONTAL; + c2.insets = new Insets(5, 5, 5, 5); + c2.ipadx = 0; + c2.ipady = 0; + options.add(text, c2); + components.put(entry.getKey(), text); + } else if (entry.getValue().size() == 1) { + JTextField text = new JTextField(entry.getValue().get(0)); + GridBagConstraints c2 = new GridBagConstraints(); + c2.gridx = 2; + c2.gridy = rowPos; + c2.gridwidth = 1; + c2.gridheight = 1; + c2.weightx = 0; + c2.weighty = 0; + c2.anchor = GridBagConstraints.WEST; + c2.fill = GridBagConstraints.HORIZONTAL; + c2.insets = new Insets(5, 5, 5, 5); + c2.ipadx = 0; + c2.ipady = 0; + options.add(text, c2); + components.put(entry.getKey(), text); + } else { + List list = entry.getValue(); + JComboBox combo = new JComboBox(list.toArray(new String[list + .size()])); + combo.setSelectedItem(list.get(0)); + GridBagConstraints c2 = new GridBagConstraints(); + c2.gridx = 2; + c2.gridy = rowPos; + c2.gridwidth = 1; + c2.gridheight = 1; + c2.weightx = 0; + c2.weighty = 0; + c2.anchor = GridBagConstraints.WEST; + c2.fill = GridBagConstraints.HORIZONTAL; + c2.insets = new Insets(5, 5, 5, 5); + c2.ipadx = 0; + c2.ipady = 0; + options.add(combo, c2); + components.put(entry.getKey(), combo); + } + i++; + } + loadConnectionProps(lastConnectionProps); + JPanel buttonsPanel = new JPanel(); + buttonsPanel.setLayout(new GridBagLayout()); + JButton loadPropsFileButton = new JButton("Load from file"); + loadPropsFileButton.addActionListener(new ActionListener() { + + public void actionPerformed(ActionEvent e) { + int result = fileChooser + .showOpenDialog(ZooInspectorConnectionPropertiesDialog.this); + if (result == JFileChooser.APPROVE_OPTION) { + File propsFilePath = fileChooser.getSelectedFile(); + Properties props = new Properties(); + try { + FileReader reader = new FileReader(propsFilePath); + try { + props.load(reader); + loadConnectionProps(props); + } finally { + reader.close(); + } + } catch (IOException ex) { + LoggerFactory + .getLogger() + .error( + "An Error occurred loading connection properties from file", + ex); + JOptionPane + .showMessageDialog( + ZooInspectorConnectionPropertiesDialog.this, + "An Error occurred loading connection properties from file", + "Error", JOptionPane.ERROR_MESSAGE); + } + options.revalidate(); + options.repaint(); + } + + } + }); + GridBagConstraints c3 = new GridBagConstraints(); + c3.gridx = 0; + c3.gridy = 0; + c3.gridwidth = 1; + c3.gridheight = 1; + c3.weightx = 0; + c3.weighty = 1; + c3.anchor = GridBagConstraints.SOUTHWEST; + c3.fill = GridBagConstraints.NONE; + c3.insets = new Insets(5, 5, 5, 5); + c3.ipadx = 0; + c3.ipady = 0; + buttonsPanel.add(loadPropsFileButton, c3); + JButton saveDefaultPropsFileButton = new JButton("Set As Default"); + saveDefaultPropsFileButton.addActionListener(new ActionListener() { + + public void actionPerformed(ActionEvent e) { + + Properties connectionProps = getConnectionProps(); + try { + zooInspectorPanel + .setdefaultConnectionProps(connectionProps); + } catch (IOException ex) { + LoggerFactory + .getLogger() + .error( + "An Error occurred saving the default connection properties file", + ex); + JOptionPane + .showMessageDialog( + ZooInspectorConnectionPropertiesDialog.this, + "An Error occurred saving the default connection properties file", + "Error", JOptionPane.ERROR_MESSAGE); + } + } + }); + GridBagConstraints c6 = new GridBagConstraints(); + c6.gridx = 1; + c6.gridy = 0; + c6.gridwidth = 1; + c6.gridheight = 1; + c6.weightx = 1; + c6.weighty = 1; + c6.anchor = GridBagConstraints.SOUTHWEST; + c6.fill = GridBagConstraints.NONE; + c6.insets = new Insets(5, 5, 5, 5); + c6.ipadx = 0; + c6.ipady = 0; + buttonsPanel.add(saveDefaultPropsFileButton, c6); + JButton okButton = new JButton("OK"); + okButton.addActionListener(new ActionListener() { + + public void actionPerformed(ActionEvent e) { + ZooInspectorConnectionPropertiesDialog.this.dispose(); + Properties connectionProps = getConnectionProps(); + zooInspectorPanel.connect(connectionProps); + } + }); + GridBagConstraints c4 = new GridBagConstraints(); + c4.gridx = 2; + c4.gridy = 0; + c4.gridwidth = 1; + c4.gridheight = 1; + c4.weightx = 0; + c4.weighty = 1; + c4.anchor = GridBagConstraints.SOUTH; + c4.fill = GridBagConstraints.HORIZONTAL; + c4.insets = new Insets(5, 5, 5, 5); + c4.ipadx = 0; + c4.ipady = 0; + buttonsPanel.add(okButton, c4); + JButton cancelButton = new JButton("Cancel"); + cancelButton.addActionListener(new ActionListener() { + + public void actionPerformed(ActionEvent e) { + ZooInspectorConnectionPropertiesDialog.this.dispose(); + } + }); + GridBagConstraints c5 = new GridBagConstraints(); + c5.gridx = 3; + c5.gridy = 0; + c5.gridwidth = 1; + c5.gridheight = 1; + c5.weightx = 0; + c5.weighty = 1; + c5.anchor = GridBagConstraints.SOUTH; + c5.fill = GridBagConstraints.HORIZONTAL; + c5.insets = new Insets(5, 5, 5, 5); + c5.ipadx = 0; + c5.ipady = 0; + buttonsPanel.add(cancelButton, c5); + this.add(options, BorderLayout.CENTER); + this.add(buttonsPanel, BorderLayout.SOUTH); + this.pack(); + } + + private void loadConnectionProps(Properties props) { + if (props != null) { + for (Object key : props.keySet()) { + String propsKey = (String) key; + if (components.containsKey(propsKey)) { + JComponent component = components.get(propsKey); + String value = props.getProperty(propsKey); + if (component instanceof JTextField) { + ((JTextField) component).setText(value); + } else if (component instanceof JComboBox) { + ((JComboBox) component).setSelectedItem(value); + } + } + } + } + } + + private Properties getConnectionProps() { + Properties connectionProps = new Properties(); + for (Entry entry : components.entrySet()) { + String value = null; + JComponent component = entry.getValue(); + if (component instanceof JTextField) { + value = ((JTextField) component).getText(); + } else if (component instanceof JComboBox) { + value = ((JComboBox) component).getSelectedItem().toString(); + } + connectionProps.put(entry.getKey(), value); + } + return connectionProps; + } +} Propchange: zookeeper/branches/branch-3.4/src/contrib/zooinspector/src/java/org/apache/zookeeper/inspector/gui/ZooInspectorConnectionPropertiesDialog.java ------------------------------------------------------------------------------ svn:eol-style = native Modified: zookeeper/branches/branch-3.4/src/contrib/zooinspector/src/java/org/apache/zookeeper/inspector/gui/ZooInspectorIconResources.java URL: http://svn.apache.org/viewvc/zookeeper/branches/branch-3.4/src/contrib/zooinspector/src/java/org/apache/zookeeper/inspector/gui/ZooInspectorIconResources.java?rev=1584500&r1=1584499&r2=1584500&view=diff ============================================================================== --- zookeeper/branches/branch-3.4/src/contrib/zooinspector/src/java/org/apache/zookeeper/inspector/gui/ZooInspectorIconResources.java (original) +++ zookeeper/branches/branch-3.4/src/contrib/zooinspector/src/java/org/apache/zookeeper/inspector/gui/ZooInspectorIconResources.java Fri Apr 4 01:30:24 2014 @@ -1,118 +1,118 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.zookeeper.inspector.gui; - -import javax.swing.ImageIcon; - -/** - * A class containing static methods for retrieving {@link ImageIcon}s used in - * the application - */ -public class ZooInspectorIconResources { - - /** - * @return file icon - */ - public static ImageIcon getTreeLeafIcon() { - return new ImageIcon("icons/file_obj.gif"); //$NON-NLS-1$ - } - - /** - * @return folder open icon - */ - public static ImageIcon getTreeOpenIcon() { - return new ImageIcon("icons/fldr_obj.gif"); //$NON-NLS-1$ - } - - /** - * @return folder closed icon - */ - public static ImageIcon getTreeClosedIcon() { - return new ImageIcon("icons/fldr_obj.gif"); //$NON-NLS-1$ - } - - /** - * @return connect icon - */ - public static ImageIcon getConnectIcon() { - return new ImageIcon("icons/launch_run.gif"); //$NON-NLS-1$ - } - - /** - * @return disconnect icon - */ - public static ImageIcon getDisconnectIcon() { - return new ImageIcon("icons/launch_stop.gif"); //$NON-NLS-1$ - } - - /** - * @return save icon - */ - public static ImageIcon getSaveIcon() { - return new ImageIcon("icons/save_edit.gif"); //$NON-NLS-1$ - } - - /** - * @return add icon - */ - public static ImageIcon getAddNodeIcon() { - return new ImageIcon("icons/new_con.gif"); //$NON-NLS-1$ - } - - /** - * @return delete icon - */ - public static ImageIcon getDeleteNodeIcon() { - return new ImageIcon("icons/trash.gif"); //$NON-NLS-1$ - } - - /** - * @return refresh icon - */ - public static ImageIcon getRefreshIcon() { - return new ImageIcon("icons/refresh.gif"); //$NON-NLS-1$ - } - - /** - * @return information icon - */ - public static ImageIcon getInformationIcon() { - return new ImageIcon("icons/info_obj.gif"); //$NON-NLS-1$ - } - - /** - * @return node viewers icon - */ - public static ImageIcon getChangeNodeViewersIcon() { - return new ImageIcon("icons/edtsrclkup_co.gif"); //$NON-NLS-1$ - } - - /** - * @return up icon - */ - public static ImageIcon getUpIcon() { - return new ImageIcon("icons/search_prev.gif"); //$NON-NLS-1$ - } - - /** - * @return down icon - */ - public static ImageIcon getDownIcon() { - return new ImageIcon("icons/search_next.gif"); //$NON-NLS-1$ - } -} +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.zookeeper.inspector.gui; + +import javax.swing.ImageIcon; + +/** + * A class containing static methods for retrieving {@link ImageIcon}s used in + * the application + */ +public class ZooInspectorIconResources { + + /** + * @return file icon + */ + public static ImageIcon getTreeLeafIcon() { + return new ImageIcon("icons/file_obj.gif"); //$NON-NLS-1$ + } + + /** + * @return folder open icon + */ + public static ImageIcon getTreeOpenIcon() { + return new ImageIcon("icons/fldr_obj.gif"); //$NON-NLS-1$ + } + + /** + * @return folder closed icon + */ + public static ImageIcon getTreeClosedIcon() { + return new ImageIcon("icons/fldr_obj.gif"); //$NON-NLS-1$ + } + + /** + * @return connect icon + */ + public static ImageIcon getConnectIcon() { + return new ImageIcon("icons/launch_run.gif"); //$NON-NLS-1$ + } + + /** + * @return disconnect icon + */ + public static ImageIcon getDisconnectIcon() { + return new ImageIcon("icons/launch_stop.gif"); //$NON-NLS-1$ + } + + /** + * @return save icon + */ + public static ImageIcon getSaveIcon() { + return new ImageIcon("icons/save_edit.gif"); //$NON-NLS-1$ + } + + /** + * @return add icon + */ + public static ImageIcon getAddNodeIcon() { + return new ImageIcon("icons/new_con.gif"); //$NON-NLS-1$ + } + + /** + * @return delete icon + */ + public static ImageIcon getDeleteNodeIcon() { + return new ImageIcon("icons/trash.gif"); //$NON-NLS-1$ + } + + /** + * @return refresh icon + */ + public static ImageIcon getRefreshIcon() { + return new ImageIcon("icons/refresh.gif"); //$NON-NLS-1$ + } + + /** + * @return information icon + */ + public static ImageIcon getInformationIcon() { + return new ImageIcon("icons/info_obj.gif"); //$NON-NLS-1$ + } + + /** + * @return node viewers icon + */ + public static ImageIcon getChangeNodeViewersIcon() { + return new ImageIcon("icons/edtsrclkup_co.gif"); //$NON-NLS-1$ + } + + /** + * @return up icon + */ + public static ImageIcon getUpIcon() { + return new ImageIcon("icons/search_prev.gif"); //$NON-NLS-1$ + } + + /** + * @return down icon + */ + public static ImageIcon getDownIcon() { + return new ImageIcon("icons/search_next.gif"); //$NON-NLS-1$ + } +} Propchange: zookeeper/branches/branch-3.4/src/contrib/zooinspector/src/java/org/apache/zookeeper/inspector/gui/ZooInspectorIconResources.java ------------------------------------------------------------------------------ svn:eol-style = native