|
|
|
@ -6,6 +6,7 @@ package com.fr.design.mainframe.bbs;
|
|
|
|
|
import com.fr.design.DesignerEnvManager; |
|
|
|
|
import com.fr.design.bbs.BBSLoginUtils; |
|
|
|
|
import com.fr.design.constants.UIConstants; |
|
|
|
|
import com.fr.design.dialog.FineJOptionPane; |
|
|
|
|
import com.fr.design.extra.LoginContextListener; |
|
|
|
|
import com.fr.design.extra.UserLoginContext; |
|
|
|
|
import com.fr.design.gui.ilable.UILabel; |
|
|
|
@ -14,6 +15,7 @@ import com.fr.design.gui.imenu.UIPopupMenu;
|
|
|
|
|
import com.fr.design.locale.impl.BbsSpaceMark; |
|
|
|
|
import com.fr.design.login.DesignerLoginHelper; |
|
|
|
|
import com.fr.design.login.DesignerLoginSource; |
|
|
|
|
import com.fr.design.login.service.DesignerPassportManager; |
|
|
|
|
import com.fr.design.login.utils.DesignerLoginUtils; |
|
|
|
|
import com.fr.design.mainframe.DesignerContext; |
|
|
|
|
import com.fr.design.os.impl.SupportOSImpl; |
|
|
|
@ -29,6 +31,7 @@ import com.fr.general.locale.LocaleMark;
|
|
|
|
|
import com.fr.log.FineLoggerFactory; |
|
|
|
|
import com.fr.stable.EncodeConstants; |
|
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
|
import javax.swing.JOptionPane; |
|
|
|
|
import javax.swing.SwingConstants; |
|
|
|
|
import java.awt.Cursor; |
|
|
|
|
import java.awt.Frame; |
|
|
|
@ -120,8 +123,33 @@ public class UserInfoLabel extends UILabel {
|
|
|
|
|
UserLoginContext.fireLoginContextListener(DesignerLoginSource.SWITCH_ACCOUNT); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
//退出登录
|
|
|
|
|
UIMenuItem logout = new UIMenuItem(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_BBSLogin_Logout")); |
|
|
|
|
logout.addMouseListener(new MouseAdapter() { |
|
|
|
|
@Override |
|
|
|
|
public void mousePressed(MouseEvent e) { |
|
|
|
|
String[] options = new String[]{ |
|
|
|
|
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_BBSLogin_Logout"), |
|
|
|
|
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Button_Cancel") |
|
|
|
|
}; |
|
|
|
|
int rv = FineJOptionPane.showConfirmDialog( |
|
|
|
|
DesignerLoginHelper.getDialog(), |
|
|
|
|
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_BBSLogin_Logout_Tip"), |
|
|
|
|
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tool_Tips"), |
|
|
|
|
JOptionPane.OK_CANCEL_OPTION, |
|
|
|
|
JOptionPane.WARNING_MESSAGE, |
|
|
|
|
null, |
|
|
|
|
options, |
|
|
|
|
options[1] |
|
|
|
|
); |
|
|
|
|
if (rv == JOptionPane.YES_OPTION) { |
|
|
|
|
DesignerPassportManager.getInstance().logout(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
menu.add(priviteMessage); |
|
|
|
|
menu.add(closeOther); |
|
|
|
|
menu.add(logout); |
|
|
|
|
GUICoreUtils.showPopupMenu(menu, UserInfoLabel.this, 0, MENU_HEIGHT); |
|
|
|
|
} else { |
|
|
|
|
UserLoginContext.fireLoginContextListener(DesignerLoginSource.NORMAL); |
|
|
|
|