-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Minimize to tray on window closing #36
- Loading branch information
Angelo Gülle (Windows)
committed
Jan 2, 2017
1 parent
9583f6c
commit dc562f1
Showing
4 changed files
with
79 additions
and
4 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
13 changes: 13 additions & 0 deletions
13
Midi Automator/src/main/java/com/midi_automator/view/frames/TrayInfoPaneFrame.java
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,13 @@ | ||
package com.midi_automator.view.frames; | ||
|
||
import javax.swing.JFrame; | ||
|
||
import org.springframework.stereotype.Component; | ||
|
||
@Component | ||
public class TrayInfoPaneFrame extends JFrame { | ||
|
||
private static final long serialVersionUID = 1L; | ||
public static final String MESSAGE = "The program window will be minimized to the system tray."; | ||
|
||
} |
35 changes: 35 additions & 0 deletions
35
.../src/test/java/com/midi_automator/tests/FunctionalTests/CloseProgramFunctionalITCase.java
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,35 @@ | ||
package com.midi_automator.tests.FunctionalTests; | ||
|
||
import static com.midi_automator.tests.utils.GUIAutomations.findTrayInfoPane; | ||
|
||
import org.assertj.swing.fixture.JOptionPaneFixture; | ||
import org.junit.Test; | ||
|
||
public class CloseProgramFunctionalITCase extends FunctionalBaseCase { | ||
|
||
@Test | ||
public void closingProgramShouldShowDialogOnWindows() { | ||
|
||
if (System.getProperty("os.name").contains("Windows")) { | ||
startApplication(); | ||
window.close(); | ||
|
||
JOptionPaneFixture trayOptionPane = findTrayInfoPane(); | ||
trayOptionPane.requireVisible(); | ||
} | ||
} | ||
|
||
@Test | ||
public void comittingTrayDialogShouldHideProgramOnWindows() { | ||
|
||
if (System.getProperty("os.name").contains("Windows")) { | ||
startApplication(); | ||
window.close(); | ||
|
||
JOptionPaneFixture trayOptionPane = findTrayInfoPane(); | ||
trayOptionPane.button().click(); | ||
|
||
window.requireNotVisible(); | ||
} | ||
} | ||
} |
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