You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by ri...@apache.org on 2007/03/08 15:34:16 UTC

svn commit: r516055 - /incubator/felix/trunk/shell.gui.plugin/src/main/java/org/apache/felix/shell/gui/plugin/BundleListPlugin.java

Author: rickhall
Date: Thu Mar  8 06:34:15 2007
New Revision: 516055

URL: http://svn.apache.org/viewvc?view=rev&rev=516055
Log:
Added a shutdown button to the bundle list plugin. (FELIX-249)

Modified:
    incubator/felix/trunk/shell.gui.plugin/src/main/java/org/apache/felix/shell/gui/plugin/BundleListPlugin.java

Modified: incubator/felix/trunk/shell.gui.plugin/src/main/java/org/apache/felix/shell/gui/plugin/BundleListPlugin.java
URL: http://svn.apache.org/viewvc/incubator/felix/trunk/shell.gui.plugin/src/main/java/org/apache/felix/shell/gui/plugin/BundleListPlugin.java?view=diff&rev=516055&r1=516054&r2=516055
==============================================================================
--- incubator/felix/trunk/shell.gui.plugin/src/main/java/org/apache/felix/shell/gui/plugin/BundleListPlugin.java (original)
+++ incubator/felix/trunk/shell.gui.plugin/src/main/java/org/apache/felix/shell/gui/plugin/BundleListPlugin.java Thu Mar  8 06:34:15 2007
@@ -41,6 +41,7 @@
     private JButton m_updateButton = null;
     private JButton m_refreshButton = null;
     private JButton m_uninstallButton = null;
+    private JButton m_shutdownButton = null;
 
     // Plugin interface methods.
 
@@ -62,9 +63,8 @@
 
         // Create user interface components.
         setLayout(new BorderLayout());
-        JScrollPane scroll = null;
         add(createURLPanel(), BorderLayout.NORTH);
-        add(scroll = new JScrollPane(m_bundleTable = new JTable()), BorderLayout.CENTER);
+        add(new JScrollPane(m_bundleTable = new JTable()), BorderLayout.CENTER);
         add(createButtonPanel(), BorderLayout.SOUTH);
 
         // Set table model to display bundles.
@@ -95,11 +95,13 @@
         panel.add(m_updateButton = new JButton("Update"));
         panel.add(m_refreshButton = new JButton("Refresh"));
         panel.add(m_uninstallButton = new JButton("Uninstall"));
+        panel.add(m_shutdownButton = new JButton("Shutdown"));
         m_startButton.setMnemonic('S');
         m_stopButton.setMnemonic('p');
         m_updateButton.setMnemonic('a');
         m_refreshButton.setMnemonic('R');
         m_uninstallButton.setMnemonic('U');
+        m_shutdownButton.setMnemonic('d');
         return panel;
     }
 
@@ -250,6 +252,23 @@
                 }
             }
         });
+
+        m_shutdownButton.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent event)
+            {
+                Bundle systembundle = m_context.getBundle(0);
+                try
+                {
+                    systembundle.stop();
+                }
+                catch (Exception ex)
+                {
+                    System.out.println(ex.toString());
+                    ex.printStackTrace(System.out);
+                }
+            }
+        });
+
     }
 
     private class SimpleTableModel extends AbstractTableModel