Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/macosx/classes/com/apple/eawt/ApplicationEvent.java
38831 views
/*1* Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package com.apple.eawt;2627import java.util.EventObject;2829/**30* The class of events sent to the deprecated ApplicationListener callbacks.31*32* @deprecated replaced by {@link AboutHandler}, {@link PreferencesHandler}, {@link AppReOpenedListener}, {@link OpenFilesHandler}, {@link PrintFilesHandler}, {@link QuitHandler}, {@link QuitResponse}33* @since 1.434*/35@Deprecated36public class ApplicationEvent extends EventObject {37private String fFilename = null;38private boolean fHandled = false;3940ApplicationEvent(final Object source) {41super(source);42}4344ApplicationEvent(final Object source, final String filename) {45super(source);46fFilename = filename;47}4849/**50* Determines whether an ApplicationListener has acted on a particular event.51* An event is marked as having been handled with <code>setHandled(true)</code>.52*53* @return <code>true</code> if the event has been handled, otherwise <code>false</code>54*55* @since 1.456* @deprecated57*/58@Deprecated59public boolean isHandled() {60return fHandled;61}6263/**64* Marks the event as handled.65* After this method handles an ApplicationEvent, it may be useful to specify that it has been handled.66* This is usually used in conjunction with <code>getHandled()</code>.67* Set to <code>true</code> to designate that this event has been handled. By default it is <code>false</code>.68*69* @param state <code>true</code> if the event has been handled, otherwise <code>false</code>.70*71* @since 1.472* @deprecated73*/74@Deprecated75public void setHandled(final boolean state) {76fHandled = state;77}7879/**80* Provides the filename associated with a particular AppleEvent.81* When the ApplicationEvent corresponds to an AppleEvent that needs to act on a particular file, the ApplicationEvent carries the name of the specific file with it.82* For example, the Print and Open events refer to specific files.83* For these cases, this returns the appropriate file name.84*85* @return the full path to the file associated with the event, if applicable, otherwise <code>null</code>86*87* @since 1.488* @deprecated use {@link OpenFilesHandler} or {@link PrintFilesHandler} instead89*/90@Deprecated91public String getFilename() {92return fFilename;93}94}959697