This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 31913
Collapse All | Expand All

(-)src/org/netbeans/modules/java/JavaParserGlue.java (+4 lines)
Lines 263-268 Link Here
263
        return cloneableEditSupp;
263
        return cloneableEditSupp;
264
    }
264
    }
265
    
265
    
266
    public void takeLock() throws IOException {
267
        jdo.getPrimaryEntry().takeLock();
268
    }
269
266
    private synchronized void bindEditorSupport(CloneableEditorSupport supp) {
270
    private synchronized void bindEditorSupport(CloneableEditorSupport supp) {
267
        if (!editorBound) {
271
        if (!editorBound) {
268
            supp.addChangeListener(l);
272
            supp.addChangeListener(l);
(-)src/org/netbeans/modules/java/codegen/DocumentBinding.java (+6 lines)
Lines 14-19 Link Here
14
package org.netbeans.modules.java.codegen;
14
package org.netbeans.modules.java.codegen;
15
15
16
import java.util.Collection;
16
import java.util.Collection;
17
import java.io.IOException;
17
18
18
import org.openide.cookies.SourceCookie;
19
import org.openide.cookies.SourceCookie;
19
20
Lines 88-93 Link Here
88
         * deferred to the user of the code generation suite.
89
         * deferred to the user of the code generation suite.
89
         */
90
         */
90
        public PositionRef  findFreePosition(PositionBounds bounds);
91
        public PositionRef  findFreePosition(PositionBounds bounds);
92
93
        /**
94
         * @throws IOException
95
         */
96
        public void         takeLock() throws IOException;
91
    }
97
    }
92
}
98
}
93
99
(-)src/org/netbeans/modules/java/codegen/SourceText.java (-2 / +12 lines)
Lines 166-174 Link Here
166
        runAtomic(null, r);
166
        runAtomic(null, r);
167
    }
167
    }
168
    
168
    
169
    private void checkWritable(Element el) throws IOException {
170
        environment.takeLock();
171
    }
172
169
    private void runAtomic(Element el, final Runnable r) throws SourceException {
173
    private void runAtomic(Element el, final Runnable r) throws SourceException {
170
       final Exception[] exc = new Exception[1];
174
       final Exception[] exc = new Exception[1];
171
       try {
175
       try {
176
           checkWritable(el);
172
           if (isAtomicAsUser()) {
177
           if (isAtomicAsUser()) {
173
               NbDocument.runAtomicAsUser(getDocument(), r);
178
               NbDocument.runAtomicAsUser(getDocument(), r);
174
           } else {
179
           } else {
Lines 209-215 Link Here
209
            ex, null);
214
            ex, null);
210
        } else if (ex instanceof IOException) {
215
        } else if (ex instanceof IOException) {
211
           x =  new SourceException.IO((IOException)ex);
216
           x =  new SourceException.IO((IOException)ex);
212
           man.annotate(x, ex);
217
           man.annotate(x, ErrorManager.USER, null, ex.getLocalizedMessage(), ex, null);
213
        } else if (ex instanceof SourceException) {
218
        } else if (ex instanceof SourceException) {
214
           x = (SourceException)ex;
219
           x = (SourceException)ex;
215
        } else {
220
        } else {
Lines 220-227 Link Here
220
        throw x;
225
        throw x;
221
    }
226
    }
222
    
227
    
223
    public void runAtomic(Element el, final ExceptionRunnable r) throws SourceException {
228
    public void runAtomic(final Element el, final ExceptionRunnable r) throws SourceException {
224
        final Exception[] exc = new Exception[1];
229
        final Exception[] exc = new Exception[1];
230
        try {
231
            checkWritable(el);
232
        } catch (IOException ex) {
233
            rethrowException(el, ex);
234
        }
225
        Runnable r2 = new Runnable() {
235
        Runnable r2 = new Runnable() {
226
            public void run() {
236
            public void run() {
227
                //environment.notifyBeginEdit();
237
                //environment.notifyBeginEdit();
(-)srcmodel/src/org/openide/src/nodes/ClassElementNode.java (-5 / +4 lines)
Lines 110-121 Link Here
110
    protected Sheet createSheet () {
110
    protected Sheet createSheet () {
111
        Sheet sheet = Sheet.createDefault();
111
        Sheet sheet = Sheet.createDefault();
112
        Sheet.Set ps = sheet.get(Sheet.PROPERTIES);
112
        Sheet.Set ps = sheet.get(Sheet.PROPERTIES);
113
        boolean canWrite = isWriteable();
113
        ps.put(createModifiersProperty(writeable));
114
        ps.put(createModifiersProperty(canWrite));
114
        ps.put(createNameProperty(writeable));
115
        ps.put(createNameProperty(canWrite));
116
        if (((ClassElement)element).isClass())
115
        if (((ClassElement)element).isClass())
117
            ps.put(createSuperclassProperty(canWrite));
116
            ps.put(createSuperclassProperty(writeable));
118
        ps.put(createInterfacesProperty(canWrite));
117
        ps.put(createInterfacesProperty(writeable));
119
        ps.setValue("helpID", ((ClassElement)element).isClass() ?
118
        ps.setValue("helpID", ((ClassElement)element).isClass() ?
120
                "org.openide.src.ClassProperties" : "org.openide.src.InterfaceProperties");
119
                "org.openide.src.ClassProperties" : "org.openide.src.InterfaceProperties");
121
        return sheet;
120
        return sheet;
(-)srcmodel/src/org/openide/src/nodes/ConstructorElementNode.java (-3 / +3 lines)
Lines 70-79 Link Here
70
    protected Sheet createSheet () {
70
    protected Sheet createSheet () {
71
        Sheet sheet = Sheet.createDefault();
71
        Sheet sheet = Sheet.createDefault();
72
        Sheet.Set ps = sheet.get(Sheet.PROPERTIES);
72
        Sheet.Set ps = sheet.get(Sheet.PROPERTIES);
73
        ps.put(createModifiersProperty(isWriteable()));
73
        ps.put(createModifiersProperty(writeable));
74
        ps.put(createNameProperty(false));
74
        ps.put(createNameProperty(false));
75
        ps.put(createParametersProperty(isWriteable()));
75
        ps.put(createParametersProperty(writeable));
76
        ps.put(createExceptionsProperty(isWriteable()));
76
        ps.put(createExceptionsProperty(writeable));
77
        ps.setValue("helpID", "org.openide.src.ConstructorProperties");
77
        ps.setValue("helpID", "org.openide.src.ConstructorProperties");
78
        return sheet;
78
        return sheet;
79
    }
79
    }
(-)srcmodel/src/org/openide/src/nodes/FieldElementNode.java (-4 / +4 lines)
Lines 83-92 Link Here
83
    protected Sheet createSheet () {
83
    protected Sheet createSheet () {
84
        Sheet sheet = Sheet.createDefault();
84
        Sheet sheet = Sheet.createDefault();
85
        Sheet.Set ps = sheet.get(Sheet.PROPERTIES);
85
        Sheet.Set ps = sheet.get(Sheet.PROPERTIES);
86
        ps.put(createModifiersProperty(isWriteable()));
86
        ps.put(createModifiersProperty(writeable));
87
        ps.put(createNameProperty(isWriteable()));
87
        ps.put(createNameProperty(writeable));
88
        ps.put(createTypeProperty(isWriteable()));
88
        ps.put(createTypeProperty(writeable));
89
        ps.put(createInitValueProperty(isWriteable()));
89
        ps.put(createInitValueProperty(writeable));
90
        ps.setValue("helpID", "org.openide.src.FieldProperties");
90
        ps.setValue("helpID", "org.openide.src.FieldProperties");
91
        return sheet;
91
        return sheet;
92
    }
92
    }
(-)srcmodel/src/org/openide/src/nodes/InitializerElementNode.java (-1 / +1 lines)
Lines 76-82 Link Here
76
    protected Sheet createSheet () {
76
    protected Sheet createSheet () {
77
        Sheet sheet = Sheet.createDefault();
77
        Sheet sheet = Sheet.createDefault();
78
        Sheet.Set ps = sheet.get(Sheet.PROPERTIES);
78
        Sheet.Set ps = sheet.get(Sheet.PROPERTIES);
79
        ps.put(createStaticProperty(isWriteable()));
79
        ps.put(createStaticProperty(writeable));
80
        ps.setValue("helpID", "org.openide.src.InitializerProperties");
80
        ps.setValue("helpID", "org.openide.src.InitializerProperties");
81
        return sheet;
81
        return sheet;
82
    }
82
    }
(-)srcmodel/src/org/openide/src/nodes/MethodElementNode.java (-5 / +5 lines)
Lines 92-102 Link Here
92
    protected Sheet createSheet () {
92
    protected Sheet createSheet () {
93
        Sheet sheet = Sheet.createDefault();
93
        Sheet sheet = Sheet.createDefault();
94
        Sheet.Set ps = sheet.get(Sheet.PROPERTIES);
94
        Sheet.Set ps = sheet.get(Sheet.PROPERTIES);
95
        ps.put(createModifiersProperty(isWriteable()));
95
        ps.put(createModifiersProperty(writeable));
96
        ps.put(createNameProperty(isWriteable()));
96
        ps.put(createNameProperty(writeable));
97
        ps.put(createParametersProperty(isWriteable()));
97
        ps.put(createParametersProperty(writeable));
98
        ps.put(createReturnProperty(isWriteable()));
98
        ps.put(createReturnProperty(writeable));
99
        ps.put(createExceptionsProperty(isWriteable()));
99
        ps.put(createExceptionsProperty(writeable));
100
        ps.setValue("helpID", "org.openide.src.MethodProperties");
100
        ps.setValue("helpID", "org.openide.src.MethodProperties");
101
        return sheet;
101
        return sheet;
102
    }
102
    }

Return to bug 31913