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 236325
Collapse All | Expand All

(-)projectuiapi/apichanges.xml (+18 lines)
Lines 108-113 Link Here
108
108
109
    <changes>
109
    <changes>
110
110
111
         <change id="ProjectProblemsProvider.unresolvable">
112
            <api name="general"/>
113
            <summary>Allow creating ProjectProblemsProvider.ProjectProblem without a ProjectProblemResolver </summary>
114
            <version major="1" minor="74"/>
115
            <date day="7" month="10" year="2013"/>
116
            <author login="mkleint"/>
117
            <compatibility addition="yes"/>
118
            <description>
119
                <p>
120
                    <code>ProjectProblemsProvider.ProjectProblem</code> has so far required a <code>ProjectProblemResolver</code> effectively
121
                    making all problems resolvable, however a few places emerged where an automated resolution is not at hand and still we want to report the
122
                    error/warning. 2 new factory methods introduced.
123
                </p>
124
            </description>
125
            <class package="org.netbeans.spi.project.ui" name="ProjectProblemsProvider"/>
126
            <issue number="236325"/>
127
        </change>
128
111
        <change id="CustomizerProvider2">
129
        <change id="CustomizerProvider2">
112
            <api name="general"/>
130
            <api name="general"/>
113
            <summary>Moved CustomizerProvider2 from java.api.common</summary>
131
            <summary>Moved CustomizerProvider2 from java.api.common</summary>
(-)projectuiapi/nbproject/project.properties (-1 / +1 lines)
Lines 42-48 Link Here
42
42
43
javac.compilerargs=-Xlint -Xlint:-serial
43
javac.compilerargs=-Xlint -Xlint:-serial
44
javac.source=1.6
44
javac.source=1.6
45
spec.version.base=1.73.0
45
spec.version.base=1.74.0
46
is.autoload=true
46
is.autoload=true
47
javadoc.arch=${basedir}/arch.xml
47
javadoc.arch=${basedir}/arch.xml
48
javadoc.apichanges=${basedir}/apichanges.xml
48
javadoc.apichanges=${basedir}/apichanges.xml
(-)projectuiapi/src/org/netbeans/spi/project/ui/ProjectProblemsProvider.java (-4 / +49 lines)
Lines 44-49 Link Here
44
import java.beans.PropertyChangeListener;
44
import java.beans.PropertyChangeListener;
45
import java.util.Collection;
45
import java.util.Collection;
46
import java.util.concurrent.Future;
46
import java.util.concurrent.Future;
47
import java.util.concurrent.FutureTask;
47
import org.netbeans.api.annotations.common.CheckForNull;
48
import org.netbeans.api.annotations.common.CheckForNull;
48
import org.netbeans.api.annotations.common.NonNull;
49
import org.netbeans.api.annotations.common.NonNull;
49
import org.netbeans.api.annotations.common.NullAllowed;
50
import org.netbeans.api.annotations.common.NullAllowed;
Lines 212-222 Link Here
212
                @NonNull final Severity severity,
213
                @NonNull final Severity severity,
213
                @NonNull final String displayName,
214
                @NonNull final String displayName,
214
                @NonNull final String description,
215
                @NonNull final String description,
215
                @NonNull final ProjectProblemResolver resolver) {
216
                @NullAllowed final ProjectProblemResolver resolver) {
216
            Parameters.notNull("severity", severity); //NOI18N
217
            Parameters.notNull("severity", severity); //NOI18N
217
            Parameters.notNull("displayName", displayName); //NOI18N
218
            Parameters.notNull("displayName", displayName); //NOI18N
218
            Parameters.notNull("description", description); //NOI18N
219
            Parameters.notNull("description", description); //NOI18N
219
            Parameters.notNull("resolver", resolver);   //NOI18N
220
            this.severity = severity;
220
            this.severity = severity;
221
            this.displayName = displayName;
221
            this.displayName = displayName;
222
            this.description = description;
222
            this.description = description;
Lines 253-258 Link Here
253
        }
253
        }
254
254
255
        /**
255
        /**
256
         * Is the problem resolvable?
257
         * @return
258
         * @since 1.74
259
         */
260
        public boolean isResolvable() {
261
            return resolver != null;
262
        }
263
264
        /**
256
         * Resolves the problem.
265
         * Resolves the problem.
257
         * Called by the Event Dispatch Thread.
266
         * Called by the Event Dispatch Thread.
258
         * When the resolution needs to be done by a background thread, eg. downloading
267
         * When the resolution needs to be done by a background thread, eg. downloading
Lines 261-266 Link Here
261
         * @return the {@link Future} holding the problem resolution status.
270
         * @return the {@link Future} holding the problem resolution status.
262
         */
271
         */
263
        public Future<Result> resolve() {
272
        public Future<Result> resolve() {
273
            if (resolver == null) {
274
                return new FutureTask<Result>(new Runnable() {
275
                    @Override
276
                    public void run() {
277
                        //noop
278
                    }
279
                }, Result.create(Status.UNRESOLVED));
280
            }
264
            return resolver.resolve();
281
            return resolver.resolve();
265
        }
282
        }
266
283
Lines 278-284 Link Here
278
            final  ProjectProblem otherProblem = (ProjectProblem) other;
295
            final  ProjectProblem otherProblem = (ProjectProblem) other;
279
            return displayName.equals(otherProblem.displayName) &&
296
            return displayName.equals(otherProblem.displayName) &&
280
                description.equals(otherProblem.description) &&
297
                description.equals(otherProblem.description) &&
281
                resolver.equals(otherProblem.resolver);
298
                (resolver != null ? resolver.equals(otherProblem.resolver) : otherProblem.resolver == null);
282
        }
299
        }
283
300
284
        /**
301
        /**
Lines 289-295 Link Here
289
            int result = 17;
306
            int result = 17;
290
            result = 31 * result + displayName.hashCode();
307
            result = 31 * result + displayName.hashCode();
291
            result = 31 * result + description.hashCode();
308
            result = 31 * result + description.hashCode();
292
            result = 31 * result + resolver.hashCode();
309
            result = 31 * result + (resolver != null ? resolver.hashCode() : 0);
293
            return result;
310
            return result;
294
        }
311
        }
295
312
Lines 321-326 Link Here
321
        }
338
        }
322
339
323
        /**
340
        /**
341
         * Creates a new unresolvable instance of the {@link ProjectProblem} with error {@link Severity}.
342
         * @param displayName the project problem display name.
343
         * @param description the project problem description.
344
         * @return a new instance of {@link ProjectProblem}
345
         * @since 1.74
346
         */
347
        @NonNull
348
        public static ProjectProblem createError(
349
                @NonNull final String displayName,
350
                @NonNull final String description) {            
351
            return new ProjectProblem(Severity.ERROR, displayName, description, null);
352
        }
353
354
        /**
324
         * Creates a new instance of the {@link ProjectProblem} with warning {@link Severity}.
355
         * Creates a new instance of the {@link ProjectProblem} with warning {@link Severity}.
325
         * @param displayName the project problem display name.
356
         * @param displayName the project problem display name.
326
         * @param description the project problem description.
357
         * @param description the project problem description.
Lines 335-340 Link Here
335
            return new ProjectProblem(Severity.WARNING, displayName,description,resolver);
366
            return new ProjectProblem(Severity.WARNING, displayName,description,resolver);
336
        }
367
        }
337
368
369
        /**
370
         * Creates a new unresolvable instance of the {@link ProjectProblem} with warning {@link Severity}.
371
         * @param displayName the project problem display name.
372
         * @param description the project problem description.
373
         * @return a new instance of {@link ProjectProblem}
374
         * @since 1.74
375
         */
376
        @NonNull
377
        public static ProjectProblem createWarning(
378
                @NonNull final String displayName,
379
                @NonNull final String description) {
380
            return new ProjectProblem(Severity.WARNING, displayName, description, null);
338
    }
381
    }
339
382
340
}
383
}
384
385
}

Return to bug 236325