001    // License: GPL. For details, see LICENSE file.
002    package org.openstreetmap.josm.gui.progress;
003    
004    import java.awt.Component;
005    
006    import org.openstreetmap.josm.Main;
007    
008    public class NullProgressMonitor implements ProgressMonitor {
009    
010        public static final ProgressMonitor INSTANCE = new NullProgressMonitor();
011    
012        private NullProgressMonitor() {
013    
014        }
015    
016        public void addCancelListener(CancelListener listener) {
017        }
018    
019        public void beginTask(String title) {
020        }
021    
022        public void beginTask(String title, int ticks) {
023        }
024    
025        public void cancel() {
026        }
027    
028        public ProgressMonitor createSubTaskMonitor(int ticks, boolean internal) {
029            return INSTANCE;
030        }
031    
032        public void finishTask() {
033        }
034    
035        public String getErrorMessage() {
036            return null;
037        }
038    
039        public int getTicks() {
040            return 0;
041        }
042    
043        public void indeterminateSubTask(String title) {
044        }
045    
046        public void invalidate() {
047        }
048    
049        public boolean isCanceled() {
050            return false;
051        }
052    
053        public void removeCancelListener(CancelListener listener) {
054        }
055    
056        public void setCustomText(String text) {
057        }
058    
059        public void setErrorMessage(String message) {
060        }
061    
062        public void setExtraText(String text) {
063        }
064    
065        public void appendLogMessage(String message) {
066        }
067    
068        public void setSilent(boolean value) {
069        }
070    
071        public void setTicks(int ticks) {
072        }
073    
074        public void setTicksCount(int ticks) {
075        }
076    
077        public void subTask(String title) {
078        }
079    
080        public void worked(int ticks) {
081        }
082    
083        public int getTicksCount() {
084            return 0;
085        }
086    
087        @Override
088        public void setProgressTaskId(ProgressTaskId taskId) {
089        }
090    
091        @Override
092        public ProgressTaskId getProgressTaskId() {
093            return null;
094        }
095    
096        @Override
097        public Component getWindowParent() {
098            return Main.parent;
099        }
100    }