Dialog.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. import java.util.ArrayList;
  23. import java.util.List;

  24. /**
  25.  * Dialog
  26.  *
  27.  * @author Giuliano Pintori (pintori@link.it)
  28.  * @author $Author$
  29.  * @version $Rev$, $Date$
  30.  */
  31. public class Dialog implements Serializable{

  32.     /**
  33.      *
  34.      */
  35.     private static final long serialVersionUID = 1L;
  36.     private String titolo;
  37.     private String icona;
  38.     private String headerRiga1;
  39.     private String headerRiga2;
  40.     private List<BodyElement> body;
  41.     private String notaFinale;
  42.     private BodyElement urlElement;
  43.    
  44.     private boolean resizable = false;
  45.     private boolean draggable = false;
  46.     private String height = "auto";
  47.     private String width = "660px";
  48.    
  49.     public Dialog() {
  50.         this.body = new ArrayList<Dialog.BodyElement>();
  51.         this.icona = Costanti.ICON_DIALOG_HEADER;
  52.     }
  53.    
  54.     public String getTitolo() {
  55.         return DataElement.checkNull(this.titolo);
  56.     }
  57.     public void setTitolo(String titolo) {
  58.         this.titolo = titolo;
  59.     }
  60.     public String getIcona() {
  61.         return DataElement.checkNull(this.icona);
  62.     }
  63.     public void setIcona(String icona) {
  64.         this.icona = icona;
  65.     }
  66.     public String getHeaderRiga1() {
  67.         return DataElement.checkNull(this.headerRiga1);
  68.     }
  69.     public void setHeaderRiga1(String headerRiga1) {
  70.         this.headerRiga1 = headerRiga1;
  71.     }
  72.     public String getHeaderRiga2() {
  73.         return DataElement.checkNull(this.headerRiga2);
  74.     }
  75.     public void setHeaderRiga2(String headerRiga2) {
  76.         this.headerRiga2 = headerRiga2;
  77.     }
  78.     public List<BodyElement> getBody() {
  79.         return this.body;
  80.     }
  81.     public void addBodyElement(BodyElement bodyElement) {
  82.         this.body.add(bodyElement);
  83.     }
  84.     @Deprecated
  85.     public void setBody(List<BodyElement> body) {
  86.         this.body = body;
  87.     }
  88.     public String getNotaFinale() {
  89.         return DataElement.checkNull(this.notaFinale);
  90.     }
  91.     public void setNotaFinale(String notaFinale) {
  92.         this.notaFinale = notaFinale;
  93.     }
  94.    
  95.     public boolean isResizable() {
  96.         return this.resizable;
  97.     }
  98.     public void setResizable(boolean resizable) {
  99.         this.resizable = resizable;
  100.     }
  101.     public boolean isDraggable() {
  102.         return this.draggable;
  103.     }
  104.     public void setDraggable(boolean draggable) {
  105.         this.draggable = draggable;
  106.     }
  107.     public String getHeight() {
  108.         return this.height;
  109.     }
  110.     public void setHeight(String height) {
  111.         this.height = height;
  112.     }
  113.     public String getWidth() {
  114.         return this.width;
  115.     }
  116.     public void setWidth(String width) {
  117.         this.width = width;
  118.     }  
  119.     public BodyElement getUrlElement() {
  120.         return this.urlElement;
  121.     }
  122.     public void setUrlElement(BodyElement urlElement) {
  123.         this.urlElement = urlElement;
  124.     }

  125.     public class BodyElement extends DataElement  implements Serializable{

  126.         /**
  127.          *
  128.          */
  129.         private static final long serialVersionUID = 1L;
  130.        
  131.         private boolean visualizzaCopyAction;
  132.         private String tooltipCopyAction;
  133.         private boolean resizable = false;
  134.        
  135.         public boolean isVisualizzaCopyAction() {
  136.             return this.visualizzaCopyAction;
  137.         }
  138.         public void setVisualizzaCopyAction(boolean visualizzaCopyAction) {
  139.             this.visualizzaCopyAction = visualizzaCopyAction;
  140.         }
  141.         public String getTooltipCopyAction() {
  142.             return DataElement.checkNull(this.tooltipCopyAction);
  143.         }
  144.         public void setTooltipCopyAction(String tooltipCopyAction) {
  145.             this.tooltipCopyAction = tooltipCopyAction;
  146.         }
  147.         public boolean isResizable() {
  148.             return this.resizable;
  149.         }
  150.         public void setResizable(boolean resizable) {
  151.             this.resizable = resizable;
  152.         }
  153.     }
  154.    
  155.     public static BodyElement newBodyElement() {
  156.         return new Dialog(). new BodyElement();
  157.     }
  158. }