()
| 2854 | |
| 2855 | /// Works only for modal forms by returning to the previous form |
| 2856 | void disposeImpl() { |
| 2857 | if (previousForm != null) { |
| 2858 | boolean clearPrevious = Display.getInstance().getCurrent() == this; //NOPMD CompareObjectsWithEquals |
| 2859 | if (!clearPrevious) { |
| 2860 | Form f = Display.getInstance().getCurrent(); |
| 2861 | while (f != null) { |
| 2862 | if (f.previousForm == this) { //NOPMD CompareObjectsWithEquals |
| 2863 | f.previousForm = previousForm; |
| 2864 | previousForm = null; |
| 2865 | return; |
| 2866 | } |
| 2867 | f = f.previousForm; |
| 2868 | } |
| 2869 | } |
| 2870 | previousForm.tint = false; |
| 2871 | |
| 2872 | if (previousForm instanceof Dialog) { |
| 2873 | if (!previousForm.isDisposed()) { |
| 2874 | Display.getInstance().setCurrent(previousForm, false); |
| 2875 | } |
| 2876 | } else { |
| 2877 | Display.getInstance().setCurrent(previousForm, false); |
| 2878 | //previousForm.revalidate(); |
| 2879 | } |
| 2880 | |
| 2881 | if (clearPrevious) { |
| 2882 | // enable GC to cleanup the previous form if no longer referenced |
| 2883 | previousForm = null; |
| 2884 | } |
| 2885 | } |
| 2886 | } |
| 2887 | |
| 2888 | boolean isMenu() { |
| 2889 | return false; |
no test coverage detected