Skip to content

Commit ae8a508

Browse files
committed
remove twig settings init from constructor for eap changes, as forms now also loaded in search everywhere #370, #383
1 parent dcf4fe7 commit ae8a508

File tree

1 file changed

+35
-34
lines changed

1 file changed

+35
-34
lines changed

src/fr/adrienbrault/idea/symfony2plugin/ui/TwigSettingsForm.java

+35-34
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,42 @@ public class TwigSettingsForm implements Configurable {
4141
private ListTableModel<TwigPath> modelList;
4242

4343
public TwigSettingsForm(@NotNull Project project) {
44-
4544
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() {
4680

4781
this.tableView = new TableView<TwigPath>();
4882
this.modelList = new ListTableModel<TwigPath>(
@@ -81,40 +115,7 @@ public void mouseClicked(MouseEvent e) {
81115
}
82116
}
83117
});
84-
}
85118

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() {
118119
ToolbarDecorator tablePanel = ToolbarDecorator.createDecorator(this.tableView, new ElementProducer<TwigPath>() {
119120
@Override
120121
public TwigPath createElement() {

0 commit comments

Comments
 (0)