Skip to content

Commit

Permalink
Merge pull request #57 from dmeybohm/fix-template-extension-in-ui
Browse files Browse the repository at this point in the history
Fix the template extension in UI
  • Loading branch information
dmeybohm authored Aug 9, 2021
2 parents 178923b + 17b8cf0 commit 64d61cf
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/main/java/com/daveme/chocolateCakePHP/ConfigForm.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import com.daveme.chocolateCakePHP.ui.FullyQualifiedNameTextFieldCompletionProvider;
import com.intellij.openapi.options.SearchableConfigurable;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.TextFieldWithBrowseButton;
import com.intellij.util.textCompletion.TextFieldWithCompletion;
import com.jetbrains.php.completion.PhpCompletionUtil;
import org.jetbrains.annotations.Nls;
Expand All @@ -15,7 +14,7 @@
import java.lang.reflect.InvocationTargetException;

class ConfigForm implements SearchableConfigurable {
private Project project;
private final Project project;
private JPanel topPanel;
private JCheckBox enableCake3SupportCheckBox;
private JButton appNamespaceDefaultButton;
Expand Down Expand Up @@ -43,12 +42,13 @@ private void loadSettingsToUI(@NotNull Settings settings) {
templateExtensionTextField.setText(settings.getCakeTemplateExtension());

toggleCake2State(settings.getCake2Enabled());
cake2TemplateExtensionTextField.setText(settings.getCakeTemplateExtension());
cake2TemplateExtensionTextField.setText(settings.getCake2TemplateExtension());
cake2AppDirectoryTextField.setText(settings.getCake2AppDirectory());
}

private void copySettingsFromUI(@NotNull Settings settings) {
SettingsState state = settings.getState();
assert state != null;

state.setCake3Enabled(enableCake3SupportCheckBox.isSelected());
state.setAppDirectory(appDirectoryTextField.getText());
Expand Down Expand Up @@ -142,9 +142,7 @@ private void createUIComponents() {
FullyQualifiedNameInsertHandler insertHandler = new FullyQualifiedNameInsertHandler();
try {
if (!SwingUtilities.isEventDispatchThread()) {
SwingUtilities.invokeAndWait(() -> {
setupHandler(insertHandler);
});
SwingUtilities.invokeAndWait(() -> setupHandler(insertHandler));
} else {
setupHandler(insertHandler);
}
Expand Down

0 comments on commit 64d61cf

Please sign in to comment.