org.openswing.swing.permissions.java
Class ButtonsAuthorizations

java.lang.Object
  extended byorg.openswing.swing.permissions.java.ButtonsAuthorizations
All Implemented Interfaces:
java.io.Serializable

public class ButtonsAuthorizations
extends java.lang.Object
implements java.io.Serializable

Title: OpenSwing Framework

Description: According to the authorizations defined for the button container, this class defines a button abilitation. .

Copyright: Copyright (C) 2006 Mauro Carniel

This file is part of OpenSwing Framework. This library is free software; you can redistribute it and/or modify it under the terms of the (LGPL) Lesser General Public License as published by the Free Software Foundation; GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 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; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. The author may be contacted at: maurocarniel@tin.it

See Also:
Serialized Form

Constructor Summary
ButtonsAuthorizations()
           
 
Method Summary
 void addButtonAuthorization(java.lang.String functionId, boolean isInsertEnabled, boolean isEditEnabled, boolean isDeleteEnabled)
          Add buttons authorizations for insert, edit and delete buttons.
 void addGenericButtonAuthorization(java.lang.String functionId, java.lang.String buttonId, boolean isEnabled)
          Add button authorizations for a generic button, identified by button id.
 boolean isDeleteEnabled(java.lang.String functionId)
           
 boolean isEditEnabled(java.lang.String functionId)
           
 boolean isEnabled(java.lang.String functionId, java.lang.String buttonId)
           
 boolean isInsertEnabled(java.lang.String functionId)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ButtonsAuthorizations

public ButtonsAuthorizations()
Method Detail

addButtonAuthorization

public final void addButtonAuthorization(java.lang.String functionId,
                                         boolean isInsertEnabled,
                                         boolean isEditEnabled,
                                         boolean isDeleteEnabled)
Add buttons authorizations for insert, edit and delete buttons.


addGenericButtonAuthorization

public final void addGenericButtonAuthorization(java.lang.String functionId,
                                                java.lang.String buttonId,
                                                boolean isEnabled)
Add button authorizations for a generic button, identified by button id. This method must not be used for insert, edit or delete buttons.


isInsertEnabled

public final boolean isInsertEnabled(java.lang.String functionId)
Parameters:
functionId - identifier of the function
Returns:
true to enable the button, false to disable the button

isEditEnabled

public final boolean isEditEnabled(java.lang.String functionId)
Parameters:
functionId - identifier of the function
Returns:
true to enable the button, false to disable the button

isDeleteEnabled

public final boolean isDeleteEnabled(java.lang.String functionId)
Parameters:
functionId - identifier of the function
Returns:
true to enable the button, false to disable the button

isEnabled

public final boolean isEnabled(java.lang.String functionId,
                               java.lang.String buttonId)
Parameters:
functionId - identifier of the function
buttonId - button identifier, optionally setted using button id property in GenericButton
Returns:
true to enable the button, false to disable the button