mirror of
https://github.com/igniterealtime/Spark.git
synced 2025-12-01 12:27:58 +00:00
SPARK-1351, remove plugins from install directory so they wont be loaded again
changed X-icon to another X-icon ;-) git-svn-id: http://svn.igniterealtime.org/svn/repos/spark/trunk@12461 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
committed by
wolf.posdorfer
parent
d559d4cf49
commit
2235996ede
@ -588,7 +588,7 @@ public class ReceiveMessage extends JPanel {
|
|||||||
cancelButton.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, new Color(73, 113, 196)));
|
cancelButton.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, new Color(73, 113, 196)));
|
||||||
cancelButton.setForeground(new Color(73, 113, 196));
|
cancelButton.setForeground(new Color(73, 113, 196));
|
||||||
cancelButton.setFont(new Font("Dialog", Font.BOLD, 11));
|
cancelButton.setFont(new Font("Dialog", Font.BOLD, 11));
|
||||||
cancelButton.setIcon(SparkRes.getImageIcon(SparkRes.CANCEL_IMAGE));
|
cancelButton.setIcon(SparkRes.getImageIcon(SparkRes.SMALL_DELETE));
|
||||||
|
|
||||||
cancelButton.addActionListener(new ActionListener() {
|
cancelButton.addActionListener(new ActionListener() {
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
|
|||||||
@ -94,7 +94,7 @@ public class SendMessage extends JPanel {
|
|||||||
|
|
||||||
cancelButton.setText(Res.getString("cancel"));
|
cancelButton.setText(Res.getString("cancel"));
|
||||||
retryButton.setText(Res.getString("retry"));
|
retryButton.setText(Res.getString("retry"));
|
||||||
cancelButton.setIcon(SparkRes.getImageIcon(SparkRes.CANCEL_IMAGE));
|
cancelButton.setIcon(SparkRes.getImageIcon(SparkRes.SMALL_DELETE));
|
||||||
retryButton.setIcon(SparkRes.getImageIcon(SparkRes.REFRESH_IMAGE));
|
retryButton.setIcon(SparkRes.getImageIcon(SparkRes.REFRESH_IMAGE));
|
||||||
|
|
||||||
add(cancelButton, new GridBagConstraints(1, 4, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 5, 0, 5), 0, 0));
|
add(cancelButton, new GridBagConstraints(1, 4, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 5, 0, 5), 0, 0));
|
||||||
|
|||||||
@ -19,6 +19,41 @@
|
|||||||
*/
|
*/
|
||||||
package org.jivesoftware.sparkimpl.plugin.viewer;
|
package org.jivesoftware.sparkimpl.plugin.viewer;
|
||||||
|
|
||||||
|
import java.awt.Color;
|
||||||
|
import java.awt.Component;
|
||||||
|
import java.awt.EventQueue;
|
||||||
|
import java.awt.GridBagConstraints;
|
||||||
|
import java.awt.GridBagLayout;
|
||||||
|
import java.awt.Insets;
|
||||||
|
import java.awt.event.ActionEvent;
|
||||||
|
import java.awt.event.MouseAdapter;
|
||||||
|
import java.awt.event.MouseEvent;
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileOutputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.io.OutputStream;
|
||||||
|
import java.net.URL;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.swing.AbstractAction;
|
||||||
|
import javax.swing.Action;
|
||||||
|
import javax.swing.JFrame;
|
||||||
|
import javax.swing.JLabel;
|
||||||
|
import javax.swing.JMenu;
|
||||||
|
import javax.swing.JMenuBar;
|
||||||
|
import javax.swing.JMenuItem;
|
||||||
|
import javax.swing.JOptionPane;
|
||||||
|
import javax.swing.JPanel;
|
||||||
|
import javax.swing.JProgressBar;
|
||||||
|
import javax.swing.JScrollPane;
|
||||||
|
import javax.swing.JTabbedPane;
|
||||||
|
import javax.swing.event.ChangeEvent;
|
||||||
|
import javax.swing.event.ChangeListener;
|
||||||
|
|
||||||
import org.apache.commons.httpclient.HttpClient;
|
import org.apache.commons.httpclient.HttpClient;
|
||||||
import org.apache.commons.httpclient.methods.GetMethod;
|
import org.apache.commons.httpclient.methods.GetMethod;
|
||||||
import org.apache.commons.httpclient.protocol.Protocol;
|
import org.apache.commons.httpclient.protocol.Protocol;
|
||||||
@ -27,6 +62,7 @@ import org.dom4j.DocumentException;
|
|||||||
import org.dom4j.Element;
|
import org.dom4j.Element;
|
||||||
import org.dom4j.Node;
|
import org.dom4j.Node;
|
||||||
import org.dom4j.io.SAXReader;
|
import org.dom4j.io.SAXReader;
|
||||||
|
import org.jivesoftware.Spark;
|
||||||
import org.jivesoftware.resource.Default;
|
import org.jivesoftware.resource.Default;
|
||||||
import org.jivesoftware.resource.Res;
|
import org.jivesoftware.resource.Res;
|
||||||
import org.jivesoftware.resource.SparkRes;
|
import org.jivesoftware.resource.SparkRes;
|
||||||
@ -44,42 +80,9 @@ import org.jivesoftware.spark.util.log.Log;
|
|||||||
import org.jivesoftware.sparkimpl.settings.JiveInfo;
|
import org.jivesoftware.sparkimpl.settings.JiveInfo;
|
||||||
import org.jivesoftware.sparkimpl.updater.EasySSLProtocolSocketFactory;
|
import org.jivesoftware.sparkimpl.updater.EasySSLProtocolSocketFactory;
|
||||||
|
|
||||||
import javax.swing.AbstractAction;
|
/**
|
||||||
import javax.swing.Action;
|
* Class to handle the viewing of installed and downloadable Plugins
|
||||||
import javax.swing.JFrame;
|
*/
|
||||||
import javax.swing.JLabel;
|
|
||||||
import javax.swing.JMenu;
|
|
||||||
import javax.swing.JMenuBar;
|
|
||||||
import javax.swing.JMenuItem;
|
|
||||||
import javax.swing.JOptionPane;
|
|
||||||
import javax.swing.JPanel;
|
|
||||||
import javax.swing.JProgressBar;
|
|
||||||
import javax.swing.JScrollPane;
|
|
||||||
import javax.swing.JTabbedPane;
|
|
||||||
import javax.swing.event.ChangeEvent;
|
|
||||||
import javax.swing.event.ChangeListener;
|
|
||||||
|
|
||||||
import java.awt.Color;
|
|
||||||
import java.awt.Component;
|
|
||||||
import java.awt.EventQueue;
|
|
||||||
import java.awt.GridBagConstraints;
|
|
||||||
import java.awt.GridBagLayout;
|
|
||||||
import java.awt.Insets;
|
|
||||||
import java.awt.event.ActionEvent;
|
|
||||||
import java.awt.event.ActionListener;
|
|
||||||
import java.awt.event.MouseAdapter;
|
|
||||||
import java.awt.event.MouseEvent;
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.FileOutputStream;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStream;
|
|
||||||
import java.io.OutputStream;
|
|
||||||
import java.net.URL;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Collection;
|
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class PluginViewer extends JPanel implements Plugin {
|
public class PluginViewer extends JPanel implements Plugin {
|
||||||
|
|
||||||
private static final long serialVersionUID = -4249017716988031394L;
|
private static final long serialVersionUID = -4249017716988031394L;
|
||||||
@ -105,19 +108,25 @@ public class PluginViewer extends JPanel implements Plugin {
|
|||||||
availablePanel = new JPanel();
|
availablePanel = new JPanel();
|
||||||
setLayout(new GridBagLayout());
|
setLayout(new GridBagLayout());
|
||||||
|
|
||||||
installedPanel.setLayout(new VerticalFlowLayout(VerticalFlowLayout.TOP, 0, 0, true, false));
|
installedPanel.setLayout(new VerticalFlowLayout(
|
||||||
|
VerticalFlowLayout.TOP, 0, 0, true, false));
|
||||||
installedPanel.setBackground(Color.white);
|
installedPanel.setBackground(Color.white);
|
||||||
|
|
||||||
availablePanel.setLayout(new VerticalFlowLayout(VerticalFlowLayout.TOP, 0, 0, true, false));
|
availablePanel.setLayout(new VerticalFlowLayout(
|
||||||
|
VerticalFlowLayout.TOP, 0, 0, true, false));
|
||||||
availablePanel.setBackground(Color.white);
|
availablePanel.setBackground(Color.white);
|
||||||
|
|
||||||
// Add TabbedPane
|
// Add TabbedPane
|
||||||
add(tabbedPane, new GridBagConstraints(0, 1, 2, 1, 1.0, 1.0, GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(5, 5, 5, 5), 0, 0));
|
add(tabbedPane, new GridBagConstraints(0, 1, 2, 1, 1.0, 1.0,
|
||||||
|
GridBagConstraints.WEST, GridBagConstraints.BOTH,
|
||||||
|
new Insets(5, 5, 5, 5), 0, 0));
|
||||||
|
|
||||||
// Add Tabs
|
// Add Tabs
|
||||||
tabbedPane.addTab(Res.getString("tab.installed.plugins"), new JScrollPane(installedPanel));
|
tabbedPane.addTab(Res.getString("tab.installed.plugins"),
|
||||||
if(!Default.getBoolean(Default.INSTALL_PLUGINS_DISABLED)){
|
new JScrollPane(installedPanel));
|
||||||
tabbedPane.addTab(Res.getString("tab.available.plugins"), new JScrollPane(availablePanel));
|
if (!Default.getBoolean(Default.INSTALL_PLUGINS_DISABLED)) {
|
||||||
|
tabbedPane.addTab(Res.getString("tab.available.plugins"),
|
||||||
|
new JScrollPane(availablePanel));
|
||||||
}
|
}
|
||||||
|
|
||||||
loadInstalledPlugins();
|
loadInstalledPlugins();
|
||||||
@ -177,7 +186,10 @@ public class PluginViewer extends JPanel implements Plugin {
|
|||||||
// Delete main jar.
|
// Delete main jar.
|
||||||
File pluginDir = plugin.getPluginDir();
|
File pluginDir = plugin.getPluginDir();
|
||||||
File pluginJAR = new File(plugin.getPluginDir().getParentFile(), pluginDir.getName() + ".jar");
|
File pluginJAR = new File(plugin.getPluginDir().getParentFile(), pluginDir.getName() + ".jar");
|
||||||
|
File mainpluginJar = new File(Spark.getBinDirectory().getParent()+"/plugins/"+pluginJAR.getName());
|
||||||
|
|
||||||
pluginJAR.delete();
|
pluginJAR.delete();
|
||||||
|
mainpluginJar.delete();
|
||||||
|
|
||||||
JOptionPane.showMessageDialog(this, Res.getString("message.restart.spark.changes"), Res.getString("title.reminder"), JOptionPane.INFORMATION_MESSAGE);
|
JOptionPane.showMessageDialog(this, Res.getString("message.restart.spark.changes"), Res.getString("title.reminder"), JOptionPane.INFORMATION_MESSAGE);
|
||||||
PluginManager.getInstance().removePublicPlugin(plugin);
|
PluginManager.getInstance().removePublicPlugin(plugin);
|
||||||
@ -475,7 +487,7 @@ public class PluginViewer extends JPanel implements Plugin {
|
|||||||
|
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
System.out.println("We can ignore these.");
|
Log.error("Error retrieving PluginInformation from xml.",e);
|
||||||
}
|
}
|
||||||
pluginList.add(publicPlugin);
|
pluginList.add(publicPlugin);
|
||||||
}
|
}
|
||||||
@ -555,8 +567,11 @@ public class PluginViewer extends JPanel implements Plugin {
|
|||||||
ui.setSelected(true);
|
ui.setSelected(true);
|
||||||
|
|
||||||
final PluginManager pluginManager = PluginManager.getInstance();
|
final PluginManager pluginManager = PluginManager.getInstance();
|
||||||
ui.getInstallButton().addActionListener(new ActionListener() {
|
ui.getInstallButton().addMouseListener(new MouseAdapter() {
|
||||||
public void actionPerformed(ActionEvent actionEvent) {
|
|
||||||
|
@Override
|
||||||
|
public void mouseClicked(MouseEvent e) {
|
||||||
|
|
||||||
boolean isInstalled = pluginManager.isInstalled(ui.getPlugin());
|
boolean isInstalled = pluginManager.isInstalled(ui.getPlugin());
|
||||||
if (isInstalled) {
|
if (isInstalled) {
|
||||||
boolean uninstalled = uninstall(ui.getPlugin());
|
boolean uninstalled = uninstall(ui.getPlugin());
|
||||||
@ -564,6 +579,7 @@ public class PluginViewer extends JPanel implements Plugin {
|
|||||||
installedPanel.remove(ui);
|
installedPanel.remove(ui);
|
||||||
installedPanel.invalidate();
|
installedPanel.invalidate();
|
||||||
installedPanel.repaint();
|
installedPanel.repaint();
|
||||||
|
installedPanel.revalidate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
Reference in New Issue
Block a user