Added a shutdown button to the bundle list plugin. (FELIX-249)
git-svn-id: https://svn.apache.org/repos/asf/incubator/felix/trunk@516055 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/shell.gui.plugin/src/main/java/org/apache/felix/shell/gui/plugin/BundleListPlugin.java b/shell.gui.plugin/src/main/java/org/apache/felix/shell/gui/plugin/BundleListPlugin.java
index 44d906a..f2c20d0 100644
--- a/shell.gui.plugin/src/main/java/org/apache/felix/shell/gui/plugin/BundleListPlugin.java
+++ b/shell.gui.plugin/src/main/java/org/apache/felix/shell/gui/plugin/BundleListPlugin.java
@@ -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