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 java.util.HashMap;
018    import java.util.Map;
019    
020    /**
021     * @author Iv??n Zaera
022     */
023    public class URLMenuItem extends MenuItem implements URLUIItem {
024    
025            public Map<String, Object> getData() {
026                    if (_data == null) {
027                            _data = new HashMap<>();
028                    }
029    
030                    return _data;
031            }
032    
033            public String getMethod() {
034                    return _method;
035            }
036    
037            @Override
038            public String getTarget() {
039                    return _target;
040            }
041    
042            @Override
043            public String getURL() {
044                    return _url;
045            }
046    
047            public boolean isUseDialog() {
048                    return _useDialog;
049            }
050    
051            public void setData(Map<String, Object> data) {
052                    _data = data;
053            }
054    
055            public void setMethod(String method) {
056                    _method = method;
057            }
058    
059            @Override
060            public void setTarget(String target) {
061                    _target = target;
062            }
063    
064            @Override
065            public void setURL(String url) {
066                    _url = url;
067            }
068    
069            public void setUseDialog(boolean useDialog) {
070                    _useDialog = useDialog;
071            }
072    
073            private static final String _TARGET_DEFAULT = "_self";
074    
075            private Map<String, Object> _data;
076            private String _method;
077            private String _target = _TARGET_DEFAULT;
078            private String _url;
079            private boolean _useDialog;
080    
081    }