mirror of
https://github.com/igniterealtime/Spark.git
synced 2025-12-01 12:27:58 +00:00
SPARK-1096 - Custom status messages should be sorted by name
add generics git-svn-id: http://svn.igniterealtime.org/svn/repos/spark/trunk@11433 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
committed by
michael.will
parent
837a9d1199
commit
df6b93ecd0
@ -10,20 +10,6 @@
|
|||||||
|
|
||||||
package org.jivesoftware.spark.ui;
|
package org.jivesoftware.spark.ui;
|
||||||
|
|
||||||
import org.jivesoftware.resource.Res;
|
|
||||||
import org.jivesoftware.resource.SparkRes;
|
|
||||||
import org.jivesoftware.smack.ConnectionListener;
|
|
||||||
import org.jivesoftware.smack.ReconnectionManager;
|
|
||||||
import org.jivesoftware.spark.SparkManager;
|
|
||||||
import org.jivesoftware.spark.component.RolloverButton;
|
|
||||||
import org.jivesoftware.spark.util.ModelUtil;
|
|
||||||
import org.jivesoftware.spark.util.SwingTimerTask;
|
|
||||||
import org.jivesoftware.spark.util.TaskEngine;
|
|
||||||
|
|
||||||
import javax.swing.JEditorPane;
|
|
||||||
import javax.swing.JPanel;
|
|
||||||
import javax.swing.text.html.HTMLEditorKit;
|
|
||||||
|
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
import java.awt.GridBagConstraints;
|
import java.awt.GridBagConstraints;
|
||||||
import java.awt.GridBagLayout;
|
import java.awt.GridBagLayout;
|
||||||
@ -32,6 +18,19 @@ import java.awt.event.ActionEvent;
|
|||||||
import java.awt.event.ActionListener;
|
import java.awt.event.ActionListener;
|
||||||
import java.util.TimerTask;
|
import java.util.TimerTask;
|
||||||
|
|
||||||
|
import javax.swing.JEditorPane;
|
||||||
|
import javax.swing.JPanel;
|
||||||
|
import javax.swing.text.html.HTMLEditorKit;
|
||||||
|
|
||||||
|
import org.jivesoftware.resource.Res;
|
||||||
|
import org.jivesoftware.resource.SparkRes;
|
||||||
|
import org.jivesoftware.smack.ConnectionListener;
|
||||||
|
import org.jivesoftware.spark.SparkManager;
|
||||||
|
import org.jivesoftware.spark.component.RolloverButton;
|
||||||
|
import org.jivesoftware.spark.util.ModelUtil;
|
||||||
|
import org.jivesoftware.spark.util.SwingTimerTask;
|
||||||
|
import org.jivesoftware.spark.util.TaskEngine;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* RetryPanel is the UI/Function class to handle reconnection logic. This allows for a simple card layout to replace the current
|
* RetryPanel is the UI/Function class to handle reconnection logic. This allows for a simple card layout to replace the current
|
||||||
* roster when the connection has been lost.
|
* roster when the connection has been lost.
|
||||||
@ -39,7 +38,8 @@ import java.util.TimerTask;
|
|||||||
* @author Derek DeMoro
|
* @author Derek DeMoro
|
||||||
*/
|
*/
|
||||||
public class RetryPanel extends JPanel implements ConnectionListener {
|
public class RetryPanel extends JPanel implements ConnectionListener {
|
||||||
private JEditorPane pane;
|
private static final long serialVersionUID = -7099075581561760774L;
|
||||||
|
private JEditorPane pane;
|
||||||
private RolloverButton retryButton;
|
private RolloverButton retryButton;
|
||||||
private boolean closedOnError;
|
private boolean closedOnError;
|
||||||
|
|
||||||
|
|||||||
@ -274,7 +274,9 @@ public class RosterDialog implements PropertyChangeListener, ActionListener {
|
|||||||
|
|
||||||
|
|
||||||
JPanel mainPanel = new JPanel() {
|
JPanel mainPanel = new JPanel() {
|
||||||
public Dimension getPreferredSize() {
|
private static final long serialVersionUID = -7489967438182277375L;
|
||||||
|
|
||||||
|
public Dimension getPreferredSize() {
|
||||||
final Dimension size = super.getPreferredSize();
|
final Dimension size = super.getPreferredSize();
|
||||||
size.width = 350;
|
size.width = 350;
|
||||||
return size;
|
return size;
|
||||||
@ -521,8 +523,8 @@ public class RosterDialog implements PropertyChangeListener, ActionListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class AccountItem extends JPanel {
|
class AccountItem extends JPanel {
|
||||||
|
private static final long serialVersionUID = -7657731912529801653L;
|
||||||
private Transport transport;
|
private Transport transport;
|
||||||
|
|
||||||
public AccountItem(Icon icon, String name, Transport transport) {
|
public AccountItem(Icon icon, String name, Transport transport) {
|
||||||
setLayout(new GridBagLayout());
|
setLayout(new GridBagLayout());
|
||||||
|
|||||||
@ -20,7 +20,8 @@ import javax.swing.tree.DefaultMutableTreeNode;
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class RosterNode extends DefaultMutableTreeNode {
|
public class RosterNode extends DefaultMutableTreeNode {
|
||||||
private String name;
|
private static final long serialVersionUID = -3043224462615651820L;
|
||||||
|
private String name;
|
||||||
private boolean isGroup;
|
private boolean isGroup;
|
||||||
|
|
||||||
private Icon openIcon;
|
private Icon openIcon;
|
||||||
|
|||||||
@ -33,7 +33,8 @@ import java.util.List;
|
|||||||
* The <code>RosterPickList</code> is used as a pick list of users within ones Roster.
|
* The <code>RosterPickList</code> is used as a pick list of users within ones Roster.
|
||||||
*/
|
*/
|
||||||
public class RosterPickList extends JPanel {
|
public class RosterPickList extends JPanel {
|
||||||
private DefaultListModel model = new DefaultListModel();
|
private static final long serialVersionUID = -7725304880236329893L;
|
||||||
|
private DefaultListModel model = new DefaultListModel();
|
||||||
private JList rosterList = new JList(model);
|
private JList rosterList = new JList(model);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -57,7 +58,7 @@ public class RosterPickList extends JPanel {
|
|||||||
* @param parent the parent container.
|
* @param parent the parent container.
|
||||||
* @return all items choosen in the pick list.
|
* @return all items choosen in the pick list.
|
||||||
*/
|
*/
|
||||||
public Collection showRoster(JDialog parent) {
|
public Collection<String> showRoster(JDialog parent) {
|
||||||
final List<ContactItem> userList = new ArrayList<ContactItem>();
|
final List<ContactItem> userList = new ArrayList<ContactItem>();
|
||||||
|
|
||||||
// Populate Invite Panel with Available users.
|
// Populate Invite Panel with Available users.
|
||||||
|
|||||||
@ -25,7 +25,8 @@ import java.awt.Font;
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class RosterTreeCellRenderer extends DefaultTreeCellRenderer {
|
public class RosterTreeCellRenderer extends DefaultTreeCellRenderer {
|
||||||
private Object value;
|
private static final long serialVersionUID = 4645070076041138834L;
|
||||||
|
private Object value;
|
||||||
private boolean isExpanded;
|
private boolean isExpanded;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -29,11 +29,11 @@ public class SparklerDecorator {
|
|||||||
popups.put(matchedText, gui);
|
popups.put(matchedText, gui);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map getURLS() {
|
public Map<String, String> getURLS() {
|
||||||
return urls;
|
return urls;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map getPopups() {
|
public Map<String, JComponent> getPopups() {
|
||||||
return popups;
|
return popups;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -23,8 +23,9 @@ import java.io.IOException;
|
|||||||
* Used for String Drag and Drop functionality.
|
* Used for String Drag and Drop functionality.
|
||||||
*/
|
*/
|
||||||
public abstract class StringTransferHandler extends TransferHandler {
|
public abstract class StringTransferHandler extends TransferHandler {
|
||||||
|
private static final long serialVersionUID = 4783002180033288533L;
|
||||||
|
|
||||||
protected abstract String exportString(JComponent c);
|
protected abstract String exportString(JComponent c);
|
||||||
|
|
||||||
protected abstract void importString(JComponent c, String str);
|
protected abstract void importString(JComponent c, String str);
|
||||||
|
|
||||||
|
|||||||
@ -24,8 +24,8 @@ import java.awt.GridBagLayout;
|
|||||||
import java.awt.Insets;
|
import java.awt.Insets;
|
||||||
|
|
||||||
public class TranscriptAlert extends JPanel {
|
public class TranscriptAlert extends JPanel {
|
||||||
|
private static final long serialVersionUID = -4882289773265904417L;
|
||||||
private JLabel imageLabel = new JLabel();
|
private JLabel imageLabel = new JLabel();
|
||||||
private JLabel titleLabel = new JLabel();
|
private JLabel titleLabel = new JLabel();
|
||||||
private RolloverButton yesButton = new RolloverButton();
|
private RolloverButton yesButton = new RolloverButton();
|
||||||
private RolloverButton cancelButton = new RolloverButton();
|
private RolloverButton cancelButton = new RolloverButton();
|
||||||
|
|||||||
@ -10,17 +10,24 @@
|
|||||||
|
|
||||||
package org.jivesoftware.spark.ui.status;
|
package org.jivesoftware.spark.ui.status;
|
||||||
|
|
||||||
import com.thoughtworks.xstream.XStream;
|
import java.awt.BorderLayout;
|
||||||
import org.jivesoftware.resource.Res;
|
import java.awt.GridBagConstraints;
|
||||||
import org.jivesoftware.smack.packet.Presence;
|
import java.awt.GridBagLayout;
|
||||||
import org.jivesoftware.spark.SparkManager;
|
import java.awt.Insets;
|
||||||
import org.jivesoftware.spark.component.JiveTreeCellRenderer;
|
import java.awt.event.ActionEvent;
|
||||||
import org.jivesoftware.spark.component.JiveTreeNode;
|
import java.awt.event.MouseAdapter;
|
||||||
import org.jivesoftware.spark.component.Tree;
|
import java.awt.event.MouseEvent;
|
||||||
import org.jivesoftware.spark.component.renderer.ListIconRenderer;
|
import java.beans.PropertyChangeEvent;
|
||||||
import org.jivesoftware.spark.util.ModelUtil;
|
import java.beans.PropertyChangeListener;
|
||||||
import org.jivesoftware.spark.util.ResourceUtils;
|
import java.io.File;
|
||||||
import org.jivesoftware.spark.util.log.Log;
|
import java.io.FileReader;
|
||||||
|
import java.io.FileWriter;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.Comparator;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import javax.swing.AbstractAction;
|
import javax.swing.AbstractAction;
|
||||||
import javax.swing.Action;
|
import javax.swing.Action;
|
||||||
@ -37,22 +44,18 @@ import javax.swing.JTextField;
|
|||||||
import javax.swing.tree.DefaultTreeModel;
|
import javax.swing.tree.DefaultTreeModel;
|
||||||
import javax.swing.tree.TreePath;
|
import javax.swing.tree.TreePath;
|
||||||
|
|
||||||
import java.awt.BorderLayout;
|
import org.jivesoftware.resource.Res;
|
||||||
import java.awt.GridBagConstraints;
|
import org.jivesoftware.smack.packet.Presence;
|
||||||
import java.awt.GridBagLayout;
|
import org.jivesoftware.spark.SparkManager;
|
||||||
import java.awt.Insets;
|
import org.jivesoftware.spark.component.JiveTreeCellRenderer;
|
||||||
import java.awt.event.ActionEvent;
|
import org.jivesoftware.spark.component.JiveTreeNode;
|
||||||
import java.awt.event.MouseAdapter;
|
import org.jivesoftware.spark.component.Tree;
|
||||||
import java.awt.event.MouseEvent;
|
import org.jivesoftware.spark.component.renderer.ListIconRenderer;
|
||||||
import java.beans.PropertyChangeEvent;
|
import org.jivesoftware.spark.util.ModelUtil;
|
||||||
import java.beans.PropertyChangeListener;
|
import org.jivesoftware.spark.util.ResourceUtils;
|
||||||
import java.io.File;
|
import org.jivesoftware.spark.util.log.Log;
|
||||||
import java.io.FileReader;
|
|
||||||
import java.io.FileWriter;
|
import com.thoughtworks.xstream.XStream;
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class CustomMessages {
|
public class CustomMessages {
|
||||||
private static File customMessages = new File(SparkManager.getUserDirectory(), "custom_messages.xml");
|
private static File customMessages = new File(SparkManager.getUserDirectory(), "custom_messages.xml");
|
||||||
@ -69,18 +72,18 @@ public class CustomMessages {
|
|||||||
|
|
||||||
|
|
||||||
// Handle Custom Messages
|
// Handle Custom Messages
|
||||||
public static List load() {
|
public static List<CustomStatusItem> load() {
|
||||||
List list = null;
|
List<CustomStatusItem> list = null;
|
||||||
|
|
||||||
if (customMessages.exists()) {
|
if (customMessages.exists()) {
|
||||||
try {
|
try {
|
||||||
list = (List)xstream.fromXML(new FileReader(customMessages));
|
list = (List<CustomStatusItem>)xstream.fromXML(new FileReader(customMessages));
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
xstream.alias("list", List.class);
|
xstream.alias("list", List.class);
|
||||||
xstream.alias("com.jivesoftware.workspaces.CustomStatusItem", CustomStatusItem.class);
|
xstream.alias("com.jivesoftware.workspaces.CustomStatusItem", CustomStatusItem.class);
|
||||||
try {
|
try {
|
||||||
list = (List)xstream.fromXML(new FileReader(customMessages));
|
list = (List<CustomStatusItem>)xstream.fromXML(new FileReader(customMessages));
|
||||||
}
|
}
|
||||||
catch (Exception e1) {
|
catch (Exception e1) {
|
||||||
Log.error(e1);
|
Log.error(e1);
|
||||||
@ -89,12 +92,22 @@ public class CustomMessages {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (list == null) {
|
if (list == null) {
|
||||||
list = new ArrayList();
|
list = new ArrayList<CustomStatusItem>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Sort Custom Messages
|
||||||
|
Collections.sort( list, new Comparator<CustomStatusItem>()
|
||||||
|
{
|
||||||
|
public int compare( final CustomStatusItem a, final CustomStatusItem b )
|
||||||
|
{
|
||||||
|
return( a.getStatus().compareToIgnoreCase( b.getStatus() ) );
|
||||||
|
}
|
||||||
|
} );
|
||||||
|
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void save(List list) {
|
public static void save(List<CustomStatusItem> list) {
|
||||||
xstream.alias("custom-items", List.class);
|
xstream.alias("custom-items", List.class);
|
||||||
xstream.alias("custom-status", CustomStatusItem.class);
|
xstream.alias("custom-status", CustomStatusItem.class);
|
||||||
|
|
||||||
@ -116,14 +129,14 @@ public class CustomMessages {
|
|||||||
final Tree tree = new Tree(rootNode);
|
final Tree tree = new Tree(rootNode);
|
||||||
tree.setCellRenderer(new JiveTreeCellRenderer());
|
tree.setCellRenderer(new JiveTreeCellRenderer());
|
||||||
|
|
||||||
final List customItems = load();
|
final List<CustomStatusItem> customItems = load();
|
||||||
|
|
||||||
final StatusBar statusBar = SparkManager.getWorkspace().getStatusBar();
|
final StatusBar statusBar = SparkManager.getWorkspace().getStatusBar();
|
||||||
Iterator statusItems = statusBar.getStatusList().iterator();
|
Iterator<StatusItem> statusItems = statusBar.getStatusList().iterator();
|
||||||
while (statusItems.hasNext()) {
|
while (statusItems.hasNext()) {
|
||||||
StatusItem item = (StatusItem)statusItems.next();
|
StatusItem item = statusItems.next();
|
||||||
JiveTreeNode node = new JiveTreeNode(item.getText(), false, item.getIcon());
|
JiveTreeNode node = new JiveTreeNode(item.getText(), false, item.getIcon());
|
||||||
Iterator cMessages = customItems.iterator();
|
Iterator<CustomStatusItem> cMessages = customItems.iterator();
|
||||||
|
|
||||||
node.setAllowsChildren(true);
|
node.setAllowsChildren(true);
|
||||||
|
|
||||||
@ -196,7 +209,9 @@ public class CustomMessages {
|
|||||||
else if (selectedNode.getParent() == rootNode) {
|
else if (selectedNode.getParent() == rootNode) {
|
||||||
JPopupMenu popup = new JPopupMenu();
|
JPopupMenu popup = new JPopupMenu();
|
||||||
Action addAction = new AbstractAction() {
|
Action addAction = new AbstractAction() {
|
||||||
public void actionPerformed(ActionEvent actionEvent) {
|
private static final long serialVersionUID = 2187174931315380754L;
|
||||||
|
|
||||||
|
public void actionPerformed(ActionEvent actionEvent) {
|
||||||
CustomStatus status = new CustomStatus();
|
CustomStatus status = new CustomStatus();
|
||||||
String type = (String)selectedNode.getUserObject();
|
String type = (String)selectedNode.getUserObject();
|
||||||
status.invoke(type);
|
status.invoke(type);
|
||||||
@ -218,9 +233,11 @@ public class CustomMessages {
|
|||||||
if (event.isPopupTrigger()) {
|
if (event.isPopupTrigger()) {
|
||||||
JPopupMenu popup = new JPopupMenu();
|
JPopupMenu popup = new JPopupMenu();
|
||||||
Action deleteAction = new AbstractAction() {
|
Action deleteAction = new AbstractAction() {
|
||||||
public void actionPerformed(ActionEvent actionEvent) {
|
private static final long serialVersionUID = -4421868467918912876L;
|
||||||
List list = new ArrayList();
|
|
||||||
Iterator iter = customItems.iterator();
|
public void actionPerformed(ActionEvent actionEvent) {
|
||||||
|
List<CustomStatusItem> list = new ArrayList<CustomStatusItem>();
|
||||||
|
Iterator<CustomStatusItem> iter = customItems.iterator();
|
||||||
while (iter.hasNext()) {
|
while (iter.hasNext()) {
|
||||||
CustomStatusItem item = (CustomStatusItem)iter.next();
|
CustomStatusItem item = (CustomStatusItem)iter.next();
|
||||||
if (item.getType().equals(messageType) && item.getStatus().equals(messageStatus)) {
|
if (item.getType().equals(messageType) && item.getStatus().equals(messageStatus)) {
|
||||||
@ -242,11 +259,13 @@ public class CustomMessages {
|
|||||||
|
|
||||||
|
|
||||||
Action editAction = new AbstractAction() {
|
Action editAction = new AbstractAction() {
|
||||||
public void actionPerformed(ActionEvent actionEvent) {
|
private static final long serialVersionUID = 39916149252596354L;
|
||||||
List newItems = load();
|
|
||||||
Iterator iter = newItems.iterator();
|
public void actionPerformed(ActionEvent actionEvent) {
|
||||||
|
List<CustomStatusItem> newItems = load();
|
||||||
|
Iterator<CustomStatusItem> iter = newItems.iterator();
|
||||||
while (iter.hasNext()) {
|
while (iter.hasNext()) {
|
||||||
CustomStatusItem item = (CustomStatusItem)iter.next();
|
CustomStatusItem item = iter.next();
|
||||||
if (item.getType().equals(messageType) && item.getStatus().equals(messageStatus)) {
|
if (item.getType().equals(messageType) && item.getStatus().equals(messageStatus)) {
|
||||||
CustomStatus customStatus = new CustomStatus();
|
CustomStatus customStatus = new CustomStatus();
|
||||||
customStatus.showEditDialog(item);
|
customStatus.showEditDialog(item);
|
||||||
@ -276,18 +295,18 @@ public class CustomMessages {
|
|||||||
private static void reloadTree(JiveTreeNode rootNode, Tree tree) {
|
private static void reloadTree(JiveTreeNode rootNode, Tree tree) {
|
||||||
StatusBar statusBar = SparkManager.getWorkspace().getStatusBar();
|
StatusBar statusBar = SparkManager.getWorkspace().getStatusBar();
|
||||||
rootNode.removeAllChildren();
|
rootNode.removeAllChildren();
|
||||||
Iterator statusItems = statusBar.getStatusList().iterator();
|
Iterator<StatusItem> statusItems = statusBar.getStatusList().iterator();
|
||||||
while (statusItems.hasNext()) {
|
while (statusItems.hasNext()) {
|
||||||
StatusItem statusItem = (StatusItem)statusItems.next();
|
StatusItem statusItem = statusItems.next();
|
||||||
JiveTreeNode node = new JiveTreeNode(statusItem.getText(), false, statusItem.getIcon());
|
JiveTreeNode node = new JiveTreeNode(statusItem.getText(), false, statusItem.getIcon());
|
||||||
|
|
||||||
List newItems = load();
|
List<CustomStatusItem> newItems = load();
|
||||||
Iterator cMessages = newItems.iterator();
|
Iterator<CustomStatusItem> cMessages = newItems.iterator();
|
||||||
|
|
||||||
node.setAllowsChildren(true);
|
node.setAllowsChildren(true);
|
||||||
|
|
||||||
while (cMessages.hasNext()) {
|
while (cMessages.hasNext()) {
|
||||||
CustomStatusItem csi = (CustomStatusItem)cMessages.next();
|
CustomStatusItem csi = cMessages.next();
|
||||||
if (csi.getType().equals(statusItem.getText())) {
|
if (csi.getType().equals(statusItem.getText())) {
|
||||||
JiveTreeNode subNode = new JiveTreeNode(csi.getStatus(), false);
|
JiveTreeNode subNode = new JiveTreeNode(csi.getStatus(), false);
|
||||||
node.add(subNode);
|
node.add(subNode);
|
||||||
@ -305,7 +324,8 @@ public class CustomMessages {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static class CustomStatus extends JPanel {
|
private static class CustomStatus extends JPanel {
|
||||||
private JLabel typeLabel = new JLabel();
|
private static final long serialVersionUID = 1117350001209641469L;
|
||||||
|
private JLabel typeLabel = new JLabel();
|
||||||
private JComboBox typeBox = new JComboBox();
|
private JComboBox typeBox = new JComboBox();
|
||||||
|
|
||||||
private JLabel statusLabel = new JLabel();
|
private JLabel statusLabel = new JLabel();
|
||||||
@ -341,9 +361,9 @@ public class CustomMessages {
|
|||||||
|
|
||||||
typeBox.setRenderer(new ListIconRenderer());
|
typeBox.setRenderer(new ListIconRenderer());
|
||||||
// Add Types
|
// Add Types
|
||||||
Iterator statusIterator = statusBar.getStatusList().iterator();
|
Iterator<StatusItem> statusIterator = statusBar.getStatusList().iterator();
|
||||||
while (statusIterator.hasNext()) {
|
while (statusIterator.hasNext()) {
|
||||||
final StatusItem statusItem = (StatusItem)statusIterator.next();
|
final StatusItem statusItem = statusIterator.next();
|
||||||
ImageIcon icon = (ImageIcon)statusItem.getIcon();
|
ImageIcon icon = (ImageIcon)statusItem.getIcon();
|
||||||
|
|
||||||
ImageIcon newIcon = new ImageIcon(icon.getImage());
|
ImageIcon newIcon = new ImageIcon(icon.getImage());
|
||||||
@ -414,12 +434,12 @@ public class CustomMessages {
|
|||||||
optionsDialog.setVisible(false);
|
optionsDialog.setVisible(false);
|
||||||
}
|
}
|
||||||
else if (Res.getString("ok").equals(value)) {
|
else if (Res.getString("ok").equals(value)) {
|
||||||
List list = load();
|
List<CustomStatusItem> list = load();
|
||||||
Iterator iter = list.iterator();
|
Iterator<CustomStatusItem> iter = list.iterator();
|
||||||
|
|
||||||
CustomStatusItem changeItem = null;
|
CustomStatusItem changeItem = null;
|
||||||
while (iter.hasNext()) {
|
while (iter.hasNext()) {
|
||||||
CustomStatusItem customItem = (CustomStatusItem)iter.next();
|
CustomStatusItem customItem = iter.next();
|
||||||
if (customItem.getType().equals(item.getType()) &&
|
if (customItem.getType().equals(item.getType()) &&
|
||||||
customItem.getStatus().equals(item.getStatus())) {
|
customItem.getStatus().equals(item.getStatus())) {
|
||||||
|
|
||||||
@ -429,10 +449,10 @@ public class CustomMessages {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Iterator customListIterator = list.iterator();
|
Iterator<CustomStatusItem> customListIterator = list.iterator();
|
||||||
boolean exists = false;
|
boolean exists = false;
|
||||||
while (customListIterator.hasNext()) {
|
while (customListIterator.hasNext()) {
|
||||||
CustomStatusItem customItem = (CustomStatusItem)customListIterator.next();
|
CustomStatusItem customItem = customListIterator.next();
|
||||||
String type = customItem.getType();
|
String type = customItem.getType();
|
||||||
String status = customItem.getStatus();
|
String status = customItem.getStatus();
|
||||||
|
|
||||||
@ -526,7 +546,7 @@ public class CustomMessages {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
List list = load();
|
List<CustomStatusItem> list = load();
|
||||||
|
|
||||||
CustomStatusItem customStatusItem = new CustomStatusItem();
|
CustomStatusItem customStatusItem = new CustomStatusItem();
|
||||||
customStatusItem.setPriority(getPriority());
|
customStatusItem.setPriority(getPriority());
|
||||||
@ -534,10 +554,10 @@ public class CustomMessages {
|
|||||||
customStatusItem.setType(getType());
|
customStatusItem.setType(getType());
|
||||||
|
|
||||||
|
|
||||||
Iterator customListIterator = list.iterator();
|
Iterator<CustomStatusItem> customListIterator = list.iterator();
|
||||||
boolean exists = false;
|
boolean exists = false;
|
||||||
while (customListIterator.hasNext()) {
|
while (customListIterator.hasNext()) {
|
||||||
CustomStatusItem customItem = (CustomStatusItem)customListIterator.next();
|
CustomStatusItem customItem = customListIterator.next();
|
||||||
String type = customItem.getType();
|
String type = customItem.getType();
|
||||||
String status = customItem.getStatus();
|
String status = customItem.getStatus();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user