Package org.boco.seamwebappgen.info

Source Code of org.boco.seamwebappgen.info.ShowList

/***************************************************************************
*  Copyright (c) 2004 - 2008  Fabrizio Boco fabboco@users.sourceforge.net *
*                                                                         *
*                                                                         *
*   This is free software; you can redistribute it and/or                 *
*   modify it under the terms of the GNU Library General Public           *
*   License (version 2.1) as published by the Free Software Foundation    *
*                                                                         *
*   This library  is distributed in the hope that it will be useful,      *
*   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
*   GNU Library General Public License for more details.                  *
*                                                                         *
*   You should have received a copy of the GNU Library General Public     *
*   License along with this library; see the file COPYING.LIB. If not,    *
*   write to the Free Software Foundation, Inc., 59 Temple Place,         *
*   Suite 330, Boston, MA  02111-1307, USA                                *
*                                                                         *
***************************************************************************/

/**
- $Header: /usr/local/cvslocalrepository/SeamWebAppGenerator/src/org/boco/seamwebappgen/info/Attic/ShowList.java,v 1.1.2.2 2008/04/22 05:37:58 fab Exp $
- $Author: fab $
- $Revision: 1.1.2.2 $
- $Date: 2008/04/22 05:37:58 $
- $Log: ShowList.java,v $
- Revision 1.1.2.2  2008/04/22 05:37:58  fab
- Aggiornamento indirizzo di posta
-
- Revision 1.1.2.1  2008/04/19 13:12:42  fab
- Modifiche varie per rafactoring
-
- Revision 1.1.2.1  2008/04/19 11:18:29  fab
- Refactoring
-
- Revision 1.4.4.1  2008/04/19 10:07:02  fab
- Aggiornamento riferimenti licenza
-
- Revision 1.4  2008/01/28 16:31:46  fab
- Implementazione 0544/C
-
- Revision 1.3  2007/11/02 10:56:47  fab
- Aggiornamento della @ShowList
-
- Revision 1.2  2007/10/30 09:07:54  fab
- Implementazione 0301/C
-
- Revision 1.1  2007/09/29 13:17:04  fab
- Nuova versione iniziale del 29/09/2007
-
- Revision 1.1.2.6  2007/09/26 08:02:35  fab
- Supporto per nuova annotazione IgnorePrintListForm e
- Supporto alla nuova opzione per @ShowList
-
- Revision 1.1.2.5  2007/08/29 12:46:22  bob
- Tolta 'a' ed 'e' accentate
-
- Revision 1.1.2.4  2007/05/19 09:33:28  dev
- Moltissime modifiche
-
- Revision 1.1.2.3  2007/04/03 06:11:03  dev
- Aggiornamento della documentazione
-
- Revision 1.1.2.2  2007/03/24 17:24:16  dev
- Inseriti i ruoli associati alla lista
-
- Revision 1.1.2.1  2007/03/24 12:25:32  dev
- Versione Iniziale
-
**/
package org.boco.seamwebappgen.info;

import java.util.Vector;

import org.boco.seamwebappgen.exception.WrongShowEnableRolesListException;
import org.boco.seamwebappgen.utils.Utils;



/**
* Informazioni sulle liste di visualizzazione di un bean
*
* @author Fabrizio Boco
*/
public class ShowList
{
  /**
   * Nome assegnato alla lista
   */
  private String  name;
 
  /**
   * Filtro associato alla lista
   */
  private String   filter;
 
  /**
   * True se e' la lista da visualizzare all'apertura dell'applicazione
   */
  private boolean  main;
 
 
//  /**
//   * True se nella lista deve essere presente l'opzione di stampa
//   */
//  private boolean   printMenu;
 
 
  /**
   * Condizione per il rendering della opzione New
   */
  private String   newMenuCondition;
 
  /**
   * Condizione per il rendering della opzione Print nella lista
   */
  private String   printMenuInListCondition;
 
  /**
   * Ruoli abilitati ad accedere alla lista
   *
   */
  private Vector<String> enabledRoles;

 
  public ShowList(String beanName, String name, String filter, boolean main, String stringRoles, String printMenuCondition, String newMenuCondition) throws WrongShowEnableRolesListException
  {
    this.name = beanName + Utils.makeFirstLetterUpperCase(name);
   
    this.filter = filter;
    this.main = main;
    enabledRoles = new Vector<String>();
   
    if (!stringRoles.startsWith("["))
      throw new WrongShowEnableRolesListException(beanName,stringRoles,"La lista deve iniziare con [");
   
    if (!stringRoles.endsWith("]"))
      throw new WrongShowEnableRolesListException(beanName,stringRoles,"La lista deve terminare con ]");
   
    String roles = stringRoles.substring(1,stringRoles.length()-1);
   
    String tmp[] = roles.split(",");
   
    for (int i = 0; i < tmp.length; i++)
    {
      if (!tmp[i].equals(""))
        enabledRoles.add(tmp[i]);
    }
   
    this.printMenuInListCondition = printMenuCondition;
    this.newMenuCondition = newMenuCondition;
  }
 
  public boolean isMain()
  {
    return main;
  }
 
  public void setMain(boolean main)
  {
    this.main = main;
  }
 
  public String getName()
  {
    return name;
  }
 
  public void setName(String name)
  {
    this.name = name;
  }

 
  public String getFilter()
  {
    return filter;
  }

 
  public void setFilter(String filter)
  {
    this.filter = filter;
  }

 
  public Vector<String> getEnabledRoles()
  {
    return enabledRoles;
  }

 
  public void setEnabledRoles(Vector<String> enabledRoles)
  {
    this.enabledRoles = enabledRoles;
  }
 
  public String getPrintMenuInListCondition()
  {
    return printMenuInListCondition;
  }

 
  public void setPrintMenuInListCondition(String printMenuCondition)
  {
    this.printMenuInListCondition = printMenuCondition;
  }

  @Override
  public String toString()
  {
    return name;
  }

 
    public String getNewMenuCondition()
    {
      return newMenuCondition;
    }

 
    public void setNewMenuCondition(String newMenu)
    {
      this.newMenuCondition = newMenu;
    }
}
TOP

Related Classes of org.boco.seamwebappgen.info.ShowList

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.