forked from IbcAlpha/IBC
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
46cb82f
commit 90693cf
Showing
9 changed files
with
122 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// This file is part of IBC. | ||
// Copyright (C) 2004 Steven M. Kearns ([email protected] ) | ||
// Copyright (C) 2004 - 2022 Richard L King ([email protected]) | ||
// For conditions of distribution and use, see copyright notice in COPYING.txt | ||
|
||
// IBC is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
|
||
// IBC is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
|
||
// You should have received a copy of the GNU General Public License | ||
// along with IBC. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
package ibcalpha.ibc; | ||
|
||
import java.awt.Window; | ||
import java.awt.event.WindowEvent; | ||
import javax.swing.JDialog; | ||
|
||
public class RestartConfirmationDialogHandler implements WindowHandler { | ||
public boolean filterEvent(Window window, int eventId) { | ||
switch (eventId) { | ||
case WindowEvent.WINDOW_OPENED: | ||
return true; | ||
default: | ||
return false; | ||
} | ||
} | ||
|
||
public void handleWindow(Window window, int eventID) { | ||
if (!SwingUtils.clickButton(window, "Yes")) { | ||
Utils.logError("could not ignore shutdown confirmation dialog because we could not find one of the controls."); | ||
} | ||
} | ||
|
||
public boolean recogniseWindow(Window window) { | ||
if (! (window instanceof JDialog)) return false; | ||
|
||
return (SwingUtils.findLabel(window, "Are you sure you would like to restart the application") != null); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters