001: // @@
002: // @@
003: /*
004: * Wi.Ser Framework
005: *
006: * Version: 1.8.1, 20-September-2007
007: * Copyright (C) 2005 Dirk von der Weiden <dvdw@imail.de>
008: *
009: * This library is free software; you can redistribute it and/or
010: * modify it under the terms of the GNU Lesser General Public
011: * License as published by the Free Software Foundation; either
012: * version 2 of the License, or (at your option) any later version.
013: *
014: * This library is distributed in the hope that it will be useful,
015: * but WITHOUT ANY WARRANTY; without even the implied warranty of
016: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
017: * Lesser General Public License for more details.
018: *
019: * You should have received a copy of the GNU Lesser General Public
020: * License along with this library located in LGPL.txt in the
021: * license directory; if not, write to the
022: * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
023: * Boston, MA 02111-1307, USA.
024: *
025: * If this agreement does not cover your requirements, please contact us
026: * via email to get detailed information about the commercial license
027: * or our service offerings!
028: *
029: */
030: // @@
031: package de.ug2t.unifiedGui.wizard;
032:
033: import java.util.*;
034:
035: import de.ug2t.unifiedGui.interfaces.*;
036: import de.ug2t.unifiedGui.plugins.*;
037: import de.ug2t.unifiedGui.validator.*;
038:
039: abstract public class ADialogPlugin extends PlBasicComponentAggregat {
040: private HashMap pem_mandatory = null;
041: private HashMap pem_validation = null;
042:
043: public void pcmf_addMandatory(String xPlLocalName,
044: IUnComponent xComp) {
045: if (this .pem_mandatory == null)
046: this .pem_mandatory = new HashMap();
047:
048: this .pem_mandatory.put(xPlLocalName, xComp);
049: }
050:
051: public ArrayList pcmf_getAllMandatorys() {
052: if (this .pem_mandatory == null)
053: return (null);
054:
055: return (new ArrayList(this .pem_mandatory.values()));
056: }
057:
058: public ArrayList pcmf_getAllMandatoryLocalNames() {
059: if (this .pem_mandatory == null)
060: return (null);
061:
062: return (new ArrayList(this .pem_mandatory.keySet()));
063: }
064:
065: public Map pcmf_getAllMandatoryMap() {
066: if (this .pem_mandatory == null)
067: return (null);
068:
069: return ((Map) this .pem_mandatory.clone());
070: }
071:
072: public void pcmf_removeMandatory(String xName) {
073: if (this .pem_mandatory == null)
074: return;
075:
076: this .pem_mandatory.remove(xName);
077: }
078:
079: public void pcmf_clearMandatory() {
080: if (this .pem_mandatory == null)
081: return;
082:
083: this .pem_mandatory.clear();
084: }
085:
086: public boolean pcmf_isMandatory(String xPlName) {
087: return (this .pem_mandatory.get(xPlName) != null ? true : false);
088: }
089:
090: public class ValidationPair {
091: public IUnComponent pcm_toValidate = null;
092: public AUnValidator pcm_validator = null;
093:
094: ValidationPair(IUnComponent xToValidate, AUnValidator xValidator) {
095: this .pcm_toValidate = xToValidate;
096: this .pcm_validator = xValidator;
097: }
098: }
099:
100: public void pcmf_addValidator(String xPlLocalName,
101: IUnComponent xComp, AUnValidator xValid) {
102: if (this .pem_validation == null)
103: this .pem_validation = new HashMap();
104:
105: this .pem_validation.put(xPlLocalName, new ValidationPair(xComp,
106: xValid));
107: }
108:
109: public ArrayList pcmf_getAllValidations() {
110: if (this .pem_validation == null)
111: return (null);
112:
113: return (new ArrayList(this .pem_validation.values()));
114: }
115:
116: public ArrayList pcmf_getAllValidationLocalNames() {
117: if (this .pem_validation == null)
118: return (null);
119:
120: return (new ArrayList(this .pem_validation.keySet()));
121: }
122:
123: public Map pcmf_getAllValidationsMap() {
124: if (this .pem_validation == null)
125: return (null);
126:
127: return ((Map) this .pem_validation.clone());
128: }
129:
130: public void pcmf_removeValidators(String xName) {
131: if (this .pem_validation == null)
132: return;
133:
134: this .pem_validation.remove(xName);
135: }
136:
137: public void pcmf_clearValidators() {
138: if (this.pem_validation == null)
139: return;
140:
141: this.pem_validation.clear();
142: }
143: }
|