• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In
Build has been canceled!

moosetechnology / MooseIDE / 21443026785

28 Jan 2026 02:52PM UTC coverage: 65.791% (-0.03%) from 65.818%
21443026785

push

github

web-flow
Merge pull request #1576 from moosetechnology/jdk

Allow to parse a JDK via the folders importer dialog

0 of 16 new or added lines in 1 file covered. (0.0%)

1 existing line in 1 file now uncovered.

21805 of 33143 relevant lines covered (65.79%)

1.32 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/MooseIDE-Meta/MiImportModelFromFoldersDialog.class.st
1
"
2
I am a presenter that will allow the user to select one or multiple folders and that will generate a json file for each one. Then I'll import those files in the model browser.
3

4
For now, I only work with Java and the latest version of VerveineJ. In the future we could add other languages.
5
"
6
Class {
7
        #name : 'MiImportModelFromFoldersDialog',
8
        #superclass : 'MiImportModelDialog',
9
        #instVars : [
10
                'description',
11
                'foldersList',
12
                'addFolderButton',
13
                'addFoldersButton',
14
                'jdkVersionInput'
15
        ],
16
        #category : 'MooseIDE-Meta-Import',
17
        #package : 'MooseIDE-Meta',
18
        #tag : 'Import'
19
}
20

21
{ #category : 'opening' }
22
MiImportModelFromFoldersDialog class >> open [
×
23

×
24
        <script>
×
25
        ^ super open
×
26
]
×
27

28
{ #category : 'specs' }
29
MiImportModelFromFoldersDialog class >> title [
×
30

×
31
        ^ 'Parse and import models from folders'
×
32
]
×
33

34
{ #category : 'accessing' }
35
MiImportModelFromFoldersDialog class >> windowExtent [
×
36

×
37
        ^ 600 @ 500
×
38
]
×
39

40
{ #category : 'initialization' }
41
MiImportModelFromFoldersDialog >> connectPresenters [
×
42

×
43
        super connectPresenters.
×
44
        self flag: #todo. "In the future UIManager should be removed to use the spec selection tool but it is not possible since we still run on Pharo 11"
×
45
        addFolderButton action: [
×
46
                (UIManager default chooseDirectory: 'Select a project folder to add.') ifNotNil: [ :folder |
×
47
                        foldersList items add: folder.
×
48
                        foldersList refresh ] ].
×
49
        addFoldersButton action: [
×
50
                (UIManager default chooseDirectory: 'Select a folder contaninig only project folders to add.') ifNotNil: [ :folder |
×
51
                        foldersList items addAll: folder directories.
×
52
                        foldersList refresh ] ]
×
53
]
×
54

55
{ #category : 'layout' }
56
MiImportModelFromFoldersDialog >> defaultLayout [
×
57

×
58
        ^ SpBoxLayout newTopToBottom
×
NEW
59
                  spacing: 10;
×
60
                  add: description;
×
61
                  add: foldersList;
×
62
                  add: (SpBoxLayout newLeftToRight
×
63
                                   add: addFolderButton expand: false;
×
64
                                   add: addFoldersButton expand: false;
×
65
                                   yourself)
×
66
                  expand: false;
×
NEW
67
                  add: (SpBoxLayout newLeftToRight
×
NEW
68
                                   spacing: 10;
×
NEW
69
                                   add: 'JDK version (only if sources includes the JDK, leave blank otherwise): ' expand: false;
×
NEW
70
                                   add: jdkVersionInput;
×
NEW
71
                                   yourself)
×
NEW
72
                  expand: false;
×
73
                  yourself
×
74
]
×
75

76
{ #category : 'action' }
77
MiImportModelFromFoldersDialog >> importModel [
×
78

×
79
        ^ self privateImportModel
×
80
]
×
81

82
{ #category : 'initialization' }
83
MiImportModelFromFoldersDialog >> initializePresenters [
×
84

×
85
        super initializePresenters.
×
86
        description := self newText.
×
87
        foldersList := self newList.
×
88
        addFolderButton := self newButton.
×
89
        addFoldersButton := self newButton.
×
NEW
90
        jdkVersionInput := self newTextInput.
×
91

×
92
        description
×
93
                text: self userDescription;
×
94
                beNotEditable.
×
95

×
96
        foldersList items: OrderedCollection new.
×
NEW
97
        
×
NEW
98
        jdkVersionInput placeholder: 'Example: 1.7'.
×
99

×
100
        addFolderButton
×
101
                label: 'Add Folder';
×
102
                iconName: #add.
×
103
        addFoldersButton
×
104
                label: 'Add Folders';
×
105
                iconName: #add
×
106
]
×
107

108
{ #category : 'action' }
109
MiImportModelFromFoldersDialog >> privateImportModel [
×
110

×
NEW
111
        | importer |
×
NEW
112
        importer := FamixJavaFoldersImporter new folders: self selectedFolders.
×
NEW
113

×
NEW
114
        jdkVersionInput text ifNotEmpty: [ :version | importer jdkVersion: version ].
×
NEW
115

×
NEW
116
        ^ MiMooseModelsWrapper models: importer import
×
UNCOV
117
]
×
118

119
{ #category : 'accessing' }
120
MiImportModelFromFoldersDialog >> selectedFolders [
×
121

×
122
        ^ foldersList items
×
123
]
×
124

125
{ #category : 'accessing' }
126
MiImportModelFromFoldersDialog >> userDescription [
×
127

×
128
        ^ 'I am in interface to easily parse projects and import the resulting models into Moose.
×
129
For now I am only working for Java projects. This might change in the future depending on the needs Moose users have.
×
130
Bellow, you can select folders containing each a project to parse with the latest version of VerveineJ. If you wish to use your own VerveineJ version, a setting is available.'
×
131
]
×
132

133
{ #category : 'action' }
134
MiImportModelFromFoldersDialog >> validateImportForm [
×
135

×
136
        self selectedFolders ifEmpty: [ self error: 'Please select at least one folder.' ].
×
137
        self selectedFolders do: [ :folder | folder ifAbsent: [ self error: 'Selected folder does not exist.' ] ]
×
138
]
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc