Skip to content

Commit

Permalink
fbandroid/libraries/components/litho-intellij-plugin/src/main/java/co…
Browse files Browse the repository at this point in the history
…m/facebook/litho/intellij/settings/AppSettingsController.java

Reviewed By: luluwu2032

Differential Revision: D68405868

fbshipit-source-id: 8a449231f4048fb30c81d097c586b37fcb6a0e25
  • Loading branch information
generatedunixname89002005287564 authored and facebook-github-bot committed Jan 20, 2025
1 parent e0028a9 commit 3a04a31
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@
import com.intellij.openapi.project.Project;
import java.util.HashMap;
import java.util.Map;
import javax.annotation.Nullable;
import javax.swing.JComponent;
import org.jetbrains.annotations.Nls;

/** Bridges settings UI with settings data model. */
@Nullsafe(Nullsafe.Mode.LOCAL)
public class AppSettingsController implements Configurable {
private final Project project;
// NULLSAFE_FIXME[Field Not Initialized]
private AppSettingsView view;
@Nullable private AppSettingsView view;

public AppSettingsController(Project project) {
this.project = project;
Expand All @@ -52,12 +52,14 @@ public JComponent createComponent() {
@Override
public boolean isModified() {
final AppSettingsState.Model model = AppSettingsState.getInstance(project).getState();
// NULLSAFE_FIXME[Nullable Dereference]
return view.isResolveRedSymbols() != model.resolveRedSymbols;
}

@Override
public void apply() {
final AppSettingsState.Model model = AppSettingsState.getInstance(project).getState();
// NULLSAFE_FIXME[Nullable Dereference]
final boolean resolveRedSymbols = view.isResolveRedSymbols();
model.resolveRedSymbols = resolveRedSymbols;
final Map<String, String> eventData = new HashMap<>(1);
Expand All @@ -68,12 +70,12 @@ public void apply() {
@Override
public void reset() {
final AppSettingsState.Model model = AppSettingsState.getInstance(project).getState();
// NULLSAFE_FIXME[Nullable Dereference]
view.setResolveRedSymbols(model.resolveRedSymbols);
}

@Override
public void disposeUIResources() {
// NULLSAFE_FIXME[Field Not Nullable]
view = null;
}
}

0 comments on commit 3a04a31

Please sign in to comment.