mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-17 05:55:22 +02:00
Cosmetics.
This commit is contained in:
parent
5b3ed2f9c1
commit
7b619824e8
1 changed files with 8 additions and 10 deletions
|
@ -41,7 +41,7 @@ import org.eclipse.cdt.internal.ui.util.ImageDescriptorRegistry;
|
||||||
/**
|
/**
|
||||||
* LabelDecorator that decorates an element's image with error and warning overlays that
|
* LabelDecorator that decorates an element's image with error and warning overlays that
|
||||||
* represent the severity of markers attached to the element's underlying resource. To see
|
* represent the severity of markers attached to the element's underlying resource. To see
|
||||||
* a problem decoration for a marker, the marker needs to be a subtype of <code>IMarker.PROBLEM</code>.
|
* a problem decoration for a marker, the marker needs to be a subtype of {@code IMarker.PROBLEM}.
|
||||||
* <p>
|
* <p>
|
||||||
* Note: Only images for elements in Java projects are currently updated on marker changes.
|
* Note: Only images for elements in Java projects are currently updated on marker changes.
|
||||||
* </p>
|
* </p>
|
||||||
|
@ -49,23 +49,22 @@ import org.eclipse.cdt.internal.ui.util.ImageDescriptorRegistry;
|
||||||
* @since 2.0
|
* @since 2.0
|
||||||
*/
|
*/
|
||||||
public class ProblemsLabelDecorator implements ILabelDecorator, ILightweightLabelDecorator {
|
public class ProblemsLabelDecorator implements ILabelDecorator, ILightweightLabelDecorator {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is a special <code>LabelProviderChangedEvent</code> carring additional
|
* This is a special <code>LabelProviderChangedEvent</code> carrying additional
|
||||||
* information whether the event orgins from a maker change.
|
* information whether the event origins from a maker change.
|
||||||
* <p>
|
* <p>
|
||||||
* <code>ProblemsLabelChangedEvent</code>s are only generated by <code>
|
* <code>ProblemsLabelChangedEvent</code>s are only generated by <code>
|
||||||
* ProblemsLabelDecorator</code>s.
|
* ProblemsLabelDecorator</code>s.
|
||||||
* </p>
|
* </p>
|
||||||
*/
|
*/
|
||||||
public static class ProblemsLabelChangedEvent extends LabelProviderChangedEvent {
|
public static class ProblemsLabelChangedEvent extends LabelProviderChangedEvent {
|
||||||
|
|
||||||
private boolean fMarkerChange;
|
private boolean fMarkerChange;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Note: This constructor is for internal use only. Clients should not call this constructor.
|
* Note: This constructor is for internal use only. Clients should not call this constructor.
|
||||||
*/
|
*/
|
||||||
public ProblemsLabelChangedEvent(IBaseLabelProvider source, IResource[] changedResource, boolean isMarkerChange) {
|
public ProblemsLabelChangedEvent(IBaseLabelProvider source, IResource[] changedResource,
|
||||||
|
boolean isMarkerChange) {
|
||||||
super(source, changedResource);
|
super(source, changedResource);
|
||||||
fMarkerChange= isMarkerChange;
|
fMarkerChange= isMarkerChange;
|
||||||
}
|
}
|
||||||
|
@ -80,14 +79,13 @@ public class ProblemsLabelDecorator implements ILabelDecorator, ILightweightLabe
|
||||||
public boolean isMarkerChange() {
|
public boolean isMarkerChange() {
|
||||||
return fMarkerChange;
|
return fMarkerChange;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final int ERRORTICK_WARNING= CElementImageDescriptor.WARNING;
|
private static final int ERRORTICK_WARNING= CElementImageDescriptor.WARNING;
|
||||||
private static final int ERRORTICK_ERROR= CElementImageDescriptor.ERROR;
|
private static final int ERRORTICK_ERROR= CElementImageDescriptor.ERROR;
|
||||||
|
|
||||||
private ImageDescriptorRegistry fRegistry;
|
private ImageDescriptorRegistry fRegistry;
|
||||||
private boolean fUseNewRegistry= false;
|
private boolean fUseNewRegistry;
|
||||||
private IProblemChangedListener fProblemChangedListener;
|
private IProblemChangedListener fProblemChangedListener;
|
||||||
|
|
||||||
private ListenerList fListeners;
|
private ListenerList fListeners;
|
||||||
|
@ -119,7 +117,6 @@ public class ProblemsLabelDecorator implements ILabelDecorator, ILightweightLabe
|
||||||
return fRegistry;
|
return fRegistry;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String decorateText(String text, Object element) {
|
public String decorateText(String text, Object element) {
|
||||||
return text;
|
return text;
|
||||||
|
@ -175,7 +172,8 @@ public class ProblemsLabelDecorator implements ILabelDecorator, ILightweightLabe
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
private int getErrorTicksFromMarkers(IResource res, int depth, ISourceReference sourceElement) throws CoreException {
|
private int getErrorTicksFromMarkers(IResource res, int depth, ISourceReference sourceElement)
|
||||||
|
throws CoreException {
|
||||||
if (res == null || !res.isAccessible()) {
|
if (res == null || !res.isAccessible()) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue