Last change
on this file since 7029 was 6084, checked in by bastiK, 11 years ago |
see #8902 - add missing @Override annotations (patch by shinigami)
|
-
Property svn:eol-style
set to
native
|
File size:
845 bytes
|
Line | |
---|
1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.tools;
|
---|
3 |
|
---|
4 | import java.io.Serializable;
|
---|
5 | import java.util.Comparator;
|
---|
6 |
|
---|
7 | import javax.swing.JMenuItem;
|
---|
8 |
|
---|
9 | import org.openstreetmap.josm.Main;
|
---|
10 |
|
---|
11 | public class PresetTextComparator implements Comparator<JMenuItem>, Serializable {
|
---|
12 | @Override
|
---|
13 | public int compare(JMenuItem arg0, JMenuItem arg1) {
|
---|
14 | if (Main.main.menu.presetSearchAction.equals(arg0.getAction()))
|
---|
15 | return -1;
|
---|
16 | else if (Main.main.menu.presetSearchAction.equals(arg0.getAction()))
|
---|
17 | return 1;
|
---|
18 | else if (arg0.getText() == arg1.getText())
|
---|
19 | return 0;
|
---|
20 | else if (arg0.getText() == null)
|
---|
21 | return -1;
|
---|
22 | else if (arg1.getText() == null)
|
---|
23 | return 1;
|
---|
24 | else
|
---|
25 | return arg0.getText().compareTo(arg1.getText());
|
---|
26 | }
|
---|
27 |
|
---|
28 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.