Skip to content

Commit

Permalink
Merge pull request #6958 from oyarzun/flatlaf-options-rcp
Browse files Browse the repository at this point in the history
FlatLAF properties fallback to Openable for rcp apps without editors
  • Loading branch information
oyarzun authored Jan 15, 2024
2 parents 1400bff + 4384695 commit 82c6c8f
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 82c6c8f

Please sign in to comment.