Spec-Zone .ru
спецификации, руководства, описания, API
001/*
002 * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
003 */
004package javafx.scene.web;
005
006/**
007 * This class encapsulates data passed into JavaScript {@code prompt()} function:
008 * a message and a default value. Instances are passed into {@code prompt}
009 * handlers registered on a {@code WebEngine} using
010 * {@link WebEngine#setPromptHandler} method.
011 * 
012 * @see WebEngine
013 * @see WebEngine#setPromptHandler
014 */
015public final class PromptData {
016
017    private final String message;
018    private final String defaultValue;
019
020    /**
021     * Creates a new instance.
022     */
023    public PromptData(String message, String defaultValue) {
024        this.message = message;
025        this.defaultValue = defaultValue;
026    }
027
028    /**
029     * Returns message carried by this data object.
030     */
031    public final String getMessage() {
032        return message;
033    }
034
035    /**
036     * Returns default value carried by this data object.
037     */
038    public final String getDefaultValue() {
039        return defaultValue;
040    }
041}