From 43846955ad80f87dc97e42fb23b1cead4a954139 Mon Sep 17 00:00:00 2001 From: Christian Oyarzun Date: Mon, 15 Jan 2024 12:28:53 -0500 Subject: [PATCH] flatlaf properties fallback to openable for rcp apps without editors --- .../netbeans/swing/laf/flatlaf/FlatLafOptionsPanel.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/platform/o.n.swing.laf.flatlaf/src/org/netbeans/swing/laf/flatlaf/FlatLafOptionsPanel.java b/platform/o.n.swing.laf.flatlaf/src/org/netbeans/swing/laf/flatlaf/FlatLafOptionsPanel.java index 553a910c8951..09e8ae4f0659 100644 --- a/platform/o.n.swing.laf.flatlaf/src/org/netbeans/swing/laf/flatlaf/FlatLafOptionsPanel.java +++ b/platform/o.n.swing.laf.flatlaf/src/org/netbeans/swing/laf/flatlaf/FlatLafOptionsPanel.java @@ -30,6 +30,7 @@ import java.util.Properties; import javax.swing.UIManager; import org.netbeans.api.actions.Editable; +import org.netbeans.api.actions.Openable; import org.netbeans.spi.options.OptionsPanelController; import org.openide.LifecycleManager; import org.openide.awt.Notification; @@ -299,7 +300,13 @@ private void customPropertiesButtonActionPerformed(java.awt.event.ActionEvent ev } DataObject dob = DataObject.find(customProp); Editable editable = dob.getLookup().lookup(Editable.class); - editable.edit(); + if (editable != null) { + editable.edit(); + } else { + // fallback to openable for platform apps without editor modules + Openable openable = dob.getLookup().lookup(Openable.class); + openable.open(); + } } catch (Exception ex) { Exceptions.printStackTrace(ex); }