diff options
| author | Jonathan Bauer | 2015-08-26 15:16:35 +0200 |
|---|---|---|
| committer | Jonathan Bauer | 2015-08-26 15:16:35 +0200 |
| commit | d6191af35d871de1e56c0afc026577134d019396 (patch) | |
| tree | 1ed6264dc6518c70894829eb4a8fc3be7296a030 /dozentenmodul/src/main/java | |
| parent | [client] add "View/Edit" button to button panel and popup menu in ImageList (diff) | |
| download | tutor-module-d6191af35d871de1e56c0afc026577134d019396.tar.gz tutor-module-d6191af35d871de1e56c0afc026577134d019396.tar.xz tutor-module-d6191af35d871de1e56c0afc026577134d019396.zip | |
[client] LectureImageList Page for Wizard
Diffstat (limited to 'dozentenmodul/src/main/java')
6 files changed, 83 insertions, 2 deletions
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/control/ImageListViewer.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/control/ImageListViewer.java index f0b41693..0239e951 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/control/ImageListViewer.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/control/ImageListViewer.java @@ -75,7 +75,6 @@ public class ImageListViewer extends JLabel { // the actual table imageTable = new ImageTable(); - grid.add(filterPanel).fill(true, false).expand(true,false); grid.nextRow(); grid.add(new JScrollPane(imageTable)).fill(true, true).expand(true,true); diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImageListWindow.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImageListWindow.java index b19ff6c0..75d6eeab 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImageListWindow.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImageListWindow.java @@ -248,6 +248,11 @@ public class ImageListWindow extends ImageListWindowLayout implements DownloadCa new LectureWizard(SwingUtilities.getWindowAncestor(this), image, image.getLatestVersionId()).setVisible(true); } + /** + * Opens the given image details as a popup window + * + * @param image the image to show the details of + */ private void openImageDetails(ImageSummaryRead image) { if (image == null) return; 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 ac5a68de..f3cc2ca3 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 @@ -14,6 +14,7 @@ import org.openslx.dozmod.gui.helper.UiFeedback; import org.openslx.dozmod.gui.window.LectureListWindow; import org.openslx.dozmod.gui.wizard.page.LectureCreationPage; import org.openslx.dozmod.gui.wizard.page.LectureCustomPermissionPage; +import org.openslx.dozmod.gui.wizard.page.LectureImageListPage; import org.openslx.dozmod.gui.wizard.page.LectureOptionsPage; import org.openslx.dozmod.state.LectureWizardState; import org.openslx.dozmod.thrift.ThriftActions; @@ -43,6 +44,8 @@ public class LectureWizard extends Wizard implements UiFeedback { // create the shared object for all pages of the wizard addPage(new LectureCreationPage(this, state)); + if (true) + addPage(new LectureImageListPage(this, state)); addPage(new LectureOptionsPage(this, state)); addPage(new LectureCustomPermissionPage(this, state)); } diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/layout/LectureImageListPageLayout.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/layout/LectureImageListPageLayout.java new file mode 100644 index 00000000..4467137c --- /dev/null +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/layout/LectureImageListPageLayout.java @@ -0,0 +1,24 @@ +package org.openslx.dozmod.gui.wizard.layout; + +import org.openslx.dozmod.gui.control.ImageListViewer; +import org.openslx.dozmod.gui.helper.GridManager; +import org.openslx.dozmod.gui.wizard.Wizard; +import org.openslx.dozmod.gui.wizard.WizardPage; + +@SuppressWarnings("serial") +public abstract class LectureImageListPageLayout extends WizardPage { + + protected final ImageListViewer imageListViewer; + /** + * Page for setting custom permissions of a lecture + */ + public LectureImageListPageLayout(Wizard wizard) { + super(wizard, "Image verknüpfen"); + setDescription("Wählen Sie ein Image für diese Veranstaltung aus"); + GridManager grid = new GridManager(this, 1, false); + + imageListViewer = new ImageListViewer(); + grid.add(imageListViewer).fill(true, true).expand(true, true); + grid.finish(true); + } +} diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/page/LectureCustomPermissionPage.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/page/LectureCustomPermissionPage.java index d4c70d5a..328981ef 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/page/LectureCustomPermissionPage.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/page/LectureCustomPermissionPage.java @@ -34,7 +34,6 @@ public class LectureCustomPermissionPage extends LectureCustomPermissionPageLayo } } - @Override protected boolean wantNextOrFinish() { LOGGER.debug("Saving permissions to state ..."); diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/page/LectureImageListPage.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/page/LectureImageListPage.java new file mode 100644 index 00000000..d325ea53 --- /dev/null +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/page/LectureImageListPage.java @@ -0,0 +1,51 @@ +package org.openslx.dozmod.gui.wizard.page; + +import org.apache.log4j.Logger; +import org.openslx.bwlp.thrift.iface.ImageSummaryRead; +import org.openslx.dozmod.gui.control.table.ImageTable; +import org.openslx.dozmod.gui.wizard.Wizard; +import org.openslx.dozmod.gui.wizard.layout.LectureImageListPageLayout; +import org.openslx.dozmod.state.LectureWizardState; + +@SuppressWarnings("serial") +public class LectureImageListPage extends LectureImageListPageLayout { + + private final static Logger LOGGER = Logger.getLogger(LectureImageListPage.class); + + private boolean initDone = false; + + private LectureWizardState state = null; + + /** + * The image table held by the ImageListViewer + */ + public final ImageTable imageTable = imageListViewer.getImageTable(); + + /** + * Page for setting custom permissions of a lecture + */ + public LectureImageListPage(Wizard wizard, LectureWizardState state) { + super(wizard); + this.state = state; + setPageComplete(true); + } + + @Override + protected void onPageEnter() { + imageListViewer.refreshList(false, 1); + } + + @Override + protected boolean wantNextOrFinish() { + return saveToState(); + } + private boolean saveToState() { + ImageSummaryRead selected = imageListViewer.getImageTable().getSelectedItem(); + if (selected != null) { + state.image = selected; + return true; + } + return false; + } + +} |
