MCPcopy Create free account
hub / github.com/codenameone/CodenameOne / disposeImpl

Method disposeImpl

CodenameOne/src/com/codename1/ui/Form.java:2856–2886  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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;

Callers 3

disposeMethod · 0.95
onShowCompletedImplMethod · 0.80
showMenuMethod · 0.80

Calls 4

getInstanceMethod · 0.95
getCurrentMethod · 0.45
isDisposedMethod · 0.45
setCurrentMethod · 0.45

Tested by

no test coverage detected