aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/java/sip/communicator/plugin/profiler4j/SettingsWindowMenuEntry.java
diff options
context:
space:
mode:
authorBenoit Pradelle <pradelle@java.net>2008-10-02 02:00:26 +0000
committerBenoit Pradelle <pradelle@java.net>2008-10-02 02:00:26 +0000
commit3aecc0800f6ff4ec4313719487d12a520793ad30 (patch)
tree89e8c64de31ee968333f37f43eb8fb556a67440c /src/net/java/sip/communicator/plugin/profiler4j/SettingsWindowMenuEntry.java
parent0ec995e1f51458b96d175ee4605f32af33acb970 (diff)
downloadjitsi-3aecc0800f6ff4ec4313719487d12a520793ad30.zip
jitsi-3aecc0800f6ff4ec4313719487d12a520793ad30.tar.gz
jitsi-3aecc0800f6ff4ec4313719487d12a520793ad30.tar.bz2
Integrating profiler4j. GSoC result of Vladimir.
Diffstat (limited to 'src/net/java/sip/communicator/plugin/profiler4j/SettingsWindowMenuEntry.java')
-rw-r--r--src/net/java/sip/communicator/plugin/profiler4j/SettingsWindowMenuEntry.java85
1 files changed, 85 insertions, 0 deletions
diff --git a/src/net/java/sip/communicator/plugin/profiler4j/SettingsWindowMenuEntry.java b/src/net/java/sip/communicator/plugin/profiler4j/SettingsWindowMenuEntry.java
new file mode 100644
index 0000000..120d6cd
--- /dev/null
+++ b/src/net/java/sip/communicator/plugin/profiler4j/SettingsWindowMenuEntry.java
@@ -0,0 +1,85 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.plugin.profiler4j;
+
+/**
+ * Menu entry for the profiler plug-in
+ *
+ * @author Vladimir Å karupelov
+ */
+import java.awt.event.*;
+import javax.swing.*;
+import net.java.sip.communicator.service.contactlist.*;
+import net.java.sip.communicator.service.gui.*;
+import net.sf.profiler4j.console.*;
+
+public class SettingsWindowMenuEntry implements PluginComponent
+{
+ private static final String PROFILER_NAME = "profiler";
+ private JMenuItem settingsMenuEntry;
+ private Container container;
+
+ public SettingsWindowMenuEntry(Container container)
+ {
+ settingsMenuEntry = new JMenuItem(Resources.getString( PROFILER_NAME ));
+ settingsMenuEntry.addActionListener(new ActionListener()
+ {
+ public void actionPerformed(ActionEvent e)
+ {
+ Prefs prefs = new Prefs();
+
+ System.setProperty("swing.aatext",
+ String.valueOf(prefs.isAntialiasing()));
+
+ final Console app = new Console(prefs);
+ app.connect();
+ MainFrame f = new MainFrame(app);
+ app.setMainFrame(f);
+ f.pack();
+ f.setVisible(true);
+ }
+ });
+ this.container = container;
+ }
+
+ public Object getComponent()
+ {
+ return settingsMenuEntry;
+ }
+
+ public String getConstraints()
+ {
+ return null;
+ }
+
+ public Container getContainer()
+ {
+ return container;
+ }
+
+ public String getName()
+ {
+ return Resources.getString( PROFILER_NAME );
+ }
+
+ public void setCurrentContact(MetaContact metaContact)
+ {
+ }
+
+ public void setCurrentContactGroup(MetaContactGroup metaGroup)
+ {
+ }
+
+ public int getPositionIndex()
+ {
+ return -1;
+ }
+
+ public boolean isNativeComponent() {
+ return false;
+ }
+}