# HG changeset patch # User Frank Benoit # Date 1220978766 -7200 # Node ID 284c2e810329deabe29baf69ea8ce26c86ac4be0 # Parent 3b8f773f35e49fc9760d1139821e59da34d62e4e compile of JFace.Text is ok now diff -r 3b8f773f35e4 -r 284c2e810329 dwtx/jface/text/DefaultTextDoubleClickStrategy.d --- a/dwtx/jface/text/DefaultTextDoubleClickStrategy.d Tue Sep 09 17:44:33 2008 +0200 +++ b/dwtx/jface/text/DefaultTextDoubleClickStrategy.d Tue Sep 09 18:46:06 2008 +0200 @@ -176,7 +176,7 @@ */ public class DefaultTextDoubleClickStrategy : ITextDoubleClickStrategy { - +/++ /** * Implements a character iterator that works directly on * instances of IDocument. Used to collaborate with @@ -308,13 +308,13 @@ return i; } } - +++/ /** * The document character iterator used by this strategy. * @since 2.0 */ - private DocumentCharacterIterator fDocIter= new DocumentCharacterIterator(); +// private DocumentCharacterIterator fDocIter= new DocumentCharacterIterator(); /** @@ -341,11 +341,14 @@ if (position is line.getOffset() + line.getLength()) return; - fDocIter.setDocument(document, line); + //mangoicu +// fDocIter.setDocument(document, line); + String strLine = document.get( line.getOffset(), line.getLength() ); + UBreakIterator breakIter= UBreakIterator.openWordIterator( ULocale.Default, strLine/+fDocIter+/ ); - UBreakIterator breakIter= UBreakIterator.openWordIterator( ULocale.Default, fDocIter ); - int start= breakIter.preceding(position); + //int start= breakIter.preceding(position); + int start= breakIter.previous(position); // mangoicu if (start is UBreakIterator.DONE) start= line.getOffset(); diff -r 3b8f773f35e4 -r 284c2e810329 dwtx/jface/text/contentassist/AdditionalInfoController.d --- a/dwtx/jface/text/contentassist/AdditionalInfoController.d Tue Sep 09 17:44:33 2008 +0200 +++ b/dwtx/jface/text/contentassist/AdditionalInfoController.d Tue Sep 09 18:46:06 2008 +0200 @@ -46,6 +46,8 @@ import dwt.dwthelper.utils; import dwtx.dwtxhelper.JThread; +import tango.core.sync.Mutex; +import tango.core.sync.Condition; import dwt.events.SelectionEvent; import dwt.events.SelectionListener; @@ -77,12 +79,35 @@ */ class AdditionalInfoController : AbstractInformationControlManager { + alias AbstractInformationControlManager.showInformation showInformation; + /** * A timer thread. * * @since 3.2 */ - private static abstract class Timer { + private static abstract class Timer : Object.Monitor { + + private Mutex fMutex; + private Condition fMutex_cond; + + public override void lock(){ + fMutex.lock(); + } + public override void unlock(){ + fMutex.unlock(); + } + public void notifyAll(){ + fMutex_cond.notifyAll(); + } + public void wait(){ + fMutex_cond.wait(); + } + public void wait( long delay ){ + fMutex_cond.wait(delay/1000.0); + } + + private static const int DELAY_UNTIL_JOB_IS_SCHEDULED= 50; /** @@ -280,6 +305,9 @@ * @param delay the delay until to show additional info */ public this(Display display, int delay) { + fMutex = new Mutex(); + fMutex_cond = new Condition(fMutex); + // DWT instance init IDLE_init(); FIRST_WAIT_init(); @@ -293,7 +321,7 @@ schedule(IDLE, current); fThread= new JThread( &threadrun ); - fThread.serName( JFaceTextMessages.getString("InfoPopup.info_delay_timer_name")); //$NON-NLS-1$ + fThread.setName( JFaceTextMessages.getString("InfoPopup.info_delay_timer_name")); //$NON-NLS-1$ fThread.start(); } void threadrun() { @@ -370,7 +398,7 @@ } private bool isExt5(ICompletionProposal p) { - return cast(ICompletionProposalExtension5)p; + return null !is cast(ICompletionProposalExtension5)p; } ICompletionProposal getCurrentProposal() { @@ -378,7 +406,7 @@ } ICompletionProposalExtension5 getCurrentProposalEx() { - Assert.isTrue( cast(ICompletionProposalExtension5)fCurrentProposal ); + Assert.isTrue( null !is cast(ICompletionProposalExtension5)fCurrentProposal ); return cast(ICompletionProposalExtension5) fCurrentProposal; } @@ -511,12 +539,15 @@ super.install(control.getShell()); - Assert.isTrue( cast(Table)control ); + Assert.isTrue( null !is cast(Table)control ); fProposalTable= cast(Table) control; fProposalTable.addSelectionListener(fSelectionListener); getInternalAccessor().getInformationControlReplacer().install(fProposalTable); fTimer= new class(fProposalTable.getDisplay(), fDelay) Timer { + this( Display d, int del ){ + super(d,del); + } protected void showInformation(ICompletionProposal proposal, Object info) { InformationControlReplacer replacer= getInternalAccessor().getInformationControlReplacer(); if (replacer !is null) @@ -571,7 +602,7 @@ if (fProposalTable is null || fProposalTable.isDisposed()) return; - if (fProposal is proposal && ((info is null && fInformation is null) || (info !is null && info.equals(fInformation)))) + if (fProposal is proposal && ((info is null && fInformation is null) || (info !is null && info.opEquals(fInformation)))) return; fInformation= info; diff -r 3b8f773f35e4 -r 284c2e810329 dwtx/jface/text/templates/persistence/TemplateStore.d --- a/dwtx/jface/text/templates/persistence/TemplateStore.d Tue Sep 09 17:44:33 2008 +0200 +++ b/dwtx/jface/text/templates/persistence/TemplateStore.d Tue Sep 09 18:46:06 2008 +0200 @@ -18,6 +18,8 @@ import dwt.dwthelper.utils; import dwtx.dwtxhelper.Collection; +import dwtx.dwtxhelper.StringWriter; +import dwtx.dwtxhelper.StringReader; import dwtx.core.runtime.Assert; import dwtx.jface.preference.IPersistentPreferenceStore; @@ -37,7 +39,7 @@ */ public class TemplateStore { /** The stored templates. */ - private const List fTemplates= new ArrayList(); + private const List fTemplates; /** The preference store. */ private IPreferenceStore fPreferenceStore; /** @@ -74,7 +76,9 @@ * templates */ public this(IPreferenceStore store, String key) { - Assert.isNotNull(store); + fTemplates= new ArrayList(); + + Assert.isNotNull(cast(Object)store); Assert.isNotNull(key); fPreferenceStore= store; fKey= key; @@ -159,7 +163,7 @@ * @since 3.2 */ protected void handleException(IOException x) { - x.printStackTrace(); + ExceptionPrintStackTrace(x); } /** @@ -287,7 +291,7 @@ load(); } catch (IOException x) { // can't log from jface-text - x.printStackTrace(); + ExceptionPrintStackTrace(x); } }