Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ openocd_scripts = OPENOCD_SCRIPTS represents the value specified in environment
jtag_flash_args = JTAG_FLASH_ARGS dynamically converts ${JTAG_FLASH_ARGS} into a command line with -c and -f options. These options are generated based on the current launch target, configuring settings like flash voltage and specifying configuration files for the JTAG interface and target device.
gdb_client_executable = GDB_CLIENT_EXECUTABLE is a dynamic variable that is replaced during the debug session with the appropriate toolchain path automatically based on the selected target.
serial_port = serial_port is a dynamic variable that is replaced by the serial port specified in the launch target
flash_command = Specifies which idf.py flash command should be executed, depending on whether flash encryption is enabled (e.g., "flash" or "encrypted-flash").
5 changes: 5 additions & 0 deletions bundles/com.espressif.idf.core/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -341,5 +341,10 @@ config-only component and an interface library is created instead."
name="serial_port"
resolver="com.espressif.idf.core.variable.UartVariableResolver">
</variable>
<variable
description="%flash_command"
name="flash_command"
resolver="com.espressif.idf.core.variable.UartVariableResolver">
</variable>
</extension>
</plugin>
Original file line number Diff line number Diff line change
Expand Up @@ -39,22 +39,22 @@ public interface IDFConstants
* idf python file
*/
String IDF_PYTHON_SCRIPT = "idf.py"; //$NON-NLS-1$

/**
* idf.py list targets
*/
String IDF_LIST_TARGETS_CMD = "--list-targets"; //$NON-NLS-1$
String IDF_LIST_TARGETS_CMD = "--list-targets"; //$NON-NLS-1$

/**
* idf_monitor python file
*/
String IDF_MONITOR_PYTHON_SCRIPT = "idf_monitor.py"; //$NON-NLS-1$

/**
* idf sysviewtrace_proc script file
*/
String IDF_SYSVIEW_TRACE_SCRIPT = "sysviewtrace_proc.py"; //$NON-NLS-1$

/**
* idf app_trace_folder
*/
Expand All @@ -64,17 +64,17 @@ public interface IDFConstants
* idf tools file
*/
String IDF_TOOLS_SCRIPT = "idf_tools.py"; //$NON-NLS-1$

/**
* idf_monitor.py
*/
String IDF_MONITOR_SCRIPT = "idf_monitor.py"; //$NON-NLS-1$

/**
* idf size file
*/
String IDF_SIZE_SCRIPT = "idf_size.py"; //$NON-NLS-1$

/**
* idf tools.json file for installable tools
*/
Expand All @@ -84,9 +84,11 @@ public interface IDFConstants
* <IDF_PATH>/tools
*/
String TOOLS_FOLDER = "tools"; //$NON-NLS-1$

String FLASH_CMD = "flash"; //$NON-NLS-1$

String FLASH_ENCRYPTED_CMD = "encrypted-flash"; //$NON-NLS-1$

Comment on lines 88 to +91
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Encrypted command name likely incorrect; align with idf.py target "encrypted-app-flash".

idf.py exposes "encrypted-app" and "encrypted-app-flash" targets; "encrypted-flash" is not a known target. Using the wrong subcommand will fail at runtime. Recommend switching the value to "encrypted-app-flash" (keep the constant name if you want to minimize ripples), and audit call sites.

Apply:

- String FLASH_ENCRYPTED_CMD = "encrypted-flash"; //$NON-NLS-1$
+ String FLASH_ENCRYPTED_CMD = "encrypted-app-flash"; //$NON-NLS-1$

To double-check usages and docs across the repo:


🏁 Script executed:

#!/bin/bash
# Look for potential mismatches
rg -nP -C2 '(encrypted[-_]app[-_]flash|encrypted[-_]flash|FLASH_ENCRYPTED_CMD|flash_command)'

Length of output: 3520


Replace incorrect “encrypted-flash” constant and update UI tooltip

--- a/bundles/com.espressif.idf.core/src/com/espressif/idf/core/IDFConstants.java
+++ b/bundles/com.espressif.idf.core/src/com/espressif/idf/core/IDFConstants.java
@@ -88,7 +88,7 @@
 	String FLASH_CMD = "flash"; //$NON-NLS-1$
 
-	String FLASH_ENCRYPTED_CMD = "encrypted-flash"; //$NON-NLS-1$
+	String FLASH_ENCRYPTED_CMD = "encrypted-app-flash"; //$NON-NLS-1$

Also update the Messages.properties tooltip so it reflects the two valid targets (“flash” and “encrypted-app-flash”):

--- a/bundles/com.espressif.idf.terminal.connector.serial/src/com/espressif/idf/terminal/connector/serial/nls/Messages.properties
+++ b/bundles/com.espressif.idf.terminal.connector.serial/src/com/espressif/idf/terminal/connector/serial/nls/Messages.properties
@@ -15,1 +15,1 @@
-SerialSettingsPage_EncryptionOptionTooltip1=Enable Flash Encryption. Ctrl+F and Ctrl+A will trigger the encrypted-flash and encrypted-app-flash commands.
+SerialSettingsPage_EncryptionOptionTooltip1=Enable Flash Encryption. Ctrl+F and Ctrl+A will trigger the flash and encrypted-app-flash commands.

Audit any other references to “encrypted-flash” to ensure consistency.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
String FLASH_CMD = "flash"; //$NON-NLS-1$
String FLASH_ENCRYPTED_CMD = "encrypted-flash"; //$NON-NLS-1$
String FLASH_CMD = "flash"; //$NON-NLS-1$
String FLASH_ENCRYPTED_CMD = "encrypted-app-flash"; //$NON-NLS-1$
Suggested change
String FLASH_CMD = "flash"; //$NON-NLS-1$
String FLASH_ENCRYPTED_CMD = "encrypted-flash"; //$NON-NLS-1$
SerialSettingsPage_EncryptionOptionTooltip1=Enable Flash Encryption. Ctrl+F and Ctrl+A will trigger the flash and encrypted-app-flash commands.
🤖 Prompt for AI Agents
In bundles/com.espressif.idf.core/src/com/espressif/idf/core/IDFConstants.java
around lines 88 to 91 the FLASH_ENCRYPTED_CMD constant is set to the incorrect
value "encrypted-flash"; change it to the correct target "encrypted-app-flash".
After updating the constant, update the corresponding tooltip text in
Messages.properties to list the two valid targets "flash" and
"encrypted-app-flash", and search the codebase for any other occurrences of
"encrypted-flash" to replace them with "encrypted-app-flash" or adjust
references to use the new constant to keep everything consistent.

/**
* <IDF_PATH>/tools/cmake
*/
Expand All @@ -106,7 +108,7 @@ public interface IDFConstants
* Json config menu file name
*/
String KCONFIG_MENUS_JSON = "kconfig_menus.json"; //$NON-NLS-1$

/**
* sdk config json file
*/
Expand All @@ -130,28 +132,28 @@ public interface IDFConstants
String TOOLS_INSTALL_CMD = "install"; //$NON-NLS-1$

String TOOLS_INSTALL_ALL_CMD = "all"; //$NON-NLS-1$

String TOOLS_INSTALL_PYTHON_CMD = "install-python-env"; //$NON-NLS-1$

String TOOLS_LIST_CMD = "list"; //$NON-NLS-1$

String TOOLS_EXPORT_FORMAT_KEYVALUE = "key-value"; //$NON-NLS-1$

String TOOLS_EXPORT_CMD_FORMAT = "--format"; //$NON-NLS-1$

String TOOLS_EXPORT_CMD_FORMAT_VAL = TOOLS_EXPORT_CMD_FORMAT + "=" + TOOLS_EXPORT_FORMAT_KEYVALUE; //$NON-NLS-1$

String PYTHON_CMD = "python"; //$NON-NLS-1$

String PYTHON3_CMD = "python3"; //$NON-NLS-1$

/**
* <IDF_PATH>/components
*/
String COMPONENTS_FOLDER = "components"; //$NON-NLS-1$

String ESP_CORE_DUMP_FOLDER = "espcoredump"; //$NON-NLS-1$

String ESP_CORE_DUMP_SCRIPT = "espcoredump.py"; //$NON-NLS-1$

/**
Expand All @@ -172,13 +174,13 @@ public interface IDFConstants
String ESP_TOOL_CHIP_ID_CMD = "chip_id"; //$NON-NLS-1$

String ESP_TOOL_ERASE_FLASH_CMD = "erase_flash"; //$NON-NLS-1$

String ESP_WRITE_FLASH_CMD = "write_flash"; //$NON-NLS-1$

/**
* Property to store project custom build directory
*/
String BUILD_DIR_PROPERTY = "idf.buildDirectory.property"; //$NON-NLS-1$

String PROECT_DESCRIPTION_JSON = "project_description.json"; //$NON-NLS-1$
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,6 @@ public final class IDFLaunchConstants
public static final String SERIAL_MONITOR_ENCODING = "SERIAL_MONITOR_ENCODING"; //$NON-NLS-1$
public static final String BUILD_FOLDER_PATH = "com.espressif.idf.launch.serial.core.idfBuildFolderPath"; //$NON-NLS-1$
public static final String OPENOCD_USB_LOCATION = "OPENOCD_USB_ADAPTER_LOCATION"; //$NON-NLS-1$
public static final String FLASH_ENCRYPTION_ENABLED = "com.espressif.idf.launch.FLASH_ENCRYPTION_ENABLED"; //$NON-NLS-1$

}
Original file line number Diff line number Diff line change
Expand Up @@ -717,37 +717,80 @@ public static void updateEspressifPrefPageOpenocdPath()

public static String getCurrentTarget()
{
IProject project = null;
IProject project = getProjectFromActiveLaunchConfig();
if (project == null)
{
Logger.log(Messages.IDFUtil_CantFindProjectMsg);
return null;
}
return new SDKConfigJsonReader(project).getValue("IDF_TARGET"); //$NON-NLS-1$
}

public static boolean isFlashEncrypted()
{
ILaunchConfiguration configuration;
try
{
configuration = getActiveLaunchConfiguration();

return configuration != null
&& configuration.getAttribute(IDFLaunchConstants.FLASH_ENCRYPTION_ENABLED, false);
}
catch (CoreException e)
{
Logger.log(e);
}

return false;
}
Comment on lines +729 to +745
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Make isFlashEncrypted resilient: fall back to sdkconfig (SECURE_FLASH_ENC_ENABLED) when launch attribute is absent

Current logic relies solely on the launch attribute; if it’s unset, encryption may be incorrectly treated as disabled. Add a fallback to sdkconfig with tolerant boolean parsing.

Apply:

 public static boolean isFlashEncrypted()
 {
-        ILaunchConfiguration configuration;
-        try
-        {
-            configuration = getActiveLaunchConfiguration();
-
-            return configuration != null
-                    && configuration.getAttribute(IDFLaunchConstants.FLASH_ENCRYPTION_ENABLED, false);
-        }
-        catch (CoreException e)
-        {
-            Logger.log(e);
-        }
-
-        return false;
+        try {
+            ILaunchConfiguration configuration = getActiveLaunchConfiguration();
+            boolean enabled = configuration != null
+                    && configuration.getAttribute(IDFLaunchConstants.FLASH_ENCRYPTION_ENABLED, false);
+            if (enabled) {
+                return true;
+            }
+            // Fallback to sdkconfig if the launch attribute is absent/false
+            IProject project = getProjectFromActiveLaunchConfig();
+            if (project == null) {
+                return false;
+            }
+            String v = new SDKConfigJsonReader(project).getValue("SECURE_FLASH_ENC_ENABLED"); //$NON-NLS-1$
+            if (v == null) {
+                return false;
+            }
+            v = v.trim();
+            return "true".equalsIgnoreCase(v) || "1".equals(v) || "y".equalsIgnoreCase(v) || "yes".equalsIgnoreCase(v);
+        } catch (CoreException e) {
+            Logger.log(e);
+            return false;
+        }
 }

🏁 Script executed:

#!/bin/bash
# Verify that the launch attribute is actually set somewhere.
rg -nP -C2 'FLASH_ENCRYPTION_ENABLED'
# Heuristic: look for setAttribute calls touching it
rg -nP -C2 'setAttribute\(\s*IDFLaunchConstants\.FLASH_ENCRYPTION_ENABLED'

Length of output: 3862


🏁 Script executed:

#!/bin/bash
# Search for SDKConfigJsonReader class declaration
rg -n "class SDKConfigJsonReader"

# Search for any references to SDKConfigJsonReader
rg -n "SDKConfigJsonReader"

# Search for getProjectFromActiveLaunchConfig method
rg -n "getProjectFromActiveLaunchConfig"

# Verify getActiveLaunchConfiguration definition in IDFUtil.java
rg -n -C2 "getActiveLaunchConfiguration" bundles/com.espressif.idf.core/src/com/espressif/idf/core/util/IDFUtil.java

Length of output: 4611


Make isFlashEncrypted resilient: fallback to sdkconfig when launch attribute is absent

Add a secondary lookup in isFlashEncrypted() to read SECURE_FLASH_ENC_ENABLED via SDKConfigJsonReader(project) whenever the FLASH_ENCRYPTION_ENABLED launch attribute is false or unset. Ensure getProjectFromActiveLaunchConfig() handles null, and update IDFUtilTest to mock SDKConfigJsonReader for this new path.

🤖 Prompt for AI Agents
In bundles/com.espressif.idf.core/src/com/espressif/idf/core/util/IDFUtil.java
around lines 729-745, enhance isFlashEncrypted() so that if the
FLASH_ENCRYPTION_ENABLED launch attribute is false or absent it falls back to
reading SECURE_FLASH_ENC_ENABLED from the project's sdkconfig via new
SDKConfigJsonReader(project).getBoolean("SECURE_FLASH_ENC_ENABLED") (guarding
nulls); ensure getProjectFromActiveLaunchConfig() can safely handle a null
configuration and return null without throwing, and update IDFUtilTest to add a
mock SDKConfigJsonReader that simulates the sdkconfig lookup path (include tests
for launch attr true, launch attr false with sdkconfig true, and null project
case).


/**
* Returns the active project from the currently selected launch configuration.
*/
public static IProject getProjectFromActiveLaunchConfig()
{
try
{
ILaunchBarManager launchBarManager = IDFCorePlugin.getService(ILaunchBarManager.class);
ILaunchConfiguration activeConfig = launchBarManager.getActiveLaunchConfiguration();
if (activeConfig == null || activeConfig.getMappedResources() == null)
ILaunchConfiguration activeConfig = getActiveLaunchConfiguration();
if (activeConfig == null)
{
Logger.log(Messages.IDFUtil_CantFindProjectMsg);
return StringUtil.EMPTY;
return null;
}

IResource[] resources = activeConfig.getMappedResources();
if (resources == null || resources.length == 0)
{
Logger.log("No mapped resources in active launch configuration."); //$NON-NLS-1$
return null;
}
project = activeConfig.getMappedResources()[0].getProject();
Logger.log("Project:: " + project); //$NON-NLS-1$

IProject project = resources[0].getProject();
Logger.log("Active project: " + project); //$NON-NLS-1$
return project;
}
catch (CoreException e)
{
Logger.log(e);
return null;
}
return new SDKConfigJsonReader(project).getValue("IDF_TARGET"); //$NON-NLS-1$
}

public static IProject getProjectFromActiveLaunchConfig() throws CoreException
private static ILaunchConfiguration getActiveLaunchConfiguration() throws CoreException
{
final ILaunchBarManager launchBarManager = IDFCorePlugin.getService(ILaunchBarManager.class);
ILaunchConfiguration launchConfiguration = launchBarManager.getActiveLaunchConfiguration();
IResource[] mappedResources = launchConfiguration.getMappedResources();
if (mappedResources != null && mappedResources[0].getProject() != null)
ILaunchBarManager launchBarManager = IDFCorePlugin.getService(ILaunchBarManager.class);
if (launchBarManager == null)
{
return mappedResources[0].getProject();
Logger.log("LaunchBarManager service not found."); //$NON-NLS-1$
return null;
}

return null;
ILaunchConfiguration activeConfig = launchBarManager.getActiveLaunchConfiguration();
if (activeConfig == null)
{
Logger.log("No active launch configuration."); //$NON-NLS-1$
return null;
}
return activeConfig;
}

public static String getGitExecutablePathFromSystem()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

public enum UartDynamicVariable
{
SERIAL_PORT("serial_port"); //$NON-NLS-1$
SERIAL_PORT("serial_port"), //$NON-NLS-1$
FLASH_COMMAND("flash_command"); //$NON-NLS-1$

private String value;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@
import org.eclipse.launchbar.core.ILaunchBarManager;
import org.eclipse.launchbar.core.target.ILaunchTarget;

import com.espressif.idf.core.IDFConstants;
import com.espressif.idf.core.IDFCorePlugin;
import com.espressif.idf.core.LaunchBarTargetConstants;
import com.espressif.idf.core.logging.Logger;
import com.espressif.idf.core.util.IDFUtil;
import com.espressif.idf.core.util.StringUtil;

public class UartVariableResolver implements IDynamicVariableResolver
Expand All @@ -34,6 +36,7 @@ private String resolveForDynamicEnum(UartDynamicVariable enumVariable)
return switch (enumVariable)
{
case SERIAL_PORT -> getSerialPort(); // $NON-NLS-1$
case FLASH_COMMAND -> IDFUtil.isFlashEncrypted() ? IDFConstants.FLASH_ENCRYPTED_CMD : IDFConstants.FLASH_CMD;
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ private void openSerialMonitor(ILaunchConfiguration configuration) throws CoreEx
map.put(ITerminalsConnectorConstants.PROP_ENCODING, configuration.getAttribute(
IDFLaunchConstants.SERIAL_MONITOR_ENCODING, WorkbenchEncoding.getWorkbenchDefaultEncoding()));
map.put(ITerminalsConnectorConstants.PROP_FORCE_NEW, Boolean.FALSE);
map.put(SerialSettings.ENCRYPTION_ATTR, IDFUtil.isFlashEncrypted());
new SerialLauncherDelegate().execute(map, null);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import com.espressif.idf.core.configparser.EspConfigParser;
import com.espressif.idf.core.logging.Logger;
import com.espressif.idf.core.util.IDFUtil;
import com.espressif.idf.core.variable.UartDynamicVariable;

public class ESPFlashUtil
{
Expand Down Expand Up @@ -75,7 +76,8 @@ public static String getParseableEspFlashCommand(String serialPort)
.generateVariableExpression(IDFDynamicVariables.BUILD_DIR.name(), null));
commands.add("-p"); //$NON-NLS-1$
commands.add(serialPort);
commands.add(IDFConstants.FLASH_CMD);
commands.add(VariablesPlugin.getDefault().getStringVariableManager()
.generateVariableExpression(UartDynamicVariable.FLASH_COMMAND.getValue(), null));

return String.join(" ", commands); //$NON-NLS-1$
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,14 @@
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.program.Program;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Link;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.dialogs.ElementListSelectionDialog;
import org.eclipse.ui.ide.IDEEncoding;
Expand All @@ -79,6 +81,7 @@
@SuppressWarnings("restriction")
public class CMakeMainTab2 extends GenericMainTab
{
private static final String DOCS_ESPRESSIF_FLASH_ENCRYPTION_HTML = "https://docs.espressif.com/projects/espressif-ide/en/latest/flashdevice.html#customize-flash-arguments"; //$NON-NLS-1$
private static final String DEFAULT_JTAG_CONFIG_OPTIONS = String.format("-s ${%s} ${%s}", //$NON-NLS-1$
OpenocdDynamicVariable.OPENOCD_SCRIPTS, JtagDynamicVariable.JTAG_FLASH_ARGS);
private Combo flashOverComboButton;
Expand All @@ -94,6 +97,7 @@ public class CMakeMainTab2 extends GenericMainTab
private TextWithButton dfuArgumentsField;
private Button checkOpenSerialMonitorButton;
private Combo fEncodingCombo;
private Button flashEncryptionCheckbox;

public enum FlashInterface
{
Expand Down Expand Up @@ -230,9 +234,27 @@ protected void createUartComposite(Composite parent)
uartAgrumentsField = new TextWithButton(parent, SWT.WRAP | SWT.BORDER);

createArgumentComponent(defaultComposite, uartAgrumentsField);
createFlashEncryptionCheckbox(defaultComposite);
createVerticalSpacer(defaultComposite, 1);
}

private void createFlashEncryptionCheckbox(Composite parent)
{
Group flashGroup = new Group(parent, SWT.NONE);
flashGroup.setText(Messages.CMakeMainTab2_FlashEncryptionGroup);
flashGroup.setLayout(new GridLayout(1, false));
flashGroup.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));

flashEncryptionCheckbox = new Button(flashGroup, SWT.CHECK);
flashEncryptionCheckbox.setText(Messages.CMakeMainTab2_FlashEncryptionCheckbox);
flashEncryptionCheckbox.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, true));

Link flashEncryptionNote = new Link(flashGroup, SWT.WRAP);
flashEncryptionNote.setText(Messages.CMakeMainTab2_FlashEncryptionNote);

flashEncryptionNote.addListener(SWT.Selection, e -> Program.launch(DOCS_ESPRESSIF_FLASH_ENCRYPTION_HTML));
}

Comment on lines +241 to +257
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Missing selection listener and visibility logic for the note.

The note is always visible; there’s no linkage to the checkbox state. Add a listener to show/hide the note and relayout.

Apply:

-    Link flashEncryptionNote = new Link(flashGroup, SWT.WRAP);
-    flashEncryptionNote.setText(Messages.CMakeMainTab2_FlashEncryptionNote);
-
-    flashEncryptionNote.addListener(SWT.Selection, e -> Program.launch(DOCS_ESPRESSIF_FLASH_ENCRYPTION_HTML));
+    flashEncryptionNote = new Link(flashGroup, SWT.WRAP);
+    flashEncryptionNote.setText(Messages.CMakeMainTab2_FlashEncryptionNote);
+    flashEncryptionNote.addListener(SWT.Selection, e -> Program.launch(DOCS_ESPRESSIF_FLASH_ENCRYPTION_HTML));
+    // Toggle note visibility with checkbox
+    flashEncryptionCheckbox.addListener(SWT.Selection, e -> refreshFlashEncryptionNoteVisibility(flashGroup));
+    refreshFlashEncryptionNoteVisibility(flashGroup);

And declare a field:

- private Button flashEncryptionCheckbox;
+ private Button flashEncryptionCheckbox;
+ private Link flashEncryptionNote;

Add helper (outside changed ranges, shown for completeness):

private void refreshFlashEncryptionNoteVisibility(Composite container) {
    boolean visible = flashEncryptionCheckbox.getSelection();
    flashEncryptionNote.setVisible(visible);
    GridData gd = (GridData) flashEncryptionNote.getLayoutData();
    if (gd == null) {
        gd = new GridData(SWT.FILL, SWT.TOP, true, false);
        flashEncryptionNote.setLayoutData(gd);
    }
    gd.exclude = !visible;
    container.layout(true, true);
    if (mainComposite != null) {
        mainComposite.layout(true, true);
    }
}
🤖 Prompt for AI Agents
In
bundles/com.espressif.idf.launch.serial.ui/src/com/espressif/idf/launch/serial/ui/internal/CMakeMainTab2.java
around lines 241-257, the flash encryption note Link is always visible and not
tied to the checkbox state; add a private field for flashEncryptionNote, add a
selection listener on flashEncryptionCheckbox that calls a helper to show/hide
the note and relayout the parent (use the flashGroup or the composite container
you used to create the controls), ensure the initial visibility is set after
creation, and implement the provided
refreshFlashEncryptionNoteVisibility(Composite container) helper (outside these
lines) which toggles Link.setVisible, sets/excludes its GridData, and calls
container.layout(true,true) and mainComposite.layout(true,true) if non-null.

protected void createJtagflashComposite(Composite parent)
{

Expand Down Expand Up @@ -541,6 +563,8 @@ public void performApply(ILaunchConfigurationWorkingCopy configuration)
wc.setAttribute(IDFLaunchConstants.OPEN_SERIAL_MONITOR, checkOpenSerialMonitorButton.getSelection());
if (checkOpenSerialMonitorButton.getSelection())
wc.setAttribute(IDFLaunchConstants.SERIAL_MONITOR_ENCODING, fEncodingCombo.getText());
wc.setAttribute(IDFLaunchConstants.FLASH_ENCRYPTION_ENABLED, flashEncryptionCheckbox.getSelection());

wc.doSave();
}
catch (CoreException e)
Expand All @@ -553,13 +577,28 @@ public void performApply(ILaunchConfigurationWorkingCopy configuration)
public void initializeFrom(ILaunchConfiguration configuration)
{
super.initializeFrom(configuration);
updateFlashEncryptionGroup(configuration);
updateStartSerialMonitorGroup(configuration);
updateProjetFromConfig(configuration);
updateFlashOverStatus(configuration);
updateArgumentsWithDefaultFlashCommand(configuration);
switchUI(FlashInterface.values()[flashOverComboButton.getSelectionIndex()]);
}

private void updateFlashEncryptionGroup(ILaunchConfiguration configuration)
{
boolean isFlashEncryptionEnabled = false;
try
{
isFlashEncryptionEnabled = configuration.getAttribute(IDFLaunchConstants.FLASH_ENCRYPTION_ENABLED, false);
}
catch (CoreException e)
{
Logger.log(e);
}
flashEncryptionCheckbox.setSelection(isFlashEncryptionEnabled);
}

private void updateProjetFromConfig(ILaunchConfiguration configuration)
{
String projectName = StringUtil.EMPTY;
Expand Down
Loading
Loading