diff dwt/browser/WindowEvent.d @ 125:5583f8eeee6c

Synced mozilla with dwt-linux
author Jacob Carlborg <doob@me.com>
date Fri, 16 Jan 2009 12:49:08 +0100
parents d8635bb48c7c
children
line wrap: on
line diff
--- a/dwt/browser/WindowEvent.d	Fri Jan 16 12:19:08 2009 +0100
+++ b/dwt/browser/WindowEvent.d	Fri Jan 16 12:49:08 2009 +0100
@@ -1,5 +1,5 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2008 IBM Corporation and others.
+/*******************************************************************************
+ * Copyright (c) 2003, 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
@@ -7,17 +7,19 @@
  *
  * Contributors:
  *     IBM Corporation - initial API and implementation
- *     
  * Port to the D programming language:
- *     Jacob Carlborg <doob@me.com>
+ *      John Reimer <terminal.node@gmail.com>
  *******************************************************************************/
 module dwt.browser.WindowEvent;
 
-import dwt.browser.Browser;
+import tango.text.convert.Format;
+
 import dwt.dwthelper.utils;
+
 import dwt.events.TypedEvent;
 import dwt.graphics.Point;
 import dwt.widgets.Widget;
+import dwt.browser.Browser;
 
 /**
  * A <code>WindowEvent</code> is sent by a {@link Browser} when
@@ -66,12 +68,12 @@
  *      });
  *      browser.addVisibilityWindowListener(new VisibilityWindowListener() {
  *          public void hide(WindowEvent event) {
- *              Browser browser = cast(Browser)event.widget;
+ *              Browser browser = (Browser)event.widget;
  *              Shell shell = browser.getShell();
  *              shell.setVisible(false);
  *          }
  *          public void show(WindowEvent event) {
- *              Browser browser = cast(Browser)event.widget;
+ *              Browser browser = (Browser)event.widget;
  *              Shell shell = browser.getShell();
  *              if (event.location !is null) shell.setLocation(event.location);
  *              if (event.size !is null) {
@@ -88,7 +90,7 @@
  *      });
  *      browser.addCloseWindowListener(new CloseWindowListener() {
  *          public void close(WindowEvent event) {
- *              Browser browser = cast(Browser)event.widget;
+ *              Browser browser = (Browser)event.widget;
  *              Shell shell = browser.getShell();
  *              shell.close();
  *          }
@@ -123,7 +125,6 @@
  * @see CloseWindowListener
  * @see OpenWindowListener
  * @see VisibilityWindowListener
- * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
  * 
  * @since 3.0
  */
@@ -136,7 +137,8 @@
      * @since 3.1
      */
     public bool required;
-
+    
+    
     /** 
      * <code>Browser</code> provided by the application.
      */
@@ -154,7 +156,7 @@
      * It is <code>null</code> if no size has been requested.
      */
     public Point size;
-
+    
     /**
      * Specifies whether the <code>Shell</code> hosting the <code>Browser</code> should
      * display an address bar.
@@ -170,7 +172,7 @@
      * @since 3.1
      */
     public bool menuBar;
-
+    
     /**
      * Specifies whether the <code>Shell</code> hosting the <code>Browser</code> should
      * display a status bar.
@@ -178,7 +180,7 @@
      * @since 3.1
      */
     public bool statusBar;
-
+    
     /**
      * Specifies whether the <code>Shell</code> hosting the <code>Browser</code> should
      * display a tool bar.
@@ -186,22 +188,25 @@
      * @since 3.1
      */
     public bool toolBar;
-
+    
     static final long serialVersionUID = 3617851997387174969L;
-
-    this (Widget w) {
-        super(w);
-    }
+    
+this(Widget w) {
+    super(w);
+}
 
-    /**
-     * Returns a String containing a concise, human-readable
-     * description of the receiver.
-     *
-     * @return a String representation of the event
-     */
-    public String toString () {
-        String str = super.toString();
-        return str.substring(0, str.length() - 1) // remove trailing '}'
-        + " required=" + required + " browser=" + browser + " location=" + location + " size=" + size + " addressBar=" + addressBar + " menuBar=" + menuBar + " statusBar=" + statusBar + " toolBar=" + toolBar + "}";
-    }
+/**
+ * Returns a string containing a concise, human-readable
+ * description of the receiver.
+ *
+ * @return a string representation of the event
+ */
+
+public String toString() {
+    return Format( "{} {required = {}, browser = {}, location = {}, size = {}, addressbar = {}, menubar = {}, statusbar = {}, toolbar = {}}", 
+        super.toString[1 .. $-2], 
+        required, browser, 
+        location, size, addressBar, 
+        menuBar, statusBar, toolBar ); 
 }
+}