comparison dwtx/jface/text/contentassist/AdditionalInfoController.d @ 135:65801ad2b265

Regex fix for anon classes
author Frank Benoit <benoit@tionex.de>
date Sun, 24 Aug 2008 01:52:31 +0200
parents 51e6e63f930e
children 6dcb0baaa031
comparison
equal deleted inserted replaced
134:51e6e63f930e 135:65801ad2b265
110 110
111 /** 111 /**
112 * IDLE: the initial task, and active whenever the info has been shown. It cannot be run, 112 * IDLE: the initial task, and active whenever the info has been shown. It cannot be run,
113 * but specifies an infinite delay. 113 * but specifies an infinite delay.
114 */ 114 */
115 private final Task IDLE= new Task() { 115 private final Task IDLE= new class() Task {
116 public void run() { 116 public void run() {
117 Assert.isTrue(false); 117 Assert.isTrue(false);
118 } 118 }
119 119
120 public Task nextTask() { 120 public Task nextTask() {
131 } 131 }
132 }; 132 };
133 /** 133 /**
134 * FIRST_WAIT: Schedules a platform {@link Job} to fetch additional info from an {@link ICompletionProposalExtension5}. 134 * FIRST_WAIT: Schedules a platform {@link Job} to fetch additional info from an {@link ICompletionProposalExtension5}.
135 */ 135 */
136 private final Task FIRST_WAIT= new Task() { 136 private final Task FIRST_WAIT= new class() Task {
137 public void run() { 137 public void run() {
138 final ICompletionProposalExtension5 proposal= getCurrentProposalEx(); 138 final ICompletionProposalExtension5 proposal= getCurrentProposalEx();
139 Job job= new Job(JFaceTextMessages.getString("AdditionalInfoController.job_name")) { //$NON-NLS-1$ 139 Job job= new Job(JFaceTextMessages.getString("AdditionalInfoController.job_name")) { //$NON-NLS-1$
140 protected IStatus run(IProgressMonitor monitor) { 140 protected IStatus run(IProgressMonitor monitor) {
141 Object info; 141 Object info;
169 }; 169 };
170 /** 170 /**
171 * SECOND_WAIT: Allows display of additional info obtained from an 171 * SECOND_WAIT: Allows display of additional info obtained from an
172 * {@link ICompletionProposalExtension5}. 172 * {@link ICompletionProposalExtension5}.
173 */ 173 */
174 private final Task SECOND_WAIT= new Task() { 174 private final Task SECOND_WAIT= new class() Task {
175 public void run() { 175 public void run() {
176 // show the info 176 // show the info
177 allowShowing(); 177 allowShowing();
178 } 178 }
179 179
190 } 190 }
191 }; 191 };
192 /** 192 /**
193 * LEGACY_WAIT: Posts a runnable into the display thread to fetch additional info from non-{@link ICompletionProposalExtension5}s. 193 * LEGACY_WAIT: Posts a runnable into the display thread to fetch additional info from non-{@link ICompletionProposalExtension5}s.
194 */ 194 */
195 private final Task LEGACY_WAIT= new Task() { 195 private final Task LEGACY_WAIT= new class() Task {
196 public void run() { 196 public void run() {
197 final ICompletionProposal proposal= getCurrentProposal(); 197 final ICompletionProposal proposal= getCurrentProposal();
198 if (!fDisplay.isDisposed()) { 198 if (!fDisplay.isDisposed()) {
199 fDisplay.asyncExec(new Runnable() { 199 fDisplay.asyncExec(new class() Runnable {
200 public void run() { 200 public void run() {
201 synchronized (Timer.this) { 201 synchronized (Timer.this) {
202 if (proposal is getCurrentProposal()) { 202 if (proposal is getCurrentProposal()) {
203 Object info= proposal.getAdditionalProposalInfo(); 203 Object info= proposal.getAdditionalProposalInfo();
204 showInformation(proposal, info); 204 showInformation(proposal, info);
222 } 222 }
223 }; 223 };
224 /** 224 /**
225 * EXIT: The task that triggers termination of the timer thread. 225 * EXIT: The task that triggers termination of the timer thread.
226 */ 226 */
227 private final Task EXIT= new Task() { 227 private final Task EXIT= new class() Task {
228 public long delay() { 228 public long delay() {
229 return 1; 229 return 1;
230 } 230 }
231 231
232 public Task nextTask() { 232 public Task nextTask() {
268 fDisplay= display; 268 fDisplay= display;
269 fDelay= delay; 269 fDelay= delay;
270 long current= System.currentTimeMillis(); 270 long current= System.currentTimeMillis();
271 schedule(IDLE, current); 271 schedule(IDLE, current);
272 272
273 fThread= new Thread(new Runnable() { 273 fThread= new class(new Runnable() Thread {
274 public void run() { 274 public void run() {
275 try { 275 try {
276 loop(); 276 loop();
277 } catch (InterruptedException x) { 277 } catch (InterruptedException x) {
278 } 278 }
370 } 370 }
371 371
372 private void triggerShowing() { 372 private void triggerShowing() {
373 final Object info= fCurrentInfo; 373 final Object info= fCurrentInfo;
374 if (!fDisplay.isDisposed()) { 374 if (!fDisplay.isDisposed()) {
375 fDisplay.asyncExec(new Runnable() { 375 fDisplay.asyncExec(new class() Runnable {
376 public void run() { 376 public void run() {
377 synchronized (Timer.this) { 377 synchronized (Timer.this) {
378 if (info is fCurrentInfo) { 378 if (info is fCurrentInfo) {
379 showInformation(fCurrentProposal, info); 379 showInformation(fCurrentProposal, info);
380 } 380 }
489 Assert.isTrue(control instanceof Table); 489 Assert.isTrue(control instanceof Table);
490 fProposalTable= cast(Table) control; 490 fProposalTable= cast(Table) control;
491 fProposalTable.addSelectionListener(fSelectionListener); 491 fProposalTable.addSelectionListener(fSelectionListener);
492 getInternalAccessor().getInformationControlReplacer().install(fProposalTable); 492 getInternalAccessor().getInformationControlReplacer().install(fProposalTable);
493 493
494 fTimer= new Timer(fProposalTable.getDisplay(), fDelay) { 494 fTimer= new class(fProposalTable.getDisplay(), fDelay) Timer {
495 protected void showInformation(ICompletionProposal proposal, Object info) { 495 protected void showInformation(ICompletionProposal proposal, Object info) {
496 InformationControlReplacer replacer= getInternalAccessor().getInformationControlReplacer(); 496 InformationControlReplacer replacer= getInternalAccessor().getInformationControlReplacer();
497 if (replacer !is null) 497 if (replacer !is null)
498 replacer.hideInformationControl(); 498 replacer.hideInformationControl();
499 AdditionalInfoController.this.showInformation(proposal, info); 499 AdditionalInfoController.this.showInformation(proposal, info);