OSDN Git Service
Accumulate rendering errors and ensure they are always shown
There are some scenarios where rendering failures (such as an NPE in
the layout lib) will not appear in the error display, and it will not
appear in the Error Log.
In addition, we now get fidelity warnings from the layout library
(warning about Android code using graphics operations not supported by
the layout preview), and these should all be displayed to the user
with a proper explanation.
To solve these problems, this changeset replaces the layout logger
with a new logger which:
(1) Writes all exceptions to the AdtPlug.log(Throwable) method, which
results in the full exception being captured in the Error Log
(2) Accumulates all errors, warnings and fidelity warnings
(3) Provides a summary of ALL the problems at the end, such that they
are all displayed (in decreasing order of severity) for the user
rather than the last one clobbering them all.
The logger also records whether exceptions were logged, and if so, the
last line of the error display indicates that further details can be
found in Window > Show View > Error Log.
Finally, the old logger was a member of the GraphicalEditorPart, but
this is a lightweight object so there is no need to cache it, and in
fact we don't want other types of rendering (such as preview
rendering) popping open the error display area.
Change-Id: Ia00978a725cb7e7ec2dcfbf9e868df2a5136efc0