comparison dwt/browser/TitleEvent.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
comparison
equal deleted inserted replaced
124:540fa4e9974a 125:5583f8eeee6c
1 /******************************************************************************* 1 /*******************************************************************************
2 * Copyright (c) 2003, 2008 IBM Corporation and others. 2 * Copyright (c) 2003, 2004 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials 3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0 4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at 5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html 6 * http://www.eclipse.org/legal/epl-v10.html
7 * 7 *
8 * Contributors: 8 * Contributors:
9 * IBM Corporation - initial API and implementation 9 * IBM Corporation - initial API and implementation
10 *
11 * Port to the D programming language: 10 * Port to the D programming language:
12 * Jacob Carlborg <doob@me.com> 11 * John Reimer <terminal.node@gmail.com>
13 *******************************************************************************/ 12 *******************************************************************************/
14 module dwt.browser.TitleEvent; 13 module dwt.browser.TitleEvent;
15 14
15 import tango.text.convert.Format;
16
16 import dwt.dwthelper.utils; 17 import dwt.dwthelper.utils;
17 import dwt.dwthelper.string; 18
18 import dwt.events.TypedEvent; 19 import dwt.events.TypedEvent;
19 import dwt.widgets.Widget; 20 import dwt.widgets.Widget;
20 21
21 /** 22 /**
22 * A <code>TitleEvent</code> is sent by a {@link Browser} to 23 * A <code>TitleEvent</code> is sent by a {@link Browser} to
23 * {@link TitleListener}'s when the title of the current document 24 * {@link TitleListener}'s when the title of the current document
24 * is available or when it is modified. 25 * is available or when it is modified.
25 * 26 *
26 * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
27 *
28 * @since 3.0 27 * @since 3.0
29 */ 28 */
30 public class TitleEvent : TypedEvent { 29 public class TitleEvent : TypedEvent {
31 /** the title of the current document */ 30 /** the title of the current document */
32 public String title; 31 public String title;
32
33 static final long serialVersionUID = 4121132532906340919L;
33 34
34 static const long serialVersionUID = 4121132532906340919L; 35 this(Widget w) {
36 super(w);
37 }
35 38
36 this (Widget w) { 39 /**
37 super(w); 40 * Returns a string containing a concise, human-readable
38 } 41 * description of the receiver.
39 42 *
40 /** 43 * @return a string representation of the event
41 * Returns a string containing a concise, human-readable 44 */
42 * description of the receiver. 45 public override String toString() {
43 * 46 return Format( "{} {title = {}}",
44 * @return a string representation of the event 47 super.toString[1 .. $-2], title );
45 */
46 public String toString () {
47 String str = super.toString();
48 return str.substring(0, string.length() - 1) // remove trailing '}'
49 + " title=" + title + "}";
50 }
51 } 48 }
49 }