From f65f45ed0480ec6659d7ddd668765fef71f75bae Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Mon, 18 Jan 2016 13:59:46 +0100 Subject: [client] make the LocationSelectionWindow modal if a parent is given (e.g. LectureDetailsWindow) --- .../gui/window/layout/LocationSelectionWindowLayout.java | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'dozentenmodul/src/main/java') diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/LocationSelectionWindowLayout.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/LocationSelectionWindowLayout.java index ee06692d..60e1e8c4 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/LocationSelectionWindowLayout.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/LocationSelectionWindowLayout.java @@ -1,6 +1,7 @@ package org.openslx.dozmod.gui.window.layout; import java.awt.Window; +import java.awt.Dialog.ModalityType; import java.util.List; import javax.swing.BorderFactory; @@ -21,12 +22,17 @@ public class LocationSelectionWindowLayout extends JDialog { protected LocationSelector locationSelector; protected JButton btnSaveChanges; protected JButton btnClose; - public LocationSelectionWindowLayout(Window modalParent, List locationList) { - super(modalParent); - - getRootPane().setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); + + public LocationSelectionWindowLayout(Window modalParent, + List locationList) { + super(modalParent, modalParent != null ? ModalityType.APPLICATION_MODAL + : ModalityType.MODELESS); + + getRootPane() + .setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); GridManager grid = new GridManager(this, 1); - WordWrapLabel header = new WordWrapLabel("Hier können Sie die Räume auswählen, in denen diese Veranstaltung sichtbar sein soll."); + WordWrapLabel header = new WordWrapLabel( + "Hier können Sie die Räume auswählen, in denen diese Veranstaltung sichtbar sein soll."); locationSelector = new LocationSelector(); locationSelector.setSelectedLocationsAsIds(locationList); grid.add(header).fill(true, false).expand(true, false); -- cgit v1.2.3-55-g7522