File tree Expand file tree Collapse file tree 1 file changed +14
-13
lines changed
src/main/java/io/github/dsheirer/module/decode/event Expand file tree Collapse file tree 1 file changed +14
-13
lines changed Original file line number Diff line number Diff line change @@ -56,12 +56,21 @@ public T getItem(int index)
56
56
*/
57
57
public void add (T item )
58
58
{
59
- mItems .addFirst (item );
60
- ClearableHistoryModel .this .fireTableRowsInserted (0 , 0 );
61
- while (mItems .size () > mHistorySize )
59
+ if (mItems .contains (item ))
62
60
{
63
- mItems .removeLast ();
64
- super .fireTableRowsDeleted (mItems .size () - 1 , mItems .size () - 1 );
61
+ int itemRow = mItems .indexOf (item );
62
+ fireTableRowsUpdated (itemRow , itemRow );
63
+ }
64
+ else
65
+ {
66
+ mItems .addFirst (item );
67
+ fireTableRowsInserted (0 , 0 );
68
+
69
+ while (mItems .size () > mHistorySize )
70
+ {
71
+ mItems .removeLast ();
72
+ fireTableRowsDeleted (mItems .size () - 1 , mItems .size () - 1 );
73
+ }
65
74
}
66
75
}
67
76
@@ -100,14 +109,6 @@ public int getHistorySize()
100
109
return mHistorySize ;
101
110
}
102
111
103
- /**
104
- * Resets the history size to the default value.
105
- */
106
- public void resetHistorySize ()
107
- {
108
- setHistorySize (DEFAULT_HISTORY_SIZE );
109
- }
110
-
111
112
/**
112
113
* Sets the history size
113
114
* @param historySize
You can’t perform that action at this time.
0 commit comments