001    /**
002     * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.kernel.servlet.taglib.ui;
016    
017    import com.liferay.portal.kernel.util.Validator;
018    
019    /**
020     * @author Sergio Gonz??lez
021     */
022    public class ImageSelector {
023    
024            public ImageSelector(long imageId) {
025                    _imageId = imageId;
026    
027                    _imageURL = null;
028            }
029    
030            public ImageSelector(long imageId, String imageURL) {
031                    _imageId = imageId;
032    
033                    _imageURL = imageURL;
034            }
035    
036            public ImageSelector(String imageURL) {
037                    _imageId = 0;
038    
039                    _imageURL = imageURL;
040            }
041    
042            public long getImageId() {
043                    return _imageId;
044            }
045    
046            public String getImageURL() {
047                    return _imageURL;
048            }
049    
050            public boolean isRemoveSmallImage() {
051                    if ((_imageId == 0) && Validator.isNull(_imageURL)) {
052                            return true;
053                    }
054    
055                    return false;
056            }
057    
058            private final long _imageId;
059            private final String _imageURL;
060    
061    }