Jasper Floor pushed to branch master at cms-community / hippo-cms
Commits: 9f176613 by Bert Leunis at 2017-08-01T12:56:10+02:00 CMS-10836 new constructor that accepts context and config for crop dialog - - - - - 66f11007 by Jasper Floor at 2017-09-05T11:31:40+02:00 CMS-10836 Merge master changes in feature/CMS-10836 - - - - - e6c35e7b by Jasper Floor at 2017-09-05T11:43:42+02:00 CMS-10836 Reintegrate feature/CMS-10836 - - - - - 2 changed files: - gallery/frontend/src/main/java/org/hippoecm/frontend/plugins/gallery/editor/ImageCropEditorDialog.java - gallery/frontend/src/main/java/org/hippoecm/frontend/plugins/gallery/editor/ImageCropPlugin.java Changes: ===================================== gallery/frontend/src/main/java/org/hippoecm/frontend/plugins/gallery/editor/ImageCropEditorDialog.java ===================================== --- a/gallery/frontend/src/main/java/org/hippoecm/frontend/plugins/gallery/editor/ImageCropEditorDialog.java +++ b/gallery/frontend/src/main/java/org/hippoecm/frontend/plugins/gallery/editor/ImageCropEditorDialog.java @@ -1,5 +1,5 @@ /* - * Copyright 2011-2016 Hippo B.V. (http://www.onehippo.com) + * Copyright 2011-2017 Hippo B.V. (http://www.onehippo.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -49,6 +49,8 @@ import org.apache.wicket.util.value.ValueMap; import org.hippoecm.frontend.dialog.Dialog; import org.hippoecm.frontend.editor.plugins.resource.ResourceHelper; import org.hippoecm.frontend.model.JcrNodeModel; +import org.hippoecm.frontend.plugin.IPluginContext; +import org.hippoecm.frontend.plugin.config.IPluginConfig; import org.hippoecm.frontend.plugins.gallery.editor.crop.ImageCropBehavior; import org.hippoecm.frontend.plugins.gallery.editor.crop.ImageCropSettings; import org.hippoecm.frontend.plugins.gallery.imageutil.ImageUtils; @@ -91,10 +93,25 @@ public class ImageCropEditorDialog extends Dialog<Node> { private Dimension thumbnailDimension; private float compressionQuality; private final ImageCropSettings cropSettings; + @SuppressWarnings("unused") + private IPluginConfig config; + @SuppressWarnings("unused") + private IPluginContext context; - public ImageCropEditorDialog(IModel<Node> jcrImageNodeModel, GalleryProcessor galleryProcessor) { + /** + * A dialog to crop an image variant. + * + * @param jcrImageNodeModel node where the variant to be cropped is stored. + * @param galleryProcessor with configuration for scaling parameters and dimensions. + * @param config Config of the instantiating Plugin. + * @param context Context of the instantiating Plugin. + */ + public ImageCropEditorDialog(final IModel<Node> jcrImageNodeModel, final GalleryProcessor galleryProcessor, final IPluginConfig config, final IPluginContext context) { super(jcrImageNodeModel); + this.config = config; + this.context = context; + setSize(DIALOG_SIZE); setTitleKey(DIALOG_TITLE); @@ -202,6 +219,15 @@ public class ImageCropEditorDialog extends Dialog<Node> { } catch (RepositoryException e) { log.info("Cannot retrieve compression quality.", e); } + + } + + /** + * @deprecated use {@link ImageCropEditorDialog(IModel, GalleryProcessor, IPluginConfig, IPluginContext)} instead. + */ + @Deprecated + public ImageCropEditorDialog(IModel<Node> jcrImageNodeModel, GalleryProcessor galleryProcessor) { + this(jcrImageNodeModel, galleryProcessor, null, null); } /** ===================================== gallery/frontend/src/main/java/org/hippoecm/frontend/plugins/gallery/editor/ImageCropPlugin.java ===================================== --- a/gallery/frontend/src/main/java/org/hippoecm/frontend/plugins/gallery/editor/ImageCropPlugin.java +++ b/gallery/frontend/src/main/java/org/hippoecm/frontend/plugins/gallery/editor/ImageCropPlugin.java @@ -1,5 +1,5 @@ /* - * Copyright 2011-2016 Hippo B.V. (http://www.onehippo.com) + * Copyright 2011-2017 Hippo B.V. (http://www.onehippo.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -47,7 +47,7 @@ public class ImageCropPlugin extends RenderPlugin<Node> { private static final long serialVersionUID = 1L; - static final Logger log = LoggerFactory.getLogger(ImageCropPlugin.class); + private static final Logger log = LoggerFactory.getLogger(ImageCropPlugin.class); private static final CssResourceReference CROP_SKIN = new CssResourceReference(ImageCropPlugin.class, "crop-plugin.css"); @@ -110,7 +110,7 @@ public class ImageCropPlugin extends RenderPlugin<Node> { @Override protected void onEvent(final AjaxRequestTarget target) { IDialogService dialogService = context.getService(IDialogService.class.getName(), IDialogService.class); - dialogService.show(new ImageCropEditorDialog(jcrImageNodeModel, processor)); + dialogService.show(new ImageCropEditorDialog(jcrImageNodeModel, processor, config, context)); } }); } View it on GitLab: https://code.onehippo.org/cms-community/hippo-cms/compare/a50f77e9ef0644df0bc977d6499c0b1969007213...e6c35e7bd8e38aad3b9f9e8af82c3c66bf998bea --- View it on GitLab: https://code.onehippo.org/cms-community/hippo-cms/compare/a50f77e9ef0644df0bc977d6499c0b1969007213...e6c35e7bd8e38aad3b9f9e8af82c3c66bf998bea You're receiving this email because of your account on code.onehippo.org.
_______________________________________________ Hippocms-svn mailing list Hippocms-svn@lists.onehippo.org https://lists.onehippo.org/mailman/listinfo/hippocms-svn