Rename validators, Make forms resizable

This commit is contained in:
YNH Webdev
2013-11-10 17:22:28 +01:00
parent 40bb88a55f
commit f369b26d88
12 changed files with 83 additions and 32 deletions

View File

@@ -6,16 +6,22 @@ note
class
WSF_AGENT_VALIDATOR [G]
inherit
WSF_VALIDATOR [G]
rename
make as make_validator
end
create
make_with_agent
make
feature {NONE} -- Initialization
make_with_agent (h:like handler; e: STRING)
make (h: like handler; e: STRING)
do
make (e)
make_validator (e)
handler := h
end
@@ -23,10 +29,9 @@ feature
is_valid (input: G): BOOLEAN
do
Result := handler.item ( [input])
Result := handler.item ([input])
end
handler: FUNCTION [ANY, TUPLE [G], BOOLEAN]
handler: FUNCTION[ANY,TUPLE[G],BOOLEAN]
end

View File

@@ -10,13 +10,16 @@ class
inherit
WSF_REGEXP_VALIDATOR
rename
make as make_regexp_validator
end
create
make_decimal_validator
make
feature {NONE} -- Initialization
make_decimal_validator (e: STRING)
make (e: STRING)
-- Initialize with specified error message which will be displayed on validation failure
do
make_regexp_validator ("^[0-9]+(\.[0-9]*)?$|^\.[0-9]+$", e)

View File

@@ -10,13 +10,16 @@ class
inherit
WSF_REGEXP_VALIDATOR
rename
make as make_regexp_validator
end
create
make_email_validator
make
feature {NONE} -- Initialization
make_email_validator (e: STRING)
make (e: STRING)
-- Initialize with specified error message which will be displayed on validation failure
do
make_regexp_validator ("^[a-zA-Z0-9._%%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,6}$", e)

View File

@@ -5,24 +5,26 @@ note
revision: "$Revision$"
class
WSF_MAX_VALIDATOR [G->FINITE[ANY]]
WSF_MAX_VALIDATOR [G -> FINITE [ANY]]
inherit
WSF_VALIDATOR [G]
rename
make as make_validator
redefine
state
end
create
make_max_validator
make
feature {NONE} -- Initialization
make_max_validator (m: INTEGER; e: STRING)
make (m: INTEGER; e: STRING)
-- Initialize with specified maximum and error message which will be displayed on validation failure
do
make (e)
make_validator (e)
max := m
end

View File

@@ -5,24 +5,26 @@ note
revision: "$Revision$"
class
WSF_MIN_VALIDATOR [G->FINITE[ANY]]
WSF_MIN_VALIDATOR [G -> FINITE [ANY]]
inherit
WSF_VALIDATOR [G]
rename
make as make_validator
redefine
state
end
create
make_min_validator
make
feature {NONE} -- Initialization
make_min_validator (m: INTEGER; e: STRING)
make (m: INTEGER; e: STRING)
-- Initialize with specified minimum and error message which will be displayed on validation failure
do
make (e)
make_validator (e)
min := m
end

View File

@@ -10,6 +10,9 @@ class
inherit
WSF_REGEXP_VALIDATOR
rename
make as make_regexp_validator
end
create
make_with_message

View File

@@ -10,19 +10,21 @@ class
inherit
WSF_VALIDATOR [STRING]
rename
make as make_validator
redefine
state
end
create
make_regexp_validator
make
feature {NONE} -- Initialization
make_regexp_validator (r, e: STRING)
make (r, e: STRING)
-- Initialize with specified regular expression and error message which will be displayed on validation failure
do
make (e)
make_validator (e)
regexp_string := r
create regexp
end