| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||||||
| AuditFieldEditorBean |
|
| 0.0;0 |
| 1 | /* |
|
| 2 | * ============================================================================ |
|
| 3 | * GNU Lesser General Public License |
|
| 4 | * ============================================================================ |
|
| 5 | * |
|
| 6 | * Taylor - The Java Enterprise Application Framework. |
|
| 7 | * Copyright (C) 2005 John Gilbert jgilbert01@users.sourceforge.net |
|
| 8 | * |
|
| 9 | * This library is free software; you can redistribute it and/or |
|
| 10 | * modify it under the terms of the GNU Lesser General Public |
|
| 11 | * License as published by the Free Software Foundation; either |
|
| 12 | * version 2.1 of the License, or (at your option) any later version. |
|
| 13 | * |
|
| 14 | * This library is distributed in the hope that it will be useful, |
|
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
| 17 | * Lesser General Public License for more details. |
|
| 18 | * |
|
| 19 | * You should have received a copy of the GNU Lesser General Public |
|
| 20 | * License along with this library; if not, write to the Free Software |
|
| 21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. |
|
| 22 | * |
|
| 23 | * John Gilbert |
|
| 24 | * Email: jgilbert01@users.sourceforge.net |
|
| 25 | */ |
|
| 26 | package net.taylor.audit.entity.editor; |
|
| 27 | ||
| 28 | import javax.ejb.Stateful; |
|
| 29 | ||
| 30 | import net.taylor.audit.entity.AuditField; |
|
| 31 | import net.taylor.audit.entity.editor.AuditEntryFinderBean.AuditEntryComboBox; |
|
| 32 | import net.taylor.richfaces.RootTreeNode; |
|
| 33 | import net.taylor.seam.AbstractEditorBean; |
|
| 34 | import net.taylor.seam.ComboBox; |
|
| 35 | ||
| 36 | import org.jboss.seam.ScopeType; |
|
| 37 | import org.jboss.seam.annotations.Factory; |
|
| 38 | import org.jboss.seam.annotations.Name; |
|
| 39 | import org.jboss.seam.annotations.Out; |
|
| 40 | ||
| 41 | /** |
|
| 42 | * The implementation of the Editor interface. |
|
| 43 | * |
|
| 44 | * @author jgilbert |
|
| 45 | * @generated |
|
| 46 | */ |
|
| 47 | @Name("auditFieldEditor") |
|
| 48 | @Stateful |
|
| 49 | 15 | public class AuditFieldEditorBean extends AbstractEditorBean< AuditField > implements AuditFieldEditor { |
| 50 | /** @generated */ |
|
| 51 | private static final long serialVersionUID = 1L; |
|
| 52 | ||
| 53 | /** @generated */ |
|
| 54 | public RootTreeNode initAuditFieldTree() { |
|
| 55 | 12 | return initRoot(new AuditFieldTreeNode(null, getInstance())); |
| 56 | } |
|
| 57 | ||
| 58 | /** @generated */ |
|
| 59 | @Factory(value="auditField", scope=ScopeType.EVENT, autoCreate=true) |
|
| 60 | public AuditField initAuditField() { |
|
| 61 | 12 | return getInstance(); |
| 62 | } |
|
| 63 | ||
| 64 | /** @generated */ |
|
| 65 | @Override |
|
| 66 | protected AuditField createInstance() { |
|
| 67 | 6 | AuditField result = new AuditField(); |
| 68 | // result.setUser(getCurrentUserName()); |
|
| 69 | 6 | return result; |
| 70 | } |
|
| 71 | ||
| 72 | /** @generated */ |
|
| 73 | public boolean isSimpleEntity() { |
|
| 74 | 153 | return true; |
| 75 | } |
|
| 76 | ||
| 77 | /** @generated */ |
|
| 78 | protected void prePersist() { |
|
| 79 | 3 | super.prePersist(); |
| 80 | 3 | if (getInstance().getEntry() != null) { |
| 81 | 0 | getInstance().getEntry().addField(getInstance()); |
| 82 | } |
|
| 83 | 3 | } |
| 84 | ||
| 85 | /** @generated */ |
|
| 86 | protected void preRemove() { |
|
| 87 | 3 | super.preRemove(); |
| 88 | 3 | if (getInstance().getEntry() != null) { |
| 89 | 0 | getInstance().getEntry().removeField(getInstance()); |
| 90 | } |
|
| 91 | 3 | } |
| 92 | ||
| 93 | /** |
|
| 94 | * ------------------------------------------------------------------------ |
|
| 95 | * --- Entry ManyToOne Association |
|
| 96 | * ------------------------------------------------------------------------ |
|
| 97 | * |
|
| 98 | * @generated |
|
| 99 | */ |
|
| 100 | @Out |
|
| 101 | 9 | private ComboBox entryComboBox = new AuditEntryComboBox<AuditFieldEditor, AuditField>(this, "entry") { |
| 102 | 9 | public boolean isRendered() { |
| 103 | 0 | return getComponent().isTop(); |
| 104 | } |
|
| 105 | }; |
|
| 106 | } |