mbien commented on code in PR #7605:
URL: https://github.com/apache/netbeans/pull/7605#discussion_r1690261160


##########
java/java.source/src/org/netbeans/modules/java/JavaNode.java:
##########
@@ -429,6 +385,147 @@ public String getValue() {
         }
     }
 
+    private static final class RunFileJDKProperty extends 
PropertySupport.ReadWrite<String> {
+
+        private final PropertyEditorSupport jdkPicker = new JDKPicker();
+        private final DataObject dObj;
+
+        public RunFileJDKProperty(DataObject dObj) {
+            super("runFileJDK", String.class, // NOI18N
+                  "JDK",
+                  "JDK used to run the file.");
+            this.dObj = dObj;
+        }
+
+        @Override
+        public String getValue() {
+            return dObj.getPrimaryFile().getAttribute(FILE_JDK) instanceof 
String args ? args : "";
+        }
+
+        @Override
+        public void setValue(String text) {
+            try {
+                dObj.getPrimaryFile().setAttribute(FILE_JDK, text);
+            } catch (IOException ex) {
+                LOG.log(Level.WARNING, "Java File does not exist : {0}", 
dObj.getPrimaryFile().getName()); //NOI18N
+            }
+        }
+
+        @Override
+        public PropertyEditor getPropertyEditor() {
+            return jdkPicker;
+        }
+
+        private static final class JDKPicker extends PropertyEditorSupport {

Review Comment:
   thanks a lot, this looks much better. Updated the screenshot.
   
   I have to say the API for this is not very intuitive. Now it returns a 
custom editor, but `supportsCustomEditor` is left at false. This will now 
display the inline editor without the `...` button (as it should be).



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to