sdedic commented on code in PR #4043:
URL: https://github.com/apache/netbeans/pull/4043#discussion_r861510784


##########
extide/gradle/src/org/netbeans/modules/gradle/problems/PropertiesEditor.java:
##########
@@ -0,0 +1,141 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.netbeans.modules.gradle.problems;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.PrintWriter;
+import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.StandardOpenOption;
+import java.util.concurrent.atomic.AtomicReference;
+import java.util.logging.Logger;
+import javax.swing.text.BadLocationException;
+import javax.swing.text.Document;
+import org.netbeans.api.actions.Savable;
+import org.netbeans.api.editor.document.AtomicLockDocument;
+import org.netbeans.api.editor.document.LineDocumentUtils;
+import org.openide.cookies.EditorCookie;
+import org.openide.filesystems.FileObject;
+import org.openide.filesystems.FileUtil;
+import org.openide.util.EditableProperties;
+
+/**
+ *
+ * @author sdedic
+ */
+public class PropertiesEditor {

Review Comment:
   Could be, but I'd let the implementation mature a bit. `EditableProperties` 
are a good start, but I am not satisfied with this implementation and my impl 
for opened Document is ... well, barely acceptable. In fact you'd like to aply 
line-by-line diff to the current document's contents, so that caret, selection 
are not disturbed, if possible. Some tweaks for opened Panels could be also 
nice. Also EditableProperties do not count much with stand-alone comments (all 
are assigned to keys) etc - something that could be eventually improved. 
   
   Our product requirements lead to some API to "add technologies to a project" 
(i.e. apply a certain plugin + its settings in project gradle.properties in 
Gradle terms), which  will hopefully give me an excuse to improve the editing 
capabilities for .properties files - sorry to choose Gradle projects for an 
incubator of this :)
   



-- 
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