sdkcreationmw/sdkconnectivityfw/emuconnectmanager/epdt_java/src/com/nokia/epdt/plugins/s60/pan/PanPlugin.java
--- a/sdkcreationmw/sdkconnectivityfw/emuconnectmanager/epdt_java/src/com/nokia/epdt/plugins/s60/pan/PanPlugin.java Mon Mar 08 12:09:11 2010 +0530
+++ b/sdkcreationmw/sdkconnectivityfw/emuconnectmanager/epdt_java/src/com/nokia/epdt/plugins/s60/pan/PanPlugin.java Wed Apr 21 09:56:53 2010 +0530
@@ -1,50 +1,47 @@
/*
-* Copyright (c) 2000 - 2006 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
+ * Copyright (c) 2000 - 2006 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
-*/
-
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
package com.nokia.epdt.plugins.s60.pan;
-import org.apache.log4j.Logger;
import java.awt.Image;
+import java.io.IOException;
+
import javax.swing.ImageIcon;
import javax.swing.JPanel;
-import javax.swing.JOptionPane;
+
+import org.apache.log4j.Logger;
+
+import com.nokia.epdt.core.CoreController;
+import com.nokia.epdt.core.CoreUtils;
+import com.nokia.epdt.core.action.Action;
+import com.nokia.epdt.core.action.ActionEventQueue;
+import com.nokia.epdt.core.action.ActionInterface;
+import com.nokia.epdt.core.action.ActionListener;
+import com.nokia.epdt.core.messaging.MessageInterface;
+import com.nokia.epdt.core.messaging.MessageQueue;
import com.nokia.epdt.core.plugin.CustomPlugin;
import com.nokia.epdt.core.plugin.PluginType;
-import com.nokia.epdt.core.messaging.MessageInterface;
-import com.nokia.epdt.core.messaging.MessageListener;
-import com.nokia.epdt.core.messaging.Message;
-import com.nokia.epdt.core.messaging.MessageQueue;
-import com.nokia.epdt.core.action.Action;
-import com.nokia.epdt.core.action.ActionInterface;
-import com.nokia.epdt.core.action.ActionListener;
-import com.nokia.epdt.core.action.ActionEventQueue;
-import com.nokia.epdt.core.CoreController;
-import com.nokia.epdt.core.CoreUtils;
-import com.nokia.epdt.core.connection.ConnectionStatus;
-import java.io.IOException;
/**
* PanPlugin
*
* @version 1.0
*/
-public class PanPlugin extends CustomPlugin
-{
+public class PanPlugin extends CustomPlugin {
private static Logger log = Logger.getLogger(PanPlugin.class);
private static final Integer UID = Integer.valueOf(PanResourceBundle
.getInstance().getValue(PanConstants.PLUGIN_UID), 16);
@@ -55,37 +52,33 @@
private ActionEventQueue actionEventQueue;
private CoreController coreController;
private JPanel jPanel;
+
/**
* A ActionListener object is used to receive synchronously delivered actions.
*/
- private class PanPluginActionListener implements ActionListener
- {
- public void actionPerformed(Action e)
- {
- if (e.getName() == Action.PREFERENCES_OK)
- {
+ private class PanPluginActionListener implements ActionListener {
+ public void actionPerformed(Action e) {
+ if (e.getName() == Action.PREFERENCES_OK) {
actionEventQueue.put(new Action(
Action.PREFERENCES_REMOVE_PLUGIN_MODEL_CHANGED,
PanPlugin.UID, Action.CORE, new int[0]));
panModel.save();
actionEventQueue.put(new Action(Action.PREFERENCES_HIDE_PLUGIN,
PanPlugin.UID, Action.CORE, new int[0]));
- } else if (e.getName() == Action.PREFERENCES_APPLY)
- {
+ } else if (e.getName() == Action.PREFERENCES_APPLY) {
actionEventQueue.put(new Action(
Action.PREFERENCES_REMOVE_PLUGIN_MODEL_CHANGED,
PanPlugin.UID, Action.CORE, new int[0]));
panModel.save();
- } else if (e.getName() == Action.PREFERENCES_CANCEL)
- {
+ } else if (e.getName() == Action.PREFERENCES_CANCEL) {
}
}
}
+
/**
* Creates a new instance of PanPlugin
*/
- public PanPlugin()
- {
+ public PanPlugin() {
super();
}
@@ -94,8 +87,7 @@
* Getter for property pluginUID.
* @return Value of property pluginUID.
*/
- public Integer getPluginUID()
- {
+ public Integer getPluginUID() {
return PanPlugin.UID;
}
@@ -103,8 +95,7 @@
* Getter for property pluginType.
* @return Value of property pluginType.
*/
- public PluginType getPluginType()
- {
+ public PluginType getPluginType() {
return PluginType.PREFERENCES;
}
@@ -112,8 +103,7 @@
* Getter for property name.
* @return Value of property name.
*/
- public String getName()
- {
+ public String getName() {
return PanResourceBundle.getInstance().getValue(
PanConstants.PLUGIN_NAME);
}
@@ -122,8 +112,7 @@
* Getter for property icon.
* @return Value of property icon.
*/
- public Image getIcon(int type)
- {
+ public Image getIcon(int type) {
return (new ImageIcon()).getImage();
}
@@ -131,10 +120,8 @@
* Getter for property jPanelView.
* @return plug-in module user interface
*/
- public JPanel getJPanelView()
- {
- if (jPanel == null)
- {
+ public JPanel getJPanelView() {
+ if (jPanel == null) {
jPanel = new PanPluginJPanel(this);
}
return jPanel;
@@ -144,14 +131,11 @@
* Bind the plugin's with the epdt core.
* @param c instance of CoreController that is assosiated with this plugin
*/
- public void bindCore(CoreController c)
- {
- try
- {
+ public void bindCore(CoreController c) {
+ try {
panModel = new PanModel(CoreUtils.EpocRoot());
- } catch (IOException ex)
- { //TODO: do something to prevent view from loading
- log.error("Error loading BT or Irda ESK files: " + ex.getMessage());
+ } catch (IOException ex) { //TODO: do something to prevent view from loading
+ log.error("Error loading BT ESK files: " + ex.getMessage());
}
coreController = c;
}
@@ -160,16 +144,14 @@
* Bind the plugin's with the message interface.
* @param m the message interface which is used to send and receive messages
*/
- public void bindMessageInterface(MessageInterface m)
- {
+ public void bindMessageInterface(MessageInterface m) {
}
/**
* Bind the plugin's with the action interface.
* @param a the action interface which is used to mediate and receive actions
*/
- public void bindActionInterface(ActionInterface a)
- {
+ public void bindActionInterface(ActionInterface a) {
a.setActionListener(new PanPlugin.PanPluginActionListener(),
PanPlugin.UID, ActionListener.PLUGIN);
this.actionEventQueue = a.getActionEventQueue();
@@ -178,10 +160,8 @@
/**
* Notifies the core that a plugin model is changed
*/
- public void pluginModelChangedAction()
- {
- if (actionEventQueue != null)
- {
+ public void pluginModelChangedAction() {
+ if (actionEventQueue != null) {
actionEventQueue.put(new Action(
Action.PREFERENCES_PLUGIN_MODEL_CHANGED, PanPlugin.UID,
Action.CORE, new int[0]));
@@ -192,8 +172,7 @@
* Returns the data model for this plugin
* @return the data model
*/
- PanModel getModel()
- {
+ PanModel getModel() {
return panModel;
}
}