IDEA-157763 Settings repository for IDE: new UI

This commit is contained in:
Alexander Lobas
2016-12-01 11:18:22 +03:00
parent 3a4264a912
commit 44e92eaa24
2 changed files with 37 additions and 52 deletions
@@ -1494,6 +1494,16 @@ public class Messages {
}
protected JComponent doCreateCenterPanel() {
JPanel panel = createIconPanel();
if (myMessage != null) {
JTextPane messageComponent = createMessageComponent(myMessage);
panel.add(wrapToScrollPaneIfNeeded(messageComponent, 100, 10), BorderLayout.CENTER);
}
return panel;
}
@NotNull
protected JPanel createIconPanel() {
JPanel panel = new JPanel(new BorderLayout(15, 0));
if (myIcon != null) {
JLabel iconLabel = new JLabel(myIcon);
@@ -1502,13 +1512,21 @@ public class Messages {
container.add(iconLabel, BorderLayout.NORTH);
panel.add(container, BorderLayout.WEST);
}
if (myMessage != null) {
JTextPane messageComponent = createMessageComponent(myMessage);
panel.add(wrapToScrollPaneIfNeeded(messageComponent, 100, 10), BorderLayout.CENTER);
}
return panel;
}
@NotNull
protected JPanel createMessagePanel() {
JPanel messagePanel = new JPanel(new BorderLayout());
if (myMessage != null) {
JLabel textLabel = new JLabel(myMessage);
textLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 0));
textLabel.setUI(new MultiLineLabelUI());
messagePanel.add(textLabel, BorderLayout.NORTH);
}
return messagePanel;
}
protected static JTextPane createMessageComponent(final String message) {
final JTextPane messageComponent = new JTextPane();
return configureMessagePaneUi(messageComponent, message);
@@ -1629,34 +1647,22 @@ public class Messages {
@Override
protected JComponent createNorthPanel() {
JPanel panel = new JPanel(new BorderLayout(15, 0));
if (myIcon != null) {
JLabel iconLabel = new JLabel(myIcon);
Container container = new Container();
container.setLayout(new BorderLayout());
container.add(iconLabel, BorderLayout.NORTH);
panel.add(container, BorderLayout.WEST);
}
JPanel panel = createIconPanel();
JPanel messagePanel = createMessagePanel();
JPanel messagePanel = new JPanel(new BorderLayout());
if (myMessage != null) {
JLabel textLabel = new JLabel(myMessage);
textLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 0));
textLabel.setUI(new MultiLineLabelUI());
messagePanel.add(textLabel, BorderLayout.NORTH);
}
final JPanel checkboxPanel = new JPanel();
checkboxPanel.setLayout(new BoxLayout(checkboxPanel, BoxLayout.X_AXIS));
myCheckBox = new JCheckBox(myCheckboxText);
myCheckBox.setSelected(myChecked);
messagePanel.add(myCheckBox, BorderLayout.SOUTH);
messagePanel.add(createCheckComponent(), BorderLayout.SOUTH);
panel.add(messagePanel, BorderLayout.CENTER);
return panel;
}
@NotNull
protected JComponent createCheckComponent() {
myCheckBox = new JCheckBox(myCheckboxText);
myCheckBox.setSelected(myChecked);
return myCheckBox;
}
@Override
public int getExitCode() {
final int exitCode = super.getExitCode();
@@ -1786,14 +1792,7 @@ public class Messages {
@Override
protected JComponent createNorthPanel() {
JPanel panel = new JPanel(new BorderLayout(15, 0));
if (myIcon != null) {
JLabel iconLabel = new JLabel(myIcon);
Container container = new Container();
container.setLayout(new BorderLayout());
container.add(iconLabel, BorderLayout.NORTH);
panel.add(container, BorderLayout.WEST);
}
JPanel panel = createIconPanel();
JPanel messagePanel = createMessagePanel();
panel.add(messagePanel, BorderLayout.CENTER);
@@ -2014,22 +2013,8 @@ public class Messages {
@Override
protected JComponent createNorthPanel() {
JPanel panel = new JPanel(new BorderLayout(15, 0));
if (myIcon != null) {
JLabel iconLabel = new JLabel(myIcon);
Container container = new Container();
container.setLayout(new BorderLayout());
container.add(iconLabel, BorderLayout.NORTH);
panel.add(container, BorderLayout.WEST);
}
JPanel messagePanel = new JPanel(new BorderLayout());
if (myMessage != null) {
JLabel textLabel = new JLabel(myMessage);
textLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 0));
textLabel.setUI(new MultiLineLabelUI());
messagePanel.add(textLabel, BorderLayout.NORTH);
}
JPanel panel = createIconPanel();
JPanel messagePanel = createMessagePanel();
myComboBox = new ComboBox(220);
messagePanel.add(myComboBox, BorderLayout.SOUTH);
@@ -48,7 +48,7 @@ import java.util.Set;
public class PluginsTableRenderer extends DefaultTableCellRenderer {
private static final InstalledPluginsState ourState = InstalledPluginsState.getInstance();
private SimpleColoredComponent myName;
protected SimpleColoredComponent myName;
private JLabel myStatus;
private RatesPanel myRating;
private JLabel myDownloads;
@@ -60,7 +60,7 @@ public class PluginsTableRenderer extends DefaultTableCellRenderer {
private JPanel myBottomPanel;
private JPanel myInfoPanel;
private final IdeaPluginDescriptor myPluginDescriptor;
protected final IdeaPluginDescriptor myPluginDescriptor;
private final boolean myPluginsView;
// showFullInfo: true for Plugin Repository view, false for Installed Plugins view