Exceptions logged properly.

cusax-fix
Yana Stamcheva 20 years ago
parent cf6ff80cc1
commit ff2dec3ca0

@ -12,6 +12,7 @@
import javax.swing.JOptionPane;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
import javax.swing.plaf.metal.MetalLookAndFeel;
import javax.swing.plaf.metal.MetalTheme;
@ -19,6 +20,7 @@
import net.java.sip.communicator.impl.gui.lookandfeel.SIPCommLookAndFeel;
import net.java.sip.communicator.impl.gui.main.configforms.ConfigurationFrame;
import net.java.sip.communicator.impl.gui.utils.ImageLoader;
import net.java.sip.communicator.util.Logger;
/**
* Starts the GUI application using the SkinLookAndFeel of l2fprod.
@ -29,6 +31,8 @@ public class CommunicatorMain {
private MainFrame mainFrame;
private Logger logger = Logger.getLogger(CommunicatorMain.class.getName());
public CommunicatorMain() {
this.setDefaultThemePack();
@ -46,19 +50,18 @@ public CommunicatorMain() {
public void setDefaultThemePack() {
try {
SIPCommLookAndFeel lf = new SIPCommLookAndFeel();
SIPCommLookAndFeel.setCurrentTheme(new SIPCommDefaultTheme());
// we need to set the UIDefaults class loader so that it may access
// resources packed inside OSGI bundles
UIManager.put("ClassLoader", getClass()
.getClassLoader());
SIPCommLookAndFeel lf = new SIPCommLookAndFeel();
SIPCommLookAndFeel.setCurrentTheme(new SIPCommDefaultTheme());
// we need to set the UIDefaults class loader so that it may access
// resources packed inside OSGI bundles
UIManager.put("ClassLoader", getClass()
.getClassLoader());
try{
UIManager.setLookAndFeel(lf);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
catch(UnsupportedLookAndFeelException e){
logger.error("The provided Look & Feel is not supported.", e);
}
}

@ -39,6 +39,7 @@
import net.java.sip.communicator.service.protocol.event.ProviderPresenceStatusChangeEvent;
import net.java.sip.communicator.service.protocol.event.ProviderPresenceStatusListener;
import net.java.sip.communicator.service.protocol.icqconstants.IcqStatusEnum;
import net.java.sip.communicator.util.Logger;
/**
* The main application frame.
@ -47,6 +48,8 @@
*/
public class MainFrame extends JFrame {
private Logger logger = Logger.getLogger(MainFrame.class.getName());
private JPanel contactListPanel = new JPanel(new BorderLayout());
private JPanel menusPanel = new JPanel(new BorderLayout());
@ -212,29 +215,21 @@ public void setConfigFrame(ConfigurationFrame configFrame) {
try {
presence
.publishPresenceStatus(IcqStatusEnum.ONLINE, "");
this.getStatusPanel().stopConnecting(
protocolProvider.getProtocolName());
this.statusPanel.setSelectedStatus
(protocolProvider.getProtocolName(),
Constants.ONLINE_STATUS);
//request the focus int the contact list panel, which
//permits to search in the contact list
this.tabbedPane.getContactListPanel()
.getContactList().requestFocus();
} catch (IllegalArgumentException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IllegalStateException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (OperationFailedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
logger.error("Publish presence status failed.", e);
}
this.getStatusPanel().stopConnecting(
protocolProvider.getProtocolName());
this.statusPanel.setSelectedStatus
(protocolProvider.getProtocolName(),
Constants.ONLINE_STATUS);
//request the focus int the contact list panel, which
//permits to search in the contact list
this.tabbedPane.getContactListPanel()
.getContactList().requestFocus();
}
else if(key.equals(OperationSetBasicInstantMessaging.class.getName())
|| key.equals(OperationSetPresence.class.getName())){

@ -23,8 +23,10 @@
import javax.swing.text.html.StyleSheet;
import net.java.sip.communicator.impl.gui.main.CommunicatorMain;
import net.java.sip.communicator.service.protocol.PresenceStatus;
import net.java.sip.communicator.service.protocol.icqconstants.IcqStatusEnum;
import net.java.sip.communicator.util.Logger;
/**
* All look and feel related constants are stored here.
@ -34,6 +36,7 @@
public class Constants {
private static Logger logger = Logger.getLogger(CommunicatorMain.class.getName());
/*
* ===================================================================
* ------------------------ SIZE CONSTANTS ---------------------------
@ -350,8 +353,7 @@ public static void loadStyle(StyleSheet style){
style.loadRules(r, null);
r.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
logger.error("Failed to load css style.", e);
}
}

Loading…
Cancel
Save