@@ -41,8 +41,42 @@ public class TwigSettingsForm implements Configurable {
41
41
private ListTableModel <TwigPath > modelList ;
42
42
43
43
public TwigSettingsForm (@ NotNull Project project ) {
44
-
45
44
this .project = project ;
45
+ }
46
+
47
+ private void attachItems (boolean includeSettings ) {
48
+
49
+ // @TODO: remove this check, moved init stuff out of constructor
50
+ // dont load on project less context
51
+ if (this .project == null ) {
52
+ return ;
53
+ }
54
+
55
+ List <TwigPath > sortableLookupItems = new ArrayList <TwigPath >();
56
+ sortableLookupItems .addAll (TwigHelper .getTwigNamespaces (this .project , includeSettings ));
57
+ Collections .sort (sortableLookupItems );
58
+
59
+ for (TwigPath twigPath : sortableLookupItems ) {
60
+ // dont use managed class here
61
+ this .modelList .addRow (twigPath .clone ());
62
+ }
63
+ }
64
+
65
+ @ Nls
66
+ @ Override
67
+ public String getDisplayName () {
68
+ return "Twig" ;
69
+ }
70
+
71
+ @ Nullable
72
+ @ Override
73
+ public String getHelpTopic () {
74
+ return null ;
75
+ }
76
+
77
+ @ Nullable
78
+ @ Override
79
+ public JComponent createComponent () {
46
80
47
81
this .tableView = new TableView <TwigPath >();
48
82
this .modelList = new ListTableModel <TwigPath >(
@@ -81,40 +115,7 @@ public void mouseClicked(MouseEvent e) {
81
115
}
82
116
}
83
117
});
84
- }
85
118
86
- private void attachItems (boolean includeSettings ) {
87
-
88
- // dont load on project less context
89
- if (this .project == null ) {
90
- return ;
91
- }
92
-
93
- List <TwigPath > sortableLookupItems = new ArrayList <TwigPath >();
94
- sortableLookupItems .addAll (TwigHelper .getTwigNamespaces (this .project , includeSettings ));
95
- Collections .sort (sortableLookupItems );
96
-
97
- for (TwigPath twigPath : sortableLookupItems ) {
98
- // dont use managed class here
99
- this .modelList .addRow (twigPath .clone ());
100
- }
101
- }
102
-
103
- @ Nls
104
- @ Override
105
- public String getDisplayName () {
106
- return "Twig" ;
107
- }
108
-
109
- @ Nullable
110
- @ Override
111
- public String getHelpTopic () {
112
- return null ;
113
- }
114
-
115
- @ Nullable
116
- @ Override
117
- public JComponent createComponent () {
118
119
ToolbarDecorator tablePanel = ToolbarDecorator .createDecorator (this .tableView , new ElementProducer <TwigPath >() {
119
120
@ Override
120
121
public TwigPath createElement () {
0 commit comments