1 /******************************************************************************* 2 * Copyright (c) 2003, 2004 IBM Corporation and others. 3 * All rights reserved. This program and the accompanying materials 4 * are made available under the terms of the Eclipse Public License v1.0 5 * which accompanies this distribution, and is available at 6 * http://www.eclipse.org/legal/epl-v10.html 7 * 8 * Contributors: 9 * IBM Corporation - initial API and implementation 10 * Port to the D programming language: 11 * John Reimer <terminal.node@gmail.com> 12 *******************************************************************************/ 13 module org.eclipse.swt.browser.LocationEvent; 14 15 16 import org.eclipse.swt.events.TypedEvent; 17 import org.eclipse.swt.widgets.Widget; 18 import java.lang.all; 19 20 /** 21 * A <code>LocationEvent</code> is sent by a {@link Browser} to 22 * {@link LocationListener}'s when the <code>Browser</code> 23 * navigates to a different URL. This notification typically 24 * occurs when the application navigates to a new location with 25 * {@link Browser#setUrl(String)} or when the user activates a 26 * hyperlink. 27 * 28 * @since 3.0 29 */ 30 public class LocationEvent : TypedEvent { 31 /** current location */ 32 public String location; 33 34 /** 35 * A flag indicating whether the location opens in the top frame 36 * or not. 37 */ 38 public bool top; 39 40 /** 41 * A flag indicating whether the location loading should be allowed. 42 * Setting this field to <code>false</code> will cancel the operation. 43 */ 44 public bool doit; 45 46 static const long serialVersionUID = 3906644198244299574L; 47 48 this(Widget w) { 49 super(w); 50 } 51 52 /** 53 * Returns a string containing a concise, human-readable 54 * description of the receiver. 55 * 56 * @return a string representation of the event 57 */ 58 public override String toString() { 59 return Format( "{} location = {}, top = {}, doit = {}}", 60 super.toString()[0 .. $-1], location, top, doit ); 61 } 62 }