@Override
    public void selectResource(final String resourcePath, final CmsUUID structureId, final String title) {

        switch (getGalleryMode()) {
            case widget:
                getInitialCroppingParameter(resourcePath, new I_CmsSimpleCallback<CmsCroppingParamBean>() {

                    public void execute(CmsCroppingParamBean param) {

                        if (getGalleryDialog().getWidgetHandler() != null) {
                            getGalleryDialog().getWidgetHandler().setWidgetValue(resourcePath, structureId, param);
                        } else {
                            if (CmsPreviewUtil.isAdvancedWidget()) {
                                CmsPreviewUtil.setVfsImage(
                                    resourcePath,
                                    param.getScaleParam(),
                                    param.getFormatName(),
                                    param.getRatio() + "");
                            } else {
                                CmsPreviewUtil.setResourcePath(
                                    resourcePath
                                        + ((param.isCropped() || param.isScaled()) ? "?" + param.toString() : ""));
                            }
                        }
                    }
                });

                break;
            case editor:
                getInitialCroppingParameter(resourcePath, new I_CmsSimpleCallback<CmsCroppingParamBean>() {

                    public void execute(CmsCroppingParamBean param) {

                        Map<String, String> attributes = new HashMap<String, String>();
                        attributes.put("title", title);
                        attributes.put("width", String.valueOf(param.getResultingWidth()));
                        attributes.put("height", String.valueOf(param.getResultingHeight()));
                        CmsPreviewUtil.setImage(
                            CmsCoreProvider.get().link(resourcePath)
                                + (param.isScaled() ? "?" + param.toString() + ",c:transparent" : ""),
                            attributes);
                        CmsPreviewUtil.closeDialog();
                    }
                });
                break;
            case ade:
            case view:
            case adeView:
            default:
                //nothing to do here, should not be called
                break;
        }
    }
@ Override public void selectResource ( final String resourcePath , final CmsUUID structureId , final String title ) { switch ( getGalleryMode ( ) ) { case widget : getInitialCroppingParameter ( resourcePath , new I_CmsSimpleCallback < CmsCroppingParamBean > ( ) { public void execute ( CmsCroppingParamBean param ) { if ( getGalleryDialog ( ) . getWidgetHandler ( ) != null ) { getGalleryDialog ( ) . getWidgetHandler ( ) . setWidgetValue ( resourcePath , structureId , param ) ; } else { if ( CmsPreviewUtil . isAdvancedWidget ( ) ) { CmsPreviewUtil . setVfsImage ( resourcePath , param . getScaleParam ( ) , param . getFormatName ( ) , param . getRatio ( ) + "" ) ; } else { CmsPreviewUtil . setResourcePath ( resourcePath + ( ( param . isCropped ( ) || param . isScaled ( ) ) ? "?" + param . toString ( ) : "" ) ) ; } } } } ) ; break ; case editor : getInitialCroppingParameter ( resourcePath , new I_CmsSimpleCallback < CmsCroppingParamBean > ( ) { public void execute ( CmsCroppingParamBean param ) { Map < String , String > attributes = new HashMap < String , String > ( ) ; attributes . put ( "title" , title ) ; attributes . put ( "width" , String . valueOf ( param . getResultingWidth ( ) ) ) ; attributes . put ( "height" , String . valueOf ( param . getResultingHeight ( ) ) ) ; CmsPreviewUtil . setImage ( CmsCoreProvider . get ( ) . link ( resourcePath ) + ( param . isScaled ( ) ? "?" + param . toString ( ) + ",c:transparent" : "" ) , attributes ) ; CmsPreviewUtil . closeDialog ( ) ; } } ) ; break ; case ade : case view : case adeView : default : break ; } }
@see org.opencms.ade.galleries.client.preview.A_CmsResourcePreview#selectResource(java.lang.String, org.opencms.util.CmsUUID, java.lang.String)