# HG changeset patch
# User Frank Benoit
@@ -862,7 +863,18 @@
return false;
}
- return handler.isEnabled();
+ try {
+ return handler.isEnabled();
+ } catch (Exception e) {
+ if (DEBUG_HANDLERS) {
+ // since this has the ability to generate megs of logs, only
+ // provide information if tracing
+ Tracing.printTrace("HANDLERS", "Handler " ~ (cast(Object)handler).toString() ~ " for " //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
+ ~ id ~ " threw unexpected exception"); //$NON-NLS-1$
+ ExceptionPrintStackTrace( e, Stdout );
+ }
+ }
+ return false;
}
/**
diff -r 040da1cb0d76 -r 7ffeace6c47f dwtx/core/commands/CommandManager.d
--- a/dwtx/core/commands/CommandManager.d Sun Jun 22 22:57:31 2008 +0200
+++ b/dwtx/core/commands/CommandManager.d Sun Jul 06 23:30:07 2008 +0200
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff -r 040da1cb0d76 -r 7ffeace6c47f dwtx/core/commands/common/CommandException.d
--- a/dwtx/core/commands/common/CommandException.d Sun Jun 22 22:57:31 2008 +0200
+++ b/dwtx/core/commands/common/CommandException.d Sun Jul 06 23:30:07 2008 +0200
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff -r 040da1cb0d76 -r 7ffeace6c47f dwtx/core/runtime/Path.d
--- a/dwtx/core/runtime/Path.d Sun Jun 22 22:57:31 2008 +0200
+++ b/dwtx/core/runtime/Path.d Sun Jul 06 23:30:07 2008 +0200
@@ -18,7 +18,7 @@
import dwt.dwthelper.utils;
-import tango.io.FileConst;
+import tango.io.model.IFile;
static import tango.text.Text;
alias tango.text.Text.Text!(char) StringBuffer;
diff -r 040da1cb0d76 -r 7ffeace6c47f dwtx/jface/action/AbstractGroupMarker.d
--- a/dwtx/jface/action/AbstractGroupMarker.d Sun Jun 22 22:57:31 2008 +0200
+++ b/dwtx/jface/action/AbstractGroupMarker.d Sun Jul 06 23:30:07 2008 +0200
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -23,6 +23,7 @@
*
* This class is not intended to be subclassed outside the framework.
*
* This class may be instantiated; it is not intended to be subclassed.
*
MenuManager
}.
*
+ * @noimplement This interface is not intended to be implemented by clients.
*/
public interface IMenuManager : IContributionManager, IContributionItem {
diff -r 040da1cb0d76 -r 7ffeace6c47f dwtx/jface/action/MenuManager.d
--- a/dwtx/jface/action/MenuManager.d Sun Jun 22 22:57:31 2008 +0200
+++ b/dwtx/jface/action/MenuManager.d Sun Jul 06 23:30:07 2008 +0200
@@ -609,6 +609,7 @@
*
* @return true
if the control is created
* and not disposed, false
otherwise
+ * @since 3.4 protected, was added in 3.1 as private method
*/
protected bool menuExist() {
return menu !is null && !menu.isDisposed();
diff -r 040da1cb0d76 -r 7ffeace6c47f dwtx/jface/action/Separator.d
--- a/dwtx/jface/action/Separator.d Sun Jun 22 22:57:31 2008 +0200
+++ b/dwtx/jface/action/Separator.d Sun Jul 06 23:30:07 2008 +0200
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -31,6 +31,7 @@
* This class may be instantiated; it is not intended to be
* subclassed outside the framework.
*
+ * @noextend This class is not intended to be subclassed by clients.
*/
public class Separator : AbstractGroupMarker {
alias AbstractGroupMarker.fill fill;
diff -r 040da1cb0d76 -r 7ffeace6c47f dwtx/jface/action/SubContributionItem.d
--- a/dwtx/jface/action/SubContributionItem.d Sun Jun 22 22:57:31 2008 +0200
+++ b/dwtx/jface/action/SubContributionItem.d Sun Jul 06 23:30:07 2008 +0200
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -29,6 +29,7 @@
* * This class is not intended to be subclassed. *
+ * @noextend This class is not intended to be subclassed by clients. */ public class SubContributionItem : IContributionItem { /** diff -r 040da1cb0d76 -r 7ffeace6c47f dwtx/jface/action/ToolBarContributionItem.d --- a/dwtx/jface/action/ToolBarContributionItem.d Sun Jun 22 22:57:31 2008 +0200 +++ b/dwtx/jface/action/ToolBarContributionItem.d Sun Jul 06 23:30:07 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -59,6 +59,7 @@ * * * @since 3.0 + * @noextend This class is not intended to be subclassed by clients. */ public class ToolBarContributionItem : ContributionItem, IToolBarContributionItem { alias ContributionItem.fill fill; diff -r 040da1cb0d76 -r 7ffeace6c47f dwtx/jface/bindings/BindingManager.d --- a/dwtx/jface/bindings/BindingManager.d Sun Jun 22 22:57:31 2008 +0200 +++ b/dwtx/jface/bindings/BindingManager.d Sun Jul 06 23:30:07 2008 +0200 @@ -1281,7 +1281,8 @@ /** * @param command * @return - * blah + * a trigger sequence, ornull
+ * @since 3.4
*/
public final TriggerSequence getBestActiveBindingFor(ParameterizedCommand command) {
final Binding[] bindings = getActiveBindingsFor1(command);
diff -r 040da1cb0d76 -r 7ffeace6c47f dwtx/jface/dialogs/DialogSettings.d
--- a/dwtx/jface/dialogs/DialogSettings.d Sun Jun 22 22:57:31 2008 +0200
+++ b/dwtx/jface/dialogs/DialogSettings.d Sun Jul 06 23:30:07 2008 +0200
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -63,6 +63,7 @@
* settings.save("c:\\temp\\test\\dialog.xml");
*
*
+ * @noextend This class is not intended to be subclassed by clients.
*/
public class DialogSettings : IDialogSettings {
diff -r 040da1cb0d76 -r 7ffeace6c47f dwtx/jface/dialogs/PopupDialog.d
--- a/dwtx/jface/dialogs/PopupDialog.d Sun Jun 22 22:57:31 2008 +0200
+++ b/dwtx/jface/dialogs/PopupDialog.d Sun Jul 06 23:30:07 2008 +0200
@@ -294,14 +294,14 @@
/**
* Image registry key for menu image.
*
- * @since 3.3
+ * @since 3.4
*/
public static const String POPUP_IMG_MENU = "popup_menu_image"; //$NON-NLS-1$
/**
* Image registry key for disabled menu image.
*
- * @since 3.3
+ * @since 3.4
*/
public static const String POPUP_IMG_MENU_DISABLED = "popup_menu_image_diabled"; //$NON-NLS-1$
diff -r 040da1cb0d76 -r 7ffeace6c47f dwtx/jface/fieldassist/ComboContentAdapter.d
--- a/dwtx/jface/fieldassist/ComboContentAdapter.d Sun Jun 22 22:57:31 2008 +0200
+++ b/dwtx/jface/fieldassist/ComboContentAdapter.d Sun Jul 06 23:30:07 2008 +0200
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
+ * Copyright (c) 2005, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -132,9 +132,7 @@
(cast(Combo) control).setSelection(new Point(index, index));
}
- /*
- * (non-Javadoc)
- *
+ /**
* @see dwtx.jface.fieldassist.IControlContentAdapter2#getSelection(dwt.widgets.Control)
*
* @since 3.4
@@ -143,9 +141,7 @@
return (cast(Combo) control).getSelection();
}
- /*
- * (non-Javadoc)
- *
+ /**
* @see dwtx.jface.fieldassist.IControlContentAdapter2#setSelection(dwt.widgets.Control,
* dwt.graphics.Point)
*
diff -r 040da1cb0d76 -r 7ffeace6c47f dwtx/jface/fieldassist/TextContentAdapter.d
--- a/dwtx/jface/fieldassist/TextContentAdapter.d Sun Jun 22 22:57:31 2008 +0200
+++ b/dwtx/jface/fieldassist/TextContentAdapter.d Sun Jul 06 23:30:07 2008 +0200
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
+ * Copyright (c) 2005, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -104,9 +104,7 @@
(cast(Text) control).setSelection(new Point(position, position));
}
- /*
- * (non-Javadoc)
- *
+ /**
* @see dwtx.jface.fieldassist.IControlContentAdapter2#getSelection(dwt.widgets.Control)
*
* @since 3.4
@@ -115,9 +113,7 @@
return (cast(Text) control).getSelection();
}
- /*
- * (non-Javadoc)
- *
+ /**
* @see dwtx.jface.fieldassist.IControlContentAdapter2#setSelection(dwt.widgets.Control,
* dwt.graphics.Point)
*
diff -r 040da1cb0d76 -r 7ffeace6c47f dwtx/jface/internal/ConfigureColumnsDialog.d
--- a/dwtx/jface/internal/ConfigureColumnsDialog.d Sun Jun 22 22:57:31 2008 +0200
+++ b/dwtx/jface/internal/ConfigureColumnsDialog.d Sun Jul 06 23:30:07 2008 +0200
@@ -204,7 +204,7 @@
Composite composite = cast(Composite) super.createDialogArea(parent);
table = new Table(composite, DWT.BORDER | DWT.SINGLE | DWT.V_SCROLL
- | DWT.H_SCROLL | DWT.FULL_SELECTION /*
+ | DWT.H_SCROLL /*
* | DWT.CHECK
*/);
for (int i = 0; i < columnObjects.length; i++) {
@@ -280,6 +280,8 @@
}
});
+ Dialog.applyDialogFont(composite);
+
return composite;
}
diff -r 040da1cb0d76 -r 7ffeace6c47f dwtx/jface/operation/ModalContext.d
--- a/dwtx/jface/operation/ModalContext.d Sun Jun 22 22:57:31 2008 +0200
+++ b/dwtx/jface/operation/ModalContext.d Sun Jul 06 23:30:07 2008 +0200
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -40,6 +40,8 @@
* * This class is not intended to be subclassed. *
+ * @noinstantiate This class is not intended to be instantiated by clients. + * @noextend This class is not intended to be subclassed by clients. */ public class ModalContext { diff -r 040da1cb0d76 -r 7ffeace6c47f dwtx/jface/preference/PathEditor.d --- a/dwtx/jface/preference/PathEditor.d Sun Jun 22 22:57:31 2008 +0200 +++ b/dwtx/jface/preference/PathEditor.d Sun Jul 06 23:30:07 2008 +0200 @@ -15,7 +15,7 @@ import dwtx.jface.preference.ListEditor; import tango.io.FilePath; -import tango.io.FileConst; +import tango.io.model.IFile; // import java.util.ArrayList; // import java.util.StringTokenizer; diff -r 040da1cb0d76 -r 7ffeace6c47f dwtx/jface/preference/PreferenceConverter.d --- a/dwtx/jface/preference/PreferenceConverter.d Sun Jun 22 22:57:31 2008 +0200 +++ b/dwtx/jface/preference/PreferenceConverter.d Sun Jul 06 23:30:07 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -47,6 +47,7 @@ * be instantiated. * * Note: touching this class has the side effect of creating a display (static initializer). + * @noinstantiate This class is not intended to be instantiated by clients. */ public class PreferenceConverter { diff -r 040da1cb0d76 -r 7ffeace6c47f dwtx/jface/preference/PreferenceDialog.d --- a/dwtx/jface/preference/PreferenceDialog.d Sun Jun 22 22:57:31 2008 +0200 +++ b/dwtx/jface/preference/PreferenceDialog.d Sun Jul 06 23:30:07 2008 +0200 @@ -737,15 +737,21 @@ public void selectionChanged(SelectionChangedEvent event) { Object selection = cast(Object) getSingleSelection(event.getSelection()); if (cast(IPreferenceNode)selection ) { - if (!isCurrentPageValid()) { - handleError(); - } else if (!showPage(cast(IPreferenceNode) selection)) { - // Page flipping wasn't successful - handleError(); - } else { - // Everything went well - lastSuccessfulNode = cast(IPreferenceNode) selection; - } + BusyIndicator.showWhile(getShell().getDisplay(), new class(selection) Runnable { + Object selection_; + this(Object o){ selection_=o; } + public void run() { + if (!isCurrentPageValid()) { + handleError(); + } else if (!showPage(cast(IPreferenceNode) selection_)) { + // Page flipping wasn't successful + handleError(); + } else { + // Everything went well + lastSuccessfulNode = cast(IPreferenceNode) selection_; + } + } + }); } } }); diff -r 040da1cb0d76 -r 7ffeace6c47f dwtx/jface/preference/PreferenceStore.d --- a/dwtx/jface/preference/PreferenceStore.d Sun Jun 22 22:57:31 2008 +0200 +++ b/dwtx/jface/preference/PreferenceStore.d Sun Jul 06 23:30:07 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -298,6 +298,7 @@ * * * @see IPreferenceStore + * @noextend This class is not intended to be subclassed by clients. */ public class PreferenceStore : EventManager, IPersistentPreferenceStore { diff -r 040da1cb0d76 -r 7ffeace6c47f dwtx/jface/resource/ColorRegistry.d --- a/dwtx/jface/resource/ColorRegistry.d Sun Jun 22 22:57:31 2008 +0200 +++ b/dwtx/jface/resource/ColorRegistry.d Sun Jul 06 23:30:07 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2007 IBM Corporation and others. + * Copyright (c) 2003, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -51,6 +51,7 @@ * * * @since 3.0 + * @noextend This class is not intended to be subclassed by clients. */ public class ColorRegistry : ResourceRegistry { @@ -105,6 +106,8 @@ }; } + private final bool cleanOnDisplayDisposal; + /** * Create a new instance of the receiver that is hooked to the current * display. @@ -141,6 +144,7 @@ init_displayRunnable(); Assert.isNotNull(display); this.display = display; + this.cleanOnDisplayDisposal = cleanOnDisplayDisposal; if (cleanOnDisplayDisposal) { hookDisplayDispose(); } @@ -155,6 +159,16 @@ * @since 3.1 */ private Color createColor(RGB rgb) { + if (this.display is null) { + Display display = Display.getCurrent(); + if (display is null) { + throw new IllegalStateException(); + } + this.display = display; + if (cleanOnDisplayDisposal) { + hookDisplayDispose(); + } + } return new Color(display, rgb); } @@ -275,6 +289,7 @@ // disposeColors(staleColors.iterator()); stringToColor.clear(); staleColors.clear(); + display = null; } /* (non-Javadoc) diff -r 040da1cb0d76 -r 7ffeace6c47f dwtx/jface/resource/FileImageDescriptor.d --- a/dwtx/jface/resource/FileImageDescriptor.d Sun Jun 22 22:57:31 2008 +0200 +++ b/dwtx/jface/resource/FileImageDescriptor.d Sun Jul 06 23:30:07 2008 +0200 @@ -25,7 +25,8 @@ import dwt.graphics.Device; import dwt.graphics.Image; import dwt.graphics.ImageData; -import dwtx.core.runtime.Path; +// import dwtx.core.runtime.FileLocator; +// import dwtx.core.runtime.Path; import dwt.dwthelper.utils; import dwt.dwthelper.InputStream; @@ -221,16 +222,15 @@ // // if (resource is null) // return null; -// try { -// if (JFaceActivator.getBundleContext() is null) {// Stand-alone case +// try { +// if (JFaceActivator.getBundleContext() is null) {// Stand-alone case // -// return new Path(resource.getFile()).toOSString(); -// } -// return new Path(FileLocator.toFileURL(resource).getPath()).toOSString(); +// return new Path(resource.getFile()).toOSString(); +// } +// return new Path(FileLocator.toFileURL(resource).getPath()).toOSString(); +// } catch (IOException e) { +// Policy.logException(e); return null; -// } catch (IOException e) { -// Policy.logException(e); -// return null; -// } +// } } } diff -r 040da1cb0d76 -r 7ffeace6c47f dwtx/jface/resource/FontRegistry.d --- a/dwtx/jface/resource/FontRegistry.d Sun Jun 22 22:57:31 2008 +0200 +++ b/dwtx/jface/resource/FontRegistry.d Sun Jul 06 23:30:07 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -70,6 +70,7 @@ * * * Since 3.0 this class extends ResourceRegistry. + * @noextend This class is not intended to be subclassed by clients. */ public class FontRegistry : ResourceRegistry { @@ -217,6 +218,10 @@ */ protected Runnable displayRunnable; + private bool displayDisposeHooked; + + private final bool cleanOnDisplayDisposal; + /** * Creates an empty font registry. *@@ -292,6 +297,7 @@ //readResourceBundle(location, loader); readResourceBundle(location); + cleanOnDisplayDisposal = true; hookDisplayDispose(display); } @@ -410,6 +416,7 @@ public this(Display display, bool cleanOnDisplayDisposal) { initInstance(); Assert.isNotNull(display); + this.cleanOnDisplayDisposal = cleanOnDisplayDisposal; if (cleanOnDisplayDisposal) { hookDisplayDispose(display); } @@ -534,6 +541,9 @@ if (display is null) { return null; } + if (cleanOnDisplayDisposal && !displayDisposeHooked) { + hookDisplayDispose(display); + } FontData[] validData = filterData(fonts, display); if (validData.length is 0) { @@ -732,12 +742,15 @@ stringToFontRecord.clear(); staleFonts.clear(); + + displayDisposeHooked = false; } /** * Hook a dispose listener on the DWT display. */ private void hookDisplayDispose(Display display) { + displayDisposeHooked = true; display.disposeExec(displayRunnable); } diff -r 040da1cb0d76 -r 7ffeace6c47f dwtx/jface/resource/ImageRegistry.d --- a/dwtx/jface/resource/ImageRegistry.d Sun Jun 22 22:57:31 2008 +0200 +++ b/dwtx/jface/resource/ImageRegistry.d Sun Jul 06 23:30:07 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -54,6 +54,7 @@ * Unlike the FontRegistry, it is an error to replace images. As a result * there are no events that fire when values are changed in the registry *
+ * @noextend This class is not intended to be subclassed by clients. */ public class ImageRegistry { /** diff -r 040da1cb0d76 -r 7ffeace6c47f dwtx/jface/resource/JFaceResources.d --- a/dwtx/jface/resource/JFaceResources.d Sun Jun 22 22:57:31 2008 +0200 +++ b/dwtx/jface/resource/JFaceResources.d Sun Jul 06 23:30:07 2008 +0200 @@ -52,6 +52,8 @@ *null
if the file cannot be found
*/
private String getFilePath() {
-
- return null;
-// try {
-// if (JFaceActivator.getBundleContext() is null) {
-// if (FILE_PROTOCOL.equalsIgnoreCase(url.getProtocol()))
-// return new Path(url.getFile()).toOSString();
-// return null;
-// }
+// try {
+// if (JFaceActivator.getBundleContext() is null) {
+// if (FILE_PROTOCOL.equalsIgnoreCase(url.getProtocol()))
+// return new Path(url.getFile()).toOSString();
+// return null;
+// }
//
-// URL locatedURL = FileLocator.toFileURL(url);
-// if (FILE_PROTOCOL.equalsIgnoreCase(locatedURL.getProtocol()))
-// return new Path(locatedURL.getPath()).toOSString();
-// return null;
+// URL locatedURL = FileLocator.toFileURL(url);
+// if (FILE_PROTOCOL.equalsIgnoreCase(locatedURL.getProtocol()))
+// return new Path(locatedURL.getPath()).toOSString();
+// return null;
//
-// } catch (IOException e) {
-// Policy.logException(e);
-// return null;
-// }
+// } catch (IOException e) {
+// Policy.logException(e);
+// return null;
+// }
+ return null;
}
/*
diff -r 040da1cb0d76 -r 7ffeace6c47f dwtx/jface/util/Policy.d
--- a/dwtx/jface/util/Policy.d Sun Jun 22 22:57:31 2008 +0200
+++ b/dwtx/jface/util/Policy.d Sun Jul 06 23:30:07 2008 +0200
@@ -284,6 +284,7 @@
* Log the Exception to the logger.
*
* @param exception
+ * @since 3.4
*/
public static void logException(Exception exception) {
getLog().log(
diff -r 040da1cb0d76 -r 7ffeace6c47f dwtx/jface/viewers/AbstractTableViewer.d
--- a/dwtx/jface/viewers/AbstractTableViewer.d Sun Jun 22 22:57:31 2008 +0200
+++ b/dwtx/jface/viewers/AbstractTableViewer.d Sun Jul 06 23:30:07 2008 +0200
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -1037,15 +1037,14 @@
}
/**
- * Replace the entries starting at index with elements. This method assumes
- * all of these values are correct and will not call the content provider to
- * verify. Note that this method will create a TableItem for all of
- * the elements provided.
- *
+ * Replace the element at the given index with the given element. This
+ * method will not call the content provider to verify. Note that
+ * this method will materialize a TableItem the given index..
+ *
* @param element
* @param index
* @see ILazyContentProvider
- *
+ *
* @since 3.1
*/
public void replace(Object element, int index) {
diff -r 040da1cb0d76 -r 7ffeace6c47f dwtx/jface/viewers/ArrayContentProvider.d
--- a/dwtx/jface/viewers/ArrayContentProvider.d Sun Jun 22 22:57:31 2008 +0200
+++ b/dwtx/jface/viewers/ArrayContentProvider.d Sun Jul 06 23:30:07 2008 +0200
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -28,6 +28,7 @@
*
*
* @since 2.1
+ * @noextend This class is not intended to be subclassed by clients.
*/
public class ArrayContentProvider(T) : IStructuredContentProvider {
diff -r 040da1cb0d76 -r 7ffeace6c47f dwtx/jface/viewers/CellEditor.d
--- a/dwtx/jface/viewers/CellEditor.d Sun Jun 22 22:57:31 2008 +0200
+++ b/dwtx/jface/viewers/CellEditor.d Sun Jul 06 23:30:07 2008 +0200
@@ -35,6 +35,8 @@
/**
* Struct-like layout data for cell editors, with reasonable defaults for
* all fields.
+ *
+ * @noextend This class is not intended to be subclassed by clients.
*/
public static class LayoutData {
/**
@@ -56,11 +58,13 @@
/**
* Minimum height in pixels; by default the height is aligned to the
* row-height
+ * @since 3.4
*/
public int minimumHeight = DWT.DEFAULT;
/**
* The vertical alignment; DWT.CENTER
by default.
+ * @since 3.4
*/
public int verticalAlignment = DWT.CENTER;
}
@@ -266,7 +270,7 @@
Assert.isTrue(control is null);
control = createControl(parent);
// See 1GD5CA6: ITPUI:ALL - TaskView.setSelection does not work
- // Control is created with getVisible()istrue by default.
+ // Control is created with getVisible()is true by default.
// This causes composite.setFocus() to work incorrectly.
// The cell editor's control grabs focus instead, even if it is not
// active.
@@ -945,6 +949,7 @@
/**
* @param event
* deactivation event
+ * @since 3.4
*
*/
protected void deactivate(ColumnViewerEditorDeactivationEvent event) {
@@ -963,6 +968,7 @@
* double click.
*
* @return the timeout or 0
+ * @since 3.4
*/
protected int getDoubleClickTimeout() {
return Display.getCurrent().getDoubleClickTime();
diff -r 040da1cb0d76 -r 7ffeace6c47f dwtx/jface/viewers/CheckboxCellEditor.d
--- a/dwtx/jface/viewers/CheckboxCellEditor.d Sun Jun 22 22:57:31 2008 +0200
+++ b/dwtx/jface/viewers/CheckboxCellEditor.d Sun Jul 06 23:30:07 2008 +0200
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -34,6 +34,7 @@
* of the check box is being toggled by the end users; the listener method
* applyEditorValue
is immediately called to signal the change.
*
+ * @noextend This class is not intended to be subclassed by clients.
*/
public class CheckboxCellEditor : CellEditor {
diff -r 040da1cb0d76 -r 7ffeace6c47f dwtx/jface/viewers/CheckboxTableViewer.d
--- a/dwtx/jface/viewers/CheckboxTableViewer.d Sun Jun 22 22:57:31 2008 +0200
+++ b/dwtx/jface/viewers/CheckboxTableViewer.d Sun Jul 06 23:30:07 2008 +0200
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -46,6 +46,7 @@
* with a domain-specific content provider, label provider, element filter (optional),
* and element sorter (optional).
*
+ * @noextend This class is not intended to be subclassed by clients.
*/
public class CheckboxTableViewer : TableViewer, ICheckable {
alias TableViewer.preservingSelection preservingSelection;
diff -r 040da1cb0d76 -r 7ffeace6c47f dwtx/jface/viewers/CheckboxTreeViewer.d
--- a/dwtx/jface/viewers/CheckboxTreeViewer.d Sun Jun 22 22:57:31 2008 +0200
+++ b/dwtx/jface/viewers/CheckboxTreeViewer.d Sun Jul 06 23:30:07 2008 +0200
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -45,6 +45,7 @@
* with a domain-specific content provider, label provider, element filter (optional),
* and element sorter (optional).
*
+ * @noextend This class is not intended to be subclassed by clients.
*/
public class CheckboxTreeViewer : TreeViewer, ICheckable {
alias TreeViewer.preservingSelection preservingSelection;
diff -r 040da1cb0d76 -r 7ffeace6c47f dwtx/jface/viewers/ColorCellEditor.d
--- a/dwtx/jface/viewers/ColorCellEditor.d Sun Jun 22 22:57:31 2008 +0200
+++ b/dwtx/jface/viewers/ColorCellEditor.d Sun Jul 06 23:30:07 2008 +0200
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -42,6 +42,7 @@
* * This class may be instantiated; it is not intended to be subclassed. *
+ * @noextend This class is not intended to be subclassed by clients. */ public class ColorCellEditor : DialogCellEditor { diff -r 040da1cb0d76 -r 7ffeace6c47f dwtx/jface/viewers/ColumnLayoutData.d --- a/dwtx/jface/viewers/ColumnLayoutData.d Sun Jun 22 22:57:31 2008 +0200 +++ b/dwtx/jface/viewers/ColumnLayoutData.d Sun Jul 06 23:30:07 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -18,6 +18,7 @@ ** This class is not intended to be subclassed outside the framework. *
+ * @noextend This class is not intended to be subclassed by clients. */ public abstract class ColumnLayoutData { diff -r 040da1cb0d76 -r 7ffeace6c47f dwtx/jface/viewers/ColumnPixelData.d --- a/dwtx/jface/viewers/ColumnPixelData.d Sun Jun 22 22:57:31 2008 +0200 +++ b/dwtx/jface/viewers/ColumnPixelData.d Sun Jul 06 23:30:07 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -22,6 +22,7 @@ ** This class may be instantiated; it is not intended to be subclassed. *
+ * @noextend This class is not intended to be subclassed by clients. */ public class ColumnPixelData : ColumnLayoutData { diff -r 040da1cb0d76 -r 7ffeace6c47f dwtx/jface/viewers/ColumnViewer.d --- a/dwtx/jface/viewers/ColumnViewer.d Sun Jun 22 22:57:31 2008 +0200 +++ b/dwtx/jface/viewers/ColumnViewer.d Sun Jul 06 23:30:07 2008 +0200 @@ -731,7 +731,7 @@ * the new column viewer editor */ public void setColumnViewerEditor(ColumnViewerEditor columnViewerEditor) { - Assert.isNotNull(viewerEditor); + Assert.isNotNull(columnViewerEditor); this.viewerEditor = columnViewerEditor; } diff -r 040da1cb0d76 -r 7ffeace6c47f dwtx/jface/viewers/ColumnViewerEditor.d --- a/dwtx/jface/viewers/ColumnViewerEditor.d Sun Jun 22 22:57:31 2008 +0200 +++ b/dwtx/jface/viewers/ColumnViewerEditor.d Sun Jul 06 23:30:07 2008 +0200 @@ -112,6 +112,7 @@ * Style mask used to turn off the feature that an editor activation * is canceled on double click. It is also possible to turn off this feature * per cell-editor using {@link CellEditor#getDoubleClickTimeout()} + * @since 3.4 */ public static final int KEEP_EDITOR_ON_DOUBLE_CLICK = 1 << 6; diff -r 040da1cb0d76 -r 7ffeace6c47f dwtx/jface/viewers/ColumnViewerEditorActivationEvent.d --- a/dwtx/jface/viewers/ColumnViewerEditorActivationEvent.d Sun Jun 22 22:57:31 2008 +0200 +++ b/dwtx/jface/viewers/ColumnViewerEditorActivationEvent.d Sun Jul 06 23:30:07 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007 IBM Corporation and others. + * Copyright (c) 2007, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -9,7 +9,7 @@ * IBM Corporation - initial API and implementation * Port to the D programming language: * Frank Benoit* This class may be instantiated; it is not intended to be subclassed. *
+ * @noextend This class is not intended to be subclassed by clients. */ public class ColumnWeightData : ColumnLayoutData { diff -r 040da1cb0d76 -r 7ffeace6c47f dwtx/jface/viewers/ComboBoxCellEditor.d --- a/dwtx/jface/viewers/ComboBoxCellEditor.d Sun Jun 22 22:57:31 2008 +0200 +++ b/dwtx/jface/viewers/ComboBoxCellEditor.d Sun Jul 06 23:30:07 2008 +0200 @@ -41,6 +41,7 @@ ** This class may be instantiated; it is not intended to be subclassed. *
+ * @noextend This class is not intended to be subclassed by clients. */ public class ComboBoxCellEditor : AbstractComboBoxCellEditor { diff -r 040da1cb0d76 -r 7ffeace6c47f dwtx/jface/viewers/ComboBoxViewerCellEditor.d --- a/dwtx/jface/viewers/ComboBoxViewerCellEditor.d Sun Jun 22 22:57:31 2008 +0200 +++ b/dwtx/jface/viewers/ComboBoxViewerCellEditor.d Sun Jul 06 23:30:07 2008 +0200 @@ -45,6 +45,7 @@ * A cell editor that presents a list of items in a combo box. In contrast to * {@link ComboBoxCellEditor} it wraps the underlying {@link CCombo} using a * {@link ComboViewer} + * @since 3.4 */ public class ComboBoxViewerCellEditor : AbstractComboBoxCellEditor { diff -r 040da1cb0d76 -r 7ffeace6c47f dwtx/jface/viewers/DelegatingStyledCellLabelProvider.d --- a/dwtx/jface/viewers/DelegatingStyledCellLabelProvider.d Sun Jun 22 22:57:31 2008 +0200 +++ b/dwtx/jface/viewers/DelegatingStyledCellLabelProvider.d Sun Jul 06 23:30:07 2008 +0200 @@ -20,6 +20,7 @@ import dwtx.jface.viewers.IColorProvider; import dwtx.jface.viewers.IFontProvider; +import dwt.custom.StyleRange; import dwt.graphics.Color; import dwt.graphics.Font; import dwt.graphics.Image; @@ -110,19 +111,26 @@ Object element = cell.getElement(); StyledString styledString = getStyledText(element); - cell.setText(styledString.toString()); - if (isOwnerDrawEnabled()) { - cell.setStyleRanges(styledString.getStyleRanges()); - } else { - cell.setStyleRanges(null); + String newText= styledString.toString(); + + StyleRange[] oldStyleRanges= cell.getStyleRanges(); + StyleRange[] newStyleRanges= isOwnerDrawEnabled() ? styledString.getStyleRanges() : null; + + if (!Arrays.equals(oldStyleRanges, newStyleRanges)) { + cell.setStyleRanges(newStyleRanges); + if (cell.getText().equals(newText)) { + // make sure there will be a refresh from a change + cell.setText(""); //$NON-NLS-1$ + } } - + + cell.setText(newText); cell.setImage(getImage(element)); cell.setFont(getFont(element)); cell.setForeground(getForeground(element)); cell.setBackground(getBackground(element)); - - super.update(cell); + + // no super call required. changes on item will trigger the refresh. } /** diff -r 040da1cb0d76 -r 7ffeace6c47f dwtx/jface/viewers/IDecoration.d --- a/dwtx/jface/viewers/IDecoration.d Sun Jun 22 22:57:31 2008 +0200 +++ b/dwtx/jface/viewers/IDecoration.d Sun Jul 06 23:30:07 2008 +0200 @@ -25,6 +25,7 @@ * * This interface is not meant to be implemented and will be provided to * instances ofILightweightLabelDecorator
.
+ * @noimplement This interface is not intended to be implemented by clients.
*/
public interface IDecoration{
diff -r 040da1cb0d76 -r 7ffeace6c47f dwtx/jface/viewers/IStructuredContentProvider.d
--- a/dwtx/jface/viewers/IStructuredContentProvider.d Sun Jun 22 22:57:31 2008 +0200
+++ b/dwtx/jface/viewers/IStructuredContentProvider.d Sun Jul 06 23:30:07 2008 +0200
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff -r 040da1cb0d76 -r 7ffeace6c47f dwtx/jface/viewers/ListViewer.d
--- a/dwtx/jface/viewers/ListViewer.d Sun Jun 22 22:57:31 2008 +0200
+++ b/dwtx/jface/viewers/ListViewer.d Sun Jul 06 23:30:07 2008 +0200
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -41,6 +41,7 @@
*
*
* @see TableViewer
+ * @noextend This class is not intended to be subclassed by clients.
*/
public class ListViewer : AbstractListViewer {
alias AbstractListViewer.setSelectionToWidget setSelectionToWidget;
diff -r 040da1cb0d76 -r 7ffeace6c47f dwtx/jface/viewers/StructuredSelection.d
--- a/dwtx/jface/viewers/StructuredSelection.d Sun Jun 22 22:57:31 2008 +0200
+++ b/dwtx/jface/viewers/StructuredSelection.d Sun Jul 06 23:30:07 2008 +0200
@@ -31,6 +31,7 @@
* * This class is not intended to be subclassed. *
+ * @noextend This class is not intended to be subclassed by clients. */ public class StructuredSelection : IStructuredSelection { diff -r 040da1cb0d76 -r 7ffeace6c47f dwtx/jface/viewers/StructuredViewer.d --- a/dwtx/jface/viewers/StructuredViewer.d Sun Jun 22 22:57:31 2008 +0200 +++ b/dwtx/jface/viewers/StructuredViewer.d Sun Jul 06 23:30:07 2008 +0200 @@ -2048,7 +2048,7 @@ for (int i = 0; i < items.length; i++) { internalUpdate(items[i], element, properties); if (mayExitEarly && refreshOccurred) { - // detected a change from refreshOccurredisfalse to refreshOccurredistrue + // detected a change from refreshOccurred is false to refreshOccurred is true return; } } diff -r 040da1cb0d76 -r 7ffeace6c47f dwtx/jface/viewers/TableTreeViewer.d --- a/dwtx/jface/viewers/TableTreeViewer.d Sun Jun 22 22:57:31 2008 +0200 +++ b/dwtx/jface/viewers/TableTreeViewer.d Sun Jul 06 23:30:07 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -71,6 +71,7 @@ * * * @deprecated As of 3.1 use {@link TreeViewer} instead + * @noextend This class is not intended to be subclassed by clients. */ public class TableTreeViewer : AbstractTreeViewer { alias AbstractTreeViewer.addTreeListener addTreeListener; diff -r 040da1cb0d76 -r 7ffeace6c47f dwtx/jface/viewers/TableViewer.d --- a/dwtx/jface/viewers/TableViewer.d Sun Jun 22 22:57:31 2008 +0200 +++ b/dwtx/jface/viewers/TableViewer.d Sun Jul 06 23:30:07 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -71,6 +71,7 @@ * @see DWT#VIRTUAL * @see #doFindItem(Object) * @see #internalRefresh(Object, bool) + * @noextend This class is not intended to be subclassed by clients. */ public class TableViewer : AbstractTableViewer { alias AbstractTableViewer.refresh refresh; diff -r 040da1cb0d76 -r 7ffeace6c47f dwtx/jface/viewers/TableViewerFocusCellManager.d --- a/dwtx/jface/viewers/TableViewerFocusCellManager.d Sun Jun 22 22:57:31 2008 +0200 +++ b/dwtx/jface/viewers/TableViewerFocusCellManager.d Sun Jul 06 23:30:07 2008 +0200 @@ -69,6 +69,7 @@ * the delegate responsible to highlight selected cell * @param navigationStrategy * the strategy used to navigate the cells + * @since 3.4 */ public this(TableViewer viewer, FocusCellHighlighter focusDrawingDelegate, @@ -79,7 +80,7 @@ override ViewerCell getInitialFocusCell() { Table table = cast(Table) getViewer().getControl(); - if (table.getItemCount() > 0) { + if (! table.isDisposed() && table.getItemCount() > 0 && ! table.getItem(0).isDisposed()) { return getViewer().getViewerRowFromItem_package(table.getItem(0)) .getCell(0); } diff -r 040da1cb0d76 -r 7ffeace6c47f dwtx/jface/viewers/TableViewerRow.d --- a/dwtx/jface/viewers/TableViewerRow.d Sun Jun 22 22:57:31 2008 +0200 +++ b/dwtx/jface/viewers/TableViewerRow.d Sun Jul 06 23:30:07 2008 +0200 @@ -8,7 +8,7 @@ * Contributors: * IBM Corporation - initial API and implementation * Tom Schindl* This class may be instantiated; it is not intended to be subclassed. *
+ * @noextend This class is not intended to be subclassed by clients. */ public class TextCellEditor : CellEditor { diff -r 040da1cb0d76 -r 7ffeace6c47f dwtx/jface/viewers/TreeViewer.d --- a/dwtx/jface/viewers/TreeViewer.d Sun Jun 22 22:57:31 2008 +0200 +++ b/dwtx/jface/viewers/TreeViewer.d Sun Jul 06 23:30:07 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2007 IBM Corporation and others. + * Copyright (c) 2004, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -79,6 +79,7 @@ * Users setting up an editable tree with more than 1 column have to pass the * DWT.FULL_SELECTION style bit * + * @noextend This class is not intended to be subclassed by clients. */ public class TreeViewer : AbstractTreeViewer { alias AbstractTreeViewer.addTreeListener addTreeListener; diff -r 040da1cb0d76 -r 7ffeace6c47f dwtx/jface/viewers/TreeViewerFocusCellManager.d --- a/dwtx/jface/viewers/TreeViewerFocusCellManager.d Sun Jun 22 22:57:31 2008 +0200 +++ b/dwtx/jface/viewers/TreeViewerFocusCellManager.d Sun Jul 06 23:30:07 2008 +0200 @@ -121,6 +121,7 @@ * the delegate responsible to highlight selected cell * @param navigationStrategy * the strategy used to navigate the cells + * @since 3.4 */ public this(TreeViewer viewer, FocusCellHighlighter focusDrawingDelegate, @@ -131,7 +132,7 @@ override ViewerCell getInitialFocusCell() { Tree tree = cast(Tree) getViewer().getControl(); - if (tree.getItemCount() > 0) { + if (! tree.isDisposed() && tree.getItemCount() > 0 && ! tree.getItem(0).isDisposed()) { return getViewer().getViewerRowFromItem_package(tree.getItem(0)).getCell(0); } diff -r 040da1cb0d76 -r 7ffeace6c47f dwtx/jface/viewers/TreeViewerRow.d --- a/dwtx/jface/viewers/TreeViewerRow.d Sun Jun 22 22:57:31 2008 +0200 +++ b/dwtx/jface/viewers/TreeViewerRow.d Sun Jul 06 23:30:07 2008 +0200 @@ -8,7 +8,7 @@ * Contributors: * IBM Corporation - initial API and implementation * Tom Schindl+ * By default the tooltip is shifted 3 pixels to the right. + *
* * @param p * the new shift @@ -191,6 +196,7 @@ control.addListener(DWT.MouseMove, listener); control.addListener(DWT.MouseExit, listener); control.addListener(DWT.MouseDown, listener); + control.addListener(DWT.MouseWheel, listener); } /** @@ -202,10 +208,11 @@ control.removeListener(DWT.MouseMove, listener); control.removeListener(DWT.MouseExit, listener); control.removeListener(DWT.MouseDown, listener); + control.removeListener(DWT.MouseWheel, listener); } /** - * Return whther the tooltip respects bounds of the display. + * Return whether the tooltip respects bounds of the display. * * @returntrue
if the tooltip respects bounds of the display
*/
@@ -228,7 +235,7 @@
}
/**
- * Return whther the tooltip respects bounds of the monitor.
+ * Return whether the tooltip respects bounds of the monitor.
*
* @return true
if tooltip respects the bounds of the monitor
*/
@@ -254,7 +261,7 @@
/**
* Should the tooltip displayed because of the given event.
* - * Subclasses may overwrite this to get custom behaviour + * Subclasses may overwrite this to get custom behavior *
* * @param event @@ -369,7 +376,8 @@ // the cursor.x is inside the tip Point cursorLocation = tip.getDisplay().getCursorLocation(); - if( cursorLocation.y is location.y && location.x < cursorLocation.x && location.x + size.x > cursorLocation.x ) { + if (cursorLocation.y is location.y && location.x < cursorLocation.x + && location.x + size.x > cursorLocation.x) { location.y -= 2; } @@ -445,66 +453,59 @@ if (tip !is null && !tip.isDisposed() && shouldHideToolTip(event)) { control.getShell().removeListener(DWT.Deactivate, shellListener); currentArea = null; - passOnEvent(tip,event); + passOnEvent(tip, event); tip.dispose(); CURRENT_TOOLTIP = null; afterHideToolTip(event); } } - private void passOnEvent(Shell tip,Event event) { - if ( control !is null && ! control.isDisposed() && event !is null && event.widget !is control && event.type is DWT.MouseDown) { + private void passOnEvent(Shell tip, Event event) { + if (control !is null && !control.isDisposed() && event !is null + && event.widget !is control && event.type is DWT.MouseDown) { Display display = control.getDisplay(); Point newPt = display.map(tip, null, new Point(event.x, event.y)); Event newEvent = new Event(); - newEvent.button=event.button; - newEvent.character=event.character; + newEvent.button = event.button; + newEvent.character = event.character; newEvent.count = event.count; - newEvent.data=event.data; - newEvent.detail=event.detail; - newEvent.display=event.display; - newEvent.doit=event.doit; - newEvent.end=event.end; - newEvent.gc=event.gc; - newEvent.height=event.height; - newEvent.index=event.index; - newEvent.item=event.item; - newEvent.keyCode=event.keyCode; - newEvent.start=event.start; - newEvent.stateMask=event.stateMask; - newEvent.text=event.text; - newEvent.time=event.time; - newEvent.type=event.type; - newEvent.widget=event.widget; - newEvent.width=event.width; + newEvent.data = event.data; + newEvent.detail = event.detail; + newEvent.display = event.display; + newEvent.doit = event.doit; + newEvent.end = event.end; + newEvent.gc = event.gc; + newEvent.height = event.height; + newEvent.index = event.index; + newEvent.item = event.item; + newEvent.keyCode = event.keyCode; + newEvent.start = event.start; + newEvent.stateMask = event.stateMask; + newEvent.text = event.text; + newEvent.time = event.time; + newEvent.type = event.type; + newEvent.widget = event.widget; + newEvent.width = event.width; newEvent.x = newPt.x; newEvent.y = newPt.y; tip.close(); - display.asyncExec(new class(display,newEvent) Runnable { - Display display_; - Event newEvent_; - this( Display a, Event b ){ - display_=a; - newEvent_=b; + display.asyncExec(dgRunnable( delegate(Display display_, Event newEvent_) { + if (IS_OSX) { + try { + Thread.sleep(0.300); + } catch (InterruptedException e) { + + } + + display_.post(newEvent_); + newEvent_.type = DWT.MouseUp; + display_.post(newEvent_); + } else { + display_.post(newEvent_); } - public void run() { - if( IS_OSX ) { - try { - Thread.sleep(0.300); - } catch (InterruptedException e) { - - } - - display_.post(newEvent_); - newEvent_.type = DWT.MouseUp; - display_.post(newEvent_); - } else { - display_.post(newEvent_); - } - } - }); + }, display,newEvent)); } } @@ -583,7 +584,7 @@ Composite parent); /** - * This method is called after a Tooltip is hidden. + * This method is called after a tooltip is hidden. ** Subclasses may override to clean up requested system resources *
@@ -674,6 +675,7 @@ case DWT.KeyDown: case DWT.MouseDown: case DWT.MouseMove: + case DWT.MouseWheel: toolTipHide(CURRENT_TOOLTIP, event); break; case DWT.MouseHover: @@ -681,7 +683,7 @@ break; case DWT.MouseExit: /* - * Check if the mouse exit happend because we move over the + * Check if the mouse exit happened because we move over the * tooltip */ if (CURRENT_TOOLTIP !is null && !CURRENT_TOOLTIP.isDisposed()) { diff -r 040da1cb0d76 -r 7ffeace6c47f dwtx/ui/forms/HyperlinkSettings.d --- a/dwtx/ui/forms/HyperlinkSettings.d Sun Jun 22 22:57:31 2008 +0200 +++ b/dwtx/ui/forms/HyperlinkSettings.d Sun Jul 06 23:30:07 2008 +0200 @@ -23,10 +23,11 @@ /** * Manages color and underline mode settings for a group of hyperlinks. The - * class is extended by HyperlinkGroup but is otwerwise not intended to be + * class is extended by HyperlinkGroup but is otherwise not intended to be * subclassed. * * @since 3.0 + * @noextend This class is not intended to be subclassed by clients. */ public class HyperlinkSettings { /** diff -r 040da1cb0d76 -r 7ffeace6c47f dwtx/ui/forms/IManagedForm.d --- a/dwtx/ui/forms/IManagedForm.d Sun Jun 22 22:57:31 2008 +0200 +++ b/dwtx/ui/forms/IManagedForm.d Sun Jul 06 23:30:07 2008 +0200 @@ -35,6 +35,7 @@ * * @see ManagedForm * @since 3.0 + * @noimplement This interface is not intended to be implemented by clients. */ public interface IManagedForm { /** diff -r 040da1cb0d76 -r 7ffeace6c47f dwtx/ui/forms/IMessageManager.d --- a/dwtx/ui/forms/IMessageManager.d Sun Jun 22 22:57:31 2008 +0200 +++ b/dwtx/ui/forms/IMessageManager.d Sun Jul 06 23:30:07 2008 +0200 @@ -55,6 +55,7 @@ * @since 3.3 * @see IMessageProvider * @see IManagedForm + * @noimplement This interface is not intended to be implemented by clients. */ public interface IMessageManager { diff -r 040da1cb0d76 -r 7ffeace6c47f dwtx/ui/forms/widgets/Form.d --- a/dwtx/ui/forms/widgets/Form.d Sun Jun 22 22:57:31 2008 +0200 +++ b/dwtx/ui/forms/widgets/Form.d Sun Jul 06 23:30:07 2008 +0200 @@ -97,6 +97,7 @@ * Although the class is not final, it should not be subclassed. * * @since 3.0 + * @noextend This class is not intended to be subclassed by clients. */ public class Form : Composite { private FormHeading head; diff -r 040da1cb0d76 -r 7ffeace6c47f dwtx/ui/forms/widgets/ScrolledForm.d --- a/dwtx/ui/forms/widgets/ScrolledForm.d Sun Jun 22 22:57:31 2008 +0200 +++ b/dwtx/ui/forms/widgets/ScrolledForm.d Sun Jul 06 23:30:07 2008 +0200 @@ -50,6 +50,7 @@ * Although the class is not final, it is not expected to be be extended. * * @since 3.0 + * @noextend This class is not intended to be subclassed by clients. */ public class ScrolledForm : SharedScrolledComposite { private Form content; diff -r 040da1cb0d76 -r 7ffeace6c47f dwtx/ui/internal/forms/MessageManager.d --- a/dwtx/ui/internal/forms/MessageManager.d Sun Jun 22 22:57:31 2008 +0200 +++ b/dwtx/ui/internal/forms/MessageManager.d Sun Jul 06 23:30:07 2008 +0200 @@ -36,7 +36,7 @@ import tango.util.collection.HashMap; import tango.util.Convert; import tango.text.Text; -import tango.io.FileConst; +import tango.io.model.IFile; /** * @see IMessageManager */ diff -r 040da1cb0d76 -r 7ffeace6c47f dwtx/ui/internal/forms/Messages.d --- a/dwtx/ui/internal/forms/Messages.d Sun Jun 22 22:57:31 2008 +0200 +++ b/dwtx/ui/internal/forms/Messages.d Sun Jul 06 23:30:07 2008 +0200 @@ -22,7 +22,7 @@ // static { // initialize resource bundle - //NLS.initializeMessages(BUNDLE_NAME, Messages.class); +// NLS.initializeMessages(BUNDLE_NAME, Messages.class); // } public static String FormDialog_defaultTitle; @@ -40,7 +40,6 @@ public static String MessageManager_pErrorSummary; public static String ToggleHyperlink_accessibleColumn; public static String ToggleHyperlink_accessibleName; - public static String bind(String string, String[] strings) { // TODO Auto-generated method stub return null; diff -r 040da1cb0d76 -r 7ffeace6c47f dwtx/ui/internal/forms/widgets/BusyIndicator.d --- a/dwtx/ui/internal/forms/widgets/BusyIndicator.d Sun Jun 22 22:57:31 2008 +0200 +++ b/dwtx/ui/internal/forms/widgets/BusyIndicator.d Sun Jul 06 23:30:07 2008 +0200 @@ -26,6 +26,9 @@ import dwt.widgets.Canvas; import dwt.widgets.Composite; import dwt.widgets.Display; +// import dwtx.core.runtime.FileLocator; +// import dwtx.core.runtime.Path; +// import dwtx.core.runtime.Platform; import dwtx.jface.resource.ImageDescriptor; import dwt.dwthelper.utils; @@ -297,16 +300,15 @@ private ImageDescriptor createImageDescriptor(String relativePath) { - //DWT_TODO -// Bundle bundle = Platform.getBundle("dwtx.ui.forms"); //$NON-NLS-1$ -// URL url = FileLocator.find(bundle, new Path(relativePath),null); -// if (url is null) return null; -// try { -// url = FileLocator.resolve(url); -// return ImageDescriptor.createFromURL(url); -// } catch (IOException e) { -// return null; -// } +// Bundle bundle = Platform.getBundle("dwtx.ui.forms"); //$NON-NLS-1$ +// URL url = FileLocator.find(bundle, new Path(relativePath),null); +// if (url is null) return null; +// try { +// url = FileLocator.resolve(url); +// return ImageDescriptor.createFromURL(url); +// } catch (IOException e) { +// return null; +// } return null; } diff -r 040da1cb0d76 -r 7ffeace6c47f dwtx/ui/internal/forms/widgets/FormImages.d --- a/dwtx/ui/internal/forms/widgets/FormImages.d Sun Jun 22 22:57:31 2008 +0200 +++ b/dwtx/ui/internal/forms/widgets/FormImages.d Sun Jul 06 23:30:07 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007 IBM Corporation and others. + * Copyright (c) 2007, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -17,6 +17,7 @@ import dwt.graphics.Color; import dwt.graphics.GC; import dwt.graphics.Image; +import dwt.graphics.RGB; import dwt.widgets.Display; import dwt.dwthelper.utils; @@ -39,22 +40,26 @@ private abstract class ImageIdentifier { Display fDisplay; - Color[] fColors; + RGB[] fRGBs; int fLength; this(Display display, Color[] colors, int length) { fDisplay = display; - fColors = colors; + fRGBs = new RGB[colors.length]; + for (int i = 0; i < colors.length; i++) { + Color color = colors[i]; + fRGBs[i] = color is null ? null : color.getRGB(); + } fLength = length; } public bool equals(Object obj) { if (null !is cast(ImageIdentifier)obj ) { ImageIdentifier id = cast(ImageIdentifier)obj; - if (id.fColors.length is fColors.length) { + if (id.fRGBs.length is fRGBs.length) { bool result = id.fDisplay.opEquals(fDisplay) && id.fLength is fLength; - for (int i = 0; i < fColors.length && result; i++) { - result = result && id.fColors[i].opEquals(fColors[i]); + for (int i = 0; i < fRGBs.length && result; i++) { + result = result && id.fRGBs[i].opEquals(fRGBs[i]); } return result; } @@ -64,8 +69,8 @@ public override hash_t toHash() { int hash = fDisplay.toHash(); - for (int i = 0; i < fColors.length; i++) - hash = hash * 7 + fColors[i].toHash(); + for (int i = 0; i < fRGBs.length; i++) + hash = hash * 7 + fRGBs[i].toHash(); hash = hash * 7 + fLength; return hash; } @@ -101,14 +106,14 @@ } private class ComplexImageIdentifier : ImageIdentifier { - Color fBg; + RGB fBgRGB; bool fVertical; int[] fPercents; public this(Display display, Color[] colors, int length, int[] percents, bool vertical, Color bg) { super(display, colors, length); - fBg = bg; + fBgRGB = bg is null ? null : bg.getRGB(); fVertical = vertical; fPercents = percents; } @@ -118,8 +123,8 @@ ComplexImageIdentifier id = cast(ComplexImageIdentifier) obj; if (super.equals(obj) && id.fVertical is fVertical && ArrayEquals(id.fPercents, fPercents)) { - if ((id.fBg is null && fBg is null) || - (id.fBg !is null && id.fBg.opEquals(fBg))) + if ((id.fBgRGB is null && fBgRGB is null) || + (id.fBgRGB !is null && id.fBgRGB.opEquals(fBgRGB))) return true; // if the only thing that isn't the same is the background color // still return true if it does not matter (percents add up to 100) diff -r 040da1cb0d76 -r 7ffeace6c47f dwtx/ui/internal/forms/widgets/FormTextModel.d --- a/dwtx/ui/internal/forms/widgets/FormTextModel.d Sun Jun 22 22:57:31 2008 +0200 +++ b/dwtx/ui/internal/forms/widgets/FormTextModel.d Sun Jul 06 23:30:07 2008 +0200 @@ -28,6 +28,8 @@ import dwt.dwthelper.InputStream; static import tango.text.xml.Document; +static import tango.io.Buffer; + import tango.util.collection.ArraySeq; public class FormTextModel { // private static const DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory @@ -82,13 +84,7 @@ } return sbuf.toString(); } - public void parseTaggedText(String taggedText, bool expandURLs) { - implMissing(__FILE__,__LINE__); - } - public void parseInputStream(InputStream is_, bool expandURLs) { - implMissing(__FILE__,__LINE__); - } -/++ + /* * @see ITextModel#parse(String) */ @@ -97,68 +93,85 @@ reset(); return; } - try { - InputStream stream = new ByteArrayInputStream(taggedText - .getBytes("UTF8")); //$NON-NLS-1$ - parseInputStream(stream, expandURLs); - } catch (UnsupportedEncodingException e) { - DWT.error(DWT.ERROR_UNSUPPORTED_FORMAT, e); - } + _parseTaggedText(taggedText, expandURLs); } public void parseInputStream(InputStream is_, bool expandURLs) { - - documentBuilderFactory.setNamespaceAware(true); - documentBuilderFactory.setIgnoringComments(true); - + auto buf = new tango.io.Buffer.Buffer( 1024 ); + { + int l; + byte[1024] a = void; + while((l = is_.read(a)) > 0 ){ + buf.append( a[ 0 .. l ] ); + } + } + _parseTaggedText( cast(char[]) buf.slice(), expandURLs ); +// documentBuilderFactory.setNamespaceAware(true); +// documentBuilderFactory.setIgnoringComments(true); +// +// reset(); +// try { +// DocumentBuilder parser = documentBuilderFactory +// .newDocumentBuilder(); +// InputSource source = new InputSource(is_); +// Document doc = parser.parse(source); +// processDocument(doc, expandURLs); +// } catch (ParserConfigurationException e) { +// DWT.error(DWT.ERROR_INVALID_ARGUMENT, e); +// } catch (SAXException e) { +// DWT.error(DWT.ERROR_INVALID_ARGUMENT, e); +// } catch (IOException e) { +// DWT.error(DWT.ERROR_IO, e); +// } + } + private void _parseTaggedText( char[] text, bool expandURLs ){ reset(); - try { - DocumentBuilder parser = documentBuilderFactory - .newDocumentBuilder(); - InputSource source = new InputSource(is_); - Document doc = parser.parse(source); - processDocument(doc, expandURLs); - } catch (ParserConfigurationException e) { - DWT.error(DWT.ERROR_INVALID_ARGUMENT, e); - } catch (SAXException e) { - DWT.error(DWT.ERROR_INVALID_ARGUMENT, e); - } catch (IOException e) { - DWT.error(DWT.ERROR_IO, e); - } +// try { +// auto doc = tango.text.xml.Document.Document!(char)(); +// doc.parse(text); +// processDocument(doc, expandURLs); +// } catch (XmlException e) { +// DWT.error(DWT.ERROR_INVALID_ARGUMENT, e); +// } catch (IOException e) { +// DWT.error(DWT.ERROR_IO, e); +// } } - private void processDocument(Document doc, bool expandURLs) { - Node root = doc.getDocumentElement(); - NodeList children = root.getChildNodes(); - processSubnodes(paragraphs, children, expandURLs); - } +// private void processDocument(tango.text.xml.Document.Document!(char) doc, bool expandURLs) { +// auto root = doc.query.root.dup; +// auto children = root.childs.dup; +// processSubnodes(paragraphs, children, expandURLs); +// } - private void processSubnodes(TArraySeqParagraph plist, NodeList children, bool expandURLs) { - for (int i = 0; i < children.getLength(); i++) { - Node child = children.item(i); - if (child.getNodeType() is Node.TEXT_NODE) { +/+ private void processSubnodes(TArraySeqParagraph plist, NodeList children, bool expandURLs) { +//o for (int i = 0; i < children.getLength(); i++) { +//o Node child = children.item(i); + foreach( child; children ){ +//o if (child.getNodeType() is Node.TEXT_NODE) { + if (child.type is XmlNodeType.Data) { // Make an implicit paragraph String text = getSingleNodeText(child); - if (text !is null && !isIgnorableWhiteSpace(text, true)) { + if ( !isIgnorableWhiteSpace(text, true)) { Paragraph p = new Paragraph(true); - p.parseRegularText(text, expandURLs, true, - getHyperlinkSettings(), null); - plist.add(p); - } - } else if (child.getNodeType() is Node.ELEMENT_NODE) { - String tag = child.getNodeName().toLowerCase(); - if (tag.equals("p")) { //$NON-NLS-1$ - Paragraph p = processParagraph(child, expandURLs); - if (p !is null) - plist.add(p); - } else if (tag.equals("li")) { //$NON-NLS-1$ - Paragraph p = processListItem(child, expandURLs); - if (p !is null) - plist.add(p); +// p.parseRegularText(text, expandURLs, true, +// getHyperlinkSettings(), null); +// plist.add(p); +// } +// } else if (child.getNodeType() is Node.ELEMENT_NODE) { +// String tag = child.getNodeName().toLowerCase(); +// if (tag.equals("p")) { //$NON-NLS-1$ +// Paragraph p = processParagraph(child, expandURLs); +// if (p !is null) +// plist.add(p); +// } else if (tag.equals("li")) { //$NON-NLS-1$ +// Paragraph p = processListItem(child, expandURLs); +// if (p !is null) +// plist.add(p); } } } - } + }+/ +/++ private Paragraph processParagraph(Node paragraph, bool expandURLs) { NodeList children = paragraph.getChildNodes(); @@ -275,9 +288,9 @@ } } } - +++/ private bool isIgnorableWhiteSpace(String text, bool ignoreSpaces) { - for (int i = 0; i < text.length(); i++) { + for (int i = 0; i < text.length; i++) { char c = text.charAt(i); if (ignoreSpaces && c is ' ') continue; @@ -287,7 +300,7 @@ } return true; } - +/++ private ImageSegment processImageSegment(Node image) { ImageSegment segment = new ImageSegment(); processObjectSegment(segment, image, "i."); //$NON-NLS-1$ @@ -376,10 +389,11 @@ appendText(text, buf, spaceCounter); return buf.toString(); } + + private String getSingleNodeText(tango.text.xml.Document.Document!(char).NodeImpl node) { + return getNormalizedText(node.value()); + } /++ - private String getSingleNodeText(Node node) { - return getNormalizedText(node.getNodeValue()); - } private String getNodeText(Node node) { NodeList children = node.getChildNodes(); @@ -694,7 +708,7 @@ } public bool restoreSavedLink() { - if (savedSelectedLinkIndex!is -1) { + if (savedSelectedLinkIndex !is -1) { selectedSegmentIndex = savedSelectedLinkIndex; return true; } diff -r 040da1cb0d76 -r 7ffeace6c47f dwtx/ui/internal/forms/widgets/FormUtil.d --- a/dwtx/ui/internal/forms/widgets/FormUtil.d Sun Jun 22 22:57:31 2008 +0200 +++ b/dwtx/ui/internal/forms/widgets/FormUtil.d Sun Jul 06 23:30:07 2008 +0200 @@ -14,6 +14,8 @@ module dwtx.ui.internal.forms.widgets.FormUtil; +// import com.ibm.icu.text.BreakIterator; + import dwt.DWT; import dwt.custom.ScrolledComposite; import dwt.events.MouseEvent; @@ -40,42 +42,13 @@ import dwt.dwthelper.utils; -//import com.ibm.icu.text.BreakIterator; +import dwtx.dwtxhelper.BreakIterator; +// import mango.icu.UString; +// import mango.icu.ULocale; +// import mango.icu.UBreakIterator; + public class FormUtil { - //DWT_TODO temp type - static class BreakIterator{ - - public static const int DONE = 0; - char[] text; - static BreakIterator inst; - public static BreakIterator getWordInstance() { - if( inst is null ){ - inst = new BreakIterator; - } - return inst; - } - uint last = 0; - - public void setText(String text) { - this.text = text; - last = 0; - } - public int first() { - // TODO Auto-generated method stub - return text.length > 0 ? 1 : 0; - } - - public int next() { - // TODO Auto-generated method stub - last++; - if( last >= text.length ){ - return DONE; - } - return last; - } - - } public static const String PLUGIN_ID = "dwtx.ui.forms"; //$NON-NLS-1$ static const int H_SCROLL_INCREMENT = 5; @@ -138,13 +111,12 @@ } public static int computeMinimumWidth(GC gc, String text) { - BreakIterator wb = BreakIterator.getWordInstance(); - wb.setText(text); + auto wb = UBreakIterator.openWordIterator( ULocale.Default, text ); + scope(exit) wb.close(); int last = 0; - int width = 0; - for (int loc = wb.first(); loc !is BreakIterator.DONE; loc = wb.next()) { + for (int loc = wb.first(); loc !is UBreakIterator.DONE; loc = wb.next()) { String word = text.substring(last, loc); Point extent = gc.textExtent(word); width = Math.max(width, extent.x); @@ -157,8 +129,8 @@ } public static Point computeWrapSize(GC gc, String text, int wHint) { - BreakIterator wb = BreakIterator.getWordInstance(); - wb.setText(text); + auto wb = UBreakIterator.openWordIterator( ULocale.Default, text ); + scope(exit) wb.close(); FontMetrics fm = gc.getFontMetrics(); int lineHeight = fm.getHeight(); @@ -166,7 +138,7 @@ int last = 0; int height = lineHeight; int maxWidth = 0; - for (int loc = wb.first(); loc !is BreakIterator.DONE; loc = wb.next()) { + for (int loc = wb.first(); loc !is UBreakIterator.DONE; loc = wb.next()) { String word = text.substring(saved, loc); Point extent = gc.textExtent(word); if (extent.x > wHint) { @@ -196,8 +168,8 @@ public static void paintWrapText(GC gc, String text, Rectangle bounds, bool underline) { - BreakIterator wb = BreakIterator.getWordInstance(); - wb.setText(text); + auto wb = UBreakIterator.openWordIterator( ULocale.Default, text ); + scope(exit) wb.close(); FontMetrics fm = gc.getFontMetrics(); int lineHeight = fm.getHeight(); int descent = fm.getDescent(); @@ -207,7 +179,7 @@ int y = bounds.y; int width = bounds.width; - for (int loc = wb.first(); loc !is BreakIterator.DONE; loc = wb.next()) { + for (int loc = wb.first(); loc !is UBreakIterator.DONE; loc = wb.next()) { String line = text.substring(saved, loc); Point extent = gc.textExtent(line); diff -r 040da1cb0d76 -r 7ffeace6c47f dwtx/ui/internal/forms/widgets/FormsResources.d --- a/dwtx/ui/internal/forms/widgets/FormsResources.d Sun Jun 22 22:57:31 2008 +0200 +++ b/dwtx/ui/internal/forms/widgets/FormsResources.d Sun Jul 06 23:30:07 2008 +0200 @@ -48,7 +48,7 @@ public static int getProgressDelay(int index) { /* - if (progressDelaysisnull) + if (progressDelays is null) return 0; return progressDelays[index]; */ diff -r 040da1cb0d76 -r 7ffeace6c47f dwtx/ui/internal/forms/widgets/Paragraph.d --- a/dwtx/ui/internal/forms/widgets/Paragraph.d Sun Jun 22 22:57:31 2008 +0200 +++ b/dwtx/ui/internal/forms/widgets/Paragraph.d Sun Jul 06 23:30:07 2008 +0200 @@ -26,7 +26,7 @@ import dwt.dwthelper.utils; import tango.util.collection.ArraySeq; import tango.util.collection.HashMap; -import tango.io.FileConst; +import tango.io.model.IFile; import tango.text.Text; /** diff -r 040da1cb0d76 -r 7ffeace6c47f dwtx/ui/internal/forms/widgets/TextHyperlinkSegment.d --- a/dwtx/ui/internal/forms/widgets/TextHyperlinkSegment.d Sun Jun 22 22:57:31 2008 +0200 +++ b/dwtx/ui/internal/forms/widgets/TextHyperlinkSegment.d Sun Jul 06 23:30:07 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2005 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -90,6 +90,10 @@ repaintRegion); gc.setForeground(savedFg); } + + protected void drawString(GC gc, String s, int clipX, int clipY) { + gc.drawString(s, clipX, clipY, false); + } public String getTooltipText() { return tooltipText; diff -r 040da1cb0d76 -r 7ffeace6c47f dwtx/ui/internal/forms/widgets/TextSegment.d --- a/dwtx/ui/internal/forms/widgets/TextSegment.d Sun Jun 22 22:57:31 2008 +0200 +++ b/dwtx/ui/internal/forms/widgets/TextSegment.d Sun Jul 06 23:30:07 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -17,6 +17,8 @@ import dwtx.ui.internal.forms.widgets.SelectionData; import dwtx.ui.internal.forms.widgets.FormTextModel; +// import com.ibm.icu.text.BreakIterator; + import dwt.DWT; import dwt.graphics.Color; import dwt.graphics.Font; @@ -26,6 +28,10 @@ import dwt.graphics.Rectangle; import dwt.dwthelper.utils; +// import mango.icu.ULocale; +// import mango.icu.UString; +// import mango.icu.UBreakIterator; +import dwtx.dwtxhelper.BreakIterator; import tango.util.collection.ArraySeq; /** @@ -34,32 +40,6 @@ */ public class TextSegment : ParagraphSegment { - //DWT_TODO temp type - static class BreakIterator{ - - public static const int DONE = 0; - - public static BreakIterator getLineInstance() { - // TODO Auto-generated method stub - return null; - } - - public void setText(String text) { - // TODO Auto-generated method stub - - } - - public int first() { - // TODO Auto-generated method stub - return 0; - } - - public int next() { - // TODO Auto-generated method stub - return 0; - } - - } private String colorId; private String fontId; @@ -304,7 +284,9 @@ if (isSelectable()) currentExtent += 1; - if (i !is 0 && currentExtent + textFragment.length > wHint) { + // i !is 0 || locator.x > locator.getStartX() + (isSelectable() ? 1 : 0) means: + // only wrap on the first fragment if we are not at the start of a line + if ((i !is 0 || locator.x > locator.getStartX() + (isSelectable() ? 1 : 0)) && currentExtent + textFragment.length > wHint) { // overflow int lineWidth = currentExtent; locator.rowHeight = Math.max(locator.rowHeight, lineExtent.y); @@ -623,13 +605,17 @@ } if (reverse) { drawUnderline(gc, swidth, clipX, clipLineY, hover, rolloverMode); - gc.drawString(s, clipX, clipY, false); + drawString(gc, s, clipX, clipY); } else { - gc.drawString(s, clipX, clipY, false); + drawString(gc, s, clipX, clipY); drawUnderline(gc, swidth, clipX, clipLineY, hover, rolloverMode); } } + protected void drawString(GC gc, String s, int clipX, int clipY) { + gc.drawString(s, clipX, clipY, true); + } + private void drawUnderline(GC gc, int swidth, int x, int y, bool hover, bool rolloverMode) { if (underline || hover || rolloverMode) { @@ -682,7 +668,9 @@ int breakLoc = fragment.index; if (breakLoc is 0) continue; - if (i !is 0 && locator.x + lineExtent.x + fragment.length > rightEdge) { + // (i !is 0 || locator.x > locator.getStartX() + (isSelectable() ? 1 : 0)) means: + // only wrap on the first fragment if we are not at the start of a line + if ((i !is 0 || locator.x > locator.getStartX() + (isSelectable() ? 1 : 0)) && locator.x + lineExtent.x + fragment.length > rightEdge) { // overflow int lineWidth = locator.x + lineExtent.x; if (isSelectable()) @@ -732,10 +720,10 @@ if (textFragments !is null) return; ArraySeq!(Object) list = new ArraySeq!(Object); - BreakIterator wb = BreakIterator.getLineInstance(); - wb.setText(getText()); + auto wb = UBreakIterator.openLineIterator( ULocale.Default, getText() ); + scope(exit) wb.close(); int cursor = 0; - for (int loc = wb.first(); loc !is BreakIterator.DONE; loc = wb.next()) { + for (int loc = wb.first(); loc !is UBreakIterator.DONE; loc = wb.next()) { if (loc is 0) continue; String word = text.substring(cursor, loc);