Skip to content

Commit

Permalink
♻️ Refactored from myDisplayName to myDisplayNameView
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexV525 committed Feb 21, 2025
1 parent 0e4511e commit 5f69c50
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions flutter-idea/src/io/flutter/run/LaunchState.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import com.intellij.execution.runners.RunContentBuilder;
import com.intellij.execution.ui.ConsoleView;
import com.intellij.execution.ui.ConsoleViewContentType;
import com.intellij.execution.ui.MutableReactiveProperty;
import com.intellij.execution.ui.RunContentDescriptor;
import com.intellij.icons.AllIcons;
import com.intellij.openapi.actionSystem.AnAction;
Expand Down Expand Up @@ -156,12 +157,12 @@ protected RunContentDescriptor launch(@NotNull ExecutionEnvironment env) throws
else {
descriptor = new RunContentBuilder(result, env).showRunContent(env.getContentToReuse());
}
final String nameWithDeviceName = descriptor.getDisplayName() + " (" + device.deviceName() + ")";
try {
final Field f = descriptor.getClass().getDeclaredField("myDisplayName");
f.setAccessible(true);
f.set(descriptor, descriptor.getDisplayName() + " (" + device.deviceName() + ")");
final MutableReactiveProperty<String> property = (MutableReactiveProperty<String>) descriptor.getDisplayNameProperty();
property.setValue(nameWithDeviceName);
}
catch (IllegalAccessException | NoSuchFieldException e) {
catch (ClassCastException e) {
LOG.info(e);
}
return descriptor;
Expand Down

0 comments on commit 5f69c50

Please sign in to comment.