1 19 20 package org.netbeans.modules.refactoring.spi; 21 22 import org.netbeans.modules.refactoring.api.impl.ProgressSupport; 23 import org.netbeans.modules.refactoring.api.ProgressListener; 24 25 30 public class ProgressProviderAdapter implements ProgressProvider { 31 32 private ProgressSupport progressSupport; 33 34 37 protected ProgressProviderAdapter() { 38 } 39 40 44 public synchronized void addProgressListener(ProgressListener listener) { 45 if (progressSupport == null ) { 46 progressSupport = new ProgressSupport(); 47 } 48 progressSupport.addProgressListener(listener); 49 } 50 51 55 public synchronized void removeProgressListener(ProgressListener listener) { 56 if (progressSupport != null ) { 57 progressSupport.removeProgressListener(listener); 58 } 59 } 60 61 67 protected final void fireProgressListenerStart(int type, int count) { 68 if (progressSupport != null) 69 progressSupport.fireProgressListenerStart(this, type, count); 70 } 71 72 74 protected final void fireProgressListenerStep() { 75 if (progressSupport != null) 76 progressSupport.fireProgressListenerStep(this); 77 } 78 79 83 protected final void fireProgressListenerStep(int count) { 84 if (progressSupport != null) 85 progressSupport.fireProgressListenerStep(this, count); 86 } 87 88 90 protected final void fireProgressListenerStop() { 91 if (progressSupport != null) 92 progressSupport.fireProgressListenerStop(this); 93 } 94 } 95 | Popular Tags |