Skip to content

Commit 8fd0d93

Browse files
committed
rename LoginPanel to DefaultLoginPanel
Signed-off-by: Tony Germano <tony@germano.name>
1 parent 7723b34 commit 8fd0d93

3 files changed

Lines changed: 20 additions & 20 deletions

File tree

client/src/com/mirth/connect/client/ui/LoginPanel.java renamed to client/src/com/mirth/connect/client/ui/DefaultLoginPanel.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@
3737
import com.mirth.connect.plugins.MultiFactorAuthenticationClientPlugin;
3838
import com.mirth.connect.util.MirthSSLUtil;
3939

40-
public class LoginPanel extends javax.swing.JFrame {
40+
public class DefaultLoginPanel extends javax.swing.JFrame {
4141

4242
private Client client;
4343
private static final String ERROR_MESSAGE = "There was an error connecting to the server at the specified address. Please verify that the server is up and running.";
44-
private static LoginPanel instance = null;
44+
private static DefaultLoginPanel instance = null;
4545

46-
private LoginPanel() {
46+
private DefaultLoginPanel() {
4747
initComponents();
4848
DisplayUtil.setResizable(this, false);
4949
jLabel2.setForeground(UIConstants.HEADER_TITLE_TEXT_COLOR);
@@ -81,10 +81,10 @@ public void mouseClicked(java.awt.event.MouseEvent evt) {
8181
errorTextArea.setDisabledTextColor(Color.RED);
8282
}
8383

84-
public static LoginPanel getInstance() {
85-
synchronized (LoginPanel.class) {
84+
public static DefaultLoginPanel getInstance() {
85+
synchronized (DefaultLoginPanel.class) {
8686
if (instance == null) {
87-
instance = new LoginPanel();
87+
instance = new DefaultLoginPanel();
8888
}
8989
return instance;
9090
}
@@ -448,8 +448,8 @@ public Void doInBackground() {
448448
// If SUCCESS or SUCCESS_GRACE_PERIOD
449449
if (loginStatus != null && loginStatus.isSuccess()) {
450450
if (!handleSuccess(loginStatus)) {
451-
LoginPanel.getInstance().setVisible(false);
452-
LoginPanel.getInstance().initialize(PlatformUI.SERVER_URL, PlatformUI.CLIENT_VERSION, "", "");
451+
DefaultLoginPanel.getInstance().setVisible(false);
452+
DefaultLoginPanel.getInstance().initialize(PlatformUI.SERVER_URL, PlatformUI.CLIENT_VERSION, "", "");
453453
}
454454
} else {
455455
// Assume failure unless overridden by a plugin
@@ -462,13 +462,13 @@ public Void doInBackground() {
462462
String updatedUsername = StringUtils.defaultString(loginStatus.getUpdatedUsername(), username.getText());
463463
MultiFactorAuthenticationClientPlugin plugin = (MultiFactorAuthenticationClientPlugin) Class.forName(extendedLoginStatus.getClientPluginClass()).newInstance();
464464

465-
loginStatus = plugin.authenticate(LoginPanel.this, client, updatedUsername, loginStatus);
465+
loginStatus = plugin.authenticate(DefaultLoginPanel.this, client, updatedUsername, loginStatus);
466466

467467
if (loginStatus != null && loginStatus.isSuccess()) {
468468
errorOccurred = false;
469469
if (!handleSuccess(loginStatus)) {
470-
LoginPanel.getInstance().setVisible(false);
471-
LoginPanel.getInstance().initialize(PlatformUI.SERVER_URL, PlatformUI.CLIENT_VERSION, "", "");
470+
DefaultLoginPanel.getInstance().setVisible(false);
471+
DefaultLoginPanel.getInstance().initialize(PlatformUI.SERVER_URL, PlatformUI.CLIENT_VERSION, "", "");
472472
}
473473
}
474474
}
@@ -504,7 +504,7 @@ private boolean handleSuccess(LoginStatus loginStatus) throws ClientException {
504504
PublicServerSettings publicServerSettings = client.getPublicServerSettings();
505505

506506
if (publicServerSettings.getLoginNotificationEnabled() == true) {
507-
CustomBannerPanelDialog customBannerPanelDialog = new CustomBannerPanelDialog(LoginPanel.getInstance(), "Login Notification", publicServerSettings.getLoginNotificationMessage());
507+
CustomBannerPanelDialog customBannerPanelDialog = new CustomBannerPanelDialog(DefaultLoginPanel.getInstance(), "Login Notification", publicServerSettings.getLoginNotificationMessage());
508508
boolean isAccepted = customBannerPanelDialog.isAccepted();
509509

510510
if (isAccepted == true) {
@@ -559,7 +559,7 @@ private boolean handleSuccess(LoginStatus loginStatus) throws ClientException {
559559
PlatformUI.USER_NAME = StringUtils.defaultString(loginStatus.getUpdatedUsername(), username.getText());
560560
setStatus("Authenticated...");
561561
new Mirth(client);
562-
LoginPanel.getInstance().setVisible(false);
562+
DefaultLoginPanel.getInstance().setVisible(false);
563563

564564
User currentUser = PlatformUI.MIRTH_FRAME.getCurrentUser(PlatformUI.MIRTH_FRAME);
565565
Properties userPreferences = new Properties();

client/src/com/mirth/connect/client/ui/Frame.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ public void eventDispatched(AWTEvent e)
543543
*/
544544
public void setupFrame(Client mirthClient) throws ClientException {
545545

546-
LoginPanel login = LoginPanel.getInstance();
546+
DefaultLoginPanel login = DefaultLoginPanel.getInstance();
547547

548548
// Initialize the send message dialog
549549
editMessageDialog = new EditMessageDialog();
@@ -1524,7 +1524,7 @@ public void alertThrowable(Component parentComponent, Throwable t, String custom
15241524
}
15251525
mirthClient.close();
15261526
this.dispose();
1527-
LoginPanel.getInstance().initialize(PlatformUI.SERVER_URL, PlatformUI.CLIENT_VERSION, "", "");
1527+
DefaultLoginPanel.getInstance().initialize(PlatformUI.SERVER_URL, PlatformUI.CLIENT_VERSION, "", "");
15281528
return;
15291529
} else if (t.getCause() != null && t.getCause() instanceof HttpHostConnectException && (StringUtils.contains(t.getCause().getMessage(), "Connection refused") || StringUtils.contains(t.getCause().getMessage(), "Host is down"))) {
15301530
connectionError = true;
@@ -1542,7 +1542,7 @@ public void alertThrowable(Component parentComponent, Throwable t, String custom
15421542
}
15431543
mirthClient.close();
15441544
this.dispose();
1545-
LoginPanel.getInstance().initialize(PlatformUI.SERVER_URL, PlatformUI.CLIENT_VERSION, "", "");
1545+
DefaultLoginPanel.getInstance().initialize(PlatformUI.SERVER_URL, PlatformUI.CLIENT_VERSION, "", "");
15461546
return;
15471547
}
15481548
}
@@ -2292,7 +2292,7 @@ public boolean logout(boolean quit, boolean confirmFirst) {
22922292
this.dispose();
22932293

22942294
if (!quit) {
2295-
LoginPanel.getInstance().initialize(PlatformUI.SERVER_URL, PlatformUI.CLIENT_VERSION, "", "");
2295+
DefaultLoginPanel.getInstance().initialize(PlatformUI.SERVER_URL, PlatformUI.CLIENT_VERSION, "", "");
22962296
}
22972297

22982298
return true;

client/src/com/mirth/connect/client/ui/Mirth.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public Mirth(Client mirthClient) throws ClientException {
5656
UIManager.put("Tree.closedIcon", UIConstants.CLOSED_ICON);
5757

5858
userPreferences = Preferences.userNodeForPackage(Mirth.class);
59-
LoginPanel.getInstance().setStatus("Loading components...");
59+
DefaultLoginPanel.getInstance().setStatus("Loading components...");
6060
PlatformUI.MIRTH_FRAME.setupFrame(mirthClient);
6161

6262
boolean maximized;
@@ -116,7 +116,7 @@ public static void aboutMac() {
116116
* @return quit
117117
*/
118118
public static boolean quitMac() {
119-
return (LoginPanel.getInstance().isVisible() || (PlatformUI.MIRTH_FRAME != null && PlatformUI.MIRTH_FRAME.logout(true)));
119+
return (DefaultLoginPanel.getInstance().isVisible() || (PlatformUI.MIRTH_FRAME != null && PlatformUI.MIRTH_FRAME.logout(true)));
120120
}
121121

122122
/**
@@ -278,7 +278,7 @@ private static void start(final String server, final String version, final Strin
278278
public void run() {
279279
initUIManager();
280280
PlatformUI.BACKGROUND_IMAGE = new ImageIcon(com.mirth.connect.client.ui.Frame.class.getResource("images/header_nologo.png"));
281-
LoginPanel.getInstance().initialize(server, version, username, password);
281+
DefaultLoginPanel.getInstance().initialize(server, version, username, password);
282282
}
283283
});
284284
}

0 commit comments

Comments
 (0)