Mercurial > projects > dwt-addons
comparison dwtx/jface/internal/text/link/contentassist/AdditionalInfoController2.d @ 167:862b05e0334a
Add a wrapper for Thread
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Tue, 09 Sep 2008 15:59:16 +0200 |
parents | 1a5b8f8129df |
children | cef27f663573 |
comparison
equal
deleted
inserted
replaced
163:e5dd0081ccba | 167:862b05e0334a |
---|---|
23 import dwtx.jface.internal.text.link.contentassist.PopupCloser2; // packageimport | 23 import dwtx.jface.internal.text.link.contentassist.PopupCloser2; // packageimport |
24 import dwtx.jface.internal.text.link.contentassist.IContentAssistListener2; // packageimport | 24 import dwtx.jface.internal.text.link.contentassist.IContentAssistListener2; // packageimport |
25 import dwtx.jface.internal.text.link.contentassist.ContentAssistant2; // packageimport | 25 import dwtx.jface.internal.text.link.contentassist.ContentAssistant2; // packageimport |
26 | 26 |
27 import dwt.dwthelper.utils; | 27 import dwt.dwthelper.utils; |
28 import tango.core.Thread; | 28 import dwtx.dwtxhelper.JThread; |
29 | 29 |
30 import dwt.events.SelectionEvent; | 30 import dwt.events.SelectionEvent; |
31 import dwt.events.SelectionListener; | 31 import dwt.events.SelectionListener; |
32 import dwt.graphics.Point; | 32 import dwt.graphics.Point; |
33 import dwt.graphics.Rectangle; | 33 import dwt.graphics.Rectangle; |
40 import dwtx.jface.text.IInformationControlCreator; | 40 import dwtx.jface.text.IInformationControlCreator; |
41 import dwtx.jface.text.contentassist.ICompletionProposal; | 41 import dwtx.jface.text.contentassist.ICompletionProposal; |
42 import dwtx.jface.text.contentassist.ICompletionProposalExtension3; | 42 import dwtx.jface.text.contentassist.ICompletionProposalExtension3; |
43 | 43 |
44 | 44 |
45 | |
46 /** | 45 /** |
47 * Displays the additional information available for a completion proposal. | 46 * Displays the additional information available for a completion proposal. |
48 * | 47 * |
49 * @since 2.0 | 48 * @since 2.0 |
50 */ | 49 */ |
71 | 70 |
72 | 71 |
73 /** The proposal table */ | 72 /** The proposal table */ |
74 private Table fProposalTable; | 73 private Table fProposalTable; |
75 /** The thread controlling the delayed display of the additional info */ | 74 /** The thread controlling the delayed display of the additional info */ |
76 private Thread fThread; | 75 private JThread fThread; |
77 /** Indicates whether the display delay has been reset */ | 76 /** Indicates whether the display delay has been reset */ |
78 private bool fIsReset= false; | 77 private bool fIsReset= false; |
79 /** Object to synchronize display thread and table selection changes */ | 78 /** Object to synchronize display thread and table selection changes */ |
80 private const Object fMutex; | 79 private const Object fMutex; |
81 /** Thread access lock. */ | 80 /** Thread access lock. */ |
120 fProposalTable= cast(Table) control; | 119 fProposalTable= cast(Table) control; |
121 fProposalTable.addSelectionListener(fSelectionListener); | 120 fProposalTable.addSelectionListener(fSelectionListener); |
122 synchronized (fThreadAccess) { | 121 synchronized (fThreadAccess) { |
123 if (fThread !is null) | 122 if (fThread !is null) |
124 fThread.interrupt(); | 123 fThread.interrupt(); |
125 fThread= new Thread(this, ContentAssistMessages.getString("InfoPopup.info_delay_timer_name")); //$NON-NLS-1$ | 124 fThread= new JThread(this, ContentAssistMessages.getString("InfoPopup.info_delay_timer_name")); //$NON-NLS-1$ |
126 | 125 |
127 fStartSignal= new Object(); | 126 fStartSignal= new Object(); |
128 synchronized (fStartSignal) { | 127 synchronized (fStartSignal) { |
129 fThread.start(); | 128 fThread.start(); |
130 try { | 129 try { |
197 } catch (InterruptedException e) { | 196 } catch (InterruptedException e) { |
198 } | 197 } |
199 | 198 |
200 synchronized (fThreadAccess) { | 199 synchronized (fThreadAccess) { |
201 // only null fThread if it is us! | 200 // only null fThread if it is us! |
202 if (Thread.currentThread() is fThread) | 201 if (JThread.currentThread() is fThread) |
203 fThread= null; | 202 fThread= null; |
204 } | 203 } |
205 } | 204 } |
206 | 205 |
207 /** | 206 /** |