GeneralLink.java

  1. /*
  2.  * GovWay - A customizable API Gateway
  3.  * https://govway.org
  4.  *
  5.  * Copyright (c) 2005-2025 Link.it srl (https://link.it).
  6.  *
  7.  * This program is free software: you can redistribute it and/or modify
  8.  * it under the terms of the GNU General Public License version 3, as published by
  9.  * the Free Software Foundation.
  10.  *
  11.  * This program is distributed in the hope that it will be useful,
  12.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.  * GNU General Public License for more details.
  15.  *
  16.  * You should have received a copy of the GNU General Public License
  17.  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  18.  *
  19.  */




  20. package org.openspcoop2.web.lib.mvc;

  21. import java.io.Serializable;

  22. /**
  23.  * GeneralLink
  24.  *
  25.  * @author Andrea Poli (apoli@link.it)
  26.  * @author Stefano Corallo (corallo@link.it)
  27.  * @author Sandra Giangrandi (sandra@link.it)
  28.  * @author $Author$
  29.  * @version $Rev$, $Date$
  30.  *
  31.  */
  32. public class GeneralLink implements Serializable{

  33.     /**
  34.      *
  35.      */
  36.     private static final long serialVersionUID = 1L;
  37.     String label;
  38.     String url;
  39.     String target;
  40.     String onclick;
  41.     String icon;
  42.     int labelWidth;
  43.     String tooltip;

  44.     public GeneralLink() {
  45.         this.label = "";
  46.         this.url = "";
  47.         this.target = "";
  48.         this.onclick = "";
  49.         this.icon="";
  50.         this.tooltip = "";
  51.     }

  52.     public void setLabel(String s) {
  53.         this.label = s;
  54.     }

  55.     public String getLabel() {
  56.     return this.label;
  57.     }

  58.     public void setUrl(String s) {
  59.         this.url = s;
  60.     }
  61.    
  62.     public void setUrl(String servletName,Parameter ... parameter) {
  63.         this.url = DataElement._getUrlValue(servletName, parameter);
  64.     }
  65.    
  66.     public void addParameter(Parameter ... parameter) {
  67.         this.url = DataElement._getUrlValue(this.url, parameter);
  68.     }

  69.     public String getUrl() {
  70.     return this.url;
  71.     }

  72.     public void setTarget(String s) {
  73.         this.target = s;
  74.     }
  75.     public void setTargetNew(){
  76.         this.target = "new";
  77.     }

  78.     public String getTarget() {
  79.     return this.target;
  80.     }

  81.     public void setOnClick(String s) {
  82.         this.onclick = s;
  83.     }

  84.     public String getOnClick() {
  85.     return this.onclick;
  86.     }

  87.     public String getIcon() {
  88.         return this.icon;
  89.     }

  90.     public void setIcon(String icon) {
  91.         this.icon = icon;
  92.     }

  93.     public int getLabelWidth() {
  94.         return this.labelWidth;
  95.     }
  96.     public void setLabelWidth(int labelWidth) {
  97.         this.labelWidth = labelWidth;
  98.     }
  99.     public String getTooltip() {
  100.         return this.tooltip;
  101.     }
  102.     public void setTooltip(String tooltip) {
  103.         this.tooltip = tooltip;
  104.     }
  105. }