Lines 168-182
Link Here
|
168 |
log(IStatus.ERROR, "Internal Error", t); //$NON-NLS-1$ |
166 |
log(IStatus.ERROR, "Internal Error", t); //$NON-NLS-1$ |
169 |
} |
167 |
} |
170 |
|
168 |
|
171 |
public static IProgressMonitor monitorFor(IProgressMonitor monitor) { |
169 |
public static SubMonitor monitorFor(IProgressMonitor monitor) { |
172 |
return monitor == null ? new NullProgressMonitor() : monitor; |
170 |
return (monitor instanceof SubMonitor) ? (SubMonitor) monitor : SubMonitor.convert(monitor); |
173 |
} |
171 |
} |
174 |
|
172 |
|
175 |
public static IProgressMonitor subMonitorFor(IProgressMonitor monitor, int ticks) { |
173 |
public static SubMonitor subMonitorFor(IProgressMonitor monitor, int ticks) { |
176 |
if (monitor == null) |
174 |
SubMonitor subMonitor = monitorFor(monitor); |
177 |
return new NullProgressMonitor(); |
175 |
return subMonitor.newChild(ticks); |
178 |
if (monitor instanceof NullProgressMonitor) |
|
|
179 |
return monitor; |
180 |
return new SubProgressMonitor(monitor, ticks); |
181 |
} |
176 |
} |
182 |
} |
177 |
} |