Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

165
LINES

< > BotCompany Repo | #1029928 // Compact Module Include v4 (LIVE for new code using cmodule2)

JavaX fragment (include)

1  
lib 1029927 // Loadable Utils v2
2  
3  
set flag PublicExceptTopClass. // so we can override methods
4  
5  
!include once #1020737 // global functions
6  
7  
do not include function dm_current_generic.
8  
do not include function dm_current_mandatory_generic.
9  
10  
import loadableUtils.utils;
11  
import static loadableUtils.utils.fail;
12  
//import static loadableUtils.utils.print_byThread;
13  
//import static loadableUtils.utils.print_byThread_dontCreate;
14  
import static loadableUtils.utils._threadInfo;
15  
import static loadableUtils.utils._threadInheritInfo;
16  
import static loadableUtils.utils._threadInfo_addMakerAndRetriever;
17  
import static loadableUtils.utils.dm_currentModule;
18  
import static loadableUtils.utils.dm_current_mandatory;
19  
import static loadableUtils.utils.match;
20  
//import static loadableUtils.utils.getOpt; // getOpt is in x30
21  
import static loadableUtils.utils.getOpt_raw;
22  
//import static loadableUtils.utils.setOpt; // TODO: move to x30?
23  
import static loadableUtils.utils.setOpt_raw;
24  
import static loadableUtils.utils.getField;
25  
import static loadableUtils.utils.fieldType;
26  
import static loadableUtils.utils.format3;
27  
import static loadableUtils.utils.vm_generalIdentityHashSet;
28  
import static loadableUtils.utils.vm_generalHashMap;
29  
import static loadableUtils.utils.vm_generalWeakSubMap;
30  
import static loadableUtils.utils.bindToComponent;
31  
import static loadableUtils.utils.struct;
32  
import static loadableUtils.utils.structure;
33  
import static loadableUtils.utils.loadPage;
34  
import static loadableUtils.utils.loadPage_utf8;
35  
import static loadableUtils.utils.loadPageSilentlyWithTimeout;
36  
import static loadableUtils.utils.loadPageSilently;
37  
//import static loadableUtils.utils.loadPageWithUserAgent; // TODO: fix the src lib compilation problem
38  
import static loadableUtils.utils.loadSnippet;
39  
import static loadableUtils.utils.loadSnippetQuietly;
40  
import static loadableUtils.utils.sendToLocalBot;
41  
import static loadableUtils.utils.sendToLocalBotOpt;
42  
import static loadableUtils.utils.sendToLocalBotQuietly;
43  
import static loadableUtils.utils.componentPopupMenu;
44  
import static loadableUtils.utils.componentPopupMenu_top;
45  
import static loadableUtils.utils.componentPopupMenu_initForComponent;
46  
import static loadableUtils.utils.componentPopupMenu_getEvent;
47  
import static loadableUtils.utils.listPopupMenu;
48  
import static loadableUtils.utils.tablePopupMenu;
49  
import static loadableUtils.utils.tablePopupMenuFirst;
50  
import static loadableUtils.utils.rowSorter_setComparators;
51  
import static loadableUtils.utils.sexyTableWithoutDrag;
52  
import static loadableUtils.utils.dm_current_generic;
53  
import static loadableUtils.utils.dm_current_mandatory_generic;
54  
//import static loadableUtils.utils.cget; // it's mapMethodLike
55  
import static loadableUtils.utils.cset;
56  
import static loadableUtils.utils.DynamicObject_loading;
57  
//import static loadableUtils.utils.withDBLock;
58  
import static loadableUtils.utils.concepts_unlisted;
59  
import static loadableUtils.utils.makePopupMenuConditional;
60  
import static loadableUtils.utils.makeConceptsTable_idWidth;
61  
import static loadableUtils.utils.showConceptsTable_afterUpdate;
62  
import static loadableUtils.utils.dynamicObjectIsLoading;
63  
import static loadableUtils.utils.rethrow;
64  
import static loadableUtils.utils.hasBot;
65  
//import static loadableUtils.utils.interceptPrintInThisThread;
66  
import static loadableUtils.utils.concepts_internStringsLongerThan;
67  
import static loadableUtils.utils.concepts_setUnlistedByDefault;
68  
import static loadableUtils.utils.realMC_tl;
69  
70  
// import static loadableUtils.utils.getProgramID; // XXX - should do, but possible breaking change
71  
72  
//please include function programID.
73  
!include once #1027168 // programID variable - WHY?
74  
// XXX please include function print.
75  
76  
// for print-to-module
77  
// XXX? please include function tempInterceptPrintIfNotIntercepted.
78  
79  
svoid _onLoad_initUtils { utils.__javax = javax(); }
80  
81  
import loadableUtils.utils.F0;
82  
import loadableUtils.utils.F1;
83  
import loadableUtils.utils.IF0;
84  
import loadableUtils.utils.IF1;
85  
import loadableUtils.utils.IVF1;
86  
import loadableUtils.utils.IVF2;
87  
import loadableUtils.utils.Matches;
88  
import loadableUtils.utils.BetterLabel;
89  
import loadableUtils.utils.SingleComponentPanel;
90  
import loadableUtils.utils.Snippet;
91  
import loadableUtils.utils.Q;
92  
import loadableUtils.utils.ImageSurface;
93  
import loadableUtils.utils.structure_Data;
94  
import loadableUtils.utils.structure_ClassInfo;
95  
import loadableUtils.utils.RGBImage;
96  
import loadableUtils.utils.RGB;
97  
import loadableUtils.utils.BWImage;
98  
import loadableUtils.utils.MakesBufferedImage;
99  
//import loadableUtils.utils.DynamicObject;
100  
import loadableUtils.utils.MultiSet;
101  
import loadableUtils.utils.Concept;
102  
import loadableUtils.utils.Concepts;
103  
import loadableUtils.utils.RC;
104  
import loadableUtils.utils.IConceptIndex;
105  
import loadableUtils.utils.IConceptCounter;
106  
import loadableUtils.utils.IFieldIndex;
107  
import loadableUtils.utils.Derefable;
108  
import loadableUtils.utils.ImageSurfaceSelector;
109  
//import loadableUtils.utils.Cache; // because often used with string function references
110  
import loadableUtils.utils.SimpleCRUD;
111  
import loadableUtils.utils.PersistableThrowable;
112  
113  
import loadableUtils.utils.DynModule;
114  
import loadableUtils.utils.DynPrintLog;
115  
import loadableUtils.utils.DynObjectTable;
116  
import loadableUtils.utils.DynImageSurface;
117  
import loadableUtils.utils.DynCalculatedList;
118  
import loadableUtils.utils.GlobalID;
119  
import loadableUtils.utils.Rect;
120  
import loadableUtils.utils.Pt;
121  
import loadableUtils.utils.SynchronizedArrayList;
122  
//import loadableUtils.utils.IntRange;
123  
//import loadableUtils.utils.LongRange;
124  
import loadableUtils.utils.SecretValue;
125  
126  
svoid _onLoad_defaultClassFinder() {
127  
  setDefaultClassFinder(new F1<S, Class>() {
128  
    public Class get(S name) {
129  
      Class c = findClass_fullName(name);
130  
      if (c != null) ret c;
131  
      if (name.startsWith("main$"))
132  
        ret loadableUtils.utils.findClass_fullName("loadableUtils.utils" + name.substring(4));
133  
      null;
134  
    }
135  
  });
136  
}
137  
138  
/*svoid _onLoad_printByThread() {
139  
  print_byThread = loadableUtils.utils.print_byThread();
140  
}*/
141  
142  
meta-comment { We need these functions in main class because they may call String functions (callMC). }
143  
144  
//!include once #1020728 // callF + callMC + call
145  
function callF is in #1020728.
146  
function callMC is in #1020728.
147  
function call is in #1020728.
148  
149  
!include once #1028442 // Do this always to make Concepts as module field work
150  
//function dynamicObjectIsLoading_threadLocal is in #1028442.
151  
152  
!include once #1023504 // now empty
153  
154  
import loadableUtils.utils.HCRUD;
155  
import loadableUtils.utils.HCRUD_Data;
156  
import loadableUtils.utils.HCRUD_Concepts;
157  
import loadableUtils.utils.ValueConverterForField;
158  
import loadableUtils.utils.DefaultValueConverterForField;
159  
import loadableUtils.utils.OrError;
160  
import loadableUtils.utils.HTML;
161  
162  
// actually this will now always be included. doesn't cost much though
163  
ifclass Concepts
164  
please include function db_mainConcepts.
165  
endif

Author comment

Began life as a copy of #1027167

download  show line numbers  debug dex  old transpilations   

Travelled to 5 computer(s): bhatertpkbcr, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, vouqrxazstgt

No comments. add comment

Snippet ID: #1029928
Snippet name: Compact Module Include v4 (LIVE for new code using cmodule2)
Eternal ID of this version: #1029928/11
Text MD5: d485cc5b3207c0aa29d88fd4c01d8cf5
Author: stefan
Category: javax / stefan's os
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-06-29 02:52:29
Source code size: 7004 bytes / 165 lines
Pitched / IR pitched: No / No
Views / Downloads: 235 / 2291
Version history: 10 change(s)
Referenced in: [show references]