diff dwtx/jface/viewers/ColumnViewer.d @ 71:4878bef4a38e

Some fixing
author Frank Benoit <benoit@tionex.de>
date Thu, 22 May 2008 04:03:58 +0200
parents 46a6e0e6ccd4
children 5df4896124c7
line wrap: on
line diff
--- a/dwtx/jface/viewers/ColumnViewer.d	Thu May 22 01:36:46 2008 +0200
+++ b/dwtx/jface/viewers/ColumnViewer.d	Thu May 22 04:03:58 2008 +0200
@@ -48,12 +48,12 @@
  * (e.g., AbstractTreeViewer and AbstractTableViewer). Concrete subclasses of
  * {@link ColumnViewer} should implement a matching concrete subclass of {@link
  * ViewerColumn}.
- * 
+ *
  * <strong> This class is not intended to be subclassed outside of the JFace
  * viewers framework.</strong>
- * 
+ *
  * @since 3.3
- * 
+ *
  */
 public abstract class ColumnViewer : StructuredViewer {
     alias StructuredViewer.getLabelProvider getLabelProvider;
@@ -94,7 +94,7 @@
 
     /**
      * Hook up the editing support. Subclasses may override.
-     * 
+     *
      * @param control
      *      the control you want to hook on
      */
@@ -122,7 +122,7 @@
     /**
      * Creates the viewer editor used for editing cell contents. To be
      * implemented by subclasses.
-     * 
+     *
      * @return the editor, or <code>null</code> if this viewer does not support
      *  editing cell contents.
      */
@@ -131,12 +131,12 @@
     /**
      * Returns the viewer cell at the given widget-relative coordinates, or
      * <code>null</code> if there is no cell at that location
-     * 
+     *
      * @param point
      *      the widget-relative coordinates
      * @return the cell or <code>null</code> if no cell is found at the given
      *  point
-     * 
+     *
      * @since 3.4
      */
     public ViewerCell getCell(Point point) {
@@ -150,7 +150,7 @@
 
     /**
      * Returns the viewer row at the given widget-relative coordinates.
-     * 
+     *
      * @param point
      *      the widget-relative coordinates of the viewer row
      * @return ViewerRow the row or <code>null</code> if no row is found at the
@@ -174,7 +174,7 @@
      * Implementations may re-use the same instance for different row widgets;
      * callers can only use the viewer row locally and until the next call to
      * this method.
-     * 
+     *
      * @param item
      *      the row widget
      * @return ViewerRow a viewer row object
@@ -186,7 +186,7 @@
 
     /**
      * Returns the column widget at the given column index.
-     * 
+     *
      * @param columnIndex
      *      the column index
      * @return Widget the column widget
@@ -195,7 +195,7 @@
 
     /**
      * Returns the viewer column for the given column index.
-     * 
+     *
      * @param columnIndex
      *      the column index
      * @return the viewer column at the given index, or <code>null</code> if
@@ -228,7 +228,7 @@
     /**
      * Sets up editing support for the given column based on the "old" cell
      * editor API.
-     * 
+     *
      * @param columnIndex
      * @param viewer
      */
@@ -242,7 +242,7 @@
                 }
                 /*
                  * (non-Javadoc)
-                 * 
+                 *
                  * @see
                  * dwtx.jface.viewers.EditingSupport#canEdit(java.lang
                  * .Object)
@@ -260,7 +260,7 @@
 
                 /*
                  * (non-Javadoc)
-                 * 
+                 *
                  * @see
                  * dwtx.jface.viewers.EditingSupport#getCellEditor(java
                  * .lang.Object)
@@ -275,7 +275,7 @@
 
                 /*
                  * (non-Javadoc)
-                 * 
+                 *
                  * @see
                  * dwtx.jface.viewers.EditingSupport#getValue(java.lang
                  * .Object)
@@ -293,7 +293,7 @@
 
                 /*
                  * (non-Javadoc)
-                 * 
+                 *
                  * @see
                  * dwtx.jface.viewers.EditingSupport#setValue(java.lang
                  * .Object, java.lang.Object)
@@ -318,7 +318,7 @@
     /**
      * Creates a generic viewer column for the given column widget, based on the
      * given label provider.
-     * 
+     *
      * @param columnOwner
      *      the column widget
      * @param labelProvider
@@ -338,7 +338,7 @@
 
     /**
      * Update the cached cell object with the given row and column.
-     * 
+     *
      * @param rowItem
      * @param column
      * @return ViewerCell
@@ -352,7 +352,7 @@
     /**
      * Returns the {@link Item} at the given widget-relative coordinates, or
      * <code>null</code> if there is no item at the given coordinates.
-     * 
+     *
      * @param point
      *      the widget-relative coordinates
      * @return the {@link Item} at the coordinates or <code>null</code> if there
@@ -362,7 +362,7 @@
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see dwtx.jface.viewers.StructuredViewer#getItem(int, int)
      */
     protected override Item getItem(int x, int y) {
@@ -388,7 +388,7 @@
      * may also implement {@link IColorProvider} and/or {@link IFontProvider} to
      * provide colors and/or fonts.
      * </p>
-     * 
+     *
      */
     public override void setLabelProvider(IBaseLabelProvider labelProvider) {
         Assert.isTrue( null !is cast(ITableLabelProvider)labelProvider
@@ -397,14 +397,14 @@
         updateColumnParts(labelProvider);// Reset the label providers in the
         // columns
         super.setLabelProvider(labelProvider);
-        if (labelProvider instanceof CellLabelProvider) {
-            ((CellLabelProvider) labelProvider).initialize(this, null);
+        if ( null !is cast(CellLabelProvider)labelProvider ) {
+            (cast(CellLabelProvider) labelProvider).initialize(this, null);
         }
     }
 
     void internalDisposeLabelProvider(IBaseLabelProvider oldProvider) {
-        if (oldProvider instanceof CellLabelProvider) {
-            ((CellLabelProvider) oldProvider).dispose(this, null);
+        if (null !is cast(CellLabelProvider)oldProvider ) {
+            (cast(CellLabelProvider) oldProvider).dispose(this, null);
         } else {
             super.internalDisposeLabelProvider(oldProvider);
         }
@@ -426,7 +426,7 @@
     /**
      * Cancels a currently active cell editor if one is active. All changes
      * already done in the cell editor are lost.
-     * 
+     *
      * @since 3.1 (in subclasses, added in 3.3 to abstract class)
      */
     public void cancelEditing() {
@@ -437,7 +437,7 @@
 
     /**
      * Apply the value of the active cell editor if one is active.
-     * 
+     *
      * @since 3.3
      */
     protected void applyEditorValue() {
@@ -448,7 +448,7 @@
 
     /**
      * Starts editing the given element at the given column index.
-     * 
+     *
      * @param element
      *      the model element
      * @param column
@@ -488,8 +488,8 @@
      * ViewerColumn#setEditingSupport(EditingSupport)} for a more flexible way
      * of editing values in a column viewer.
      * </p>
-     * 
-     * 
+     *
+     *
      * @return CellEditor[]
      * @since 3.1 (in subclasses, added in 3.3 to abstract class)
      * @see ViewerColumn#setEditingSupport(EditingSupport)
@@ -502,13 +502,13 @@
     /**
      * Returns the cell modifier of this viewer, or <code>null</code> if none
      * has been set.
-     * 
+     *
      * <p>
      * Since 3.3, an alternative API is available, see {@link
      * ViewerColumn#setEditingSupport(EditingSupport)} for a more flexible way
      * of editing values in a column viewer.
      * </p>
-     * 
+     *
      * @return the cell modifier, or <code>null</code>
      * @since 3.1 (in subclasses, added in 3.3 to abstract class)
      * @see ViewerColumn#setEditingSupport(EditingSupport)
@@ -522,13 +522,13 @@
      * Returns the column properties of this table viewer. The properties must
      * correspond with the columns of the table control. They are used to
      * identify the column in a cell modifier.
-     * 
+     *
      * <p>
      * Since 3.3, an alternative API is available, see {@link
      * ViewerColumn#setEditingSupport(EditingSupport)} for a more flexible way
      * of editing values in a column viewer.
      * </p>
-     * 
+     *
      * @return the list of column properties
      * @since 3.1 (in subclasses, added in 3.3 to abstract class)
      * @see ViewerColumn#setEditingSupport(EditingSupport)
@@ -544,13 +544,13 @@
 
     /**
      * Returns whether there is an active cell editor.
-     * 
+     *
      * <p>
      * Since 3.3, an alternative API is available, see {@link
      * ViewerColumn#setEditingSupport(EditingSupport)} for a more flexible way
      * of editing values in a column viewer.
      * </p>
-     * 
+     *
      * @return <code>true</code> if there is an active cell editor, and
      *  <code>false</code> otherwise
      * @since 3.1 (in subclasses, added in 3.3 to abstract class)
@@ -595,7 +595,7 @@
     /**
      * Sets the cell editors of this column viewer. If editing is not supported
      * by this viewer the call simply has no effect.
-     * 
+     *
      * <p>
      * Since 3.3, an alternative API is available, see {@link
      * ViewerColumn#setEditingSupport(EditingSupport)} for a more flexible way
@@ -618,7 +618,7 @@
     /**
      * Sets the cell modifier for this column viewer. This method does nothing
      * if editing is not supported by this viewer.
-     * 
+     *
      * <p>
      * Since 3.3, an alternative API is available, see {@link
      * ViewerColumn#setEditingSupport(EditingSupport)} for a more flexible way
@@ -643,7 +643,7 @@
      * correspond with the columns of the control. They are used to identify the
      * column in a cell modifier. If editing is not supported by this viewer the
      * call simply has no effect.
-     * 
+     *
      * <p>
      * Since 3.3, an alternative API is available, see {@link
      * ViewerColumn#setEditingSupport(EditingSupport)} for a more flexible way
@@ -669,9 +669,9 @@
      * visually, one column of items may be visible. This occurs when the
      * programmer uses the column viewer like a list, adding elements but never
      * creating a column.
-     * 
+     *
      * @return the number of columns
-     * 
+     *
      * @since 3.3
      */
     protected abstract int doGetColumnCount();
@@ -682,12 +682,12 @@
     /**
      * Returns the label provider associated with the column at the given index
      * or <code>null</code> if no column with this index is known.
-     * 
+     *
      * @param columnIndex
      *      the column index
      * @return the label provider associated with the column or
      *  <code>null</code> if no column with this index is known
-     * 
+     *
      * @since 3.3
      */
     public CellLabelProvider getLabelProvider(int columnIndex) {
@@ -713,7 +713,7 @@
      * enable the editor but before this event is passed to {@link
      * ColumnViewerEditorActivationStrategy} to see if this event should really
      * trigger editor activation
-     * 
+     *
      * @param event
      *      the activation event
      */
@@ -785,13 +785,13 @@
      * if the viewer is busy. It is recommended that this method be used by
      * subclasses to determine whether the viewer is busy to return early from
      * state-changing methods.
-     * 
+     *
      * <p>
      * This method is not intended to be overridden by subclasses.
      * </p>
-     * 
+     *
      * @return <code>true</code> if the viewer is busy.
-     * 
+     *
      * @since 3.4
      */
     protected bool checkBusy() {
@@ -817,7 +817,7 @@
      * Sets the busy state of this viewer. Subclasses MUST use <code>try</code>
      * ...<code>finally</code> as follows to ensure that the busy flag is reset
      * to its original value:
-     * 
+     *
      * <pre>
      * bool oldBusy = isBusy();
      * setBusy(true);
@@ -827,14 +827,14 @@
      *  setBusy(oldBusy);
      * }
      * </pre>
-     * 
+     *
      * <p>
      * This method is not intended to be overridden by subclasses.
      * </p>
-     * 
+     *
      * @param busy
      *      the new value of the busy flag
-     * 
+     *
      * @since 3.4
      */
     protected void setBusy(bool busy) {
@@ -850,13 +850,13 @@
      * method if they can ensure by other means that they will not make
      * reentrant calls to methods like the ones listed above. See bug 184991 for
      * background discussion.
-     * 
+     *
      * <p>
      * This method is not intended to be overridden by subclasses.
      * </p>
-     * 
+     *
      * @return Returns whether this viewer is busy.
-     * 
+     *
      * @since 3.4
      */
     public bool isBusy() {