diff dwtx/jface/wizard/ProgressMonitorPart.d @ 70:46a6e0e6ccd4

Merge with d-fied sources of 3.4M7
author Frank Benoit <benoit@tionex.de>
date Thu, 22 May 2008 01:36:46 +0200
parents ea8ff534f622
children 4878bef4a38e
line wrap: on
line diff
--- a/dwtx/jface/wizard/ProgressMonitorPart.d	Mon May 19 13:41:06 2008 +0200
+++ b/dwtx/jface/wizard/ProgressMonitorPart.d	Thu May 22 01:36:46 2008 +0200
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * Copyright (c) 2000, 2007 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,13 +59,13 @@
     /** the cancel component */
     protected Control fCancelComponent;
 
-    /** true if cancled */
+    /** true if canceled */
     protected bool fIsCanceled;
 
     /** current blocked status */
     protected IStatus blockedStatus;
 
-    /** the cancle lister attached to the cancle component */
+    /** the cancel lister attached to the cancel component */
     protected Listener fCancelListener;
     private void init_fCancelListener(){
         fCancelListener = new class Listener {
@@ -165,9 +165,9 @@
 
     /**
      * Creates the progress monitor's UI parts and layouts them
-     * according to the given layout. If the layou is <code>null</code>
+     * according to the given layout. If the layout is <code>null</code>
      * the part's default layout is used.
-     * @param layout The layoutfor the receiver.
+     * @param layout The layout for the receiver.
      * @param progressIndicatorHeight The suggested height of the indicator
      */
     protected void initialize(Layout layout, int progressIndicatorHeight) {
@@ -281,12 +281,21 @@
      * @return String
      */
     private String taskLabel() {
-        String text = fSubTaskName is null ? "" : fSubTaskName; //$NON-NLS-1$
-        if (fTaskName !is null && fTaskName.length > 0) {
-            text = JFaceResources.format(
-                    "Set_SubTask", [ fTaskName, text ]);//$NON-NLS-1$
+        bool hasTask= fTaskName !is null && fTaskName.length() > 0;
+        bool hasSubtask= fSubTaskName !is null && fSubTaskName.length > 0;
+        
+        if (hasTask) {
+            if (hasSubtask)
+                return escapeMetaCharacters(JFaceResources.format(
+                        "Set_SubTask", new Object[] { fTaskName, fSubTaskName }));//$NON-NLS-1$
+            return escapeMetaCharacters(fTaskName);
+            
+        } else if (hasSubtask) {
+            return escapeMetaCharacters(fSubTaskName);
+        
+        } else {
+            return ""; //$NON-NLS-1$
         }
-        return escapeMetaCharacters(text);
     }
 
     /**