1 11 package org.eclipse.pde.internal.build; 12 13 import java.util.*; 14 import org.eclipse.core.runtime.*; 15 16 19 public class Policy { 20 21 28 public static IProgressMonitor monitorFor(IProgressMonitor monitor) { 29 if (monitor == null) 30 return new NullProgressMonitor(); 31 return monitor; 32 } 33 34 41 public static IProgressMonitor subMonitorFor(IProgressMonitor monitor, int ticks) { 42 if (monitor == null) 43 return new NullProgressMonitor(); 44 if (monitor instanceof NullProgressMonitor) 45 return monitor; 46 return new SubProgressMonitor(monitor, ticks); 47 } 48 49 58 public static IProgressMonitor subMonitorFor(IProgressMonitor monitor, int ticks, int style) { 59 if (monitor == null) 60 return new NullProgressMonitor(); 61 if (monitor instanceof NullProgressMonitor) 62 return monitor; 63 return new SubProgressMonitor(monitor, ticks, style); 64 } 65 66 70 public static void debug(boolean includeDate, String message) { 71 if (includeDate) 72 message = new Date(System.currentTimeMillis()).toString() + " - " + message; System.out.println(message); 74 } 75 } 76 | Popular Tags |