mdbe 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +15 -0
- data/LICENSE.txt +21 -0
- data/README.md +53 -0
- data/app.rb +182 -0
- data/bin/mdbe +5 -0
- data/config.ru +2 -0
- data/environment.rb +8 -0
- data/lib/mdbe.rb +39 -0
- data/lib/mdbe/action_controller_debug_patch.rb +12 -0
- data/lib/mdbe/code_evaluation.rb +46 -0
- data/lib/mdbe/database_views.rb +24 -0
- data/lib/mdbe/database_views/abstract_dictionary.rb +69 -0
- data/lib/mdbe/database_views/abstract_exception.rb +25 -0
- data/lib/mdbe/database_views/array.rb +28 -0
- data/lib/mdbe/database_views/boolean.rb +12 -0
- data/lib/mdbe/database_views/class.rb +46 -0
- data/lib/mdbe/database_views/exception.rb +3 -0
- data/lib/mdbe/database_views/execblock.rb +5 -0
- data/lib/mdbe/database_views/fixnum.rb +5 -0
- data/lib/mdbe/database_views/float.rb +5 -0
- data/lib/mdbe/database_views/globals.rb +2 -0
- data/lib/mdbe/database_views/gsnmethod.rb +29 -0
- data/lib/mdbe/database_views/hash.rb +5 -0
- data/lib/mdbe/database_views/maglev_record.rb +42 -0
- data/lib/mdbe/database_views/module.rb +103 -0
- data/lib/mdbe/database_views/nilclass.rb +5 -0
- data/lib/mdbe/database_views/object.rb +80 -0
- data/lib/mdbe/database_views/proc.rb +3 -0
- data/lib/mdbe/database_views/repository.rb +3 -0
- data/lib/mdbe/database_views/ruby_workspace.rb +5 -0
- data/lib/mdbe/database_views/smalltalk_classes.rb +34 -0
- data/lib/mdbe/database_views/smalltalk_classes.st +60 -0
- data/lib/mdbe/database_views/string.rb +31 -0
- data/lib/mdbe/database_views/symbol.rb +32 -0
- data/lib/mdbe/database_views/system.rb +61 -0
- data/lib/mdbe/database_views/thread.rb +101 -0
- data/lib/mdbe/debug_server.rb +22 -0
- data/lib/mdbe/halt.rb +42 -0
- data/lib/mdbe/ruby_workspace.rb +29 -0
- data/lib/mdbe/version.rb +3 -0
- data/lib/tasks/maglev-database-explorer_tasks.rake +4 -0
- data/public/LICENSE +35 -0
- data/public/amber/CHANGELOG +65 -0
- data/public/amber/LICENSE +22 -0
- data/public/amber/Makefile +53 -0
- data/public/amber/README.md +30 -0
- data/public/amber/bin/amber +3 -0
- data/public/amber/bin/amberc +352 -0
- data/public/amber/bin/nodecompile.js +33 -0
- data/public/amber/bin/server +3 -0
- data/public/amber/bin/server.bat +3 -0
- data/public/amber/css/amber-normalize.css +468 -0
- data/public/amber/css/amber-normalize.less +501 -0
- data/public/amber/css/amber.css +539 -0
- data/public/amber/css/documentation.css +84 -0
- data/public/amber/css/profstef.css +75 -0
- data/public/amber/css/style.css +313 -0
- data/public/amber/documentation.html +37 -0
- data/public/amber/examples/Makefile +23 -0
- data/public/amber/examples/README +4 -0
- data/public/amber/examples/android/helloamber/AndroidManifest.xml +19 -0
- data/public/amber/examples/android/helloamber/HelloAmber.st +13 -0
- data/public/amber/examples/android/helloamber/Makefile +56 -0
- data/public/amber/examples/android/helloamber/README.md +80 -0
- data/public/amber/examples/android/helloamber/ant.properties +17 -0
- data/public/amber/examples/android/helloamber/assets/index.html +15 -0
- data/public/amber/examples/android/helloamber/assets/jquery-1.7.2.min.js +4 -0
- data/public/amber/examples/android/helloamber/build.xml +83 -0
- data/public/amber/examples/android/helloamber/local.properties +10 -0
- data/public/amber/examples/android/helloamber/proguard-project.txt +20 -0
- data/public/amber/examples/android/helloamber/project.properties +14 -0
- data/public/amber/examples/android/helloamber/res/layout/main.xml +6 -0
- data/public/amber/examples/android/helloamber/res/values/strings.xml +4 -0
- data/public/amber/examples/android/helloamber/src/org/amberlang/android/helloamber/HelloAmber.java +59 -0
- data/public/amber/examples/myproject/index.html +16 -0
- data/public/amber/examples/nodejs/README +9 -0
- data/public/amber/examples/nodejs/benchfib/Benchfib.st +124 -0
- data/public/amber/examples/nodejs/benchfib/Makefile +8 -0
- data/public/amber/examples/nodejs/benchfib/benchfib +1 -0
- data/public/amber/examples/nodejs/hello/Hello.st +9 -0
- data/public/amber/examples/nodejs/hello/Makefile +8 -0
- data/public/amber/examples/nodejs/hello/README +13 -0
- data/public/amber/examples/nodejs/hello/hello +1 -0
- data/public/amber/examples/nodejs/meta/Makefile +8 -0
- data/public/amber/examples/nodejs/meta/MyScript.st +27 -0
- data/public/amber/examples/nodejs/meta/meta +1 -0
- data/public/amber/examples/nodejs/pystone/Makefile +8 -0
- data/public/amber/examples/nodejs/pystone/Pystone.st +306 -0
- data/public/amber/examples/nodejs/pystone/pystone +1 -0
- data/public/amber/examples/nodejs/trivialserver/Makefile +8 -0
- data/public/amber/examples/nodejs/trivialserver/TrivialServer.st +51 -0
- data/public/amber/examples/nodejs/trivialserver/trivial +1 -0
- data/public/amber/examples/presentation/esug2011/images/asterix.png +0 -0
- data/public/amber/examples/presentation/esug2011/images/background_box.png +0 -0
- data/public/amber/examples/presentation/esug2011/images/background_header.png +0 -0
- data/public/amber/examples/presentation/esug2011/images/balloon.jpg +0 -0
- data/public/amber/examples/presentation/esug2011/images/balloon_header.png +0 -0
- data/public/amber/examples/presentation/esug2011/images/devices.jpg +0 -0
- data/public/amber/examples/presentation/esug2011/images/enyo.png +0 -0
- data/public/amber/examples/presentation/esug2011/images/ide_star_wars.png +0 -0
- data/public/amber/examples/presentation/esug2011/images/nodejs.png +0 -0
- data/public/amber/examples/presentation/esug2011/images/terminal.png +0 -0
- data/public/amber/examples/presentation/esug2011/images/webos.png +0 -0
- data/public/amber/examples/presentation/fosdem2012/images/amber.png +0 -0
- data/public/amber/examples/presentation/fosdem2012/images/ambrhino.jpg +0 -0
- data/public/amber/examples/presentation/fosdem2012/images/nodejs.png +0 -0
- data/public/amber/examples/presentation/fosdem2012/images/pharo.png +0 -0
- data/public/amber/examples/presentation/fosdem2012/images/php.gif +0 -0
- data/public/amber/examples/presentation/fosdem2012/images/rails.png +0 -0
- data/public/amber/examples/presentation/fosdem2012/lib/booklet/images/arrow-next.png +0 -0
- data/public/amber/examples/presentation/fosdem2012/lib/booklet/images/arrow-prev.png +0 -0
- data/public/amber/examples/presentation/fosdem2012/lib/booklet/images/closedhand.cur +0 -0
- data/public/amber/examples/presentation/fosdem2012/lib/booklet/images/openhand.cur +0 -0
- data/public/amber/examples/presentation/fosdem2012/lib/booklet/images/shadow-top-back.png +0 -0
- data/public/amber/examples/presentation/fosdem2012/lib/booklet/images/shadow-top-forward.png +0 -0
- data/public/amber/examples/presentation/fosdem2012/lib/booklet/images/shadow.png +0 -0
- data/public/amber/examples/presentation/fosdem2012/lib/booklet/jquery.booklet.1.2.0.css +100 -0
- data/public/amber/examples/presentation/fosdem2012/lib/booklet/jquery.booklet.1.2.0.js +1232 -0
- data/public/amber/examples/presentation/fosdem2012/lib/booklet/jquery.booklet.1.2.0.min.js +13 -0
- data/public/amber/examples/presentation/fosdem2012/lib/booklet/jquery.easing.1.3.js +38 -0
- data/public/amber/examples/presentation/index.html +17 -0
- data/public/amber/examples/presentation/js/Presentation.deploy.js +1922 -0
- data/public/amber/examples/presentation/js/Presentation.js +2712 -0
- data/public/amber/examples/presentation/st/Presentation.st +1996 -0
- data/public/amber/examples/trysmalltalk/index.html +18 -0
- data/public/amber/examples/trysmalltalk/js/TrySmalltalk.deploy.js +837 -0
- data/public/amber/examples/trysmalltalk/js/TrySmalltalk.js +1206 -0
- data/public/amber/examples/trysmalltalk/st/TrySmalltalk.st +964 -0
- data/public/amber/examples/twitterwall/css/twitterwall.css +19 -0
- data/public/amber/examples/twitterwall/index.html +35 -0
- data/public/amber/examples/twitterwall/js/TwitterWall.deploy.js +116 -0
- data/public/amber/examples/twitterwall/js/TwitterWall.js +146 -0
- data/public/amber/examples/twitterwall/st/TwitterWall.st +91 -0
- data/public/amber/examples/webos/README +11 -0
- data/public/amber/examples/webos/eris/DuckQwaq.wav +0 -0
- data/public/amber/examples/webos/eris/EnyoAmber.st +36 -0
- data/public/amber/examples/webos/eris/Eris.css +0 -0
- data/public/amber/examples/webos/eris/Eris.st +86 -0
- data/public/amber/examples/webos/eris/Makefile +37 -0
- data/public/amber/examples/webos/eris/README +3 -0
- data/public/amber/examples/webos/eris/appinfo.json +10 -0
- data/public/amber/examples/webos/eris/index.html +12 -0
- data/public/amber/examples/webos/helloamber/EnyoAmber.st +36 -0
- data/public/amber/examples/webos/helloamber/HelloAmber.st +86 -0
- data/public/amber/examples/webos/helloamber/Makefile +38 -0
- data/public/amber/examples/webos/helloamber/README +5 -0
- data/public/amber/examples/webos/helloamber/appinfo.json +10 -0
- data/public/amber/examples/webos/helloamber/index.html +12 -0
- data/public/amber/favicon.ico +0 -0
- data/public/amber/images/amber.png +0 -0
- data/public/amber/images/amber.svg +706 -0
- data/public/amber/images/amber_small.png +0 -0
- data/public/amber/images/off.amber.png +0 -0
- data/public/amber/images/off.png +0 -0
- data/public/amber/images/offHover.amber.png +0 -0
- data/public/amber/images/offHover.png +0 -0
- data/public/amber/images/presentation.png +0 -0
- data/public/amber/images/profstef.png +0 -0
- data/public/amber/images/sprite.amber.png +0 -0
- data/public/amber/images/sprite.png +0 -0
- data/public/amber/images/tinylogo.amber.png +0 -0
- data/public/amber/images/tinylogo.png +0 -0
- data/public/amber/images/twitterwall.png +0 -0
- data/public/amber/index.html +55 -0
- data/public/amber/js/Additional-Examples.deploy.js +15 -0
- data/public/amber/js/Additional-Examples.js +21 -0
- data/public/amber/js/Benchfib.deploy.js +132 -0
- data/public/amber/js/Benchfib.js +167 -0
- data/public/amber/js/Canvas.deploy.js +2446 -0
- data/public/amber/js/Canvas.js +3547 -0
- data/public/amber/js/Compiler-Tests.deploy.js +97 -0
- data/public/amber/js/Compiler-Tests.js +137 -0
- data/public/amber/js/Compiler.deploy.js +1877 -0
- data/public/amber/js/Compiler.js +2622 -0
- data/public/amber/js/Documentation.deploy.js +961 -0
- data/public/amber/js/Documentation.js +1376 -0
- data/public/amber/js/Examples.deploy.js +53 -0
- data/public/amber/js/Examples.js +73 -0
- data/public/amber/js/IDE.deploy.js +3557 -0
- data/public/amber/js/IDE.js +5002 -0
- data/public/amber/js/Kernel-Announcements.deploy.js +107 -0
- data/public/amber/js/Kernel-Announcements.js +152 -0
- data/public/amber/js/Kernel-Classes.deploy.js +774 -0
- data/public/amber/js/Kernel-Classes.js +1095 -0
- data/public/amber/js/Kernel-Collections.deploy.js +3121 -0
- data/public/amber/js/Kernel-Collections.js +4427 -0
- data/public/amber/js/Kernel-Exceptions.deploy.js +244 -0
- data/public/amber/js/Kernel-Exceptions.js +349 -0
- data/public/amber/js/Kernel-Methods.deploy.js +573 -0
- data/public/amber/js/Kernel-Methods.js +807 -0
- data/public/amber/js/Kernel-Objects.deploy.js +2877 -0
- data/public/amber/js/Kernel-Objects.js +4107 -0
- data/public/amber/js/Kernel-Tests.deploy.js +1513 -0
- data/public/amber/js/Kernel-Tests.js +2053 -0
- data/public/amber/js/Kernel-Transcript.deploy.js +142 -0
- data/public/amber/js/Kernel-Transcript.js +202 -0
- data/public/amber/js/Maglev-Core.deploy.js +2996 -0
- data/public/amber/js/Maglev-Core.js +4246 -0
- data/public/amber/js/Maglev-Database-Explorer.deploy.js +4476 -0
- data/public/amber/js/Maglev-Database-Explorer.js +6232 -0
- data/public/amber/js/Maglev-Vendor.deploy.js +350 -0
- data/public/amber/js/Maglev-Vendor.js +465 -0
- data/public/amber/js/README.md +5 -0
- data/public/amber/js/SUnit.deploy.js +351 -0
- data/public/amber/js/SUnit.js +501 -0
- data/public/amber/js/amber.js +273 -0
- data/public/amber/js/boot.js +602 -0
- data/public/amber/js/compat.js +22 -0
- data/public/amber/js/init.js +9 -0
- data/public/amber/js/lib/CodeMirror/LICENSE +19 -0
- data/public/amber/js/lib/CodeMirror/active-line.js +39 -0
- data/public/amber/js/lib/CodeMirror/amber.css +21 -0
- data/public/amber/js/lib/CodeMirror/codemirror.css +67 -0
- data/public/amber/js/lib/CodeMirror/codemirror.js +2144 -0
- data/public/amber/js/lib/CodeMirror/smalltalk.js +134 -0
- data/public/amber/js/lib/jQuery/jquery-1.4.4.min.js +167 -0
- data/public/amber/js/lib/jQuery/jquery-1.6.4.min.js +4 -0
- data/public/amber/js/lib/jQuery/jquery-ui-1.8.16.custom.min.js +791 -0
- data/public/amber/js/lib/jQuery/jquery.textarea.js +267 -0
- data/public/amber/js/lib/peg-0.6.2.min.js +2 -0
- data/public/amber/js/lib/showdown.js +419 -0
- data/public/amber/js/parser.js +4222 -0
- data/public/amber/js/parser.pegjs +223 -0
- data/public/amber/learn.html +40 -0
- data/public/amber/repl/Makefile +8 -0
- data/public/amber/repl/REPL.js +124 -0
- data/public/amber/repl/REPL.st +56 -0
- data/public/amber/repl/amber.js +18085 -0
- data/public/amber/server/FileServer.st +576 -0
- data/public/amber/server/Makefile +8 -0
- data/public/amber/server/server.js +13049 -0
- data/public/amber/st/Benchfib.js +297 -0
- data/public/amber/st/Benchfib.st +124 -0
- data/public/amber/st/Canvas.st +968 -0
- data/public/amber/st/Compiler-Tests.st +471 -0
- data/public/amber/st/Compiler.st +1445 -0
- data/public/amber/st/Documentation.st +758 -0
- data/public/amber/st/Examples.js +100 -0
- data/public/amber/st/Examples.st +38 -0
- data/public/amber/st/IDE.st +2404 -0
- data/public/amber/st/Kernel-Announcements.st +61 -0
- data/public/amber/st/Kernel-Classes.st +462 -0
- data/public/amber/st/Kernel-Collections.st +1611 -0
- data/public/amber/st/Kernel-Exceptions.st +124 -0
- data/public/amber/st/Kernel-Methods.st +291 -0
- data/public/amber/st/Kernel-Objects.st +1587 -0
- data/public/amber/st/Kernel-Tests.st +953 -0
- data/public/amber/st/Kernel-Transcript.st +70 -0
- data/public/amber/st/Maglev-Core.st +1694 -0
- data/public/amber/st/Maglev-Database-Explorer.st +3148 -0
- data/public/amber/st/Maglev-Vendor.st +151 -0
- data/public/amber/st/Makefile +104 -0
- data/public/amber/st/README.md +4 -0
- data/public/amber/st/SUnit.st +172 -0
- data/public/css/bootstrap-combined.no-icons.min.css +731 -0
- data/public/css/bootstrap.css +6811 -0
- data/public/css/images/animated-overlay.gif +0 -0
- data/public/css/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
- data/public/css/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
- data/public/css/images/ui-bg_flat_10_000000_40x100.png +0 -0
- data/public/css/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
- data/public/css/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
- data/public/css/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/public/css/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
- data/public/css/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
- data/public/css/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
- data/public/css/images/ui-icons_222222_256x240.png +0 -0
- data/public/css/images/ui-icons_228ef1_256x240.png +0 -0
- data/public/css/images/ui-icons_ef8c08_256x240.png +0 -0
- data/public/css/images/ui-icons_ffd27a_256x240.png +0 -0
- data/public/css/images/ui-icons_ffffff_256x240.png +0 -0
- data/public/css/jquery-ui.min.css +5 -0
- data/public/css/smalltalk_code.css +42 -0
- data/public/css/style.css +210 -0
- data/public/images/bg_tile.png +0 -0
- data/public/images/maglev-logo.gif +0 -0
- data/public/images/mchammer.gif +0 -0
- data/public/images/rails_tiny.png +0 -0
- data/public/images/ruby.png +0 -0
- data/public/images/ruby_smalltalk_bridge.png +0 -0
- data/public/images/smalltalk.png +0 -0
- data/public/img/glyphicons-halflings.png +0 -0
- data/public/index.html +118 -0
- data/public/libs/bootstrap.min.js +7 -0
- data/public/libs/codemirror/CONTRIBUTING.md +72 -0
- data/public/libs/codemirror/LICENSE +23 -0
- data/public/libs/codemirror/README.md +11 -0
- data/public/libs/codemirror/addon/dialog/dialog.css +32 -0
- data/public/libs/codemirror/addon/dialog/dialog.js +80 -0
- data/public/libs/codemirror/addon/display/placeholder.js +54 -0
- data/public/libs/codemirror/addon/edit/closebrackets.js +54 -0
- data/public/libs/codemirror/addon/edit/closetag.js +86 -0
- data/public/libs/codemirror/addon/edit/continuecomment.js +44 -0
- data/public/libs/codemirror/addon/edit/continuelist.js +25 -0
- data/public/libs/codemirror/addon/edit/matchbrackets.js +82 -0
- data/public/libs/codemirror/addon/fold/brace-fold.js +31 -0
- data/public/libs/codemirror/addon/fold/foldcode.js +32 -0
- data/public/libs/codemirror/addon/fold/indent-fold.js +11 -0
- data/public/libs/codemirror/addon/fold/xml-fold.js +64 -0
- data/public/libs/codemirror/addon/hint/html-hint.js +582 -0
- data/public/libs/codemirror/addon/hint/javascript-hint.js +142 -0
- data/public/libs/codemirror/addon/hint/pig-hint.js +117 -0
- data/public/libs/codemirror/addon/hint/python-hint.js +93 -0
- data/public/libs/codemirror/addon/hint/show-hint.css +38 -0
- data/public/libs/codemirror/addon/hint/show-hint.js +180 -0
- data/public/libs/codemirror/addon/hint/xml-hint.js +118 -0
- data/public/libs/codemirror/addon/lint/javascript-lint.js +127 -0
- data/public/libs/codemirror/addon/lint/json-lint.js +14 -0
- data/public/libs/codemirror/addon/lint/lint.css +96 -0
- data/public/libs/codemirror/addon/lint/lint.js +197 -0
- data/public/libs/codemirror/addon/mode/loadmode.js +51 -0
- data/public/libs/codemirror/addon/mode/multiplex.js +95 -0
- data/public/libs/codemirror/addon/mode/overlay.js +59 -0
- data/public/libs/codemirror/addon/runmode/colorize.js +29 -0
- data/public/libs/codemirror/addon/runmode/runmode-standalone.js +130 -0
- data/public/libs/codemirror/addon/runmode/runmode.js +52 -0
- data/public/libs/codemirror/addon/runmode/runmode.node.js +89 -0
- data/public/libs/codemirror/addon/search/match-highlighter.js +60 -0
- data/public/libs/codemirror/addon/search/search.js +131 -0
- data/public/libs/codemirror/addon/search/searchcursor.js +133 -0
- data/public/libs/codemirror/addon/selection/active-line.js +39 -0
- data/public/libs/codemirror/addon/selection/mark-selection.js +34 -0
- data/public/libs/codemirror/bin/compress +91 -0
- data/public/libs/codemirror/bin/lint +11 -0
- data/public/libs/codemirror/demo/activeline.html +70 -0
- data/public/libs/codemirror/demo/bidi.html +61 -0
- data/public/libs/codemirror/demo/btree.html +87 -0
- data/public/libs/codemirror/demo/buffers.html +98 -0
- data/public/libs/codemirror/demo/changemode.html +50 -0
- data/public/libs/codemirror/demo/closebrackets.html +63 -0
- data/public/libs/codemirror/demo/closetag.html +37 -0
- data/public/libs/codemirror/demo/complete.html +70 -0
- data/public/libs/codemirror/demo/emacs.html +60 -0
- data/public/libs/codemirror/demo/folding.html +69 -0
- data/public/libs/codemirror/demo/fullscreen.html +147 -0
- data/public/libs/codemirror/demo/html5complete.html +92 -0
- data/public/libs/codemirror/demo/indentwrap.html +49 -0
- data/public/libs/codemirror/demo/lint.html +90 -0
- data/public/libs/codemirror/demo/loadmode.html +40 -0
- data/public/libs/codemirror/demo/marker.html +59 -0
- data/public/libs/codemirror/demo/markselection.html +36 -0
- data/public/libs/codemirror/demo/matchhighlighter.html +38 -0
- data/public/libs/codemirror/demo/multiplex.html +60 -0
- data/public/libs/codemirror/demo/mustache.html +59 -0
- data/public/libs/codemirror/demo/placeholder.html +36 -0
- data/public/libs/codemirror/demo/preview.html +76 -0
- data/public/libs/codemirror/demo/resize.html +49 -0
- data/public/libs/codemirror/demo/runmode.html +50 -0
- data/public/libs/codemirror/demo/search.html +85 -0
- data/public/libs/codemirror/demo/spanaffectswrapping_shim.html +73 -0
- data/public/libs/codemirror/demo/theme.html +89 -0
- data/public/libs/codemirror/demo/variableheight.html +52 -0
- data/public/libs/codemirror/demo/vim.html +65 -0
- data/public/libs/codemirror/demo/visibletabs.html +53 -0
- data/public/libs/codemirror/demo/widget.html +74 -0
- data/public/libs/codemirror/demo/xmlcomplete.html +81 -0
- data/public/libs/codemirror/index.html +487 -0
- data/public/libs/codemirror/keymap/emacs.js +30 -0
- data/public/libs/codemirror/keymap/vim.js +3044 -0
- data/public/libs/codemirror/lib/codemirror.css +253 -0
- data/public/libs/codemirror/lib/codemirror.js +5585 -0
- data/public/libs/codemirror/mode/apl/apl.js +160 -0
- data/public/libs/codemirror/mode/apl/index.html +61 -0
- data/public/libs/codemirror/mode/asterisk/asterisk.js +183 -0
- data/public/libs/codemirror/mode/asterisk/index.html +142 -0
- data/public/libs/codemirror/mode/clike/clike.js +302 -0
- data/public/libs/codemirror/mode/clike/index.html +103 -0
- data/public/libs/codemirror/mode/clike/scala.html +767 -0
- data/public/libs/codemirror/mode/clojure/clojure.js +222 -0
- data/public/libs/codemirror/mode/clojure/index.html +76 -0
- data/public/libs/codemirror/mode/coffeescript/LICENSE +22 -0
- data/public/libs/codemirror/mode/coffeescript/coffeescript.js +346 -0
- data/public/libs/codemirror/mode/coffeescript/index.html +728 -0
- data/public/libs/codemirror/mode/commonlisp/commonlisp.js +101 -0
- data/public/libs/codemirror/mode/commonlisp/index.html +165 -0
- data/public/libs/codemirror/mode/css/css.js +567 -0
- data/public/libs/codemirror/mode/css/index.html +58 -0
- data/public/libs/codemirror/mode/css/scss.html +145 -0
- data/public/libs/codemirror/mode/css/scss_test.js +80 -0
- data/public/libs/codemirror/mode/css/test.js +113 -0
- data/public/libs/codemirror/mode/d/d.js +205 -0
- data/public/libs/codemirror/mode/d/index.html +262 -0
- data/public/libs/codemirror/mode/diff/diff.js +32 -0
- data/public/libs/codemirror/mode/diff/index.html +105 -0
- data/public/libs/codemirror/mode/ecl/ecl.js +192 -0
- data/public/libs/codemirror/mode/ecl/index.html +39 -0
- data/public/libs/codemirror/mode/erlang/erlang.js +463 -0
- data/public/libs/codemirror/mode/erlang/index.html +64 -0
- data/public/libs/codemirror/mode/gas/gas.js +326 -0
- data/public/libs/codemirror/mode/gas/index.html +57 -0
- data/public/libs/codemirror/mode/gfm/gfm.js +96 -0
- data/public/libs/codemirror/mode/gfm/index.html +74 -0
- data/public/libs/codemirror/mode/gfm/test.js +112 -0
- data/public/libs/codemirror/mode/go/go.js +165 -0
- data/public/libs/codemirror/mode/go/index.html +74 -0
- data/public/libs/codemirror/mode/groovy/groovy.js +210 -0
- data/public/libs/codemirror/mode/groovy/index.html +73 -0
- data/public/libs/codemirror/mode/haskell/haskell.js +242 -0
- data/public/libs/codemirror/mode/haskell/index.html +62 -0
- data/public/libs/codemirror/mode/haxe/haxe.js +429 -0
- data/public/libs/codemirror/mode/haxe/index.html +90 -0
- data/public/libs/codemirror/mode/htmlembedded/htmlembedded.js +73 -0
- data/public/libs/codemirror/mode/htmlembedded/index.html +49 -0
- data/public/libs/codemirror/mode/htmlmixed/htmlmixed.js +104 -0
- data/public/libs/codemirror/mode/htmlmixed/index.html +73 -0
- data/public/libs/codemirror/mode/http/http.js +98 -0
- data/public/libs/codemirror/mode/http/index.html +32 -0
- data/public/libs/codemirror/mode/javascript/index.html +92 -0
- data/public/libs/codemirror/mode/javascript/javascript.js +467 -0
- data/public/libs/codemirror/mode/javascript/typescript.html +48 -0
- data/public/libs/codemirror/mode/jinja2/index.html +38 -0
- data/public/libs/codemirror/mode/jinja2/jinja2.js +42 -0
- data/public/libs/codemirror/mode/less/index.html +741 -0
- data/public/libs/codemirror/mode/less/less.js +266 -0
- data/public/libs/codemirror/mode/livescript/LICENSE +23 -0
- data/public/libs/codemirror/mode/livescript/index.html +446 -0
- data/public/libs/codemirror/mode/livescript/livescript.js +267 -0
- data/public/libs/codemirror/mode/livescript/livescript.ls +266 -0
- data/public/libs/codemirror/mode/lua/index.html +74 -0
- data/public/libs/codemirror/mode/lua/lua.js +140 -0
- data/public/libs/codemirror/mode/markdown/index.html +344 -0
- data/public/libs/codemirror/mode/markdown/markdown.js +526 -0
- data/public/libs/codemirror/mode/markdown/test.js +636 -0
- data/public/libs/codemirror/mode/meta.js +75 -0
- data/public/libs/codemirror/mode/mirc/index.html +149 -0
- data/public/libs/codemirror/mode/mirc/mirc.js +177 -0
- data/public/libs/codemirror/mode/ntriples/index.html +33 -0
- data/public/libs/codemirror/mode/ntriples/ntriples.js +170 -0
- data/public/libs/codemirror/mode/ocaml/index.html +131 -0
- data/public/libs/codemirror/mode/ocaml/ocaml.js +113 -0
- data/public/libs/codemirror/mode/pascal/LICENSE +7 -0
- data/public/libs/codemirror/mode/pascal/index.html +48 -0
- data/public/libs/codemirror/mode/pascal/pascal.js +94 -0
- data/public/libs/codemirror/mode/perl/LICENSE +19 -0
- data/public/libs/codemirror/mode/perl/index.html +62 -0
- data/public/libs/codemirror/mode/perl/perl.js +816 -0
- data/public/libs/codemirror/mode/php/index.html +51 -0
- data/public/libs/codemirror/mode/php/php.js +129 -0
- data/public/libs/codemirror/mode/pig/index.html +42 -0
- data/public/libs/codemirror/mode/pig/pig.js +171 -0
- data/public/libs/codemirror/mode/properties/index.html +41 -0
- data/public/libs/codemirror/mode/properties/properties.js +63 -0
- data/public/libs/codemirror/mode/python/LICENSE.txt +21 -0
- data/public/libs/codemirror/mode/python/index.html +135 -0
- data/public/libs/codemirror/mode/python/python.js +340 -0
- data/public/libs/codemirror/mode/q/index.html +131 -0
- data/public/libs/codemirror/mode/q/q.js +124 -0
- data/public/libs/codemirror/mode/r/LICENSE +24 -0
- data/public/libs/codemirror/mode/r/index.html +74 -0
- data/public/libs/codemirror/mode/r/r.js +141 -0
- data/public/libs/codemirror/mode/rpm/changes/changes.js +19 -0
- data/public/libs/codemirror/mode/rpm/changes/index.html +53 -0
- data/public/libs/codemirror/mode/rpm/spec/index.html +99 -0
- data/public/libs/codemirror/mode/rpm/spec/spec.css +5 -0
- data/public/libs/codemirror/mode/rpm/spec/spec.js +66 -0
- data/public/libs/codemirror/mode/rst/LICENSE.txt +21 -0
- data/public/libs/codemirror/mode/rst/index.html +524 -0
- data/public/libs/codemirror/mode/rst/rst.js +550 -0
- data/public/libs/codemirror/mode/ruby/LICENSE +24 -0
- data/public/libs/codemirror/mode/ruby/index.html +173 -0
- data/public/libs/codemirror/mode/ruby/ruby.js +197 -0
- data/public/libs/codemirror/mode/rust/index.html +48 -0
- data/public/libs/codemirror/mode/rust/rust.js +432 -0
- data/public/libs/codemirror/mode/sass/index.html +54 -0
- data/public/libs/codemirror/mode/sass/sass.js +349 -0
- data/public/libs/codemirror/mode/scheme/index.html +65 -0
- data/public/libs/codemirror/mode/scheme/scheme.js +230 -0
- data/public/libs/codemirror/mode/shell/index.html +51 -0
- data/public/libs/codemirror/mode/shell/shell.js +118 -0
- data/public/libs/codemirror/mode/sieve/LICENSE +19 -0
- data/public/libs/codemirror/mode/sieve/index.html +81 -0
- data/public/libs/codemirror/mode/sieve/sieve.js +183 -0
- data/public/libs/codemirror/mode/smalltalk/index.html +57 -0
- data/public/libs/codemirror/mode/smalltalk/smalltalk.js +141 -0
- data/public/libs/codemirror/mode/smarty/index.html +83 -0
- data/public/libs/codemirror/mode/smarty/smarty.js +148 -0
- data/public/libs/codemirror/mode/sparql/index.html +42 -0
- data/public/libs/codemirror/mode/sparql/sparql.js +143 -0
- data/public/libs/codemirror/mode/sql/index.html +68 -0
- data/public/libs/codemirror/mode/sql/sql.js +268 -0
- data/public/libs/codemirror/mode/stex/index.html +98 -0
- data/public/libs/codemirror/mode/stex/stex.js +246 -0
- data/public/libs/codemirror/mode/stex/test.js +117 -0
- data/public/libs/codemirror/mode/tcl/index.html +129 -0
- data/public/libs/codemirror/mode/tcl/tcl.js +131 -0
- data/public/libs/codemirror/mode/tiddlywiki/index.html +142 -0
- data/public/libs/codemirror/mode/tiddlywiki/tiddlywiki.css +14 -0
- data/public/libs/codemirror/mode/tiddlywiki/tiddlywiki.js +353 -0
- data/public/libs/codemirror/mode/tiki/index.html +81 -0
- data/public/libs/codemirror/mode/tiki/tiki.css +26 -0
- data/public/libs/codemirror/mode/tiki/tiki.js +308 -0
- data/public/libs/codemirror/mode/turtle/index.html +39 -0
- data/public/libs/codemirror/mode/turtle/turtle.js +145 -0
- data/public/libs/codemirror/mode/vb/LICENSE.txt +21 -0
- data/public/libs/codemirror/mode/vb/index.html +88 -0
- data/public/libs/codemirror/mode/vb/vb.js +259 -0
- data/public/libs/codemirror/mode/vbscript/index.html +42 -0
- data/public/libs/codemirror/mode/vbscript/vbscript.js +26 -0
- data/public/libs/codemirror/mode/velocity/index.html +103 -0
- data/public/libs/codemirror/mode/velocity/velocity.js +144 -0
- data/public/libs/codemirror/mode/verilog/index.html +121 -0
- data/public/libs/codemirror/mode/verilog/verilog.js +182 -0
- data/public/libs/codemirror/mode/xml/index.html +45 -0
- data/public/libs/codemirror/mode/xml/xml.js +328 -0
- data/public/libs/codemirror/mode/xquery/LICENSE +20 -0
- data/public/libs/codemirror/mode/xquery/index.html +221 -0
- data/public/libs/codemirror/mode/xquery/test.js +64 -0
- data/public/libs/codemirror/mode/xquery/xquery.js +450 -0
- data/public/libs/codemirror/mode/yaml/index.html +68 -0
- data/public/libs/codemirror/mode/yaml/yaml.js +95 -0
- data/public/libs/codemirror/mode/z80/index.html +39 -0
- data/public/libs/codemirror/mode/z80/z80.js +85 -0
- data/public/libs/codemirror/package.json +21 -0
- data/public/libs/codemirror/test/doc_test.js +329 -0
- data/public/libs/codemirror/test/driver.js +138 -0
- data/public/libs/codemirror/test/index.html +182 -0
- data/public/libs/codemirror/test/lint/acorn.js +1593 -0
- data/public/libs/codemirror/test/lint/lint.js +112 -0
- data/public/libs/codemirror/test/lint/parse-js.js +1372 -0
- data/public/libs/codemirror/test/lint/walk.js +216 -0
- data/public/libs/codemirror/test/mode_test.css +10 -0
- data/public/libs/codemirror/test/mode_test.js +192 -0
- data/public/libs/codemirror/test/phantom_driver.js +31 -0
- data/public/libs/codemirror/test/run.js +33 -0
- data/public/libs/codemirror/test/test.js +1400 -0
- data/public/libs/codemirror/test/vim_test.js +1688 -0
- data/public/libs/codemirror/theme/ambiance-mobile.css +5 -0
- data/public/libs/codemirror/theme/ambiance.css +75 -0
- data/public/libs/codemirror/theme/blackboard.css +25 -0
- data/public/libs/codemirror/theme/cobalt.css +18 -0
- data/public/libs/codemirror/theme/eclipse.css +25 -0
- data/public/libs/codemirror/theme/elegant.css +10 -0
- data/public/libs/codemirror/theme/erlang-dark.css +21 -0
- data/public/libs/codemirror/theme/lesser-dark.css +44 -0
- data/public/libs/codemirror/theme/midnight.css +52 -0
- data/public/libs/codemirror/theme/monokai.css +28 -0
- data/public/libs/codemirror/theme/neat.css +9 -0
- data/public/libs/codemirror/theme/night.css +21 -0
- data/public/libs/codemirror/theme/rubyblue.css +21 -0
- data/public/libs/codemirror/theme/solarized.css +207 -0
- data/public/libs/codemirror/theme/twilight.css +26 -0
- data/public/libs/codemirror/theme/vibrant-ink.css +27 -0
- data/public/libs/codemirror/theme/xq-dark.css +46 -0
- data/public/libs/codemirror/theme/xq-light.css +43 -0
- data/public/libs/font-awesome/css/font-awesome-ie7.css +983 -0
- data/public/libs/font-awesome/css/font-awesome-ie7.min.css +24 -0
- data/public/libs/font-awesome/css/font-awesome.css +1268 -0
- data/public/libs/font-awesome/css/font-awesome.min.css +24 -0
- data/public/libs/font-awesome/font/FontAwesome.otf +0 -0
- data/public/libs/font-awesome/font/fontawesome-webfont.eot +0 -0
- data/public/libs/font-awesome/font/fontawesome-webfont.svg +339 -0
- data/public/libs/font-awesome/font/fontawesome-webfont.ttf +0 -0
- data/public/libs/font-awesome/font/fontawesome-webfont.woff +0 -0
- data/public/libs/font-awesome/less/bootstrap.less +78 -0
- data/public/libs/font-awesome/less/core.less +132 -0
- data/public/libs/font-awesome/less/extras.less +79 -0
- data/public/libs/font-awesome/less/font-awesome-ie7.less +413 -0
- data/public/libs/font-awesome/less/font-awesome.less +32 -0
- data/public/libs/font-awesome/less/icons.less +330 -0
- data/public/libs/font-awesome/less/mixins.less +34 -0
- data/public/libs/font-awesome/less/path.less +15 -0
- data/public/libs/font-awesome/less/variables.less +9 -0
- data/public/libs/jquery-1.10.0.min.js +6 -0
- data/public/libs/jquery-ui.min.js +12 -0
- data/public/libs/jquery.jsPlumb-1.4.0-all.js +9571 -0
- data/public/libs/jquery.livequery.js +226 -0
- data/public/libs/jsPlumbInitializer.js +72 -0
- data/public/libs/jstree/README.txt +10 -0
- data/public/libs/jstree/_demo/_dump.sql +20 -0
- data/public/libs/jstree/_demo/_inc/__mysql_errors.log +0 -0
- data/public/libs/jstree/_demo/_inc/class._database.php +146 -0
- data/public/libs/jstree/_demo/_inc/class._database_i.php +152 -0
- data/public/libs/jstree/_demo/_inc/class.tree.php +602 -0
- data/public/libs/jstree/_demo/_install.txt +6 -0
- data/public/libs/jstree/_demo/config.php +14 -0
- data/public/libs/jstree/_demo/file.png +0 -0
- data/public/libs/jstree/_demo/folder.png +0 -0
- data/public/libs/jstree/_demo/index.html +461 -0
- data/public/libs/jstree/_demo/root.png +0 -0
- data/public/libs/jstree/_demo/server.php +69 -0
- data/public/libs/jstree/_docs/!style.css +48 -0
- data/public/libs/jstree/_docs/_drive.png +0 -0
- data/public/libs/jstree/_docs/_html_data.html +2 -0
- data/public/libs/jstree/_docs/_json_data.json +4 -0
- data/public/libs/jstree/_docs/_search_data.json +6 -0
- data/public/libs/jstree/_docs/_search_result.json +1 -0
- data/public/libs/jstree/_docs/_xml_flat.xml +12 -0
- data/public/libs/jstree/_docs/_xml_nest.xml +18 -0
- data/public/libs/jstree/_docs/checkbox.html +171 -0
- data/public/libs/jstree/_docs/contextmenu.html +121 -0
- data/public/libs/jstree/_docs/cookies.html +97 -0
- data/public/libs/jstree/_docs/core.html +689 -0
- data/public/libs/jstree/_docs/crrm.html +316 -0
- data/public/libs/jstree/_docs/dnd.html +199 -0
- data/public/libs/jstree/_docs/hotkeys.html +82 -0
- data/public/libs/jstree/_docs/html_data.html +175 -0
- data/public/libs/jstree/_docs/index.html +86 -0
- data/public/libs/jstree/_docs/json_data.html +249 -0
- data/public/libs/jstree/_docs/languages.html +152 -0
- data/public/libs/jstree/_docs/logo.png +0 -0
- data/public/libs/jstree/_docs/search.html +153 -0
- data/public/libs/jstree/_docs/sort.html +85 -0
- data/public/libs/jstree/_docs/syntax/!script.js +2232 -0
- data/public/libs/jstree/_docs/syntax/!style.css +511 -0
- data/public/libs/jstree/_docs/syntax/clipboard.swf +0 -0
- data/public/libs/jstree/_docs/syntax/help.png +0 -0
- data/public/libs/jstree/_docs/syntax/magnifier.png +0 -0
- data/public/libs/jstree/_docs/syntax/page_white_code.png +0 -0
- data/public/libs/jstree/_docs/syntax/page_white_copy.png +0 -0
- data/public/libs/jstree/_docs/syntax/printer.png +0 -0
- data/public/libs/jstree/_docs/syntax/wrapping.png +0 -0
- data/public/libs/jstree/_docs/themeroller.html +107 -0
- data/public/libs/jstree/_docs/themes.html +127 -0
- data/public/libs/jstree/_docs/types.html +178 -0
- data/public/libs/jstree/_docs/ui.html +197 -0
- data/public/libs/jstree/_docs/unique.html +85 -0
- data/public/libs/jstree/_docs/xml_data.html +218 -0
- data/public/libs/jstree/_lib/jquery.cookie.js +96 -0
- data/public/libs/jstree/_lib/jquery.hotkeys.js +99 -0
- data/public/libs/jstree/_lib/jquery.js +5 -0
- data/public/libs/jstree/jquery.jstree.js +4564 -0
- data/public/libs/jstree/themes/apple/bg.jpg +0 -0
- data/public/libs/jstree/themes/apple/d.png +0 -0
- data/public/libs/jstree/themes/apple/dot_for_ie.gif +0 -0
- data/public/libs/jstree/themes/apple/style.css +61 -0
- data/public/libs/jstree/themes/apple/throbber.gif +0 -0
- data/public/libs/jstree/themes/classic/d.gif +0 -0
- data/public/libs/jstree/themes/classic/d.png +0 -0
- data/public/libs/jstree/themes/classic/dot_for_ie.gif +0 -0
- data/public/libs/jstree/themes/classic/style.css +77 -0
- data/public/libs/jstree/themes/classic/throbber.gif +0 -0
- data/public/libs/jstree/themes/default-rtl/d.gif +0 -0
- data/public/libs/jstree/themes/default-rtl/d.png +0 -0
- data/public/libs/jstree/themes/default-rtl/dots.gif +0 -0
- data/public/libs/jstree/themes/default-rtl/style.css +84 -0
- data/public/libs/jstree/themes/default-rtl/throbber.gif +0 -0
- data/public/libs/jstree/themes/default/d.gif +0 -0
- data/public/libs/jstree/themes/default/d.png +0 -0
- data/public/libs/jstree/themes/default/style.css +74 -0
- data/public/libs/jstree/themes/default/throbber.gif +0 -0
- data/public/themes/geo-bootstrap/README.md +25 -0
- data/public/themes/geo-bootstrap/img/flames.gif +0 -0
- data/public/themes/geo-bootstrap/img/glyphicons-halflings-white.png +0 -0
- data/public/themes/geo-bootstrap/img/glyphicons-halflings.png +0 -0
- data/public/themes/geo-bootstrap/img/microfab.gif +0 -0
- data/public/themes/geo-bootstrap/img/progress.gif +0 -0
- data/public/themes/geo-bootstrap/img/rainbow.gif +0 -0
- data/public/themes/geo-bootstrap/img/stars.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/7upspot.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/americanflag.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/community.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/computer-01.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/computer.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/construction.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/counter.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/counter2.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/divider.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/divider1.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/divider2.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/divider3.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/divider4.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/drudgesiren.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/emailme.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/funky.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/geocities.jpg +0 -0
- data/public/themes/geo-bootstrap/img/test/hacker.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/heart.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/hot.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/ie_logo.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/mailkitten.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/mchammer.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/new.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/new2.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/noframes.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/notepad.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/ns_logo.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/sign-in.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/spinningearth.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/underconstruction.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/wabwalk.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/webtrips.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/yahooweek.gif +0 -0
- data/public/themes/geo-bootstrap/package.json +21 -0
- data/public/themes/geo-bootstrap/swatch/bootstrap-responsive.css +1109 -0
- data/public/themes/geo-bootstrap/swatch/bootstrap-responsive.min.css +9 -0
- data/public/themes/geo-bootstrap/swatch/bootstrap.css +6462 -0
- data/public/themes/geo-bootstrap/swatch/bootstrap.min.css +9 -0
- metadata +791 -0
|
@@ -0,0 +1,3148 @@
|
|
|
1
|
+
Smalltalk current createPackage: 'Maglev-Database-Explorer' properties: #{}!
|
|
2
|
+
Widget subclass: #MaglevDraggableObject
|
|
3
|
+
instanceVariableNames: 'content'
|
|
4
|
+
package: 'Maglev-Database-Explorer'!
|
|
5
|
+
|
|
6
|
+
!MaglevDraggableObject methodsFor: 'accessing'!
|
|
7
|
+
|
|
8
|
+
content
|
|
9
|
+
^ content
|
|
10
|
+
!
|
|
11
|
+
|
|
12
|
+
content: anObject
|
|
13
|
+
content := anObject.
|
|
14
|
+
! !
|
|
15
|
+
|
|
16
|
+
!MaglevDraggableObject methodsFor: 'rendering'!
|
|
17
|
+
|
|
18
|
+
renderOn: html
|
|
19
|
+
html div
|
|
20
|
+
class: 'draggable-new-object-container'
|
|
21
|
+
with: [
|
|
22
|
+
html div
|
|
23
|
+
class: 'ui-widget-content ui-draggable draggable-new-object';
|
|
24
|
+
with: [
|
|
25
|
+
html div
|
|
26
|
+
class: 'object-drag-dummy';
|
|
27
|
+
style: 'display: none;';
|
|
28
|
+
with: MaglevIcon move;
|
|
29
|
+
with: content.
|
|
30
|
+
html div
|
|
31
|
+
class: 'object-iv-name';
|
|
32
|
+
with: content]].
|
|
33
|
+
! !
|
|
34
|
+
|
|
35
|
+
!MaglevDraggableObject class methodsFor: 'not yet classified'!
|
|
36
|
+
|
|
37
|
+
with: anObject
|
|
38
|
+
^ self basicNew
|
|
39
|
+
content: anObject;
|
|
40
|
+
initialize;
|
|
41
|
+
yourself
|
|
42
|
+
! !
|
|
43
|
+
|
|
44
|
+
Widget subclass: #MaglevGsNMethodEditor
|
|
45
|
+
instanceVariableNames: 'object editorContainer errorBox rubyIcon stIcon envIdContainer sourceLocationContainer editor editorHeight editorWidth classObject'
|
|
46
|
+
package: 'Maglev-Database-Explorer'!
|
|
47
|
+
|
|
48
|
+
!MaglevGsNMethodEditor methodsFor: 'accessing'!
|
|
49
|
+
|
|
50
|
+
classObject
|
|
51
|
+
^ MaglevObject newObjectWithoutUpdate: (self methodObject at: 5)
|
|
52
|
+
!
|
|
53
|
+
|
|
54
|
+
classObject: anObject
|
|
55
|
+
classObject := anObject.
|
|
56
|
+
!
|
|
57
|
+
|
|
58
|
+
envId
|
|
59
|
+
^ self methodObject at: 2
|
|
60
|
+
!
|
|
61
|
+
|
|
62
|
+
filename
|
|
63
|
+
^ (self methodObject at: 4) at: 1
|
|
64
|
+
!
|
|
65
|
+
|
|
66
|
+
lineInFile
|
|
67
|
+
^ (self methodObject at: 4) at: 2
|
|
68
|
+
!
|
|
69
|
+
|
|
70
|
+
methodObject
|
|
71
|
+
^ object
|
|
72
|
+
!
|
|
73
|
+
|
|
74
|
+
object
|
|
75
|
+
^ object
|
|
76
|
+
!
|
|
77
|
+
|
|
78
|
+
object: anObject
|
|
79
|
+
object := anObject
|
|
80
|
+
!
|
|
81
|
+
|
|
82
|
+
sourceOffset
|
|
83
|
+
^ -1
|
|
84
|
+
!
|
|
85
|
+
|
|
86
|
+
sourceString
|
|
87
|
+
^ self methodObject at: 1
|
|
88
|
+
! !
|
|
89
|
+
|
|
90
|
+
!MaglevGsNMethodEditor methodsFor: 'initializing'!
|
|
91
|
+
|
|
92
|
+
initializeEditor
|
|
93
|
+
|params extraKeys|
|
|
94
|
+
extraKeys := Object new
|
|
95
|
+
basicAt: 'Ctrl-S' put: [self commandSave];
|
|
96
|
+
yourself.
|
|
97
|
+
params := Object new
|
|
98
|
+
basicAt: 'mode' put: 'text/x-ruby';
|
|
99
|
+
basicAt: 'styleActiveLine' put: true;
|
|
100
|
+
basicAt: 'lineNumbers' put: true;
|
|
101
|
+
basicAt: 'matchBrackets' put: true;
|
|
102
|
+
basicAt: 'extraKeys' put: extraKeys;
|
|
103
|
+
yourself.
|
|
104
|
+
editor := CodeMirror value: (editorContainer asJQuery at: 0) value: params.
|
|
105
|
+
editor setValue: ''.
|
|
106
|
+
self mouseFix.
|
|
107
|
+
self makeEditorResizable.
|
|
108
|
+
!
|
|
109
|
+
|
|
110
|
+
makeEditorResizable
|
|
111
|
+
< self['@editorContainer']._asJQuery().find('.CodeMirror').resizable({
|
|
112
|
+
resize: function() {
|
|
113
|
+
self['@editor'].setSize($(this).width(), $(this).height());
|
|
114
|
+
}
|
|
115
|
+
}); >
|
|
116
|
+
!
|
|
117
|
+
|
|
118
|
+
mouseFix
|
|
119
|
+
< var editor = self['@editorContainer'];
|
|
120
|
+
editor._asJQuery().mousedown(function (event) {
|
|
121
|
+
event.preventDefault();
|
|
122
|
+
return false;
|
|
123
|
+
}); >
|
|
124
|
+
! !
|
|
125
|
+
|
|
126
|
+
!MaglevGsNMethodEditor methodsFor: 'interactions'!
|
|
127
|
+
|
|
128
|
+
commandSave
|
|
129
|
+
|selectedCategory|
|
|
130
|
+
errorBox hide.
|
|
131
|
+
errorBox asJQuery empty.
|
|
132
|
+
self envId = 1
|
|
133
|
+
ifTrue: [self classObject
|
|
134
|
+
compileRubySourceCode: (editor getValue replace: '⚡' with: '')
|
|
135
|
+
withCallback: [:success :obj |
|
|
136
|
+
success
|
|
137
|
+
ifTrue: [self signalSuccess]
|
|
138
|
+
ifFalse: [self signalFailure: obj]]]
|
|
139
|
+
ifFalse: [self classObject
|
|
140
|
+
compileSmalltalkSourceCode: (editor getValue replace: '⚡' with: '')
|
|
141
|
+
withCallback: [:success :obj |
|
|
142
|
+
success
|
|
143
|
+
ifTrue: [self signalSuccess]
|
|
144
|
+
ifFalse: [self signalFailure: obj]]].
|
|
145
|
+
!
|
|
146
|
+
|
|
147
|
+
signalFailure: aDescription
|
|
148
|
+
|html|
|
|
149
|
+
html := HTMLCanvas onJQuery: errorBox asJQuery.
|
|
150
|
+
html with: aDescription inlineViewComponent.
|
|
151
|
+
errorBox show.
|
|
152
|
+
editorContainer asJQuery css: 'background-color' with: '#ff0039'.
|
|
153
|
+
editorContainer asJQuery animate: (Object new basicAt: 'backgroundColor' put: '#ffffff'; yourself) timeout: 250.
|
|
154
|
+
!
|
|
155
|
+
|
|
156
|
+
signalSuccess
|
|
157
|
+
editorContainer asJQuery css: 'background-color' with: '#3fb618'.
|
|
158
|
+
editorContainer asJQuery animate: (Object new basicAt: 'backgroundColor' put: '#ffffff'; yourself) timeout: 250.
|
|
159
|
+
! !
|
|
160
|
+
|
|
161
|
+
!MaglevGsNMethodEditor methodsFor: 'rendering'!
|
|
162
|
+
|
|
163
|
+
renderEditorOn: html
|
|
164
|
+
editorContainer := html span
|
|
165
|
+
class: 'pull-left code-area'.
|
|
166
|
+
html div style: 'clear: both;'.
|
|
167
|
+
errorBox := html div
|
|
168
|
+
class: 'alert alert-error';
|
|
169
|
+
style: 'margin-bottom: 0px;';
|
|
170
|
+
hide.
|
|
171
|
+
self initializeEditor.
|
|
172
|
+
!
|
|
173
|
+
|
|
174
|
+
renderMethodObject
|
|
175
|
+
|envId|
|
|
176
|
+
editor setValue: self sourceString.
|
|
177
|
+
editorContainer show.
|
|
178
|
+
envId := self envId.
|
|
179
|
+
envIdContainer asJQuery empty.
|
|
180
|
+
envIdContainer with: envId.
|
|
181
|
+
sourceLocationContainer empty.
|
|
182
|
+
envId = 1
|
|
183
|
+
ifTrue: [
|
|
184
|
+
sourceLocationContainer with: self filename.
|
|
185
|
+
stIcon hide. rubyIcon show.
|
|
186
|
+
editor setOption: 'mode' data: 'text/x-ruby'.]
|
|
187
|
+
ifFalse: [sourceLocationContainer with: 'n/a'].
|
|
188
|
+
envId = 0 ifTrue: [
|
|
189
|
+
stIcon show. rubyIcon hide.
|
|
190
|
+
editor setOption: 'mode' data: 'text/x-stsrc'].
|
|
191
|
+
envId > 1
|
|
192
|
+
ifTrue: [stIcon hide. rubyIcon hide].
|
|
193
|
+
!
|
|
194
|
+
|
|
195
|
+
renderOn: html
|
|
196
|
+
self renderEditorOn: html.
|
|
197
|
+
self renderStatusBarOn: html.
|
|
198
|
+
self renderMethodObject.
|
|
199
|
+
!
|
|
200
|
+
|
|
201
|
+
renderStatusBarOn: html
|
|
202
|
+
html table
|
|
203
|
+
class: 'table-bordered';
|
|
204
|
+
style: 'margin-top: 5px; width: 100%;';
|
|
205
|
+
with: [html tbody with: [
|
|
206
|
+
html tr with: [
|
|
207
|
+
html td with: [
|
|
208
|
+
rubyIcon := MaglevIconImage ruby hide; yourself.
|
|
209
|
+
stIcon := MaglevIconImage smalltalk hide; yourself.
|
|
210
|
+
html with: rubyIcon.
|
|
211
|
+
html with: stIcon.
|
|
212
|
+
envIdContainer := html span with: 'Environment ID'];
|
|
213
|
+
style: 'width: 1px;'.
|
|
214
|
+
html td with: [
|
|
215
|
+
sourceLocationContainer := html span with: 'Source location']]]].
|
|
216
|
+
! !
|
|
217
|
+
|
|
218
|
+
!MaglevGsNMethodEditor class methodsFor: 'instance creation'!
|
|
219
|
+
|
|
220
|
+
for: anObject
|
|
221
|
+
^ self basicNew
|
|
222
|
+
object: anObject;
|
|
223
|
+
initialize;
|
|
224
|
+
yourself
|
|
225
|
+
! !
|
|
226
|
+
|
|
227
|
+
MaglevGsNMethodEditor subclass: #MaglevGsNMethodDebugEditor
|
|
228
|
+
instanceVariableNames: 'argValueBox argSelect'
|
|
229
|
+
package: 'Maglev-Database-Explorer'!
|
|
230
|
+
!MaglevGsNMethodDebugEditor commentStamp!
|
|
231
|
+
Copied from _frameContentsAt:
|
|
232
|
+
|
|
233
|
+
"Private. Returns an Array describing the specified level in the receiver.
|
|
234
|
+
aLevel == 1 is top of stack. If aLevel is less than 1 or greater than
|
|
235
|
+
stackDepth, returns nil.
|
|
236
|
+
|
|
237
|
+
The result Array contains:
|
|
238
|
+
offset item
|
|
239
|
+
----- -----
|
|
240
|
+
1 gsMethod (a GsNMethod)
|
|
241
|
+
2 ipOffset (zero-based relative to first named instance variable in portable code;
|
|
242
|
+
negative means a stack breakpoint is present)
|
|
243
|
+
3 frameOffset (zero-based)
|
|
244
|
+
4 varContext
|
|
245
|
+
5 saveProtectedMode
|
|
246
|
+
6 markerOrException
|
|
247
|
+
7 nil (not used)
|
|
248
|
+
8 self (possibly nil in a ComplexBlock)
|
|
249
|
+
9 argAndTempNames (an Array of Symbols or Strings)
|
|
250
|
+
10 receiver
|
|
251
|
+
11 arguments and temps, if any"!
|
|
252
|
+
|
|
253
|
+
!MaglevGsNMethodDebugEditor methodsFor: 'accessing'!
|
|
254
|
+
|
|
255
|
+
argAndTempNames
|
|
256
|
+
^ object at: 9
|
|
257
|
+
!
|
|
258
|
+
|
|
259
|
+
argOrTempValue: anInteger
|
|
260
|
+
^ MaglevObject newObject: ((object at: 11) at: anInteger)
|
|
261
|
+
!
|
|
262
|
+
|
|
263
|
+
methodObject
|
|
264
|
+
^ object at: 1
|
|
265
|
+
!
|
|
266
|
+
|
|
267
|
+
ownerSelf
|
|
268
|
+
^ MaglevObject newObject: (object at: 8)
|
|
269
|
+
!
|
|
270
|
+
|
|
271
|
+
receiver
|
|
272
|
+
^ MaglevObject newObject: (object at: 10)
|
|
273
|
+
!
|
|
274
|
+
|
|
275
|
+
sourceOffset
|
|
276
|
+
^ object at: 12
|
|
277
|
+
!
|
|
278
|
+
|
|
279
|
+
sourceOffsetX
|
|
280
|
+
^ (object at: 13) at: 1
|
|
281
|
+
!
|
|
282
|
+
|
|
283
|
+
sourceOffsetY
|
|
284
|
+
^ (object at: 13) at: 2
|
|
285
|
+
! !
|
|
286
|
+
|
|
287
|
+
!MaglevGsNMethodDebugEditor methodsFor: 'rendering'!
|
|
288
|
+
|
|
289
|
+
renderArg
|
|
290
|
+
|argIndex argValue|
|
|
291
|
+
argIndex := (argSelect asJQuery at: 0) selectedIndex - 1.
|
|
292
|
+
argIndex = -1
|
|
293
|
+
ifTrue: [argValue := self ownerSelf].
|
|
294
|
+
argIndex = 0
|
|
295
|
+
ifTrue: [argValue := self receiver].
|
|
296
|
+
argIndex > 0
|
|
297
|
+
ifTrue: [argValue := self argOrTempValue: argIndex].
|
|
298
|
+
argValueBox asJQuery empty.
|
|
299
|
+
argValueBox with: argValue inlineViewComponent.
|
|
300
|
+
!
|
|
301
|
+
|
|
302
|
+
renderArgsOn: html
|
|
303
|
+
html table with: [
|
|
304
|
+
html tbody with: [
|
|
305
|
+
html tr with: [
|
|
306
|
+
html td with: [
|
|
307
|
+
argSelect := html select
|
|
308
|
+
with: [html option with: '(self)'];
|
|
309
|
+
with: [html option with: '(receiver)'];
|
|
310
|
+
with: [self argAndTempNames do: [:arg |
|
|
311
|
+
html option with: arg]];
|
|
312
|
+
style: 'margin-bottom: 0px;';
|
|
313
|
+
onChange: [self renderArg].
|
|
314
|
+
argValueBox := html div].
|
|
315
|
+
html td
|
|
316
|
+
with: [argValueBox := html div];
|
|
317
|
+
style: 'padding-left: 5px;']]];
|
|
318
|
+
style: 'margin-top: 5px;'.
|
|
319
|
+
self renderArg.
|
|
320
|
+
!
|
|
321
|
+
|
|
322
|
+
renderMethodObject
|
|
323
|
+
|rangeFrom rangeTo|
|
|
324
|
+
super renderMethodObject.
|
|
325
|
+
< self['@editor'].setSelection(
|
|
326
|
+
{line: self._sourceOffsetY(), ch: self._sourceOffsetX()},
|
|
327
|
+
{line: self._sourceOffsetY(), ch: self._sourceOffsetX()}); >.
|
|
328
|
+
editor replaceSelection: '⚡'.
|
|
329
|
+
!
|
|
330
|
+
|
|
331
|
+
renderOn: html
|
|
332
|
+
self renderEditorOn: html.
|
|
333
|
+
self renderArgsOn: html.
|
|
334
|
+
self renderStatusBarOn: html.
|
|
335
|
+
self renderMethodObject.
|
|
336
|
+
! !
|
|
337
|
+
|
|
338
|
+
Object subclass: #MaglevHaltedThreadListener
|
|
339
|
+
instanceVariableNames: 'container interval timer renderedOops html navbar'
|
|
340
|
+
package: 'Maglev-Database-Explorer'!
|
|
341
|
+
|
|
342
|
+
!MaglevHaltedThreadListener methodsFor: 'accessing'!
|
|
343
|
+
|
|
344
|
+
interval
|
|
345
|
+
interval ifNil: [interval := 2500].
|
|
346
|
+
^ interval
|
|
347
|
+
!
|
|
348
|
+
|
|
349
|
+
interval: aNumber
|
|
350
|
+
interval := aNumber.
|
|
351
|
+
< clearInterval(self['@timer']); >.
|
|
352
|
+
self startPolling.
|
|
353
|
+
! !
|
|
354
|
+
|
|
355
|
+
!MaglevHaltedThreadListener methodsFor: 'initializing'!
|
|
356
|
+
|
|
357
|
+
initialize
|
|
358
|
+
container := '#halted-threads-navigation' asJQuery.
|
|
359
|
+
navbar := '#halted-threads-navbar' asJQuery.
|
|
360
|
+
navbar hide.
|
|
361
|
+
html := HTMLCanvas onJQuery: container.
|
|
362
|
+
renderedOops := Dictionary new.
|
|
363
|
+
!
|
|
364
|
+
|
|
365
|
+
start
|
|
366
|
+
timer := self startPolling.
|
|
367
|
+
!
|
|
368
|
+
|
|
369
|
+
startPolling
|
|
370
|
+
< return setInterval(function() {self._refresh();}, self._interval()); >
|
|
371
|
+
! !
|
|
372
|
+
|
|
373
|
+
!MaglevHaltedThreadListener methodsFor: 'polling'!
|
|
374
|
+
|
|
375
|
+
refresh
|
|
376
|
+
|params|
|
|
377
|
+
params := Dictionary new
|
|
378
|
+
at: 'allElements' put: true;
|
|
379
|
+
at: 'noBehavior' put: true;
|
|
380
|
+
yourself.
|
|
381
|
+
MaglevObjectSpace instance evalObject
|
|
382
|
+
evaluateWithoutUpdate: 'MaglevDatabaseExplorer.halted_threads'
|
|
383
|
+
language: 'ruby'
|
|
384
|
+
with: params
|
|
385
|
+
withCallback: [:success :obj | |currentOops|
|
|
386
|
+
success ifTrue:[
|
|
387
|
+
currentOops := Set new.
|
|
388
|
+
obj do: [:el |
|
|
389
|
+
(renderedOops includesKey: el oop)
|
|
390
|
+
ifFalse: [self renderObject: el oop with: el inlineViewComponent].
|
|
391
|
+
currentOops add: el oop].
|
|
392
|
+
renderedOops keysAndValuesDo: [:oop :comp |
|
|
393
|
+
(currentOops includes: oop)
|
|
394
|
+
ifFalse: [self removeObject: oop with: comp]].
|
|
395
|
+
renderedOops size = 0
|
|
396
|
+
ifTrue: [navbar hide]
|
|
397
|
+
ifFalse: [navbar show]]].
|
|
398
|
+
!
|
|
399
|
+
|
|
400
|
+
removeObject: oop with: component
|
|
401
|
+
component asJQuery remove.
|
|
402
|
+
renderedOops removeKey: oop.
|
|
403
|
+
!
|
|
404
|
+
|
|
405
|
+
renderObject: oop with: component
|
|
406
|
+
|inlineContainer|
|
|
407
|
+
inlineContainer := html span
|
|
408
|
+
style: 'padding: 4px 2px 2px 4px;';
|
|
409
|
+
with: component.
|
|
410
|
+
renderedOops at: oop put: inlineContainer.
|
|
411
|
+
! !
|
|
412
|
+
|
|
413
|
+
MaglevHaltedThreadListener class instanceVariableNames: 'instance'!
|
|
414
|
+
|
|
415
|
+
!MaglevHaltedThreadListener class methodsFor: 'instance creation'!
|
|
416
|
+
|
|
417
|
+
instance
|
|
418
|
+
instance ifNil: [instance := self new].
|
|
419
|
+
^ instance
|
|
420
|
+
!
|
|
421
|
+
|
|
422
|
+
start
|
|
423
|
+
self instance start.
|
|
424
|
+
! !
|
|
425
|
+
|
|
426
|
+
Widget subclass: #MaglevIcon
|
|
427
|
+
instanceVariableNames: 'b icon spin caption'
|
|
428
|
+
package: 'Maglev-Database-Explorer'!
|
|
429
|
+
|
|
430
|
+
!MaglevIcon methodsFor: 'accessing'!
|
|
431
|
+
|
|
432
|
+
caption
|
|
433
|
+
^ caption
|
|
434
|
+
!
|
|
435
|
+
|
|
436
|
+
caption: aString
|
|
437
|
+
caption := aString.
|
|
438
|
+
!
|
|
439
|
+
|
|
440
|
+
icon
|
|
441
|
+
icon ifNil: [icon := 'star'].
|
|
442
|
+
^ icon
|
|
443
|
+
!
|
|
444
|
+
|
|
445
|
+
icon: aString
|
|
446
|
+
icon := aString.
|
|
447
|
+
!
|
|
448
|
+
|
|
449
|
+
onClick: aBlock
|
|
450
|
+
b onClick: aBlock.
|
|
451
|
+
!
|
|
452
|
+
|
|
453
|
+
spin
|
|
454
|
+
spin ifNil: [spin := false].
|
|
455
|
+
^ spin
|
|
456
|
+
!
|
|
457
|
+
|
|
458
|
+
spin: aBoolean
|
|
459
|
+
spin := aBoolean.
|
|
460
|
+
! !
|
|
461
|
+
|
|
462
|
+
!MaglevIcon methodsFor: 'interactions'!
|
|
463
|
+
|
|
464
|
+
hide
|
|
465
|
+
b hide.
|
|
466
|
+
!
|
|
467
|
+
|
|
468
|
+
show
|
|
469
|
+
b show.
|
|
470
|
+
! !
|
|
471
|
+
|
|
472
|
+
!MaglevIcon methodsFor: 'rendering'!
|
|
473
|
+
|
|
474
|
+
renderOn: html
|
|
475
|
+
|cssClass|
|
|
476
|
+
cssClass := 'icon-', self icon.
|
|
477
|
+
self spin
|
|
478
|
+
ifTrue: [cssClass := cssClass, ' icon-spin'].
|
|
479
|
+
caption
|
|
480
|
+
ifNil: [b := html b
|
|
481
|
+
class: cssClass;
|
|
482
|
+
yourself]
|
|
483
|
+
ifNotNil: [b := html b
|
|
484
|
+
class: cssClass;
|
|
485
|
+
data: 'toggle' with: 'tooltip';
|
|
486
|
+
data: 'placement' with: 'top';
|
|
487
|
+
data: 'original-title' with: caption;
|
|
488
|
+
yourself.
|
|
489
|
+
b asJQuery tooltip].
|
|
490
|
+
! !
|
|
491
|
+
|
|
492
|
+
!MaglevIcon class methodsFor: 'instance creation'!
|
|
493
|
+
|
|
494
|
+
codeFork
|
|
495
|
+
^ self new
|
|
496
|
+
icon: 'code-fork';
|
|
497
|
+
yourself
|
|
498
|
+
!
|
|
499
|
+
|
|
500
|
+
flag
|
|
501
|
+
^ self new
|
|
502
|
+
icon: 'flag';
|
|
503
|
+
yourself
|
|
504
|
+
!
|
|
505
|
+
|
|
506
|
+
globe
|
|
507
|
+
^ self new
|
|
508
|
+
icon: 'globe';
|
|
509
|
+
yourself
|
|
510
|
+
!
|
|
511
|
+
|
|
512
|
+
hdd
|
|
513
|
+
^ self new
|
|
514
|
+
icon: 'hdd';
|
|
515
|
+
yourself
|
|
516
|
+
!
|
|
517
|
+
|
|
518
|
+
listAlt
|
|
519
|
+
^ self new
|
|
520
|
+
icon: 'list-alt';
|
|
521
|
+
yourself
|
|
522
|
+
!
|
|
523
|
+
|
|
524
|
+
move
|
|
525
|
+
^ self new
|
|
526
|
+
icon: 'move';
|
|
527
|
+
yourself
|
|
528
|
+
!
|
|
529
|
+
|
|
530
|
+
pause
|
|
531
|
+
^ self new
|
|
532
|
+
icon: 'pause';
|
|
533
|
+
yourself
|
|
534
|
+
!
|
|
535
|
+
|
|
536
|
+
pencil
|
|
537
|
+
^ self new
|
|
538
|
+
icon: 'pencil';
|
|
539
|
+
yourself
|
|
540
|
+
!
|
|
541
|
+
|
|
542
|
+
play
|
|
543
|
+
^ self new
|
|
544
|
+
icon: 'play';
|
|
545
|
+
yourself
|
|
546
|
+
!
|
|
547
|
+
|
|
548
|
+
playCircle
|
|
549
|
+
^ self new
|
|
550
|
+
icon: 'play-circle';
|
|
551
|
+
yourself
|
|
552
|
+
!
|
|
553
|
+
|
|
554
|
+
remove
|
|
555
|
+
^ self new
|
|
556
|
+
icon: 'remove';
|
|
557
|
+
yourself
|
|
558
|
+
!
|
|
559
|
+
|
|
560
|
+
resizeSmall
|
|
561
|
+
^ self new
|
|
562
|
+
icon: 'resize-small';
|
|
563
|
+
yourself
|
|
564
|
+
!
|
|
565
|
+
|
|
566
|
+
search
|
|
567
|
+
^ self new
|
|
568
|
+
icon: 'search';
|
|
569
|
+
yourself
|
|
570
|
+
!
|
|
571
|
+
|
|
572
|
+
star
|
|
573
|
+
^ self new
|
|
574
|
+
icon: 'star';
|
|
575
|
+
yourself
|
|
576
|
+
!
|
|
577
|
+
|
|
578
|
+
stop
|
|
579
|
+
^ self new
|
|
580
|
+
icon: 'stop';
|
|
581
|
+
yourself
|
|
582
|
+
!
|
|
583
|
+
|
|
584
|
+
terminal
|
|
585
|
+
^ self new
|
|
586
|
+
icon: 'terminal';
|
|
587
|
+
yourself
|
|
588
|
+
!
|
|
589
|
+
|
|
590
|
+
trash
|
|
591
|
+
^ self new
|
|
592
|
+
icon: 'trash';
|
|
593
|
+
yourself
|
|
594
|
+
!
|
|
595
|
+
|
|
596
|
+
wait
|
|
597
|
+
^ self new
|
|
598
|
+
icon: 'refresh';
|
|
599
|
+
spin: true;
|
|
600
|
+
caption: 'Loading...';
|
|
601
|
+
yourself
|
|
602
|
+
! !
|
|
603
|
+
|
|
604
|
+
Widget subclass: #MaglevIconImage
|
|
605
|
+
instanceVariableNames: 'src cssClass image hidden'
|
|
606
|
+
package: 'Maglev-Database-Explorer'!
|
|
607
|
+
|
|
608
|
+
!MaglevIconImage methodsFor: 'accessing'!
|
|
609
|
+
|
|
610
|
+
cssClass: aString
|
|
611
|
+
cssClass := aString.
|
|
612
|
+
!
|
|
613
|
+
|
|
614
|
+
hidden
|
|
615
|
+
hidden ifNil: [hidden := false].
|
|
616
|
+
^ hidden
|
|
617
|
+
!
|
|
618
|
+
|
|
619
|
+
src: aString
|
|
620
|
+
src := aString.
|
|
621
|
+
! !
|
|
622
|
+
|
|
623
|
+
!MaglevIconImage methodsFor: 'interactions'!
|
|
624
|
+
|
|
625
|
+
hide
|
|
626
|
+
hidden := true.
|
|
627
|
+
image ifNotNil: [image hide].
|
|
628
|
+
!
|
|
629
|
+
|
|
630
|
+
show
|
|
631
|
+
hidden := false.
|
|
632
|
+
image ifNotNil: [image show].
|
|
633
|
+
! !
|
|
634
|
+
|
|
635
|
+
!MaglevIconImage methodsFor: 'rendering'!
|
|
636
|
+
|
|
637
|
+
renderOn: html
|
|
638
|
+
image := html img
|
|
639
|
+
src: src;
|
|
640
|
+
class: cssClass.
|
|
641
|
+
self hidden ifTrue: [image hide].
|
|
642
|
+
! !
|
|
643
|
+
|
|
644
|
+
!MaglevIconImage class methodsFor: 'instance creation'!
|
|
645
|
+
|
|
646
|
+
rails
|
|
647
|
+
^ self new
|
|
648
|
+
src: 'images/rails_tiny.png';
|
|
649
|
+
yourself
|
|
650
|
+
!
|
|
651
|
+
|
|
652
|
+
ruby
|
|
653
|
+
^ self new
|
|
654
|
+
src: 'images/ruby.png';
|
|
655
|
+
cssClass: 'icon-language';
|
|
656
|
+
yourself
|
|
657
|
+
!
|
|
658
|
+
|
|
659
|
+
rubySmalltalkBridge
|
|
660
|
+
^ self new
|
|
661
|
+
src: 'images/ruby_smalltalk_bridge.png';
|
|
662
|
+
cssClass: 'icon-language';
|
|
663
|
+
yourself
|
|
664
|
+
!
|
|
665
|
+
|
|
666
|
+
smalltalk
|
|
667
|
+
^ self new
|
|
668
|
+
src: 'images/smalltalk.png';
|
|
669
|
+
cssClass: 'icon-language';
|
|
670
|
+
yourself
|
|
671
|
+
! !
|
|
672
|
+
|
|
673
|
+
Widget subclass: #MaglevListBox
|
|
674
|
+
instanceVariableNames: 'list changedCallback htmlIv divContainer height searchbox searchInput olContainer olHeightBeforeSearch'
|
|
675
|
+
package: 'Maglev-Database-Explorer'!
|
|
676
|
+
|
|
677
|
+
!MaglevListBox methodsFor: 'accessing'!
|
|
678
|
+
|
|
679
|
+
changedCallback: aBlock
|
|
680
|
+
changedCallback := aBlock.
|
|
681
|
+
!
|
|
682
|
+
|
|
683
|
+
height
|
|
684
|
+
^ olContainer asJQuery height
|
|
685
|
+
!
|
|
686
|
+
|
|
687
|
+
height: anInteger
|
|
688
|
+
|searchboxHeight|
|
|
689
|
+
(searchbox asJQuery is: ':visible')
|
|
690
|
+
ifTrue: [searchboxHeight := searchbox asJQuery height + 2]
|
|
691
|
+
ifFalse: [searchboxHeight := 0].
|
|
692
|
+
height := anInteger.
|
|
693
|
+
olContainer asJQuery css: 'height' data: (anInteger - searchboxHeight) asString, 'px'.
|
|
694
|
+
!
|
|
695
|
+
|
|
696
|
+
selectedData
|
|
697
|
+
^ (list asJQuery find: '.ui-selected') data: 'data'
|
|
698
|
+
!
|
|
699
|
+
|
|
700
|
+
selectedDataIndex
|
|
701
|
+
^ (list asJQuery find: '.ui-selected') index + 1
|
|
702
|
+
!
|
|
703
|
+
|
|
704
|
+
selectedDataVisibleIndex
|
|
705
|
+
^ ((list asJQuery find: 'li:visible') index: (list asJQuery find: 'li.ui-selected')) + 1
|
|
706
|
+
!
|
|
707
|
+
|
|
708
|
+
size
|
|
709
|
+
^ (list asJQuery find: 'li') length
|
|
710
|
+
!
|
|
711
|
+
|
|
712
|
+
sizeVisible
|
|
713
|
+
^ (list asJQuery find: 'li:visible') length
|
|
714
|
+
!
|
|
715
|
+
|
|
716
|
+
style: aString
|
|
717
|
+
divContainer style: aString.
|
|
718
|
+
! !
|
|
719
|
+
|
|
720
|
+
!MaglevListBox methodsFor: 'interactions'!
|
|
721
|
+
|
|
722
|
+
bindEvents
|
|
723
|
+
< self['@list']._asJQuery().selectable({
|
|
724
|
+
stop: function() {self._selectionChanged();},
|
|
725
|
+
tolerance: 'fit'}); >
|
|
726
|
+
!
|
|
727
|
+
|
|
728
|
+
clear
|
|
729
|
+
list asJQuery empty.
|
|
730
|
+
!
|
|
731
|
+
|
|
732
|
+
commandFind
|
|
733
|
+
olHeightBeforeSearch := self height.
|
|
734
|
+
searchbox show.
|
|
735
|
+
self height: self height.
|
|
736
|
+
searchInput asJQuery focus.
|
|
737
|
+
!
|
|
738
|
+
|
|
739
|
+
filterResults
|
|
740
|
+
|text|
|
|
741
|
+
text := searchInput asJQuery val.
|
|
742
|
+
(list asJQuery find: 'li') each: [:idx :htmlEl | |el|
|
|
743
|
+
< el = $(htmlEl); >.
|
|
744
|
+
(el text includesSubString: text)
|
|
745
|
+
ifTrue: [el show]
|
|
746
|
+
ifFalse: [el hide]].
|
|
747
|
+
self hideSearchBox.
|
|
748
|
+
!
|
|
749
|
+
|
|
750
|
+
focus
|
|
751
|
+
list asJQuery focus.
|
|
752
|
+
!
|
|
753
|
+
|
|
754
|
+
hide
|
|
755
|
+
list hide.
|
|
756
|
+
!
|
|
757
|
+
|
|
758
|
+
hideSearchBox
|
|
759
|
+
searchbox hide.
|
|
760
|
+
self height: olHeightBeforeSearch.
|
|
761
|
+
list asJQuery focus.
|
|
762
|
+
!
|
|
763
|
+
|
|
764
|
+
moveSelectionDown
|
|
765
|
+
|newIndex|
|
|
766
|
+
newIndex := self selectedDataVisibleIndex + 1 - 1.
|
|
767
|
+
newIndex = self sizeVisible ifTrue: [newIndex := 0].
|
|
768
|
+
self unselectAll.
|
|
769
|
+
(list asJQuery find: 'li:visible:eq(', newIndex asString, ')') addClass: 'ui-selected'.
|
|
770
|
+
self selectionChanged.
|
|
771
|
+
!
|
|
772
|
+
|
|
773
|
+
moveSelectionUp
|
|
774
|
+
|newIndex|
|
|
775
|
+
newIndex := self selectedDataVisibleIndex - 1 - 1.
|
|
776
|
+
newIndex < 0 ifTrue: [newIndex := self sizeVisible - 1].
|
|
777
|
+
self unselectAll.
|
|
778
|
+
(list asJQuery find: 'li:visible:eq(', newIndex asString, ')') addClass: 'ui-selected'.
|
|
779
|
+
self selectionChanged.
|
|
780
|
+
!
|
|
781
|
+
|
|
782
|
+
selectionChanged
|
|
783
|
+
self focus.
|
|
784
|
+
changedCallback value: self selectedData value: self selectedDataIndex.
|
|
785
|
+
!
|
|
786
|
+
|
|
787
|
+
show
|
|
788
|
+
list show.
|
|
789
|
+
!
|
|
790
|
+
|
|
791
|
+
unselectAll
|
|
792
|
+
(list asJQuery find: 'li') removeClass: 'ui-selected'.
|
|
793
|
+
! !
|
|
794
|
+
|
|
795
|
+
!MaglevListBox methodsFor: 'rendering'!
|
|
796
|
+
|
|
797
|
+
makeResizable
|
|
798
|
+
< self['@olContainer']._asJQuery().resizable({handles: 's'}); >
|
|
799
|
+
!
|
|
800
|
+
|
|
801
|
+
renderOn: html
|
|
802
|
+
divContainer := html div with: [
|
|
803
|
+
self renderSearchBoxOn: html.
|
|
804
|
+
olContainer := html div
|
|
805
|
+
style: 'overflow: hidden; border: 1px solid #aaaaaa';
|
|
806
|
+
with: [
|
|
807
|
+
list := html ol
|
|
808
|
+
style: 'width: 100%; height: 100%; overflow: auto; border: none; outline: none;';
|
|
809
|
+
at: 'tabindex' put: '1';
|
|
810
|
+
onKeyDown: [:e |
|
|
811
|
+
e preventDefault.
|
|
812
|
+
e keyCode = 40 ifTrue: [self moveSelectionDown].
|
|
813
|
+
e keyCode = 38 ifTrue: [self moveSelectionUp].
|
|
814
|
+
(e keyCode = 70 and: [e ctrlKey]) ifTrue: [self commandFind]];
|
|
815
|
+
onClick: [self focus]].
|
|
816
|
+
self makeResizable.
|
|
817
|
+
htmlIv := html].
|
|
818
|
+
self bindEvents.
|
|
819
|
+
!
|
|
820
|
+
|
|
821
|
+
renderSearchBoxOn: html
|
|
822
|
+
searchbox := html div
|
|
823
|
+
class: 'input-prepend';
|
|
824
|
+
style: 'margin-bottom: 2px; box-sizing: border-box; -webkit-box-sizing: border-box; padding-right: 52px; width: 100%;';
|
|
825
|
+
with: [
|
|
826
|
+
html span
|
|
827
|
+
class: 'add-on';
|
|
828
|
+
with: 'find'.
|
|
829
|
+
searchInput := html input
|
|
830
|
+
type: 'text';
|
|
831
|
+
class: 'span2';
|
|
832
|
+
style: 'width: 100%;';
|
|
833
|
+
onChange: [self filterResults];
|
|
834
|
+
onFocusOut: [self hideSearchBox]];
|
|
835
|
+
hide.
|
|
836
|
+
!
|
|
837
|
+
|
|
838
|
+
with: content
|
|
839
|
+
self with: content data: '' darker: false.
|
|
840
|
+
!
|
|
841
|
+
|
|
842
|
+
with: content darker: aBoolean
|
|
843
|
+
self with: content data: '' darker: aBoolean.
|
|
844
|
+
!
|
|
845
|
+
|
|
846
|
+
with: content data: dataString
|
|
847
|
+
"|html|
|
|
848
|
+
html := HTMLCanvas onJQuery: list asJQuery."
|
|
849
|
+
list with: [
|
|
850
|
+
htmlIv li
|
|
851
|
+
class: 'ui-widget-content';
|
|
852
|
+
data: 'data' with: dataString;
|
|
853
|
+
with: [content value: htmlIv]].
|
|
854
|
+
!
|
|
855
|
+
|
|
856
|
+
with: content data: dataString darker: aBoolean
|
|
857
|
+
list with: [ |li|
|
|
858
|
+
li := htmlIv li
|
|
859
|
+
class: 'ui-widget-content';
|
|
860
|
+
data: 'data' with: dataString;
|
|
861
|
+
with: [content value: htmlIv].
|
|
862
|
+
aBoolean ifTrue: [li asJQuery addClass: 'list-darker']].
|
|
863
|
+
! !
|
|
864
|
+
|
|
865
|
+
Widget subclass: #MaglevObjectDropdown
|
|
866
|
+
instanceVariableNames: 'container resultContainer editor editorElement rubyButton smalltalkButton object'
|
|
867
|
+
package: 'Maglev-Database-Explorer'!
|
|
868
|
+
|
|
869
|
+
!MaglevObjectDropdown methodsFor: 'accessing'!
|
|
870
|
+
|
|
871
|
+
code
|
|
872
|
+
^ editor getValue
|
|
873
|
+
!
|
|
874
|
+
|
|
875
|
+
language
|
|
876
|
+
self isRuby
|
|
877
|
+
ifTrue: [^ 'ruby']
|
|
878
|
+
ifFalse: [^ 'smalltalk']
|
|
879
|
+
! !
|
|
880
|
+
|
|
881
|
+
!MaglevObjectDropdown methodsFor: 'initializing'!
|
|
882
|
+
|
|
883
|
+
initializeEditor
|
|
884
|
+
|params extraKeys|
|
|
885
|
+
extraKeys := Object new
|
|
886
|
+
basicAt: 'Ctrl-D' put: [self evalPrintIt];
|
|
887
|
+
basicAt: 'Ctrl-P' put: [self evalPrintIt];
|
|
888
|
+
basicAt: 'Ctrl-S' put: [self evalPrintIt];
|
|
889
|
+
yourself.
|
|
890
|
+
params := Object new
|
|
891
|
+
basicAt: 'mode' put: 'text/x-ruby';
|
|
892
|
+
basicAt: 'styleActiveLine' put: true;
|
|
893
|
+
basicAt: 'lineNumbers' put: true;
|
|
894
|
+
basicAt: 'matchBrackets' put: true;
|
|
895
|
+
basicAt: 'extraKeys' put: extraKeys;
|
|
896
|
+
yourself.
|
|
897
|
+
editor := CodeMirror value: (editorElement asJQuery at: 0) value: params.
|
|
898
|
+
editor setValue: ''.
|
|
899
|
+
!
|
|
900
|
+
|
|
901
|
+
mouseFix
|
|
902
|
+
< var menu = self['@container'];
|
|
903
|
+
var editor = self['@editorElement'];
|
|
904
|
+
menu._asJQuery().mousedown(function (event) {
|
|
905
|
+
event.preventDefault();
|
|
906
|
+
return false;
|
|
907
|
+
});
|
|
908
|
+
editor._asJQuery().mousedown(function (event) {
|
|
909
|
+
event.preventDefault();
|
|
910
|
+
return false;
|
|
911
|
+
}); >
|
|
912
|
+
! !
|
|
913
|
+
|
|
914
|
+
!MaglevObjectDropdown methodsFor: 'interactions'!
|
|
915
|
+
|
|
916
|
+
appendToInlineObject: anObject for: dropdownContainer
|
|
917
|
+
object := anObject object.
|
|
918
|
+
container asJQuery appendTo: dropdownContainer asJQuery.
|
|
919
|
+
!
|
|
920
|
+
|
|
921
|
+
evalDoIt
|
|
922
|
+
!
|
|
923
|
+
|
|
924
|
+
evalInspectIt
|
|
925
|
+
!
|
|
926
|
+
|
|
927
|
+
evalPrintIt
|
|
928
|
+
self executeWithCallback: [:success :resultObj |
|
|
929
|
+
success
|
|
930
|
+
ifTrue: [resultContainer with: resultObj inlineViewComponent]
|
|
931
|
+
ifFalse: [resultContainer with: resultObj inlineViewComponent]].
|
|
932
|
+
!
|
|
933
|
+
|
|
934
|
+
executeWithCallback: aBlock
|
|
935
|
+
resultContainer
|
|
936
|
+
addClass: 'alert-info';
|
|
937
|
+
removeClass: 'alert-success';
|
|
938
|
+
removeClass: 'alert-error'.
|
|
939
|
+
resultContainer asJQuery empty.
|
|
940
|
+
resultContainer
|
|
941
|
+
with: MaglevIcon wait;
|
|
942
|
+
with: ' loading...';
|
|
943
|
+
show.
|
|
944
|
+
object
|
|
945
|
+
evaluate: self code
|
|
946
|
+
language: self language
|
|
947
|
+
withCallback: [:success :resultObj |
|
|
948
|
+
resultContainer asJQuery empty.
|
|
949
|
+
resultContainer removeClass: 'alert-info'.
|
|
950
|
+
success
|
|
951
|
+
ifTrue: [resultContainer addClass: 'alert-success']
|
|
952
|
+
ifFalse: [resultContainer addClass: 'alert-error'].
|
|
953
|
+
aBlock value: success value: resultObj]
|
|
954
|
+
!
|
|
955
|
+
|
|
956
|
+
languageChanged
|
|
957
|
+
self isRuby
|
|
958
|
+
ifFalse: [editor setOption: 'mode' data: 'text/x-ruby']
|
|
959
|
+
ifTrue: [editor setOption: 'mode' data: 'text/x-stsrc'].
|
|
960
|
+
! !
|
|
961
|
+
|
|
962
|
+
!MaglevObjectDropdown methodsFor: 'rendering'!
|
|
963
|
+
|
|
964
|
+
renderButtonsOn: html
|
|
965
|
+
"html button
|
|
966
|
+
class: 'btn btn-primary';
|
|
967
|
+
type: 'button';
|
|
968
|
+
with: 'Do it';
|
|
969
|
+
onClick: [self evalDoIt]."
|
|
970
|
+
html button
|
|
971
|
+
class: 'btn btn-primary';
|
|
972
|
+
type: 'button';
|
|
973
|
+
style: 'margin-right: 10px;';
|
|
974
|
+
with: 'Print it';
|
|
975
|
+
onClick: [self evalPrintIt].
|
|
976
|
+
"html button
|
|
977
|
+
class: 'btn btn-primary';
|
|
978
|
+
type: 'button';
|
|
979
|
+
with: 'Inspect it';
|
|
980
|
+
onClick: [self evalInspectIt]."
|
|
981
|
+
html div
|
|
982
|
+
class: 'btn-group';
|
|
983
|
+
style: 'float: right;';
|
|
984
|
+
data: 'toggle' with: 'buttons-radio';
|
|
985
|
+
with: [
|
|
986
|
+
rubyButton := html button
|
|
987
|
+
class: 'btn active';
|
|
988
|
+
data: 'toggle' with: 'buttons-checkbox';
|
|
989
|
+
onClick: [self languageChanged];
|
|
990
|
+
type: 'button';
|
|
991
|
+
with: 'Ruby'.
|
|
992
|
+
smalltalkButton := html button
|
|
993
|
+
class: 'btn';
|
|
994
|
+
data: 'toggle' with: 'buttons-checkbox';
|
|
995
|
+
onClick: [self languageChanged];
|
|
996
|
+
type: 'button';
|
|
997
|
+
with: 'Smalltalk'].
|
|
998
|
+
!
|
|
999
|
+
|
|
1000
|
+
renderFormOn: html
|
|
1001
|
+
html form
|
|
1002
|
+
style: 'margin: 0px;';
|
|
1003
|
+
with: [
|
|
1004
|
+
editorElement := html div
|
|
1005
|
+
class: 'pull-left code-area'.
|
|
1006
|
+
html div style: 'clear: both;'.
|
|
1007
|
+
resultContainer := html div
|
|
1008
|
+
class: 'alert';
|
|
1009
|
+
hide.
|
|
1010
|
+
html div
|
|
1011
|
+
class: 'button-area';
|
|
1012
|
+
with: [self renderButtonsOn: html]].
|
|
1013
|
+
!
|
|
1014
|
+
|
|
1015
|
+
renderOn: html
|
|
1016
|
+
container := html div
|
|
1017
|
+
class: 'dropdown-menu';
|
|
1018
|
+
with: [html fieldset
|
|
1019
|
+
class: 'textbox';
|
|
1020
|
+
style: 'padding: 10px';
|
|
1021
|
+
with: [self renderFormOn: html]].
|
|
1022
|
+
self initializeEditor.
|
|
1023
|
+
self mouseFix.
|
|
1024
|
+
! !
|
|
1025
|
+
|
|
1026
|
+
!MaglevObjectDropdown methodsFor: 'testing'!
|
|
1027
|
+
|
|
1028
|
+
isRuby
|
|
1029
|
+
^ rubyButton asJQuery hasClass: 'active'
|
|
1030
|
+
!
|
|
1031
|
+
|
|
1032
|
+
isSmalltalk
|
|
1033
|
+
^ smalltalkButton asJQuery hasClass: 'active'
|
|
1034
|
+
! !
|
|
1035
|
+
|
|
1036
|
+
MaglevObjectDropdown class instanceVariableNames: 'instance'!
|
|
1037
|
+
|
|
1038
|
+
!MaglevObjectDropdown class methodsFor: 'singleton'!
|
|
1039
|
+
|
|
1040
|
+
instance
|
|
1041
|
+
instance ifNil: [
|
|
1042
|
+
instance := self new.
|
|
1043
|
+
instance appendToJQuery: '#temporary-rendering-area' asJQuery].
|
|
1044
|
+
^ instance
|
|
1045
|
+
! !
|
|
1046
|
+
|
|
1047
|
+
Widget subclass: #MaglevObjectInline
|
|
1048
|
+
instanceVariableNames: 'object hasDropDown isDraggable depth isShort dragContent dragDummy dragObject fullInspection'
|
|
1049
|
+
package: 'Maglev-Database-Explorer'!
|
|
1050
|
+
|
|
1051
|
+
!MaglevObjectInline methodsFor: 'accessing'!
|
|
1052
|
+
|
|
1053
|
+
depth
|
|
1054
|
+
depth ifNil: [depth := 1].
|
|
1055
|
+
^ depth
|
|
1056
|
+
!
|
|
1057
|
+
|
|
1058
|
+
depth: anInteger
|
|
1059
|
+
depth := anInteger.
|
|
1060
|
+
!
|
|
1061
|
+
|
|
1062
|
+
fullInspection
|
|
1063
|
+
fullInspection ifNil: [fullInspection := false].
|
|
1064
|
+
^ fullInspection
|
|
1065
|
+
!
|
|
1066
|
+
|
|
1067
|
+
fullInspection: aBoolean
|
|
1068
|
+
fullInspection := aBoolean.
|
|
1069
|
+
!
|
|
1070
|
+
|
|
1071
|
+
hasDropDown
|
|
1072
|
+
hasDropDown ifNil: [hasDropDown := self hasDropDownDefault].
|
|
1073
|
+
^ hasDropDown
|
|
1074
|
+
!
|
|
1075
|
+
|
|
1076
|
+
hasDropDown: aBoolean
|
|
1077
|
+
hasDropDown := aBoolean.
|
|
1078
|
+
!
|
|
1079
|
+
|
|
1080
|
+
isDraggable
|
|
1081
|
+
isDraggable ifNil: [isDraggable := self isDraggableDefault].
|
|
1082
|
+
^ isDraggable
|
|
1083
|
+
!
|
|
1084
|
+
|
|
1085
|
+
isDraggable: aBoolean
|
|
1086
|
+
isDraggable := aBoolean.
|
|
1087
|
+
!
|
|
1088
|
+
|
|
1089
|
+
isShort
|
|
1090
|
+
isShort ifNil: [isShort := false].
|
|
1091
|
+
^ isShort
|
|
1092
|
+
!
|
|
1093
|
+
|
|
1094
|
+
isShort: aBoolean
|
|
1095
|
+
isShort := aBoolean.
|
|
1096
|
+
!
|
|
1097
|
+
|
|
1098
|
+
object
|
|
1099
|
+
^ object
|
|
1100
|
+
!
|
|
1101
|
+
|
|
1102
|
+
object: anObject
|
|
1103
|
+
object := anObject.
|
|
1104
|
+
! !
|
|
1105
|
+
|
|
1106
|
+
!MaglevObjectInline methodsFor: 'constants'!
|
|
1107
|
+
|
|
1108
|
+
hasDropDownDefault
|
|
1109
|
+
^ true
|
|
1110
|
+
!
|
|
1111
|
+
|
|
1112
|
+
isDraggableDefault
|
|
1113
|
+
^ true
|
|
1114
|
+
!
|
|
1115
|
+
|
|
1116
|
+
maxDepth
|
|
1117
|
+
^ 1
|
|
1118
|
+
!
|
|
1119
|
+
|
|
1120
|
+
maxInspection
|
|
1121
|
+
self fullInspection
|
|
1122
|
+
ifTrue: [^ 1000]
|
|
1123
|
+
ifFalse: [^ 15].
|
|
1124
|
+
! !
|
|
1125
|
+
|
|
1126
|
+
!MaglevObjectInline methodsFor: 'interactions'!
|
|
1127
|
+
|
|
1128
|
+
bindDraggable
|
|
1129
|
+
|options cursorPos|
|
|
1130
|
+
cursorPos := Object new
|
|
1131
|
+
basicAt: 'left' put: 0;
|
|
1132
|
+
basicAt: 'top' put: 0;
|
|
1133
|
+
yourself.
|
|
1134
|
+
options := Object new
|
|
1135
|
+
basicAt: 'create' put: [:event :ui | ];
|
|
1136
|
+
basicAt: 'cursorPos' put: cursorPos;
|
|
1137
|
+
basicAt: 'start' put: [:event :ui | self dragStart: event a: ui];
|
|
1138
|
+
basicAt: 'stop' put: [:event :ui | self dragStop: event a: ui];
|
|
1139
|
+
yourself.
|
|
1140
|
+
dragObject asJQuery draggable: options.
|
|
1141
|
+
!
|
|
1142
|
+
|
|
1143
|
+
dragStart: event a: ui
|
|
1144
|
+
dragContent hide.
|
|
1145
|
+
dragDummy show.
|
|
1146
|
+
!
|
|
1147
|
+
|
|
1148
|
+
dragStop: event a: ui
|
|
1149
|
+
|position window|
|
|
1150
|
+
position := dragObject asJQuery offset.
|
|
1151
|
+
window := Maglev instance showReloadObjectWindow: object oop.
|
|
1152
|
+
window left: position left - (dragObject width / 2).
|
|
1153
|
+
window top: position top - (dragObject height / 2).
|
|
1154
|
+
dragObject left: 0.
|
|
1155
|
+
dragObject top: 0.
|
|
1156
|
+
dragDummy hide.
|
|
1157
|
+
dragContent show.
|
|
1158
|
+
!
|
|
1159
|
+
|
|
1160
|
+
showDropdownFor: dropdownContainer
|
|
1161
|
+
MaglevObjectDropdown instance appendToInlineObject: self for: dropdownContainer.
|
|
1162
|
+
! !
|
|
1163
|
+
|
|
1164
|
+
!MaglevObjectInline methodsFor: 'rendering'!
|
|
1165
|
+
|
|
1166
|
+
renderDraggableObjectOn: html
|
|
1167
|
+
html div
|
|
1168
|
+
class: 'draggable-new-object-container';
|
|
1169
|
+
with: [
|
|
1170
|
+
dragObject := html div
|
|
1171
|
+
class: 'ui-widget-content ui-draggable draggable-new-object';
|
|
1172
|
+
with: [
|
|
1173
|
+
dragDummy := html div
|
|
1174
|
+
class: 'object-drag-dummy';
|
|
1175
|
+
style: 'display: none;';
|
|
1176
|
+
with: MaglevIcon move;
|
|
1177
|
+
with: [self renderObjectContainerOn: html].
|
|
1178
|
+
dragContent := html div
|
|
1179
|
+
class: 'object-iv-name';
|
|
1180
|
+
with: [self renderObjectContainerOn: html]]].
|
|
1181
|
+
self bindDraggable.
|
|
1182
|
+
!
|
|
1183
|
+
|
|
1184
|
+
renderLoadedObjectOn: html
|
|
1185
|
+
|text shorted|
|
|
1186
|
+
shorted := false.
|
|
1187
|
+
text := object inspection copyFrom: 1 to: self maxInspection.
|
|
1188
|
+
text size < object inspection size ifTrue: [
|
|
1189
|
+
text := text, '...'.
|
|
1190
|
+
shorted := true.
|
|
1191
|
+
(text at: 2) = '<' ifTrue: [text := text, '>']].
|
|
1192
|
+
html with: [|tooltip|
|
|
1193
|
+
tooltip := html span
|
|
1194
|
+
data: 'toggle' with: 'tooltip';
|
|
1195
|
+
data: 'placement' with: 'top';
|
|
1196
|
+
data: 'original-title' with: object inspection;
|
|
1197
|
+
with: text.
|
|
1198
|
+
shorted ifTrue: [tooltip asJQuery tooltip]].
|
|
1199
|
+
!
|
|
1200
|
+
|
|
1201
|
+
renderObjectActionsOn: html
|
|
1202
|
+
" html
|
|
1203
|
+
with: MaglevIcon search;
|
|
1204
|
+
with: MaglevIcon pencil."
|
|
1205
|
+
!
|
|
1206
|
+
|
|
1207
|
+
renderObjectContainerOn: html
|
|
1208
|
+
html span
|
|
1209
|
+
class: 'object-inline-view-view';
|
|
1210
|
+
with: [
|
|
1211
|
+
self renderObjectActionsOn: html.
|
|
1212
|
+
html span
|
|
1213
|
+
class: 'object-inline-typed-view';
|
|
1214
|
+
with: [
|
|
1215
|
+
self hasDropDown
|
|
1216
|
+
ifTrue: [self renderObjectWithDropDownOn: html]
|
|
1217
|
+
ifFalse: [self renderObjectOn: html]]].
|
|
1218
|
+
!
|
|
1219
|
+
|
|
1220
|
+
renderObjectOn: html
|
|
1221
|
+
object isLoaded
|
|
1222
|
+
ifTrue: [self renderLoadedObjectOn: html]
|
|
1223
|
+
ifFalse: [self renderUnloadedObjectOn: html].
|
|
1224
|
+
!
|
|
1225
|
+
|
|
1226
|
+
renderObjectWithDropDownOn: html
|
|
1227
|
+
|dropdownContainer|
|
|
1228
|
+
dropdownContainer := html span
|
|
1229
|
+
class: 'dropdown';
|
|
1230
|
+
with: [
|
|
1231
|
+
html a
|
|
1232
|
+
class: 'dropdown-toggle btn object-dropdown-toggle';
|
|
1233
|
+
data: 'toggle' with: 'dropdown';
|
|
1234
|
+
onClick: [self showDropdownFor: dropdownContainer];
|
|
1235
|
+
with: [
|
|
1236
|
+
self renderObjectOn: html.
|
|
1237
|
+
html b class: 'caret']].
|
|
1238
|
+
!
|
|
1239
|
+
|
|
1240
|
+
renderOn: html
|
|
1241
|
+
self isDraggable
|
|
1242
|
+
ifTrue: [self renderDraggableObjectOn: html]
|
|
1243
|
+
ifFalse: [self renderObjectContainerOn: html].
|
|
1244
|
+
!
|
|
1245
|
+
|
|
1246
|
+
renderText: text withDropDownOn: html
|
|
1247
|
+
|dropdownContainer|
|
|
1248
|
+
self hasDropDown
|
|
1249
|
+
ifTrue: [
|
|
1250
|
+
dropdownContainer := html span
|
|
1251
|
+
class: 'dropdown';
|
|
1252
|
+
with: [
|
|
1253
|
+
html a
|
|
1254
|
+
class: 'dropdown-toggle btn object-dropdown-toggle';
|
|
1255
|
+
data: 'toggle' with: 'dropdown';
|
|
1256
|
+
onClick: [self showDropdownFor: dropdownContainer];
|
|
1257
|
+
with: [
|
|
1258
|
+
html with: text.
|
|
1259
|
+
html b class: 'caret']]]
|
|
1260
|
+
ifFalse: [html with: text].
|
|
1261
|
+
!
|
|
1262
|
+
|
|
1263
|
+
renderUnloadedObjectOn: html
|
|
1264
|
+
|text shorted|
|
|
1265
|
+
shorted := false.
|
|
1266
|
+
text := object inspection copyFrom: 1 to: self maxInspection.
|
|
1267
|
+
text size < object inspection size ifTrue: [
|
|
1268
|
+
text := text, '...'.
|
|
1269
|
+
shorted := true.
|
|
1270
|
+
(text at: 2) = '<' ifTrue: [text := text, '>']].
|
|
1271
|
+
html with: [|tooltip|
|
|
1272
|
+
tooltip := html span
|
|
1273
|
+
data: 'toggle' with: 'tooltip';
|
|
1274
|
+
data: 'placement' with: 'top';
|
|
1275
|
+
data: 'original-title' with: object inspection;
|
|
1276
|
+
with: text.
|
|
1277
|
+
shorted ifTrue: [tooltip asJQuery tooltip]].
|
|
1278
|
+
! !
|
|
1279
|
+
|
|
1280
|
+
!MaglevObjectInline class methodsFor: 'instance creation'!
|
|
1281
|
+
|
|
1282
|
+
newWithDepth: anInteger
|
|
1283
|
+
^ self basicNew
|
|
1284
|
+
depth: anInteger;
|
|
1285
|
+
initialize;
|
|
1286
|
+
yourself
|
|
1287
|
+
! !
|
|
1288
|
+
|
|
1289
|
+
MaglevObjectInline subclass: #MaglevArrayInline
|
|
1290
|
+
instanceVariableNames: ''
|
|
1291
|
+
package: 'Maglev-Database-Explorer'!
|
|
1292
|
+
|
|
1293
|
+
!MaglevArrayInline methodsFor: 'constants'!
|
|
1294
|
+
|
|
1295
|
+
maxDepth
|
|
1296
|
+
^ 2
|
|
1297
|
+
!
|
|
1298
|
+
|
|
1299
|
+
maxElements
|
|
1300
|
+
^ 3
|
|
1301
|
+
! !
|
|
1302
|
+
|
|
1303
|
+
!MaglevArrayInline methodsFor: 'rendering'!
|
|
1304
|
+
|
|
1305
|
+
renderLoadedObjectOn: html
|
|
1306
|
+
|showElements maxElements|
|
|
1307
|
+
maxElements := self maxElements.
|
|
1308
|
+
showElements := maxElements min: self object elementsSize.
|
|
1309
|
+
self renderText: '[' withDropDownOn: html.
|
|
1310
|
+
html with: ' '.
|
|
1311
|
+
self isShort
|
|
1312
|
+
ifTrue: [html with: ' ... ']
|
|
1313
|
+
ifFalse: [
|
|
1314
|
+
(1 to: showElements) do: [:idx |
|
|
1315
|
+
html with: ((self object at: idx) inlineViewComponentWithDepth: self depth - 1).
|
|
1316
|
+
(idx < showElements or: [self object elementsSize > maxElements])
|
|
1317
|
+
ifTrue: [html with: ' , ']].
|
|
1318
|
+
self object elementsSize > maxElements
|
|
1319
|
+
ifTrue: [html with: ' ... '] ].
|
|
1320
|
+
html with: ' '.
|
|
1321
|
+
self renderText: ']' withDropDownOn: html.
|
|
1322
|
+
!
|
|
1323
|
+
|
|
1324
|
+
renderObjectWithDropDownOn: html
|
|
1325
|
+
"Do not render a drop down menu around the whole object."
|
|
1326
|
+
self renderObjectOn: html.
|
|
1327
|
+
!
|
|
1328
|
+
|
|
1329
|
+
renderUnloadedObjectOn: html
|
|
1330
|
+
self renderText: '[' withDropDownOn: html.
|
|
1331
|
+
html with: '...'.
|
|
1332
|
+
self renderText: ']' withDropDownOn: html.
|
|
1333
|
+
! !
|
|
1334
|
+
|
|
1335
|
+
MaglevObjectInline subclass: #MaglevBooleanInline
|
|
1336
|
+
instanceVariableNames: ''
|
|
1337
|
+
package: 'Maglev-Database-Explorer'!
|
|
1338
|
+
|
|
1339
|
+
!MaglevBooleanInline methodsFor: 'constants'!
|
|
1340
|
+
|
|
1341
|
+
hasDropDownDefault
|
|
1342
|
+
^ false
|
|
1343
|
+
!
|
|
1344
|
+
|
|
1345
|
+
isDraggableDefault
|
|
1346
|
+
^ false
|
|
1347
|
+
! !
|
|
1348
|
+
|
|
1349
|
+
MaglevObjectInline subclass: #MaglevExceptionInline
|
|
1350
|
+
instanceVariableNames: ''
|
|
1351
|
+
package: 'Maglev-Database-Explorer'!
|
|
1352
|
+
|
|
1353
|
+
!MaglevExceptionInline methodsFor: 'rendering'!
|
|
1354
|
+
|
|
1355
|
+
renderObjectActionsOn: html
|
|
1356
|
+
object isTrappable
|
|
1357
|
+
ifFalse: [html with: (MaglevIcon terminal
|
|
1358
|
+
caption: 'Not trappable')].
|
|
1359
|
+
object isResumable
|
|
1360
|
+
ifTrue: [html with: (MaglevIcon playCircle
|
|
1361
|
+
caption: 'Resumable')].
|
|
1362
|
+
object isDBEHalt
|
|
1363
|
+
ifTrue: [html with: (MaglevIcon flag
|
|
1364
|
+
caption: 'Database Explorer Halt')].
|
|
1365
|
+
! !
|
|
1366
|
+
|
|
1367
|
+
MaglevObjectInline subclass: #MaglevFixnumInline
|
|
1368
|
+
instanceVariableNames: ''
|
|
1369
|
+
package: 'Maglev-Database-Explorer'!
|
|
1370
|
+
|
|
1371
|
+
!MaglevFixnumInline methodsFor: 'constants'!
|
|
1372
|
+
|
|
1373
|
+
hasDropDownDefault
|
|
1374
|
+
^ false
|
|
1375
|
+
!
|
|
1376
|
+
|
|
1377
|
+
isDraggableDefault
|
|
1378
|
+
^ false
|
|
1379
|
+
! !
|
|
1380
|
+
|
|
1381
|
+
!MaglevFixnumInline methodsFor: 'rendering'!
|
|
1382
|
+
|
|
1383
|
+
renderObjectActionsOn: html
|
|
1384
|
+
! !
|
|
1385
|
+
|
|
1386
|
+
MaglevObjectInline subclass: #MaglevFloatInline
|
|
1387
|
+
instanceVariableNames: ''
|
|
1388
|
+
package: 'Maglev-Database-Explorer'!
|
|
1389
|
+
|
|
1390
|
+
!MaglevFloatInline methodsFor: 'constants'!
|
|
1391
|
+
|
|
1392
|
+
hasDropDownDefault
|
|
1393
|
+
^ false
|
|
1394
|
+
!
|
|
1395
|
+
|
|
1396
|
+
isDraggableDefault
|
|
1397
|
+
^ false
|
|
1398
|
+
! !
|
|
1399
|
+
|
|
1400
|
+
!MaglevFloatInline methodsFor: 'rendering'!
|
|
1401
|
+
|
|
1402
|
+
renderObjectActionsOn: html
|
|
1403
|
+
! !
|
|
1404
|
+
|
|
1405
|
+
MaglevObjectInline subclass: #MaglevHashInline
|
|
1406
|
+
instanceVariableNames: ''
|
|
1407
|
+
package: 'Maglev-Database-Explorer'!
|
|
1408
|
+
|
|
1409
|
+
!MaglevHashInline methodsFor: 'constants'!
|
|
1410
|
+
|
|
1411
|
+
maxDepth
|
|
1412
|
+
^ 2
|
|
1413
|
+
!
|
|
1414
|
+
|
|
1415
|
+
maxElements
|
|
1416
|
+
^ 3
|
|
1417
|
+
! !
|
|
1418
|
+
|
|
1419
|
+
!MaglevHashInline methodsFor: 'rendering'!
|
|
1420
|
+
|
|
1421
|
+
renderLoadedObjectOn: html
|
|
1422
|
+
|showElements maxElements|
|
|
1423
|
+
maxElements := self maxElements.
|
|
1424
|
+
showElements := maxElements min: self object elementsSize.
|
|
1425
|
+
self renderText: '{' withDropDownOn: html.
|
|
1426
|
+
html with: ' '.
|
|
1427
|
+
self isShort
|
|
1428
|
+
ifTrue: [html with: ' ... ']
|
|
1429
|
+
ifFalse: [
|
|
1430
|
+
(1 to: showElements) do: [:idx | |key value|
|
|
1431
|
+
key := (self object at: idx) key.
|
|
1432
|
+
value := (self object at: idx) value.
|
|
1433
|
+
html
|
|
1434
|
+
with: (key inlineViewComponentWithDepth: self depth + 1);
|
|
1435
|
+
with: '=>';
|
|
1436
|
+
with: (value inlineViewComponentWithDepth: self depth + 1).
|
|
1437
|
+
(idx < showElements or: [self object elementsSize > maxElements])
|
|
1438
|
+
ifTrue: [html with: ' , ']].
|
|
1439
|
+
self object elementsSize > maxElements
|
|
1440
|
+
ifTrue: [html with: ' ... ']].
|
|
1441
|
+
html with: ' '.
|
|
1442
|
+
self renderText: '}' withDropDownOn: html.
|
|
1443
|
+
!
|
|
1444
|
+
|
|
1445
|
+
renderObjectWithDropDownOn: html
|
|
1446
|
+
"Do not render a drop down menu around the whole object."
|
|
1447
|
+
self renderObjectOn: html.
|
|
1448
|
+
!
|
|
1449
|
+
|
|
1450
|
+
renderUnloadedObjectOn: html
|
|
1451
|
+
self renderText: '{' withDropDownOn: html.
|
|
1452
|
+
html with: '...'.
|
|
1453
|
+
self renderText: '}' withDropDownOn: html.
|
|
1454
|
+
! !
|
|
1455
|
+
|
|
1456
|
+
MaglevObjectInline subclass: #MaglevMaglevRecordBaseInline
|
|
1457
|
+
instanceVariableNames: ''
|
|
1458
|
+
package: 'Maglev-Database-Explorer'!
|
|
1459
|
+
|
|
1460
|
+
!MaglevMaglevRecordBaseInline methodsFor: 'rendering'!
|
|
1461
|
+
|
|
1462
|
+
renderObjectActionsOn: html
|
|
1463
|
+
html with: (MaglevIcon hdd caption: 'MaglevRecord::Base')
|
|
1464
|
+
! !
|
|
1465
|
+
|
|
1466
|
+
MaglevObjectInline subclass: #MaglevModuleInline
|
|
1467
|
+
instanceVariableNames: ''
|
|
1468
|
+
package: 'Maglev-Database-Explorer'!
|
|
1469
|
+
|
|
1470
|
+
!MaglevModuleInline methodsFor: 'constants'!
|
|
1471
|
+
|
|
1472
|
+
maxDepth
|
|
1473
|
+
^ 1
|
|
1474
|
+
! !
|
|
1475
|
+
|
|
1476
|
+
MaglevModuleInline subclass: #MaglevClassInline
|
|
1477
|
+
instanceVariableNames: ''
|
|
1478
|
+
package: 'Maglev-Database-Explorer'!
|
|
1479
|
+
|
|
1480
|
+
!MaglevClassInline methodsFor: 'constants'!
|
|
1481
|
+
|
|
1482
|
+
maxDepth
|
|
1483
|
+
^ 1
|
|
1484
|
+
!
|
|
1485
|
+
|
|
1486
|
+
renderObjectActionsOn: html
|
|
1487
|
+
html with: (MaglevIcon listAlt
|
|
1488
|
+
caption: 'List class instances').
|
|
1489
|
+
! !
|
|
1490
|
+
|
|
1491
|
+
MaglevObjectInline subclass: #MaglevNilClassInline
|
|
1492
|
+
instanceVariableNames: ''
|
|
1493
|
+
package: 'Maglev-Database-Explorer'!
|
|
1494
|
+
|
|
1495
|
+
!MaglevNilClassInline methodsFor: 'constants'!
|
|
1496
|
+
|
|
1497
|
+
hasDropDownDefault
|
|
1498
|
+
^ false
|
|
1499
|
+
!
|
|
1500
|
+
|
|
1501
|
+
isDraggableDefault
|
|
1502
|
+
^ false
|
|
1503
|
+
! !
|
|
1504
|
+
|
|
1505
|
+
MaglevObjectInline subclass: #MaglevRubyWorkspaceInline
|
|
1506
|
+
instanceVariableNames: ''
|
|
1507
|
+
package: 'Maglev-Database-Explorer'!
|
|
1508
|
+
|
|
1509
|
+
!MaglevRubyWorkspaceInline methodsFor: 'rendering'!
|
|
1510
|
+
|
|
1511
|
+
renderObjectActionsOn: html
|
|
1512
|
+
html with: (MaglevIcon terminal caption: 'Workspace').
|
|
1513
|
+
! !
|
|
1514
|
+
|
|
1515
|
+
MaglevObjectInline subclass: #MaglevStringInline
|
|
1516
|
+
instanceVariableNames: ''
|
|
1517
|
+
package: 'Maglev-Database-Explorer'!
|
|
1518
|
+
|
|
1519
|
+
!MaglevStringInline methodsFor: 'constants'!
|
|
1520
|
+
|
|
1521
|
+
hasDropDownDefault
|
|
1522
|
+
^ false
|
|
1523
|
+
!
|
|
1524
|
+
|
|
1525
|
+
isDraggableDefault
|
|
1526
|
+
^ false
|
|
1527
|
+
! !
|
|
1528
|
+
|
|
1529
|
+
MaglevObjectInline subclass: #MaglevSymbolInline
|
|
1530
|
+
instanceVariableNames: ''
|
|
1531
|
+
package: 'Maglev-Database-Explorer'!
|
|
1532
|
+
|
|
1533
|
+
!MaglevSymbolInline methodsFor: 'constants'!
|
|
1534
|
+
|
|
1535
|
+
hasDropDownDefault
|
|
1536
|
+
^ false
|
|
1537
|
+
!
|
|
1538
|
+
|
|
1539
|
+
isDraggableDefault
|
|
1540
|
+
^ false
|
|
1541
|
+
! !
|
|
1542
|
+
|
|
1543
|
+
MaglevObjectInline subclass: #MaglevThreadInline
|
|
1544
|
+
instanceVariableNames: ''
|
|
1545
|
+
package: 'Maglev-Database-Explorer'!
|
|
1546
|
+
|
|
1547
|
+
!MaglevThreadInline methodsFor: 'constants'!
|
|
1548
|
+
|
|
1549
|
+
maxInspection
|
|
1550
|
+
^ 25
|
|
1551
|
+
!
|
|
1552
|
+
|
|
1553
|
+
renderObjectActionsOn: html
|
|
1554
|
+
object isRailsThread
|
|
1555
|
+
ifTrue: [html with: MaglevIconImage rails].
|
|
1556
|
+
object status = 'sleep'
|
|
1557
|
+
ifTrue: [html with: (MaglevIcon pause
|
|
1558
|
+
caption: 'Thread status: sleeping')].
|
|
1559
|
+
object status = 'false'
|
|
1560
|
+
ifTrue: [html with: (MaglevIcon stop
|
|
1561
|
+
caption: 'Thread status: stopped (false)')].
|
|
1562
|
+
object status = 'run'
|
|
1563
|
+
ifTrue: [html with: (MaglevIcon play
|
|
1564
|
+
caption: 'Thread status: running')].
|
|
1565
|
+
object status = 'aborting'
|
|
1566
|
+
ifTrue: [html with: (MaglevIcon trash
|
|
1567
|
+
caption: 'Thread status: aborting')].
|
|
1568
|
+
! !
|
|
1569
|
+
|
|
1570
|
+
Widget subclass: #MaglevObjectInstancesView
|
|
1571
|
+
instanceVariableNames: 'object rangeFrom rangeTo instancesWaitBox contentBox'
|
|
1572
|
+
package: 'Maglev-Database-Explorer'!
|
|
1573
|
+
|
|
1574
|
+
!MaglevObjectInstancesView methodsFor: 'accessing'!
|
|
1575
|
+
|
|
1576
|
+
currentInstVarNames
|
|
1577
|
+
|ivNames|
|
|
1578
|
+
ivNames := Set new.
|
|
1579
|
+
(self rangeFrom to: self rangeTo) do: [:idx | |obj|
|
|
1580
|
+
obj := self objectAt: idx.
|
|
1581
|
+
obj instVarsDo: [:key :value | ivNames add: key string]].
|
|
1582
|
+
^ ivNames
|
|
1583
|
+
!
|
|
1584
|
+
|
|
1585
|
+
object
|
|
1586
|
+
^ object
|
|
1587
|
+
!
|
|
1588
|
+
|
|
1589
|
+
object: anObject
|
|
1590
|
+
object := anObject.
|
|
1591
|
+
!
|
|
1592
|
+
|
|
1593
|
+
objectAt: anIndex
|
|
1594
|
+
^ object instances at: anIndex
|
|
1595
|
+
!
|
|
1596
|
+
|
|
1597
|
+
rangeFrom
|
|
1598
|
+
rangeFrom ifNil: [rangeFrom := 1].
|
|
1599
|
+
^ rangeFrom
|
|
1600
|
+
!
|
|
1601
|
+
|
|
1602
|
+
rangeFrom: anInteger
|
|
1603
|
+
rangeFrom := anInteger.
|
|
1604
|
+
!
|
|
1605
|
+
|
|
1606
|
+
rangeTo
|
|
1607
|
+
rangeTo ifNil: [rangeTo := 10].
|
|
1608
|
+
object instancesSize ifNotNil: [rangeTo := rangeTo min: object instancesSize].
|
|
1609
|
+
^ rangeTo
|
|
1610
|
+
!
|
|
1611
|
+
|
|
1612
|
+
rangeTo: anInteger
|
|
1613
|
+
rangeTo := anInteger.
|
|
1614
|
+
object instancesSize ifNotNil: [rangeTo := rangeTo min: object instancesSize].
|
|
1615
|
+
! !
|
|
1616
|
+
|
|
1617
|
+
!MaglevObjectInstancesView methodsFor: 'interactions'!
|
|
1618
|
+
|
|
1619
|
+
currentPage
|
|
1620
|
+
^ (self rangeFrom / 10) ceiled
|
|
1621
|
+
!
|
|
1622
|
+
|
|
1623
|
+
pages
|
|
1624
|
+
^ (object instancesSize / 10) ceiled
|
|
1625
|
+
! !
|
|
1626
|
+
|
|
1627
|
+
!MaglevObjectInstancesView methodsFor: 'rendering'!
|
|
1628
|
+
|
|
1629
|
+
renderInstVarTable
|
|
1630
|
+
|html|
|
|
1631
|
+
html := HTMLCanvas onJQuery: contentBox asJQuery.
|
|
1632
|
+
contentBox asJQuery empty.
|
|
1633
|
+
instancesWaitBox show.
|
|
1634
|
+
object
|
|
1635
|
+
loadInstancesFrom: self rangeFrom
|
|
1636
|
+
to: self rangeTo
|
|
1637
|
+
withCallback: [:obj | |ivNames|
|
|
1638
|
+
instancesWaitBox hide.
|
|
1639
|
+
object := obj.
|
|
1640
|
+
ivNames := self currentInstVarNames.
|
|
1641
|
+
html table
|
|
1642
|
+
class: 'table table-bordered';
|
|
1643
|
+
style: 'margin-bottom: 0px;';
|
|
1644
|
+
with: [html thead with: [
|
|
1645
|
+
html tr with: [
|
|
1646
|
+
html th with: 'oop'.
|
|
1647
|
+
html th with: 'Object'.
|
|
1648
|
+
ivNames do: [:ivName |
|
|
1649
|
+
html th with: ivName]]].
|
|
1650
|
+
html tbody with: [
|
|
1651
|
+
object instances do: [:obj |
|
|
1652
|
+
html tr with: [
|
|
1653
|
+
html td with: obj oop.
|
|
1654
|
+
html td with: obj inlineViewComponent.
|
|
1655
|
+
ivNames do: [:ivName |
|
|
1656
|
+
html td with: (obj instVarAt: ivName ifAbsent: MaglevInvalidObject instance) inlineViewComponent]]]]].
|
|
1657
|
+
self renderPaginationOn: html.
|
|
1658
|
+
instancesWaitBox hide].
|
|
1659
|
+
!
|
|
1660
|
+
|
|
1661
|
+
renderOn: html
|
|
1662
|
+
instancesWaitBox := html div
|
|
1663
|
+
with: [html
|
|
1664
|
+
with: MaglevIcon wait;
|
|
1665
|
+
with: ' loading...'].
|
|
1666
|
+
contentBox := html div.
|
|
1667
|
+
self renderInstVarTable.
|
|
1668
|
+
!
|
|
1669
|
+
|
|
1670
|
+
renderPaginationOn: html
|
|
1671
|
+
|firstPage lastPage currentPage|
|
|
1672
|
+
currentPage := self currentPage.
|
|
1673
|
+
firstPage := currentPage - 5 max: 1.
|
|
1674
|
+
lastPage := firstPage + 10 min: self pages.
|
|
1675
|
+
html
|
|
1676
|
+
div
|
|
1677
|
+
style: 'text-align: center;';
|
|
1678
|
+
with: [html span
|
|
1679
|
+
class: 'pagination';
|
|
1680
|
+
with: [html ul
|
|
1681
|
+
style: 'margin-top: 10px;';
|
|
1682
|
+
with: [(firstPage to: lastPage) do: [:index | |liClass|
|
|
1683
|
+
currentPage = index
|
|
1684
|
+
ifTrue: [liClass := 'disabled']
|
|
1685
|
+
ifFalse: [liClass := 'active'].
|
|
1686
|
+
html li
|
|
1687
|
+
class: liClass;
|
|
1688
|
+
with: [html a
|
|
1689
|
+
onClick: [
|
|
1690
|
+
self rangeFrom: (index - 1) * 10 + 1.
|
|
1691
|
+
self rangeTo: index * 10.
|
|
1692
|
+
self renderInstVarTable];
|
|
1693
|
+
with: index asString]]]]].
|
|
1694
|
+
! !
|
|
1695
|
+
|
|
1696
|
+
Widget subclass: #MaglevTable
|
|
1697
|
+
instanceVariableNames: 'object collectionName rangeFrom rangeTo isAssociationDictionary tableBody currentPage pageListItems pagination'
|
|
1698
|
+
package: 'Maglev-Database-Explorer'!
|
|
1699
|
+
|
|
1700
|
+
!MaglevTable methodsFor: 'accessing'!
|
|
1701
|
+
|
|
1702
|
+
collection
|
|
1703
|
+
^ object perform: collectionName
|
|
1704
|
+
!
|
|
1705
|
+
|
|
1706
|
+
collectionName
|
|
1707
|
+
^ collectionName
|
|
1708
|
+
!
|
|
1709
|
+
|
|
1710
|
+
collectionName: aString
|
|
1711
|
+
collectionName := aString
|
|
1712
|
+
!
|
|
1713
|
+
|
|
1714
|
+
collectionSize
|
|
1715
|
+
^ object perform: collectionName, 'Size'
|
|
1716
|
+
!
|
|
1717
|
+
|
|
1718
|
+
currentPage
|
|
1719
|
+
currentPage ifNil: [currentPage := 1].
|
|
1720
|
+
^ currentPage
|
|
1721
|
+
!
|
|
1722
|
+
|
|
1723
|
+
isAssociationDictionary
|
|
1724
|
+
isAssociationDictionary ifNil: [isAssociationDictionary := false].
|
|
1725
|
+
^ isAssociationDictionary
|
|
1726
|
+
!
|
|
1727
|
+
|
|
1728
|
+
isAssociationDictionary: aBoolean
|
|
1729
|
+
isAssociationDictionary := aBoolean.
|
|
1730
|
+
!
|
|
1731
|
+
|
|
1732
|
+
object
|
|
1733
|
+
^ object
|
|
1734
|
+
!
|
|
1735
|
+
|
|
1736
|
+
object: anObject
|
|
1737
|
+
object := anObject.
|
|
1738
|
+
!
|
|
1739
|
+
|
|
1740
|
+
pageSize
|
|
1741
|
+
^ 10
|
|
1742
|
+
!
|
|
1743
|
+
|
|
1744
|
+
pages
|
|
1745
|
+
^ (self collectionSize / self pageSize) ceiled
|
|
1746
|
+
!
|
|
1747
|
+
|
|
1748
|
+
rangeFrom
|
|
1749
|
+
rangeFrom ifNil: [rangeFrom := 1].
|
|
1750
|
+
^ rangeFrom
|
|
1751
|
+
!
|
|
1752
|
+
|
|
1753
|
+
rangeFrom: anInteger
|
|
1754
|
+
rangeFrom := anInteger.
|
|
1755
|
+
!
|
|
1756
|
+
|
|
1757
|
+
rangeTo
|
|
1758
|
+
^ self rangeFrom + self pageSize - 1 min: self collectionSize
|
|
1759
|
+
! !
|
|
1760
|
+
|
|
1761
|
+
!MaglevTable methodsFor: 'rendering'!
|
|
1762
|
+
|
|
1763
|
+
renderAssociation: key to: value on: html
|
|
1764
|
+
html tr with: [
|
|
1765
|
+
html td with: key inlineViewComponent.
|
|
1766
|
+
html td with: value inlineViewComponent].
|
|
1767
|
+
!
|
|
1768
|
+
|
|
1769
|
+
renderAssociationDictionaryBodyOn: html
|
|
1770
|
+
(self rangeFrom to: self rangeTo) do: [:idx | |obj|
|
|
1771
|
+
obj := self collection at: idx.
|
|
1772
|
+
html tr with: [
|
|
1773
|
+
html td with: obj key inlineViewComponent.
|
|
1774
|
+
html td with: obj value inlineViewComponent]].
|
|
1775
|
+
!
|
|
1776
|
+
|
|
1777
|
+
renderDictionaryBodyOn: html
|
|
1778
|
+
(self rangeFrom to: self rangeTo) do: [:idx | |obj|
|
|
1779
|
+
obj := self collection at: idx.
|
|
1780
|
+
html tr with: [
|
|
1781
|
+
html td with: idx inlineViewComponent.
|
|
1782
|
+
html td with: obj inlineViewComponent]].
|
|
1783
|
+
!
|
|
1784
|
+
|
|
1785
|
+
renderOn: html
|
|
1786
|
+
|pagClass|
|
|
1787
|
+
self pages = 1
|
|
1788
|
+
ifTrue: [pagClass := 'display: none;']
|
|
1789
|
+
ifFalse: [pagClass := ''].
|
|
1790
|
+
html table
|
|
1791
|
+
class: 'table table-bordered';
|
|
1792
|
+
style: 'margin-bottom: 0px;';
|
|
1793
|
+
with: [tableBody := html tbody].
|
|
1794
|
+
html div
|
|
1795
|
+
style: 'text-align: center;';
|
|
1796
|
+
with: [pagination := html span
|
|
1797
|
+
class: 'pagination';
|
|
1798
|
+
style: pagClass].
|
|
1799
|
+
self renderPagination.
|
|
1800
|
+
self renderPage: 1.
|
|
1801
|
+
!
|
|
1802
|
+
|
|
1803
|
+
renderPage: anInteger
|
|
1804
|
+
|html|
|
|
1805
|
+
currentPage := anInteger.
|
|
1806
|
+
html := HTMLCanvas onJQuery: tableBody asJQuery.
|
|
1807
|
+
rangeFrom := anInteger - 1 * self pageSize + 1.
|
|
1808
|
+
tableBody asJQuery empty.
|
|
1809
|
+
html
|
|
1810
|
+
with: MaglevIcon wait;
|
|
1811
|
+
with: ' loading...'.
|
|
1812
|
+
self renderPagination.
|
|
1813
|
+
object
|
|
1814
|
+
ensureIsLoaded: collectionName
|
|
1815
|
+
from: rangeFrom
|
|
1816
|
+
to: self rangeTo
|
|
1817
|
+
withCallback: [
|
|
1818
|
+
tableBody asJQuery empty.
|
|
1819
|
+
self renderTableBodyOn: (HTMLCanvas onJQuery: tableBody asJQuery)].
|
|
1820
|
+
!
|
|
1821
|
+
|
|
1822
|
+
renderPagination
|
|
1823
|
+
|firstPage lastPage html|
|
|
1824
|
+
pageListItems := Dictionary new.
|
|
1825
|
+
firstPage := self currentPage - 5 max: 1.
|
|
1826
|
+
lastPage := firstPage + 10 min: self pages.
|
|
1827
|
+
pagination asJQuery empty.
|
|
1828
|
+
html := (HTMLCanvas onJQuery: pagination asJQuery).
|
|
1829
|
+
pagination
|
|
1830
|
+
with: [html ul
|
|
1831
|
+
style: 'margin-top: 10px;';
|
|
1832
|
+
with: [(firstPage to: lastPage) do: [:index | |liClass|
|
|
1833
|
+
currentPage = index
|
|
1834
|
+
ifTrue: [liClass := 'disabled']
|
|
1835
|
+
ifFalse: [liClass := 'active'].
|
|
1836
|
+
html li
|
|
1837
|
+
class: liClass;
|
|
1838
|
+
with: [html a
|
|
1839
|
+
onClick: [self renderPage: index];
|
|
1840
|
+
with: index asString]]]].
|
|
1841
|
+
!
|
|
1842
|
+
|
|
1843
|
+
renderTableBodyOn: html
|
|
1844
|
+
self isAssociationDictionary
|
|
1845
|
+
ifTrue: [self renderAssociationDictionaryBodyOn: html. ^ self]
|
|
1846
|
+
ifFalse: [self renderDictionaryBodyOn: html. ^ self].
|
|
1847
|
+
! !
|
|
1848
|
+
|
|
1849
|
+
!MaglevTable class methodsFor: 'instance creation'!
|
|
1850
|
+
|
|
1851
|
+
newAssociationDictFor: anObject with: aString
|
|
1852
|
+
^ self basicNew
|
|
1853
|
+
object: anObject;
|
|
1854
|
+
collectionName: aString;
|
|
1855
|
+
isAssociationDictionary: true;
|
|
1856
|
+
initialize;
|
|
1857
|
+
yourself
|
|
1858
|
+
!
|
|
1859
|
+
|
|
1860
|
+
newFor: anObject with: aString
|
|
1861
|
+
^ self basicNew
|
|
1862
|
+
object: anObject;
|
|
1863
|
+
collectionName: aString;
|
|
1864
|
+
initialize;
|
|
1865
|
+
yourself
|
|
1866
|
+
! !
|
|
1867
|
+
|
|
1868
|
+
Widget subclass: #MaglevWindow
|
|
1869
|
+
instanceVariableNames: 'container navigationItem'
|
|
1870
|
+
package: 'Maglev-Database-Explorer'!
|
|
1871
|
+
|
|
1872
|
+
!MaglevWindow methodsFor: 'accessing'!
|
|
1873
|
+
|
|
1874
|
+
container
|
|
1875
|
+
^ container
|
|
1876
|
+
!
|
|
1877
|
+
|
|
1878
|
+
navigationItem
|
|
1879
|
+
^ navigationItem
|
|
1880
|
+
!
|
|
1881
|
+
|
|
1882
|
+
navigationItem: anObject
|
|
1883
|
+
navigationItem := anObject.
|
|
1884
|
+
! !
|
|
1885
|
+
|
|
1886
|
+
!MaglevWindow methodsFor: 'attributes'!
|
|
1887
|
+
|
|
1888
|
+
left: aValue
|
|
1889
|
+
container left: aValue.
|
|
1890
|
+
!
|
|
1891
|
+
|
|
1892
|
+
top: aValue
|
|
1893
|
+
container top: aValue.
|
|
1894
|
+
! !
|
|
1895
|
+
|
|
1896
|
+
!MaglevWindow methodsFor: 'interactions'!
|
|
1897
|
+
|
|
1898
|
+
clear
|
|
1899
|
+
container asJQuery empty.
|
|
1900
|
+
!
|
|
1901
|
+
|
|
1902
|
+
closeWindow
|
|
1903
|
+
MaglevJsPlumb deleteEndpointsFor: container asJQuery.
|
|
1904
|
+
container asJQuery remove.
|
|
1905
|
+
!
|
|
1906
|
+
|
|
1907
|
+
connectTo: aWindow as: type with: caption
|
|
1908
|
+
MaglevJsPlumb connectWindow: self to: aWindow as: type with: caption.
|
|
1909
|
+
!
|
|
1910
|
+
|
|
1911
|
+
connectTo: aWindow with: parameters
|
|
1912
|
+
MaglevJsPlumb connectWindow: self to: aWindow with: parameters.
|
|
1913
|
+
!
|
|
1914
|
+
|
|
1915
|
+
moveToFront
|
|
1916
|
+
container asJQuery css: 'z-index' data: self class highestZIndex + 1.
|
|
1917
|
+
!
|
|
1918
|
+
|
|
1919
|
+
prepareWindow
|
|
1920
|
+
MaglevJsPlumb prepareObject: (container asJQuery).
|
|
1921
|
+
container
|
|
1922
|
+
onMouseEnter: [container removeClass: 'window-mouse-out'];
|
|
1923
|
+
onMouseLeave: [container addClass: 'window-mouse-out'].
|
|
1924
|
+
!
|
|
1925
|
+
|
|
1926
|
+
replace: aWindow
|
|
1927
|
+
aWindow clear.
|
|
1928
|
+
container := aWindow container.
|
|
1929
|
+
! !
|
|
1930
|
+
|
|
1931
|
+
!MaglevWindow methodsFor: 'rendering'!
|
|
1932
|
+
|
|
1933
|
+
appendToWorkspace
|
|
1934
|
+
self renderOn: (HTMLCanvas onJQuery: '#workspace' asJQuery).
|
|
1935
|
+
!
|
|
1936
|
+
|
|
1937
|
+
renderCloseButtonOn: html
|
|
1938
|
+
html span
|
|
1939
|
+
class: 'display-inline-block';
|
|
1940
|
+
style: 'float: right; margin-top: 3px; margin-left: 3px;';
|
|
1941
|
+
with: [html a
|
|
1942
|
+
href: '#';
|
|
1943
|
+
class: 'window-close-button';
|
|
1944
|
+
onClick: [self closeWindow];
|
|
1945
|
+
with: MaglevIcon remove].
|
|
1946
|
+
!
|
|
1947
|
+
|
|
1948
|
+
renderHeightPlaceholderOn: html
|
|
1949
|
+
html span
|
|
1950
|
+
style: 'visibility: hidden;';
|
|
1951
|
+
with: [
|
|
1952
|
+
html a
|
|
1953
|
+
class: 'btn';
|
|
1954
|
+
with: 'a'].
|
|
1955
|
+
!
|
|
1956
|
+
|
|
1957
|
+
renderHorziontalLineOn: html
|
|
1958
|
+
html hr style: 'margin: 10px;'.
|
|
1959
|
+
!
|
|
1960
|
+
|
|
1961
|
+
renderNavigationOn: html
|
|
1962
|
+
html with: 'New window'.
|
|
1963
|
+
!
|
|
1964
|
+
|
|
1965
|
+
renderOn: html
|
|
1966
|
+
container ifNil: [
|
|
1967
|
+
container := html div.
|
|
1968
|
+
self prepareWindow].
|
|
1969
|
+
container
|
|
1970
|
+
class: 'component window';
|
|
1971
|
+
with: [
|
|
1972
|
+
html div
|
|
1973
|
+
class: 'nowrap';
|
|
1974
|
+
with: [
|
|
1975
|
+
self renderWindowTitleOn: html.
|
|
1976
|
+
self renderWindowContentOn: html]].
|
|
1977
|
+
container onMouseDown: [self moveToFront].
|
|
1978
|
+
self moveToFront.
|
|
1979
|
+
!
|
|
1980
|
+
|
|
1981
|
+
renderReplace
|
|
1982
|
+
self renderOn: (HTMLCanvas onJQuery: container asJQuery).
|
|
1983
|
+
!
|
|
1984
|
+
|
|
1985
|
+
renderWindowContentOn: html
|
|
1986
|
+
!
|
|
1987
|
+
|
|
1988
|
+
renderWindowTitleContentOn: html
|
|
1989
|
+
html with: 'A new window'.
|
|
1990
|
+
self renderHeightPlaceholderOn: html.
|
|
1991
|
+
self renderCloseButtonOn: html.
|
|
1992
|
+
!
|
|
1993
|
+
|
|
1994
|
+
renderWindowTitleOn: html
|
|
1995
|
+
html div
|
|
1996
|
+
class: 'window-title';
|
|
1997
|
+
with: [html span
|
|
1998
|
+
class: 'window-title-content';
|
|
1999
|
+
with: [self renderWindowTitleContentOn: html]].
|
|
2000
|
+
! !
|
|
2001
|
+
|
|
2002
|
+
!MaglevWindow methodsFor: 'testing'!
|
|
2003
|
+
|
|
2004
|
+
isWaitingWindow
|
|
2005
|
+
^ false
|
|
2006
|
+
! !
|
|
2007
|
+
|
|
2008
|
+
!MaglevWindow class methodsFor: 'instance creation'!
|
|
2009
|
+
|
|
2010
|
+
newReplace: aWindow
|
|
2011
|
+
^ self new
|
|
2012
|
+
replace: aWindow;
|
|
2013
|
+
yourself
|
|
2014
|
+
! !
|
|
2015
|
+
|
|
2016
|
+
!MaglevWindow class methodsFor: 'interactions'!
|
|
2017
|
+
|
|
2018
|
+
highestZIndex
|
|
2019
|
+
< var indexHighest = 0;
|
|
2020
|
+
$('.window').each(function(){
|
|
2021
|
+
var indexCurrent = parseInt($(this).css("z-index"), 10);
|
|
2022
|
+
if(indexCurrent >> indexHighest) {
|
|
2023
|
+
indexHighest = indexCurrent;
|
|
2024
|
+
}
|
|
2025
|
+
});
|
|
2026
|
+
return indexHighest; >.
|
|
2027
|
+
! !
|
|
2028
|
+
|
|
2029
|
+
MaglevWindow subclass: #MaglevObjectWindow
|
|
2030
|
+
instanceVariableNames: 'container object classObject tabs captions tabsContainer currentTab'
|
|
2031
|
+
package: 'Maglev-Database-Explorer'!
|
|
2032
|
+
|
|
2033
|
+
!MaglevObjectWindow methodsFor: 'accessing'!
|
|
2034
|
+
|
|
2035
|
+
captions
|
|
2036
|
+
captions ifNil: [captions := Dictionary new].
|
|
2037
|
+
^ captions
|
|
2038
|
+
!
|
|
2039
|
+
|
|
2040
|
+
container
|
|
2041
|
+
^ container
|
|
2042
|
+
!
|
|
2043
|
+
|
|
2044
|
+
object
|
|
2045
|
+
^ object
|
|
2046
|
+
!
|
|
2047
|
+
|
|
2048
|
+
object: anObject
|
|
2049
|
+
object := anObject.
|
|
2050
|
+
classObject := anObject classObject.
|
|
2051
|
+
!
|
|
2052
|
+
|
|
2053
|
+
tabs
|
|
2054
|
+
tabs ifNil: [tabs := Dictionary new].
|
|
2055
|
+
^ tabs
|
|
2056
|
+
! !
|
|
2057
|
+
|
|
2058
|
+
!MaglevObjectWindow methodsFor: 'interactions'!
|
|
2059
|
+
|
|
2060
|
+
closeWindow
|
|
2061
|
+
MaglevObjectSpace instance unregisterWindow: self.
|
|
2062
|
+
super closeWindow.
|
|
2063
|
+
!
|
|
2064
|
+
|
|
2065
|
+
defaultTab
|
|
2066
|
+
^ nil
|
|
2067
|
+
!
|
|
2068
|
+
|
|
2069
|
+
makeCurrentTabResizable
|
|
2070
|
+
currentTab
|
|
2071
|
+
style: 'overflow: hidden;'.
|
|
2072
|
+
currentTab asJQuery children first
|
|
2073
|
+
attr: 'style' with: 'width: 100%; height: 100%; overflow: auto;'.
|
|
2074
|
+
currentTab asJQuery resizable.
|
|
2075
|
+
!
|
|
2076
|
+
|
|
2077
|
+
prepareWindow
|
|
2078
|
+
super prepareWindow
|
|
2079
|
+
MaglevObjectSpace registerWindow: self.
|
|
2080
|
+
!
|
|
2081
|
+
|
|
2082
|
+
replace: aWindow
|
|
2083
|
+
super replace: aWindow.
|
|
2084
|
+
aWindow isWaitingWindow
|
|
2085
|
+
ifFalse: [MaglevObjectSpace instance unregisterWindow: aWindow].
|
|
2086
|
+
MaglevObjectSpace instance registerWindow: self.
|
|
2087
|
+
!
|
|
2088
|
+
|
|
2089
|
+
showTab: caption
|
|
2090
|
+
|allTabs|
|
|
2091
|
+
allTabs := self contentTabs.
|
|
2092
|
+
"Lazy generate new tabs."
|
|
2093
|
+
((self tabs includesKey: caption) not and: [allTabs includesKey: caption])
|
|
2094
|
+
ifTrue: [ |tab html|
|
|
2095
|
+
html := HTMLCanvas onJQuery: tabsContainer asJQuery.
|
|
2096
|
+
tab := html div
|
|
2097
|
+
with: [
|
|
2098
|
+
html div
|
|
2099
|
+
with: [self perform: (allTabs at: caption) withArguments: {html}]].
|
|
2100
|
+
self tabs at: caption put: tab].
|
|
2101
|
+
self tabs keysAndValuesDo: [:tabCaption :tab | |capEl|
|
|
2102
|
+
capEl := self captions at: tabCaption.
|
|
2103
|
+
caption = tabCaption
|
|
2104
|
+
ifTrue: [
|
|
2105
|
+
currentTab := tab.
|
|
2106
|
+
tab show.
|
|
2107
|
+
capEl addClass: 'active']
|
|
2108
|
+
ifFalse: [
|
|
2109
|
+
tab hide.
|
|
2110
|
+
capEl removeClass: 'active']].
|
|
2111
|
+
"return false to avoid scrolling to the top"
|
|
2112
|
+
^ false
|
|
2113
|
+
! !
|
|
2114
|
+
|
|
2115
|
+
!MaglevObjectWindow methodsFor: 'rendering'!
|
|
2116
|
+
|
|
2117
|
+
checkAddConnectionTo: aWindow
|
|
2118
|
+
object instVarsDo: [:ivName :ivValue |
|
|
2119
|
+
ivValue == aWindow object ifTrue: [self connectTo: aWindow as: #iv with: ivName inspection]].
|
|
2120
|
+
(object classObject == aWindow object and: [object virtualClassObject ~~ aWindow object])
|
|
2121
|
+
ifTrue: [self connectTo: aWindow as: #class with: nil].
|
|
2122
|
+
object virtualClassObject == aWindow object
|
|
2123
|
+
ifTrue: [self connectTo: aWindow as: #virtualClass with: nil].
|
|
2124
|
+
!
|
|
2125
|
+
|
|
2126
|
+
contentTabs
|
|
2127
|
+
|result|
|
|
2128
|
+
result := Dictionary new.
|
|
2129
|
+
self object hasInstVars
|
|
2130
|
+
ifTrue: [result at: 'Instance Variables' put: #renderInstanceVariablesOn:].
|
|
2131
|
+
object customTabs do: [:customTab | |selector|
|
|
2132
|
+
selector := 'renderCustom', (customTab at: 2), 'On:'.
|
|
2133
|
+
self class compile: selector, 'html ', (customTab at: 3).
|
|
2134
|
+
result at: (customTab at: 1) put: selector asSymbol].
|
|
2135
|
+
^ result
|
|
2136
|
+
!
|
|
2137
|
+
|
|
2138
|
+
renderInstanceVariablesOn: html
|
|
2139
|
+
html with: (MaglevTable newAssociationDictFor: self object with: #instVars).
|
|
2140
|
+
!
|
|
2141
|
+
|
|
2142
|
+
renderNavigationOn: html
|
|
2143
|
+
html with: object inlineViewComponentNavItem.
|
|
2144
|
+
!
|
|
2145
|
+
|
|
2146
|
+
renderVirtualClassAndClassOn: html
|
|
2147
|
+
classObject = object virtualClassObject ifFalse: [
|
|
2148
|
+
html
|
|
2149
|
+
with: ' : ';
|
|
2150
|
+
with: object virtualClassObject inlineViewComponent].
|
|
2151
|
+
html
|
|
2152
|
+
with: ' :: ';
|
|
2153
|
+
with: classObject inlineViewComponent.
|
|
2154
|
+
!
|
|
2155
|
+
|
|
2156
|
+
renderWindowContentOn: html
|
|
2157
|
+
|allTabs firstCaption defaultTab|
|
|
2158
|
+
allTabs := self contentTabs.
|
|
2159
|
+
allTabs size > 0 ifTrue: [
|
|
2160
|
+
html ul
|
|
2161
|
+
class: 'nav nav-tabs';
|
|
2162
|
+
style: 'display: inline-block; margin-bottom: 0px; margin-top: 5px; width: 100%;';
|
|
2163
|
+
with: [
|
|
2164
|
+
html li
|
|
2165
|
+
style: 'float: right;';
|
|
2166
|
+
onClick: [self makeCurrentTabResizable];
|
|
2167
|
+
with: [
|
|
2168
|
+
html a
|
|
2169
|
+
href: '#';
|
|
2170
|
+
onClick: [self makeCurrentTabResizable];
|
|
2171
|
+
with: MaglevIcon resizeSmall].
|
|
2172
|
+
self contentTabs keysAndValuesDo: [:caption :generator | |capEl|
|
|
2173
|
+
firstCaption ifNil: [firstCaption := caption].
|
|
2174
|
+
capEl := html li with: [
|
|
2175
|
+
html a
|
|
2176
|
+
href: '#';
|
|
2177
|
+
onClick: [self showTab: caption];
|
|
2178
|
+
with: caption].
|
|
2179
|
+
self captions at: caption put: capEl]]].
|
|
2180
|
+
tabsContainer := html div.
|
|
2181
|
+
defaultTab := self defaultTab.
|
|
2182
|
+
defaultTab
|
|
2183
|
+
ifNil: [firstCaption ifNotNil: [self showTab: firstCaption]]
|
|
2184
|
+
ifNotNil: [self showTab: defaultTab].
|
|
2185
|
+
!
|
|
2186
|
+
|
|
2187
|
+
renderWindowTitleContentOn: html
|
|
2188
|
+
html with: object inlineViewComponentShort.
|
|
2189
|
+
html with: [
|
|
2190
|
+
html span
|
|
2191
|
+
style: 'margin-left: 5px;';
|
|
2192
|
+
with: '<0x', object oop asHexString, '>'].
|
|
2193
|
+
self renderHeightPlaceholderOn: html.
|
|
2194
|
+
html div
|
|
2195
|
+
class: 'right-inline-block';
|
|
2196
|
+
with: [
|
|
2197
|
+
self renderVirtualClassAndClassOn: html.
|
|
2198
|
+
self renderCloseButtonOn: html].
|
|
2199
|
+
! !
|
|
2200
|
+
|
|
2201
|
+
!MaglevObjectWindow class methodsFor: 'instance creation'!
|
|
2202
|
+
|
|
2203
|
+
newReplace: aWindow with: anObject
|
|
2204
|
+
^ self new
|
|
2205
|
+
object: anObject;
|
|
2206
|
+
replace: aWindow;
|
|
2207
|
+
yourself
|
|
2208
|
+
! !
|
|
2209
|
+
|
|
2210
|
+
MaglevObjectWindow subclass: #MaglevArrayWindow
|
|
2211
|
+
instanceVariableNames: ''
|
|
2212
|
+
package: 'Maglev-Database-Explorer'!
|
|
2213
|
+
|
|
2214
|
+
!MaglevArrayWindow methodsFor: 'interactions'!
|
|
2215
|
+
|
|
2216
|
+
defaultTab
|
|
2217
|
+
^ 'Elements'
|
|
2218
|
+
! !
|
|
2219
|
+
|
|
2220
|
+
!MaglevArrayWindow methodsFor: 'rendering'!
|
|
2221
|
+
|
|
2222
|
+
checkAddConnectionTo: aWindow
|
|
2223
|
+
super checkAddConnectionTo: aWindow.
|
|
2224
|
+
object elements keysAndValuesDo: [:idx :value |
|
|
2225
|
+
value == aWindow object ifTrue: [self connectTo: aWindow as: #arrayElement with: idx]].
|
|
2226
|
+
!
|
|
2227
|
+
|
|
2228
|
+
contentTabs
|
|
2229
|
+
|result|
|
|
2230
|
+
result := super contentTabs.
|
|
2231
|
+
self object hasElements
|
|
2232
|
+
ifTrue: [result at: 'Elements' put: #renderArrayElementsOn:].
|
|
2233
|
+
^ result
|
|
2234
|
+
!
|
|
2235
|
+
|
|
2236
|
+
renderArrayElementsOn: html
|
|
2237
|
+
html with: (MaglevTable newFor: self object with: #elements).
|
|
2238
|
+
! !
|
|
2239
|
+
|
|
2240
|
+
MaglevObjectWindow subclass: #MaglevExceptionWindow
|
|
2241
|
+
instanceVariableNames: ''
|
|
2242
|
+
package: 'Maglev-Database-Explorer'!
|
|
2243
|
+
|
|
2244
|
+
MaglevObjectWindow subclass: #MaglevFixnumWindow
|
|
2245
|
+
instanceVariableNames: ''
|
|
2246
|
+
package: 'Maglev-Database-Explorer'!
|
|
2247
|
+
|
|
2248
|
+
MaglevObjectWindow subclass: #MaglevFloatWindow
|
|
2249
|
+
instanceVariableNames: ''
|
|
2250
|
+
package: 'Maglev-Database-Explorer'!
|
|
2251
|
+
|
|
2252
|
+
MaglevObjectWindow subclass: #MaglevHashWindow
|
|
2253
|
+
instanceVariableNames: ''
|
|
2254
|
+
package: 'Maglev-Database-Explorer'!
|
|
2255
|
+
|
|
2256
|
+
!MaglevHashWindow methodsFor: 'interactions'!
|
|
2257
|
+
|
|
2258
|
+
defaultTab
|
|
2259
|
+
^ 'Associations'
|
|
2260
|
+
! !
|
|
2261
|
+
|
|
2262
|
+
!MaglevHashWindow methodsFor: 'rendering'!
|
|
2263
|
+
|
|
2264
|
+
checkAddConnectionTo: aWindow
|
|
2265
|
+
super checkAddConnectionTo: aWindow.
|
|
2266
|
+
object keysAndValuesDo: [:key :value |
|
|
2267
|
+
key == aWindow object ifTrue: [self connectTo: aWindow as: #hashKey with: 'self[...] = ', value shortInspection].
|
|
2268
|
+
value == aWindow object ifTrue: [self connectTo: aWindow as: #hashValue with: 'self[', key shortInspection, '] = ...']].
|
|
2269
|
+
!
|
|
2270
|
+
|
|
2271
|
+
contentTabs
|
|
2272
|
+
|result|
|
|
2273
|
+
result := super contentTabs.
|
|
2274
|
+
self object hasElements
|
|
2275
|
+
ifTrue: [result at: 'Associations' put: #renderHashElementsOn:].
|
|
2276
|
+
^ result
|
|
2277
|
+
!
|
|
2278
|
+
|
|
2279
|
+
renderHashElementsOn: html
|
|
2280
|
+
html with: (MaglevTable newAssociationDictFor: self object with: #elements).
|
|
2281
|
+
! !
|
|
2282
|
+
|
|
2283
|
+
MaglevObjectWindow subclass: #MaglevMaglevRecordBaseWindow
|
|
2284
|
+
instanceVariableNames: ''
|
|
2285
|
+
package: 'Maglev-Database-Explorer'!
|
|
2286
|
+
|
|
2287
|
+
!MaglevMaglevRecordBaseWindow methodsFor: 'rendering'!
|
|
2288
|
+
|
|
2289
|
+
contentTabs
|
|
2290
|
+
|result|
|
|
2291
|
+
result := super contentTabs.
|
|
2292
|
+
result at: 'Attributes' put: #renderAttributesOn:.
|
|
2293
|
+
^ result
|
|
2294
|
+
!
|
|
2295
|
+
|
|
2296
|
+
renderAttributesOn: html
|
|
2297
|
+
html with: (MaglevTable newAssociationDictFor: self object with: #attributes).
|
|
2298
|
+
! !
|
|
2299
|
+
|
|
2300
|
+
MaglevObjectWindow subclass: #MaglevModuleWindow
|
|
2301
|
+
instanceVariableNames: 'categoryNamesSelect selectorsSelect selectors rubySelectors methodContainer waitingScreen hierarchyContainer'
|
|
2302
|
+
package: 'Maglev-Database-Explorer'!
|
|
2303
|
+
|
|
2304
|
+
!MaglevModuleWindow methodsFor: 'initializing'!
|
|
2305
|
+
|
|
2306
|
+
initializeTree: container
|
|
2307
|
+
< container.jstree({
|
|
2308
|
+
plugins: ["crrm", "html_data", "themes"],
|
|
2309
|
+
core: {
|
|
2310
|
+
animation: 0,
|
|
2311
|
+
open_parents: true}});
|
|
2312
|
+
// setTimout: jstree fix
|
|
2313
|
+
setTimeout(function(){
|
|
2314
|
+
container.find('.treeview-replace-me').each(function(index, el) {
|
|
2315
|
+
var jqEl = $(el);
|
|
2316
|
+
self._renderInlineViewFor_inside_(jqEl.data('oop'), jqEl);
|
|
2317
|
+
jqEl.removeClass('treeview-replace-me');
|
|
2318
|
+
});}, 0); >
|
|
2319
|
+
! !
|
|
2320
|
+
|
|
2321
|
+
!MaglevModuleWindow methodsFor: 'interactions'!
|
|
2322
|
+
|
|
2323
|
+
defaultTab
|
|
2324
|
+
^ 'Code'
|
|
2325
|
+
!
|
|
2326
|
+
|
|
2327
|
+
renderHierarchySubclass: cls for: oop
|
|
2328
|
+
< var ownerLi = self['@hierarchyContainer']._asJQuery().find("[data-oop='" + oop + "']");
|
|
2329
|
+
if (ownerLi.find("[data-oop='" + cls._oop() + "']").length == 0) {
|
|
2330
|
+
self['@hierarchyContainer']._asJQuery().jstree('create', ownerLi, null, {attr: {'data-oop': cls._oop(), 'data-replace-me': '1'}}, null, true);
|
|
2331
|
+
} >
|
|
2332
|
+
!
|
|
2333
|
+
|
|
2334
|
+
renderSelectors: selectedCategory
|
|
2335
|
+
|currentSelectors|
|
|
2336
|
+
selectorsSelect clear.
|
|
2337
|
+
currentSelectors := selectors at: selectedCategory.
|
|
2338
|
+
currentSelectors ifNil: [^ self].
|
|
2339
|
+
currentSelectors do: [:sel |
|
|
2340
|
+
selectorsSelect
|
|
2341
|
+
with: [:html | html with: sel]
|
|
2342
|
+
data: sel].
|
|
2343
|
+
!
|
|
2344
|
+
|
|
2345
|
+
renderSourceCode: selectorString
|
|
2346
|
+
|selectedCategory|
|
|
2347
|
+
methodContainer asJQuery empty.
|
|
2348
|
+
selectorString ifNil: [^ self].
|
|
2349
|
+
waitingScreen show.
|
|
2350
|
+
selectedCategory := self selectedCategoryString.
|
|
2351
|
+
selectedCategory = '(all Ruby)'
|
|
2352
|
+
ifTrue: [self renderRubySourceCodeFor: selectorString]
|
|
2353
|
+
ifFalse: [self renderSmalltalkSourceCodeFor: selectorString].
|
|
2354
|
+
!
|
|
2355
|
+
|
|
2356
|
+
replaceHierarchySubclasses
|
|
2357
|
+
< self['@hierarchyContainer']._asJQuery().find("[data-replace-me='1']").each(function(idx, el) {
|
|
2358
|
+
// TODO: jQuery not working here for unknown reasons
|
|
2359
|
+
el.getElementsByTagName('a')[0].remove();
|
|
2360
|
+
el.removeAttribute('data-replace-me');
|
|
2361
|
+
var jqEl = $(el);
|
|
2362
|
+
self._renderInlineViewFor_inside_(jqEl.data('oop'), jqEl);
|
|
2363
|
+
}); >
|
|
2364
|
+
!
|
|
2365
|
+
|
|
2366
|
+
selectedCategoryString
|
|
2367
|
+
^ categoryNamesSelect selectedData
|
|
2368
|
+
! !
|
|
2369
|
+
|
|
2370
|
+
!MaglevModuleWindow methodsFor: 'rendering'!
|
|
2371
|
+
|
|
2372
|
+
contentTabs
|
|
2373
|
+
|result|
|
|
2374
|
+
result := super contentTabs.
|
|
2375
|
+
self object hasConstants
|
|
2376
|
+
ifTrue: [result at: 'Constants' put: #renderConstantsOn:].
|
|
2377
|
+
self object hasIncludedModules
|
|
2378
|
+
ifTrue: [result at: 'Included Modules' put: #renderIncludedModulesOn:].
|
|
2379
|
+
result at: 'Code' put: #renderCodeTabOn:.
|
|
2380
|
+
result at: 'Hierarchy' put: #renderHierarchyOn:.
|
|
2381
|
+
^ result
|
|
2382
|
+
!
|
|
2383
|
+
|
|
2384
|
+
renderCodeTabOn: html
|
|
2385
|
+
html root
|
|
2386
|
+
style: 'width: 100%;'.
|
|
2387
|
+
self renderListsOn: html.
|
|
2388
|
+
waitingScreen := html div
|
|
2389
|
+
with: [html
|
|
2390
|
+
with: MaglevIcon wait;
|
|
2391
|
+
with: ' loading...'].
|
|
2392
|
+
methodContainer := html div
|
|
2393
|
+
style: 'margin-top: 10px;'.
|
|
2394
|
+
self object allSelectorsWithCallback: [:obj |
|
|
2395
|
+
selectors := obj.
|
|
2396
|
+
self renderSelectorCategories.
|
|
2397
|
+
waitingScreen hide.
|
|
2398
|
+
categoryNamesSelect show.
|
|
2399
|
+
selectorsSelect show].
|
|
2400
|
+
!
|
|
2401
|
+
|
|
2402
|
+
renderConstantsOn: html
|
|
2403
|
+
html with: (MaglevTable newAssociationDictFor: self object with: #constants).
|
|
2404
|
+
!
|
|
2405
|
+
|
|
2406
|
+
renderHierarchyOn: htmlIn
|
|
2407
|
+
|waitingBox hcContainer|
|
|
2408
|
+
hcContainer := htmlIn div
|
|
2409
|
+
style: 'height: 300px; overflow: hidden;'.
|
|
2410
|
+
waitingBox := htmlIn div with: [
|
|
2411
|
+
htmlIn
|
|
2412
|
+
with: MaglevIcon wait;
|
|
2413
|
+
with: ' loading...'].
|
|
2414
|
+
object ensureSuperListLoadedWithCallback: [ |renderedInlines html|
|
|
2415
|
+
html := HTMLCanvas onJQuery: hcContainer asJQuery.
|
|
2416
|
+
renderedInlines := Array new.
|
|
2417
|
+
hierarchyContainer := html div
|
|
2418
|
+
style: 'width: 100%; height: 100%; overflow: auto;';
|
|
2419
|
+
with: [ |lastUl|
|
|
2420
|
+
lastUl := html ul.
|
|
2421
|
+
object superList do: [:cls | "render superclasses"
|
|
2422
|
+
lastUl with: [
|
|
2423
|
+
html li
|
|
2424
|
+
data: 'oop' with: cls oop asString;
|
|
2425
|
+
with: [|container|
|
|
2426
|
+
container := html span
|
|
2427
|
+
data: 'oop' with: cls oop asString;
|
|
2428
|
+
class: 'treeview-replace-me'.
|
|
2429
|
+
renderedInlines add: container];
|
|
2430
|
+
with: [lastUl := html ul]]]].
|
|
2431
|
+
self initializeTree: hierarchyContainer asJQuery.
|
|
2432
|
+
hcContainer asJQuery resizable.
|
|
2433
|
+
waitingBox hide].
|
|
2434
|
+
!
|
|
2435
|
+
|
|
2436
|
+
renderIncludedModulesOn: html
|
|
2437
|
+
html with: (MaglevTable newFor: self object with: #includedModules).
|
|
2438
|
+
!
|
|
2439
|
+
|
|
2440
|
+
renderInlineViewFor: oop inside: htmlElement
|
|
2441
|
+
|html subclassesButton waitIcon|
|
|
2442
|
+
html := HTMLCanvas onJQuery: htmlElement.
|
|
2443
|
+
waitIcon := MaglevIcon wait.
|
|
2444
|
+
html with: waitIcon.
|
|
2445
|
+
waitIcon hide.
|
|
2446
|
+
subclassesButton := MaglevIcon codeFork.
|
|
2447
|
+
html with: [html a with: subclassesButton].
|
|
2448
|
+
subclassesButton onClick: [ |obj|
|
|
2449
|
+
subclassesButton hide.
|
|
2450
|
+
waitIcon show.
|
|
2451
|
+
obj := MaglevObjectSpace instance at: oop.
|
|
2452
|
+
obj ensureSubclassesLoadedWithCallback: [
|
|
2453
|
+
obj subclasses do: [:cls |
|
|
2454
|
+
self renderHierarchySubclass: cls for: oop].
|
|
2455
|
+
self replaceHierarchySubclasses.
|
|
2456
|
+
waitIcon hide]].
|
|
2457
|
+
(MaglevObjectSpace instance at: oop) inlineViewComponentFull renderOn: html.
|
|
2458
|
+
!
|
|
2459
|
+
|
|
2460
|
+
renderListsOn: html
|
|
2461
|
+
categoryNamesSelect := MaglevListBox new.
|
|
2462
|
+
html with: categoryNamesSelect.
|
|
2463
|
+
categoryNamesSelect
|
|
2464
|
+
changedCallback: [:cat :index | self renderSelectors: cat];
|
|
2465
|
+
height: 250;
|
|
2466
|
+
style: 'float: left; width: 50%; margin-right: 10px; margin-left: 0px; display: inline-block;';
|
|
2467
|
+
hide.
|
|
2468
|
+
selectorsSelect := MaglevListBox new.
|
|
2469
|
+
html with: selectorsSelect.
|
|
2470
|
+
selectorsSelect
|
|
2471
|
+
changedCallback: [:sel :index | self renderSourceCode: sel];
|
|
2472
|
+
height: 250;
|
|
2473
|
+
style: 'display: inline-block; width: 50%; box-sizing: border-box; -webkit-box-sizing: border-box; padding-right: 10px;';
|
|
2474
|
+
hide.
|
|
2475
|
+
!
|
|
2476
|
+
|
|
2477
|
+
renderMethodObject: obj
|
|
2478
|
+
|methodEditor|
|
|
2479
|
+
methodEditor := MaglevGsNMethodEditor for: obj.
|
|
2480
|
+
methodEditor classObject: object.
|
|
2481
|
+
methodContainer with: methodEditor.
|
|
2482
|
+
waitingScreen hide.
|
|
2483
|
+
!
|
|
2484
|
+
|
|
2485
|
+
renderRubySourceCodeFor: selectorString
|
|
2486
|
+
object
|
|
2487
|
+
sourceCodeFor: selectorString
|
|
2488
|
+
language: 'ruby'
|
|
2489
|
+
withCallback: [:obj | self renderMethodObject: obj].
|
|
2490
|
+
!
|
|
2491
|
+
|
|
2492
|
+
renderSelectorCategories
|
|
2493
|
+
categoryNamesSelect clear.
|
|
2494
|
+
selectors keysAndValuesDo: [:category :catSelectors |
|
|
2495
|
+
categoryNamesSelect with: [:html |
|
|
2496
|
+
category = '(all Ruby)'
|
|
2497
|
+
ifTrue: [html with: MaglevIconImage ruby]
|
|
2498
|
+
ifFalse: [html with: MaglevIconImage smalltalk].
|
|
2499
|
+
html with: category]
|
|
2500
|
+
data: category].
|
|
2501
|
+
!
|
|
2502
|
+
|
|
2503
|
+
renderSmalltalkSourceCodeFor: selectorString
|
|
2504
|
+
object
|
|
2505
|
+
sourceCodeFor: selectorString
|
|
2506
|
+
language: 'smalltalk'
|
|
2507
|
+
withCallback: [:obj | self renderMethodObject: obj].
|
|
2508
|
+
!
|
|
2509
|
+
|
|
2510
|
+
sortList: aListBox
|
|
2511
|
+
|box children|
|
|
2512
|
+
box := aListBox asJQuery.
|
|
2513
|
+
< children = box.children('option').sort(function (a, b) {return a.innerHTML >> b.innerHTML ? 1 : -1}); >.
|
|
2514
|
+
box empty.
|
|
2515
|
+
children appendTo: box.
|
|
2516
|
+
! !
|
|
2517
|
+
|
|
2518
|
+
MaglevModuleWindow subclass: #MaglevClassWindow
|
|
2519
|
+
instanceVariableNames: ''
|
|
2520
|
+
package: 'Maglev-Database-Explorer'!
|
|
2521
|
+
|
|
2522
|
+
!MaglevClassWindow methodsFor: 'rendering'!
|
|
2523
|
+
|
|
2524
|
+
checkAddConnectionTo: aWindow
|
|
2525
|
+
super checkAddConnectionTo: aWindow.
|
|
2526
|
+
object superclassObject == aWindow object ifTrue: [self connectTo: aWindow as: #superclass with: nil].
|
|
2527
|
+
!
|
|
2528
|
+
|
|
2529
|
+
contentTabs
|
|
2530
|
+
|result|
|
|
2531
|
+
result := super contentTabs.
|
|
2532
|
+
result at: 'Instances' put: #renderInstancesOn:.
|
|
2533
|
+
^ result
|
|
2534
|
+
!
|
|
2535
|
+
|
|
2536
|
+
renderInstancesOn: html
|
|
2537
|
+
html with: object instancesViewComponent.
|
|
2538
|
+
!
|
|
2539
|
+
|
|
2540
|
+
renderWindowTitleContentOn: html
|
|
2541
|
+
html
|
|
2542
|
+
with: object inlineViewComponentShort;
|
|
2543
|
+
with: ' < ';
|
|
2544
|
+
with: object superclassObject inlineViewComponent.
|
|
2545
|
+
html with: [
|
|
2546
|
+
html span
|
|
2547
|
+
style: 'margin-left: 5px;';
|
|
2548
|
+
with: '<0x', object oop asHexString, '>'].
|
|
2549
|
+
self renderHeightPlaceholderOn: html.
|
|
2550
|
+
html div
|
|
2551
|
+
class: 'right-inline-block';
|
|
2552
|
+
with: [
|
|
2553
|
+
self renderVirtualClassAndClassOn: html.
|
|
2554
|
+
self renderCloseButtonOn: html].
|
|
2555
|
+
! !
|
|
2556
|
+
|
|
2557
|
+
MaglevClassWindow subclass: #MaglevSystemClassWindow
|
|
2558
|
+
instanceVariableNames: 'transactionResultBox persistenceModeButton'
|
|
2559
|
+
package: 'Maglev-Database-Explorer'!
|
|
2560
|
+
|
|
2561
|
+
!MaglevSystemClassWindow methodsFor: 'interactions'!
|
|
2562
|
+
|
|
2563
|
+
abortTransaction
|
|
2564
|
+
self showTransactionWaitingBox.
|
|
2565
|
+
object
|
|
2566
|
+
evaluate: 'self.__DBEAbortTransaction'
|
|
2567
|
+
language: 'ruby'
|
|
2568
|
+
withCallback: [:success :resultObj |
|
|
2569
|
+
transactionResultBox asJQuery empty.
|
|
2570
|
+
transactionResultBox removeClass: 'alert-info'.
|
|
2571
|
+
success
|
|
2572
|
+
ifTrue: [transactionResultBox addClass: 'alert-success']
|
|
2573
|
+
ifFalse: [transactionResultBox addClass: 'alert-error'].
|
|
2574
|
+
transactionResultBox with: resultObj inlineViewComponent].
|
|
2575
|
+
!
|
|
2576
|
+
|
|
2577
|
+
commitTransaction
|
|
2578
|
+
self showTransactionWaitingBox.
|
|
2579
|
+
object
|
|
2580
|
+
evaluate: 'self.__DBECommitTransaction'
|
|
2581
|
+
language: 'ruby'
|
|
2582
|
+
withCallback: [:success :resultObj |
|
|
2583
|
+
transactionResultBox asJQuery empty.
|
|
2584
|
+
transactionResultBox removeClass: 'alert-info'.
|
|
2585
|
+
success
|
|
2586
|
+
ifTrue: [transactionResultBox addClass: 'alert-success']
|
|
2587
|
+
ifFalse: [transactionResultBox addClass: 'alert-error'].
|
|
2588
|
+
transactionResultBox with: resultObj inlineViewComponent].
|
|
2589
|
+
!
|
|
2590
|
+
|
|
2591
|
+
continueTransaction
|
|
2592
|
+
self showTransactionWaitingBox.
|
|
2593
|
+
object
|
|
2594
|
+
evaluate: 'self.__DBEContinueTransaction'
|
|
2595
|
+
language: 'ruby'
|
|
2596
|
+
withCallback: [:success :resultObj |
|
|
2597
|
+
transactionResultBox asJQuery empty.
|
|
2598
|
+
transactionResultBox removeClass: 'alert-info'.
|
|
2599
|
+
success
|
|
2600
|
+
ifTrue: [transactionResultBox addClass: 'alert-success']
|
|
2601
|
+
ifFalse: [transactionResultBox addClass: 'alert-error'].
|
|
2602
|
+
transactionResultBox with: resultObj inlineViewComponent].
|
|
2603
|
+
!
|
|
2604
|
+
|
|
2605
|
+
defaultTab
|
|
2606
|
+
^ 'Control Panel'
|
|
2607
|
+
!
|
|
2608
|
+
|
|
2609
|
+
togglePersistentMode
|
|
2610
|
+
self showTransactionWaitingBox.
|
|
2611
|
+
object
|
|
2612
|
+
evaluate: 'self.__DBETogglePersistenceMode'
|
|
2613
|
+
language: 'ruby'
|
|
2614
|
+
withCallback: [:success :resultObj |
|
|
2615
|
+
transactionResultBox asJQuery empty.
|
|
2616
|
+
transactionResultBox removeClass: 'alert-info'.
|
|
2617
|
+
success
|
|
2618
|
+
ifTrue: [
|
|
2619
|
+
transactionResultBox addClass: 'alert-success'.
|
|
2620
|
+
resultObj value = true
|
|
2621
|
+
ifTrue: [persistenceModeButton asJQuery addClass: 'active']
|
|
2622
|
+
ifFalse: [persistenceModeButton asJQuery removeClass: 'active'].
|
|
2623
|
+
transactionResultBox hide]
|
|
2624
|
+
ifFalse: [transactionResultBox addClass: 'alert-error'].
|
|
2625
|
+
transactionResultBox with: resultObj inlineViewComponent].
|
|
2626
|
+
!
|
|
2627
|
+
|
|
2628
|
+
updatePersistentMode
|
|
2629
|
+
self showTransactionWaitingBox.
|
|
2630
|
+
object
|
|
2631
|
+
evaluate: 'self.__DBEPersistenceMode'
|
|
2632
|
+
language: 'ruby'
|
|
2633
|
+
withCallback: [:success :resultObj |
|
|
2634
|
+
transactionResultBox asJQuery empty.
|
|
2635
|
+
transactionResultBox removeClass: 'alert-info'.
|
|
2636
|
+
success
|
|
2637
|
+
ifTrue: [
|
|
2638
|
+
transactionResultBox addClass: 'alert-success'.
|
|
2639
|
+
resultObj value = true
|
|
2640
|
+
ifTrue: [persistenceModeButton asJQuery addClass: 'active']
|
|
2641
|
+
ifFalse: [persistenceModeButton asJQuery removeClass: 'active'].
|
|
2642
|
+
transactionResultBox hide]
|
|
2643
|
+
ifFalse: [transactionResultBox addClass: 'alert-error'].
|
|
2644
|
+
transactionResultBox with: resultObj inlineViewComponent].
|
|
2645
|
+
! !
|
|
2646
|
+
|
|
2647
|
+
!MaglevSystemClassWindow methodsFor: 'rendering'!
|
|
2648
|
+
|
|
2649
|
+
contentTabs
|
|
2650
|
+
|result|
|
|
2651
|
+
result := super contentTabs.
|
|
2652
|
+
result at: 'Stone Version Report' put: #renderStoneVersionReportOn:.
|
|
2653
|
+
result at: 'Gem Version Report' put: #renderGemVersionReportOn:.
|
|
2654
|
+
result at: 'Control Panel' put: #renderControlPanelOn:.
|
|
2655
|
+
^ result
|
|
2656
|
+
!
|
|
2657
|
+
|
|
2658
|
+
renderControlPanelOn: html
|
|
2659
|
+
html with: [
|
|
2660
|
+
html div
|
|
2661
|
+
class: 'well';
|
|
2662
|
+
with: [
|
|
2663
|
+
html input
|
|
2664
|
+
type: 'button';
|
|
2665
|
+
class: 'btn btn-warning';
|
|
2666
|
+
value: 'Abort Transaction';
|
|
2667
|
+
style: 'width: 25%; margin-right: 1%;';
|
|
2668
|
+
onClick: [self abortTransaction].
|
|
2669
|
+
html input
|
|
2670
|
+
type: 'button';
|
|
2671
|
+
class: 'btn btn-warning';
|
|
2672
|
+
value: 'Commit Transaction';
|
|
2673
|
+
style: 'width: 25%; margin-right: 1%;';
|
|
2674
|
+
onClick: [self commitTransaction].
|
|
2675
|
+
html input
|
|
2676
|
+
type: 'button';
|
|
2677
|
+
class: 'btn btn-warning';
|
|
2678
|
+
value: 'Continue Transaction';
|
|
2679
|
+
style: 'width: 25%; margin-right: 1%;';
|
|
2680
|
+
onClick: [self continueTransaction].
|
|
2681
|
+
persistenceModeButton := html input
|
|
2682
|
+
type: 'button';
|
|
2683
|
+
class: 'btn';
|
|
2684
|
+
value: 'Persistent Mode';
|
|
2685
|
+
style: 'width: 22%;';
|
|
2686
|
+
onClick: [self togglePersistentMode].
|
|
2687
|
+
transactionResultBox := html div
|
|
2688
|
+
style: 'margin-top: 10px; margin-bottom: 0px;';
|
|
2689
|
+
class: 'alert';
|
|
2690
|
+
hide]].
|
|
2691
|
+
self updatePersistentMode.
|
|
2692
|
+
!
|
|
2693
|
+
|
|
2694
|
+
renderGemVersionReportOn: html
|
|
2695
|
+
html with: (MaglevTable newAssociationDictFor: self object with: #gemVersionReport).
|
|
2696
|
+
!
|
|
2697
|
+
|
|
2698
|
+
renderStoneVersionReportOn: html
|
|
2699
|
+
html with: (MaglevTable newAssociationDictFor: self object with: #stoneVersionReport).
|
|
2700
|
+
!
|
|
2701
|
+
|
|
2702
|
+
showTransactionWaitingBox
|
|
2703
|
+
transactionResultBox
|
|
2704
|
+
addClass: 'alert-info';
|
|
2705
|
+
removeClass: 'alert-success';
|
|
2706
|
+
removeClass: 'alert-error'.
|
|
2707
|
+
transactionResultBox asJQuery empty.
|
|
2708
|
+
transactionResultBox
|
|
2709
|
+
with: MaglevIcon wait;
|
|
2710
|
+
with: ' loading...';
|
|
2711
|
+
show.
|
|
2712
|
+
! !
|
|
2713
|
+
|
|
2714
|
+
MaglevObjectWindow subclass: #MaglevNilClassWindow
|
|
2715
|
+
instanceVariableNames: ''
|
|
2716
|
+
package: 'Maglev-Database-Explorer'!
|
|
2717
|
+
|
|
2718
|
+
MaglevObjectWindow subclass: #MaglevRubyWorkspaceWindow
|
|
2719
|
+
instanceVariableNames: 'terminalBox commandBox'
|
|
2720
|
+
package: 'Maglev-Database-Explorer'!
|
|
2721
|
+
|
|
2722
|
+
!MaglevRubyWorkspaceWindow methodsFor: 'interactions'!
|
|
2723
|
+
|
|
2724
|
+
defaultTab
|
|
2725
|
+
^ 'Workspace'
|
|
2726
|
+
!
|
|
2727
|
+
|
|
2728
|
+
handleEnter
|
|
2729
|
+
|command html|
|
|
2730
|
+
html := HTMLCanvas onJQuery: terminalBox asJQuery.
|
|
2731
|
+
command := commandBox asJQuery val.
|
|
2732
|
+
command := command replace: '''' with: ''''''.
|
|
2733
|
+
commandBox asJQuery prop: 'disabled' value: true.
|
|
2734
|
+
html
|
|
2735
|
+
with: command;
|
|
2736
|
+
with: html br.
|
|
2737
|
+
object
|
|
2738
|
+
evaluate: 'self.evaluate(''', command, ''')'
|
|
2739
|
+
language: 'ruby'
|
|
2740
|
+
withCallback: [:success :resultObj | |class|
|
|
2741
|
+
(resultObj at: 1) value
|
|
2742
|
+
ifTrue: [class := 'alert alert-error']
|
|
2743
|
+
ifFalse: [class := 'alert alert-success'].
|
|
2744
|
+
terminalBox with: [html div
|
|
2745
|
+
class: class;
|
|
2746
|
+
with: '=> ';
|
|
2747
|
+
with: (resultObj at: 2) inlineViewComponent;
|
|
2748
|
+
with: html br].
|
|
2749
|
+
self scrollToBottom.
|
|
2750
|
+
commandBox asJQuery prop: 'disabled' value: false.
|
|
2751
|
+
commandBox asJQuery val: ''].
|
|
2752
|
+
!
|
|
2753
|
+
|
|
2754
|
+
scrollToBottom
|
|
2755
|
+
terminalBox asJQuery scrollTop: (terminalBox asJQuery at: 0) scrollHeight.
|
|
2756
|
+
! !
|
|
2757
|
+
|
|
2758
|
+
!MaglevRubyWorkspaceWindow methodsFor: 'rendering'!
|
|
2759
|
+
|
|
2760
|
+
contentTabs
|
|
2761
|
+
|result|
|
|
2762
|
+
result := super contentTabs.
|
|
2763
|
+
result at: 'Workspace' put: #renderWorkspaceOn:.
|
|
2764
|
+
^ result
|
|
2765
|
+
!
|
|
2766
|
+
|
|
2767
|
+
mouseFix
|
|
2768
|
+
< var editor = self['@terminalBox'];
|
|
2769
|
+
editor._asJQuery().mousedown(function (event) {
|
|
2770
|
+
event.preventDefault();
|
|
2771
|
+
return false;
|
|
2772
|
+
}); >
|
|
2773
|
+
!
|
|
2774
|
+
|
|
2775
|
+
renderWorkspaceOn: html
|
|
2776
|
+
terminalBox := html pre
|
|
2777
|
+
style: 'height: 350px; overflow-y: scroll; overflow-x: hidden; color: #000000;'.
|
|
2778
|
+
commandBox := html input
|
|
2779
|
+
type: 'text';
|
|
2780
|
+
style: 'width: 97%;';
|
|
2781
|
+
onKeyPress: [:evt | evt keyCode == 13
|
|
2782
|
+
ifTrue: [self handleEnter]].
|
|
2783
|
+
self mouseFix.
|
|
2784
|
+
! !
|
|
2785
|
+
|
|
2786
|
+
MaglevObjectWindow subclass: #MaglevStringWindow
|
|
2787
|
+
instanceVariableNames: ''
|
|
2788
|
+
package: 'Maglev-Database-Explorer'!
|
|
2789
|
+
|
|
2790
|
+
MaglevObjectWindow subclass: #MaglevSymbolWindow
|
|
2791
|
+
instanceVariableNames: ''
|
|
2792
|
+
package: 'Maglev-Database-Explorer'!
|
|
2793
|
+
|
|
2794
|
+
MaglevObjectWindow subclass: #MaglevThreadWindow
|
|
2795
|
+
instanceVariableNames: 'methodSelect methodContainer waitingScreen waitForStackTrace'
|
|
2796
|
+
package: 'Maglev-Database-Explorer'!
|
|
2797
|
+
|
|
2798
|
+
!MaglevThreadWindow methodsFor: 'accessing'!
|
|
2799
|
+
|
|
2800
|
+
frameIndex
|
|
2801
|
+
^ methodSelect selectedDataIndex
|
|
2802
|
+
! !
|
|
2803
|
+
|
|
2804
|
+
!MaglevThreadWindow methodsFor: 'interactions'!
|
|
2805
|
+
|
|
2806
|
+
defaultTab
|
|
2807
|
+
^ 'Stack Trace'
|
|
2808
|
+
!
|
|
2809
|
+
|
|
2810
|
+
isMethodUnimportant: aString
|
|
2811
|
+
|unimportant|
|
|
2812
|
+
unimportant := {'AbstractException >>'. 'AbstractException class'. 'GsProcess >>'. 'GsProcess class'.
|
|
2813
|
+
'ProcessorScheduler >>'. 'ProcessorScheduler class'. 'CodeEvaluation class'. 'RubyCompiler >>'.
|
|
2814
|
+
'RubyCompiler class'. 'onException:do:'. 'RubyProc >> callAndRescue:'. '_gsReturnToC'.
|
|
2815
|
+
'>> onSynchronous:do:'. 'ExecBlock >> ensure:'. 'ExecBlock >> rubyEnsure:'}.
|
|
2816
|
+
unimportant do: [:str |
|
|
2817
|
+
(aString includesSubString: str)
|
|
2818
|
+
ifTrue: [^ true]].
|
|
2819
|
+
^ false
|
|
2820
|
+
!
|
|
2821
|
+
|
|
2822
|
+
proceed
|
|
2823
|
+
object
|
|
2824
|
+
proceedWithCallback: [:obj |
|
|
2825
|
+
object fullReloadWithCallback: [:threadReloaded |
|
|
2826
|
+
object isRailsThread
|
|
2827
|
+
ifTrue: [self closeWindow]
|
|
2828
|
+
ifFalse: [(threadReloaded windowViewComponentReplace: self) renderReplace]]].
|
|
2829
|
+
!
|
|
2830
|
+
|
|
2831
|
+
reloadStackWithCallback: aBlock
|
|
2832
|
+
|html|
|
|
2833
|
+
waitForStackTrace show.
|
|
2834
|
+
methodSelect clear.
|
|
2835
|
+
object stackTraceMethodsWithCallback: [:obj |
|
|
2836
|
+
obj do: [:method | |isUnimportant|
|
|
2837
|
+
isUnimportant := self isMethodUnimportant: method.
|
|
2838
|
+
methodSelect
|
|
2839
|
+
with: [:html |
|
|
2840
|
+
(method includesSubString: '(envId 0)')
|
|
2841
|
+
ifTrue: [html with: MaglevIconImage smalltalk].
|
|
2842
|
+
(method includesSubString: '(envId 1)')
|
|
2843
|
+
ifTrue: [html with: MaglevIconImage ruby].
|
|
2844
|
+
(method includesSubString: '(envId 1b)')
|
|
2845
|
+
ifTrue: [html with: MaglevIconImage rubySmalltalkBridge].
|
|
2846
|
+
html with: method] darker: isUnimportant].
|
|
2847
|
+
waitForStackTrace hide.
|
|
2848
|
+
aBlock = nil
|
|
2849
|
+
ifFalse: [aBlock value]].
|
|
2850
|
+
!
|
|
2851
|
+
|
|
2852
|
+
selectStackFrame: anInteger
|
|
2853
|
+
< self['@methodSelect']._asJQuery()[0].selectedIndex = anInteger - 1; >.
|
|
2854
|
+
self renderFrame: anInteger.
|
|
2855
|
+
!
|
|
2856
|
+
|
|
2857
|
+
stepInto
|
|
2858
|
+
|frameIndex|
|
|
2859
|
+
frameIndex := self frameIndex.
|
|
2860
|
+
object
|
|
2861
|
+
stepInto: frameIndex
|
|
2862
|
+
withCallback: [:obj |
|
|
2863
|
+
self reloadStackWithCallback: [
|
|
2864
|
+
self selectStackFrame: frameIndex]].
|
|
2865
|
+
!
|
|
2866
|
+
|
|
2867
|
+
stepOver
|
|
2868
|
+
|frameIndex|
|
|
2869
|
+
frameIndex := self frameIndex.
|
|
2870
|
+
object
|
|
2871
|
+
stepOver: frameIndex
|
|
2872
|
+
withCallback: [:obj | self reloadStackWithCallback: [
|
|
2873
|
+
self selectStackFrame: frameIndex]].
|
|
2874
|
+
!
|
|
2875
|
+
|
|
2876
|
+
trimStack
|
|
2877
|
+
|frameIndex|
|
|
2878
|
+
frameIndex := self frameIndex.
|
|
2879
|
+
object
|
|
2880
|
+
trimTo: frameIndex
|
|
2881
|
+
withCallback: [:obj | self reloadStackWithCallback: [
|
|
2882
|
+
self selectStackFrame: frameIndex]].
|
|
2883
|
+
! !
|
|
2884
|
+
|
|
2885
|
+
!MaglevThreadWindow methodsFor: 'rendering'!
|
|
2886
|
+
|
|
2887
|
+
contentTabs
|
|
2888
|
+
|result|
|
|
2889
|
+
result := super contentTabs.
|
|
2890
|
+
result at: 'Stack Trace' put: #renderStackTraceOn:.
|
|
2891
|
+
result at: 'Thread Local Storage' put: #renderLocalStorageOn:.
|
|
2892
|
+
^ result
|
|
2893
|
+
!
|
|
2894
|
+
|
|
2895
|
+
renderButtonsOn: html
|
|
2896
|
+
html div
|
|
2897
|
+
class: 'button-area';
|
|
2898
|
+
style: 'margin-bottom: 10px;';
|
|
2899
|
+
with: [
|
|
2900
|
+
html input
|
|
2901
|
+
type: 'button';
|
|
2902
|
+
class: 'btn btn-primary';
|
|
2903
|
+
value: 'Proceed';
|
|
2904
|
+
style: 'margin-right: 1%; width: 24%;';
|
|
2905
|
+
onClick: [self proceed].
|
|
2906
|
+
html input
|
|
2907
|
+
type: 'button';
|
|
2908
|
+
class: 'btn btn-primary';
|
|
2909
|
+
value: 'Step into';
|
|
2910
|
+
style: 'margin-right: 1%; width: 24%;';
|
|
2911
|
+
onClick: [self stepInto].
|
|
2912
|
+
html input
|
|
2913
|
+
type: 'button';
|
|
2914
|
+
class: 'btn btn-primary';
|
|
2915
|
+
value: 'Step over';
|
|
2916
|
+
style: 'margin-right: 1%; width: 24%;';
|
|
2917
|
+
onClick: [self stepOver].
|
|
2918
|
+
html input
|
|
2919
|
+
type: 'button';
|
|
2920
|
+
class: 'btn btn-primary';
|
|
2921
|
+
value: 'Trim stack';
|
|
2922
|
+
style: 'width: 25%;';
|
|
2923
|
+
onClick: [self trimStack]].
|
|
2924
|
+
!
|
|
2925
|
+
|
|
2926
|
+
renderFrame: frameIndex
|
|
2927
|
+
methodContainer asJQuery empty.
|
|
2928
|
+
waitingScreen show.
|
|
2929
|
+
frameIndex > 0
|
|
2930
|
+
ifTrue: [object
|
|
2931
|
+
stackFrame: frameIndex
|
|
2932
|
+
withCallback: [:obj |
|
|
2933
|
+
methodContainer asJQuery empty.
|
|
2934
|
+
methodContainer with: (MaglevGsNMethodDebugEditor for: obj).
|
|
2935
|
+
waitingScreen hide]]
|
|
2936
|
+
ifFalse: [waitingScreen hide].
|
|
2937
|
+
!
|
|
2938
|
+
|
|
2939
|
+
renderLocalStorageOn: html
|
|
2940
|
+
html with: (MaglevTable newAssociationDictFor: object localStorage with: #elements).
|
|
2941
|
+
!
|
|
2942
|
+
|
|
2943
|
+
renderStackTraceOn: html
|
|
2944
|
+
waitForStackTrace := html div
|
|
2945
|
+
with: [html
|
|
2946
|
+
with: MaglevIcon wait;
|
|
2947
|
+
with: ' loading...'].
|
|
2948
|
+
methodSelect := MaglevListBox new.
|
|
2949
|
+
html with: methodSelect.
|
|
2950
|
+
methodSelect
|
|
2951
|
+
changedCallback: [:text :index | self renderFrame: index];
|
|
2952
|
+
height: 250;
|
|
2953
|
+
style: 'width: 100%;'.
|
|
2954
|
+
self renderButtonsOn: html.
|
|
2955
|
+
waitingScreen := html div
|
|
2956
|
+
with: [html
|
|
2957
|
+
with: MaglevIcon wait;
|
|
2958
|
+
with: ' loading...'];
|
|
2959
|
+
hide.
|
|
2960
|
+
methodContainer := html div.
|
|
2961
|
+
self reloadStackWithCallback: nil.
|
|
2962
|
+
! !
|
|
2963
|
+
|
|
2964
|
+
MaglevWindow subclass: #MaglevSearchWindow
|
|
2965
|
+
instanceVariableNames: 'maglev selectBox waitForResult listContents methodContainer waitingScreen'
|
|
2966
|
+
package: 'Maglev-Database-Explorer'!
|
|
2967
|
+
|
|
2968
|
+
!MaglevSearchWindow methodsFor: 'not yet classified'!
|
|
2969
|
+
|
|
2970
|
+
listIndex
|
|
2971
|
+
^ (selectBox asJQuery at: 0) selectedIndex + 1
|
|
2972
|
+
!
|
|
2973
|
+
|
|
2974
|
+
maglev
|
|
2975
|
+
maglev ifNil: [maglev := Maglev instance].
|
|
2976
|
+
^maglev
|
|
2977
|
+
!
|
|
2978
|
+
|
|
2979
|
+
renderClass
|
|
2980
|
+
|listElement cls selector envId|
|
|
2981
|
+
waitingScreen show.
|
|
2982
|
+
listElement := listContents at: self listIndex.
|
|
2983
|
+
cls := (listElement at: 1) at:1.
|
|
2984
|
+
envId := ((listElement at: 1) at:2) inspection asNumber.
|
|
2985
|
+
selector := listElement at: 2.
|
|
2986
|
+
envId = 0 ifTrue:[
|
|
2987
|
+
cls sourceCodeFor: selector language: 'smalltalk' withCallback: [:obj|
|
|
2988
|
+
self renderMethodObject: obj.]
|
|
2989
|
+
]
|
|
2990
|
+
ifFalse:[
|
|
2991
|
+
cls sourceCodeFor: selector language: 'ruby' withCallback: [:obj|
|
|
2992
|
+
self renderMethodObject: obj]
|
|
2993
|
+
]
|
|
2994
|
+
!
|
|
2995
|
+
|
|
2996
|
+
renderListOf: selectors
|
|
2997
|
+
|html|
|
|
2998
|
+
html := HTMLCanvas onJQuery: selectBox asJQuery.
|
|
2999
|
+
selectBox asJQuery empty.
|
|
3000
|
+
listContents := Array new.
|
|
3001
|
+
selectors do:[:selector|
|
|
3002
|
+
self maglev implementersOf: selector withCallback:[:success :obj|
|
|
3003
|
+
obj hasElements ifTrue:[
|
|
3004
|
+
selectBox
|
|
3005
|
+
with: [obj do: [:cls |
|
|
3006
|
+
listContents add: {cls. selector}.
|
|
3007
|
+
html option with: (cls at:1) inspection, '>>' , selector]];
|
|
3008
|
+
size: 10;
|
|
3009
|
+
style: 'width: 100%;';
|
|
3010
|
+
show
|
|
3011
|
+
"onChange: [self renderClass]"
|
|
3012
|
+
].
|
|
3013
|
+
waitForResult hide.
|
|
3014
|
+
]
|
|
3015
|
+
]
|
|
3016
|
+
!
|
|
3017
|
+
|
|
3018
|
+
renderMethodObject: obj
|
|
3019
|
+
methodContainer asJQuery empty.
|
|
3020
|
+
methodContainer with: (MaglevGsNMethodEditor for: obj).
|
|
3021
|
+
waitingScreen hide.
|
|
3022
|
+
!
|
|
3023
|
+
|
|
3024
|
+
renderWindowContentOn: html
|
|
3025
|
+
html div
|
|
3026
|
+
class: 'maglev-search';
|
|
3027
|
+
with: [
|
|
3028
|
+
html form
|
|
3029
|
+
class: 'search-form';
|
|
3030
|
+
onSubmit: [:e|e preventDefault. self searchSelectorsAndClasses.];
|
|
3031
|
+
with:[
|
|
3032
|
+
html input
|
|
3033
|
+
class: 'search-input'
|
|
3034
|
+
]
|
|
3035
|
+
].
|
|
3036
|
+
selectBox := html select
|
|
3037
|
+
size: 10;
|
|
3038
|
+
style: 'width: 100%;';
|
|
3039
|
+
onChange: [self renderClass];
|
|
3040
|
+
hide.
|
|
3041
|
+
waitForResult := html div
|
|
3042
|
+
with: [html
|
|
3043
|
+
with: MaglevIcon wait;
|
|
3044
|
+
with: ' loading...'];
|
|
3045
|
+
hide.
|
|
3046
|
+
waitingScreen := html div
|
|
3047
|
+
with: [html
|
|
3048
|
+
with: MaglevIcon wait;
|
|
3049
|
+
with: ' loading...'];
|
|
3050
|
+
hide.
|
|
3051
|
+
methodContainer := html div.
|
|
3052
|
+
!
|
|
3053
|
+
|
|
3054
|
+
searchSelectorsAndClasses
|
|
3055
|
+
|input maglev selectors|
|
|
3056
|
+
input := '.search-input' asJQuery val.
|
|
3057
|
+
selectors := Array new.
|
|
3058
|
+
waitForResult show.
|
|
3059
|
+
self maglev findMethodNamesMatching: input with:[:success :obj|
|
|
3060
|
+
success ifTrue: [selectors addAll: (obj string tokenize: ' ').
|
|
3061
|
+
self renderListOf: selectors].
|
|
3062
|
+
|
|
3063
|
+
].
|
|
3064
|
+
! !
|
|
3065
|
+
|
|
3066
|
+
MaglevWindow subclass: #MaglevWaitingWindow
|
|
3067
|
+
instanceVariableNames: ''
|
|
3068
|
+
package: 'Maglev-Database-Explorer'!
|
|
3069
|
+
|
|
3070
|
+
!MaglevWaitingWindow methodsFor: 'rendering'!
|
|
3071
|
+
|
|
3072
|
+
renderWindowContentOn: html
|
|
3073
|
+
!
|
|
3074
|
+
|
|
3075
|
+
renderWindowTitleOn: html
|
|
3076
|
+
html
|
|
3077
|
+
with: MaglevIcon wait;
|
|
3078
|
+
with: ' loading...'.
|
|
3079
|
+
! !
|
|
3080
|
+
|
|
3081
|
+
!MaglevWaitingWindow methodsFor: 'testing'!
|
|
3082
|
+
|
|
3083
|
+
isWaitingWindow
|
|
3084
|
+
^ true
|
|
3085
|
+
! !
|
|
3086
|
+
|
|
3087
|
+
MaglevWindow subclass: #MaglevWebBrowserWindow
|
|
3088
|
+
instanceVariableNames: 'url inputUrl iframe'
|
|
3089
|
+
package: 'Maglev-Database-Explorer'!
|
|
3090
|
+
|
|
3091
|
+
!MaglevWebBrowserWindow methodsFor: 'accessing'!
|
|
3092
|
+
|
|
3093
|
+
url
|
|
3094
|
+
^ url
|
|
3095
|
+
!
|
|
3096
|
+
|
|
3097
|
+
url: aString
|
|
3098
|
+
url := aString.
|
|
3099
|
+
inputUrl asJQuery attr: 'value' with: aString.
|
|
3100
|
+
iframe asJQuery attr: 'src' with: aString.
|
|
3101
|
+
! !
|
|
3102
|
+
|
|
3103
|
+
!MaglevWebBrowserWindow methodsFor: 'rendering'!
|
|
3104
|
+
|
|
3105
|
+
renderWindowContentOn: html
|
|
3106
|
+
|iframeContainer|
|
|
3107
|
+
html div
|
|
3108
|
+
class: 'input-prepend';
|
|
3109
|
+
style: 'width: 100%; margin-top: 10px; box-sizing: border-box; padding-right: 51px; margin-bottom: 5px;';
|
|
3110
|
+
with: [
|
|
3111
|
+
html span
|
|
3112
|
+
class: 'add-on';
|
|
3113
|
+
with: 'URL'.
|
|
3114
|
+
inputUrl := html input
|
|
3115
|
+
type: 'text';
|
|
3116
|
+
style: 'width: 100%;';
|
|
3117
|
+
onKeyPress: [:evt | evt which = 13
|
|
3118
|
+
ifTrue: [self url: inputUrl asJQuery val]]].
|
|
3119
|
+
iframeContainer := html div
|
|
3120
|
+
style: 'margin-bottom: 5px; margin-right: 5px;';
|
|
3121
|
+
with: [
|
|
3122
|
+
iframe := html iframe
|
|
3123
|
+
style: 'width: 100%; height: 100%; border: 1px solid #ccc;';
|
|
3124
|
+
frameborder: '0';
|
|
3125
|
+
src: 'about:blank'].
|
|
3126
|
+
iframeContainer asJQuery resizable.
|
|
3127
|
+
!
|
|
3128
|
+
|
|
3129
|
+
renderWindowTitleContentOn: html
|
|
3130
|
+
html with: MaglevIcon globe.
|
|
3131
|
+
html with: 'Web Browser'.
|
|
3132
|
+
self renderHeightPlaceholderOn: html.
|
|
3133
|
+
self renderCloseButtonOn: html.
|
|
3134
|
+
! !
|
|
3135
|
+
|
|
3136
|
+
!MaglevWebBrowserWindow class methodsFor: 'instance creation'!
|
|
3137
|
+
|
|
3138
|
+
defaultUrl
|
|
3139
|
+
< var port = parseInt(window.location.host.split(':')[1]) - 1;
|
|
3140
|
+
return window.location.protocol + '//' + window.location.host.split(':')[0] + ':' + port + '/'; >
|
|
3141
|
+
!
|
|
3142
|
+
|
|
3143
|
+
showNew
|
|
3144
|
+
^ self new
|
|
3145
|
+
appendToWorkspace;
|
|
3146
|
+
url: self defaultUrl.
|
|
3147
|
+
! !
|
|
3148
|
+
|