mirror of
https://github.com/igniterealtime/Spark.git
synced 2025-12-01 12:27:58 +00:00
1) Update fastpath.
2) Alphabetize Contact Groups. git-svn-id: http://svn.igniterealtime.org/svn/repos/spark/trunk@7335 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Binary file not shown.
@ -45,6 +45,8 @@ import javax.swing.JTextPane;
|
|||||||
import javax.swing.JToolBar;
|
import javax.swing.JToolBar;
|
||||||
|
|
||||||
import java.awt.BorderLayout;
|
import java.awt.BorderLayout;
|
||||||
|
import java.awt.Color;
|
||||||
|
import java.awt.Font;
|
||||||
import java.awt.event.ActionEvent;
|
import java.awt.event.ActionEvent;
|
||||||
import java.awt.event.ActionListener;
|
import java.awt.event.ActionListener;
|
||||||
import java.awt.event.WindowAdapter;
|
import java.awt.event.WindowAdapter;
|
||||||
@ -576,6 +578,8 @@ public final class MainWindow extends ChatFrame implements ActionListener {
|
|||||||
frame.setIconImage(SparkRes.getImageIcon(SparkRes.MAIN_IMAGE).getImage());
|
frame.setIconImage(SparkRes.getImageIcon(SparkRes.MAIN_IMAGE).getImage());
|
||||||
|
|
||||||
final JTextPane pane = new JTextPane();
|
final JTextPane pane = new JTextPane();
|
||||||
|
pane.setBackground(Color.white);
|
||||||
|
pane.setFont(new Font("Dialog", Font.PLAIN, 12));
|
||||||
pane.setEditable(false);
|
pane.setEditable(false);
|
||||||
pane.setText(errorLogs);
|
pane.setText(errorLogs);
|
||||||
|
|
||||||
|
|||||||
@ -95,7 +95,7 @@ import java.util.TimerTask;
|
|||||||
|
|
||||||
public final class ContactList extends JPanel implements ActionListener, ContactGroupListener, Plugin, RosterListener, ConnectionListener {
|
public final class ContactList extends JPanel implements ActionListener, ContactGroupListener, Plugin, RosterListener, ConnectionListener {
|
||||||
private JPanel mainPanel = new JPanel();
|
private JPanel mainPanel = new JPanel();
|
||||||
private JScrollPane treeScroller;
|
private JScrollPane contactListScrollPane;
|
||||||
private final List<ContactGroup> groupList = new ArrayList<ContactGroup>();
|
private final List<ContactGroup> groupList = new ArrayList<ContactGroup>();
|
||||||
private final RolloverButton addingGroupButton;
|
private final RolloverButton addingGroupButton;
|
||||||
|
|
||||||
@ -169,10 +169,12 @@ public final class ContactList extends JPanel implements ActionListener, Contact
|
|||||||
|
|
||||||
mainPanel.setLayout(new VerticalFlowLayout(VerticalFlowLayout.TOP, 0, 0, true, false));
|
mainPanel.setLayout(new VerticalFlowLayout(VerticalFlowLayout.TOP, 0, 0, true, false));
|
||||||
mainPanel.setBackground((Color)UIManager.get("List.background"));
|
mainPanel.setBackground((Color)UIManager.get("List.background"));
|
||||||
treeScroller = new JScrollPane(mainPanel);
|
contactListScrollPane = new JScrollPane(mainPanel);
|
||||||
treeScroller.setBorder(BorderFactory.createEmptyBorder());
|
contactListScrollPane.setAutoscrolls(true);
|
||||||
treeScroller.getVerticalScrollBar().setBlockIncrement(50);
|
|
||||||
treeScroller.getVerticalScrollBar().setUnitIncrement(20);
|
contactListScrollPane.setBorder(BorderFactory.createEmptyBorder());
|
||||||
|
contactListScrollPane.getVerticalScrollBar().setBlockIncrement(50);
|
||||||
|
contactListScrollPane.getVerticalScrollBar().setUnitIncrement(20);
|
||||||
|
|
||||||
retryPanel = new RetryPanel();
|
retryPanel = new RetryPanel();
|
||||||
|
|
||||||
@ -181,7 +183,7 @@ public final class ContactList extends JPanel implements ActionListener, Contact
|
|||||||
workspace.getCardPanel().add(RETRY_PANEL, retryPanel);
|
workspace.getCardPanel().add(RETRY_PANEL, retryPanel);
|
||||||
|
|
||||||
|
|
||||||
add(treeScroller, BorderLayout.CENTER);
|
add(contactListScrollPane, BorderLayout.CENTER);
|
||||||
|
|
||||||
// Load Properties file
|
// Load Properties file
|
||||||
props = new Properties();
|
props = new Properties();
|
||||||
@ -900,12 +902,7 @@ public final class ContactList extends JPanel implements ActionListener, Contact
|
|||||||
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (rootGroup == offlineGroup) {
|
mainPanel.add(rootGroup, loc);
|
||||||
mainPanel.add(rootGroup, tempList.size() - 1);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
mainPanel.add(rootGroup, loc);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
Log.error(e);
|
Log.error(e);
|
||||||
@ -925,7 +922,7 @@ public final class ContactList extends JPanel implements ActionListener, Contact
|
|||||||
parent.removeContactGroup(contactGroup);
|
parent.removeContactGroup(contactGroup);
|
||||||
}
|
}
|
||||||
|
|
||||||
treeScroller.validate();
|
contactListScrollPane.validate();
|
||||||
mainPanel.invalidate();
|
mainPanel.invalidate();
|
||||||
mainPanel.repaint();
|
mainPanel.repaint();
|
||||||
|
|
||||||
@ -1648,17 +1645,16 @@ public final class ContactList extends JPanel implements ActionListener, Contact
|
|||||||
* Sorts ContactGroups
|
* Sorts ContactGroups
|
||||||
*/
|
*/
|
||||||
final Comparator groupComparator = new Comparator() {
|
final Comparator groupComparator = new Comparator() {
|
||||||
public int compare(Object contactGroupOne, Object contactGroup2) {
|
public int compare(Object contactGroupOne, Object contactGroupTwo) {
|
||||||
final ContactGroup group1 = (ContactGroup)contactGroupOne;
|
final ContactGroup group1 = (ContactGroup)contactGroupOne;
|
||||||
final ContactGroup group2 = (ContactGroup)contactGroup2;
|
final ContactGroup group2 = (ContactGroup)contactGroupTwo;
|
||||||
|
|
||||||
// Make sure that offline group is always on bottom.
|
// Make sure that offline group is always on bottom.
|
||||||
if (group2 == offlineGroup) {
|
if (group2 == offlineGroup) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return group1.getGroupName().toLowerCase().compareTo(group2.getGroupName().toLowerCase());
|
return group1.getGroupName().trim().toLowerCase().compareTo(group2.getGroupName().trim().toLowerCase());
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user