1 19 20 package org.netbeans.api.progress; 21 22 import javax.swing.JComponent ; 23 import javax.swing.JLabel ; 24 import org.netbeans.progress.spi.InternalHandle; 25 26 32 public final class ProgressHandle { 33 private InternalHandle internal; 34 35 ProgressHandle(InternalHandle internal) { 36 this.internal = internal; 37 } 38 39 40 45 public void start() { 46 start(0, -1); 47 } 48 49 53 public void start(int workunits) { 54 start(workunits, -1); 55 } 56 57 58 64 65 public void start(int workunits, long estimate) { 66 internal.start("", workunits, estimate); 67 } 68 69 70 74 public void switchToIndeterminate() { 75 internal.toIndeterminate(); 76 } 77 78 86 public void suspend(String message) { 87 internal.toSilent(message); 88 } 89 90 96 public void switchToDeterminate(int workunits) { 97 internal.toDeterminate(workunits, -1); 98 } 99 100 107 public void switchToDeterminate(int workunits, long estimate) { 108 internal.toDeterminate(workunits, estimate); 109 } 110 111 114 public void finish() { 115 internal.finish(); 116 } 117 118 119 123 public void progress(int workunit) { 124 progress(null, workunit); 125 } 126 127 131 public void progress(String message) { 132 progress(message, InternalHandle.NO_INCREASE); 133 } 134 135 140 public void progress(String message, int workunit) { 141 internal.progress(message, workunit); 142 } 143 144 145 156 public void setInitialDelay(int millis) { 157 internal.setInitialDelay(millis); 158 } 159 160 166 public void setDisplayName(String newDisplayName) { 167 internal.requestDisplayNameChange(newDisplayName); 168 } 169 170 173 JComponent extractComponent() { 174 return internal.extractComponent(); 175 } 176 177 181 @Deprecated 182 InternalHandle getInternalHandle() { 183 return internal; 184 } 185 186 JLabel extractDetailLabel() { 187 return internal.extractDetailLabel(); 188 } 189 190 JLabel extractMainLabel() { 191 return internal.extractMainLabel(); 192 } 193 194 195 } 196 | Popular Tags |