reduce using static initializers

This commit is contained in:
Konstantin Bulenkov
2016-04-15 22:36:03 +02:00
parent fd9fe77190
commit a40616faae
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2015 JetBrains s.r.o.
* Copyright 2000-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -80,7 +80,6 @@ import java.util.List;
*/
public class FlatWelcomeFrame extends JFrame implements IdeFrame, AccessibleContextAccessor {
private static final String ACTION_GROUP_KEY = "ACTION_GROUP_KEY";
private static final String WELCOME_TITLE = "Welcome to " + ApplicationNamesInfo.getInstance().getFullProductName();
private final BalloonLayout myBalloonLayout;
private final FlatWelcomeScreen myScreen;
@@ -105,7 +104,7 @@ public class FlatWelcomeFrame extends JFrame implements IdeFrame, AccessibleCont
glassPane.setVisible(false);
//setUndecorated(true);
setContentPane(myScreen.getWelcomePanel());
setTitle(WELCOME_TITLE);
setTitle(getWelcomeFrameTitle());
AppUIUtil.updateWindowIcon(this);
final int width = RecentProjectsManager.getInstance().getRecentProjectsActions(false).length == 0 ? 666 : 777;
setSize(JBUI.size(width, 460));
@@ -187,6 +186,10 @@ public class FlatWelcomeFrame extends JFrame implements IdeFrame, AccessibleCont
return accessibleContext;
}
protected String getWelcomeFrameTitle() {
return "Welcome to " + ApplicationNamesInfo.getInstance().getFullProductName();
}
private class FlatWelcomeScreen extends JPanel implements WelcomeScreen {
private JBSlidingPanel mySlidingPanel = new JBSlidingPanel();
public ParameterizedRunnable<List<NotificationType>> myEventListener;
@@ -450,7 +453,7 @@ public class FlatWelcomeFrame extends JFrame implements IdeFrame, AccessibleCont
@Override
public void run() {
mySlidingPanel.getRootPane().setDefaultButton(null);
setTitle(WELCOME_TITLE);
setTitle(getWelcomeFrameTitle());
}
});
}