summaryrefslogtreecommitdiffstats
path: root/dozentenmodul/src/main/java
diff options
context:
space:
mode:
authorStephan Schwaer2015-10-06 15:58:32 +0200
committerStephan Schwaer2015-10-06 15:58:32 +0200
commitf074750f9bb56d7ccc66696f18c642c0e73753a1 (patch)
tree809aa0ffca6753ca5b3d3320ca4785c8a5c08768 /dozentenmodul/src/main/java
parent[client] Fixed default permissions not beeing written at image creation. (diff)
downloadtutor-module-f074750f9bb56d7ccc66696f18c642c0e73753a1.tar.gz
tutor-module-f074750f9bb56d7ccc66696f18c642c0e73753a1.tar.xz
tutor-module-f074750f9bb56d7ccc66696f18c642c0e73753a1.zip
[client] More formatting
Diffstat (limited to 'dozentenmodul/src/main/java')
-rw-r--r--dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LectureChangeImage.java36
-rw-r--r--dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LecturePermissionWindow.java9
-rw-r--r--dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LoginWindow.java2
-rw-r--r--dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/LectureWizard.java10
4 files changed, 33 insertions, 24 deletions
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LectureChangeImage.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LectureChangeImage.java
index be4b5691..be92d4d6 100644
--- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LectureChangeImage.java
+++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LectureChangeImage.java
@@ -40,15 +40,15 @@ public class LectureChangeImage extends LectureChangeImageLayout implements UiFe
me = this;
/**
- * initialise the ImageListViewer
+ * initialise the ImageListViewer
*/
imageListViewer.refreshList(false, 1);
imageTable = imageListViewer.getImageTable();
- imageTable.setColumnVisible(ImageTable.COL_LASTCHANGE , false);
- imageTable.setColumnVisible(ImageTable.COL_OS , false);
- imageTable.setColumnVisible(ImageTable.COL_SIZE , false);
- imageTable.setColumnVisible(ImageTable.COL_TEMPLATE , false);
+ imageTable.setColumnVisible(ImageTable.COL_LASTCHANGE, false);
+ imageTable.setColumnVisible(ImageTable.COL_OS, false);
+ imageTable.setColumnVisible(ImageTable.COL_SIZE, false);
+ imageTable.setColumnVisible(ImageTable.COL_TEMPLATE, false);
// finally the table listeners
imageTable.addMouseListener(new MouseAdapter() {
@@ -56,14 +56,17 @@ public class LectureChangeImage extends LectureChangeImageLayout implements UiFe
public void mouseClicked(MouseEvent e) {
}
+
@Override
public void mousePressed(MouseEvent e) {
processClick(e);
}
+
@Override
public void mouseReleased(MouseEvent e) {
processClick(e);
}
+
private void processClick(MouseEvent e) {
// left double click => open details
if (SwingUtilities.isLeftMouseButton(e) && e.getClickCount() == 2) {
@@ -72,16 +75,19 @@ public class LectureChangeImage extends LectureChangeImageLayout implements UiFe
okUsed = true;
dispose();
} else {
- if(!image.isValid)
- Gui.showMessageBox(me, "Ausgewähltes Image ist ungültig!", MessageType.ERROR, LOGGER , null);
- else Gui.showMessageBox(me, "Keine Rechte zum Verlinken auf das ausgewählte Image.", MessageType.ERROR, LOGGER , null);
+ if (!image.isValid) {
+ Gui.showMessageBox(me, "Ausgewähltes Image ist ungültig!", MessageType.ERROR,
+ LOGGER, null);
+ } else {
+ Gui.showMessageBox(me, "Keine Rechte zum Verlinken auf das ausgewählte Image.",
+ MessageType.ERROR, LOGGER, null);
+ }
}
}
}
});
-
imageTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
@Override
public void valueChanged(ListSelectionEvent e) {
@@ -103,19 +109,19 @@ public class LectureChangeImage extends LectureChangeImageLayout implements UiFe
btnClose.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent arg0) {
- dispose();
+ dispose();
}
});
}
-
/**
* Set window visible and return resulting ImageSummaryRead
+ *
* @return ImageSummaryRead of selected Image
*/
- private ImageSummaryRead runAndReturn(){
+ private ImageSummaryRead runAndReturn() {
setVisible(true);
- if (okUsed){
+ if (okUsed) {
return imageTable.getSelectedItem();
} else {
return null;
@@ -124,8 +130,10 @@ public class LectureChangeImage extends LectureChangeImageLayout implements UiFe
/**
* Create new LectureChangeLinkedImage
+ *
* @param modalParent parent window of the popup window
- * @return ImageSummaryRead of selected image or null, if abort has been used
+ * @return ImageSummaryRead of selected image or null, if abort has been
+ * used
*/
public static ImageSummaryRead open(Window modalParent) {
return new LectureChangeImage(modalParent).runAndReturn();
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LecturePermissionWindow.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LecturePermissionWindow.java
index d91a75e6..5ded8538 100644
--- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LecturePermissionWindow.java
+++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LecturePermissionWindow.java
@@ -91,11 +91,10 @@ public class LecturePermissionWindow extends LecturePermissionWindowLayout imple
* abort button has been used
*/
- public static void open(Window modalParent,
- Map<String, LecturePermissions> permissionMap, LecturePermissions defaultPermissions,
- String ownerId) {
- new LecturePermissionWindow(modalParent, permissionMap, defaultPermissions, ownerId).run();
-
+ public static void open(Window modalParent, Map<String, LecturePermissions> permissionMap,
+ LecturePermissions defaultPermissions, String ownerId) {
+ new LecturePermissionWindow(modalParent, permissionMap, defaultPermissions, ownerId).run();
+
}
@Override
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LoginWindow.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LoginWindow.java
index 33bcdf5b..553378fd 100644
--- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LoginWindow.java
+++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LoginWindow.java
@@ -413,7 +413,7 @@ public class LoginWindow extends LoginWindowLayout {
}
enableLogin(true);
}
-
+
private void enableLogin(boolean enable) {
loginButton.setEnabled(enable);
usernameField.setEnabled(enable);
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/LectureWizard.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/LectureWizard.java
index fa1ca5f6..d8d63165 100644
--- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/LectureWizard.java
+++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/LectureWizard.java
@@ -33,7 +33,8 @@ public class LectureWizard extends Wizard implements UiFeedback {
*
* @param parent window of this wizard
* @param image ImageSummaryRead of the image to link this lecture to,
- * if this is null it will start add the LectureImageListPage to the wizard.
+ * if this is null it will add the LectureImageListPage to
+ * the wizard.
* @param editExistingLecture whether to create new or edit existing lecture
*/
public LectureWizard(Window parent, ImageSummaryRead image, String imageVersionId) {
@@ -43,8 +44,8 @@ public class LectureWizard extends Wizard implements UiFeedback {
state.image = image;
state.imageVersionId = imageVersionId;
}
- state.defaultPermissions = Session.getSatelliteConfig().defaultLecturePermissions;
-
+ state.defaultPermissions = Session.getSatelliteConfig().defaultLecturePermissions;
+
// create the shared object for all pages of the wizard
addPage(new LectureCreationPage(this, state));
if (image == null && imageVersionId == null)
@@ -96,7 +97,8 @@ public class LectureWizard extends Wizard implements UiFeedback {
state.uuid = uuid;
// now push the permissions if we have any
if (state.permissionMap != null && !state.permissionMap.isEmpty())
- if (!ThriftActions.writeLecturePermissions(JOptionPane.getFrameForComponent(this), state.uuid, state.permissionMap))
+ if (!ThriftActions.writeLecturePermissions(JOptionPane.getFrameForComponent(this), state.uuid,
+ state.permissionMap))
return false;
// all good, refresh cache and change to LectureList