Added comments to autocompletion, input, navbar, progressbar, validator, webcontrol. Some more little changes.

This commit is contained in:
Severin Münger
2013-09-21 23:01:36 +02:00
parent 252b5ff758
commit 57dd4ce259
33 changed files with 232 additions and 138 deletions

View File

@@ -14,9 +14,10 @@ inherit
create
make_decimal_validator
feature {NONE}
feature {NONE} -- Initialization
make_decimal_validator (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)
end

View File

@@ -14,9 +14,10 @@ inherit
create
make_email_validator
feature {NONE}
feature {NONE} -- Initialization
make_email_validator (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)
end

View File

@@ -17,9 +17,10 @@ inherit
create
make_max_validator
feature {NONE}
feature {NONE} -- Initialization
make_max_validator (m: INTEGER; e: STRING)
-- Initialize with specified maximum and error message which will be displayed on validation failure
do
make (e)
max := m
@@ -32,7 +33,7 @@ feature -- Implementation
Result := input.count < max or input.count = max
end
feature
feature -- State
state: JSON_OBJECT
do
@@ -40,6 +41,9 @@ feature
Result.put (create {JSON_NUMBER}.make_integer (max), "max")
end
feature -- Properties
max: INTEGER
-- The maximal allowed value
end

View File

@@ -5,10 +5,11 @@ note
revision: "$Revision$"
class
WSF_MIN_VALIDATOR[G]
WSF_MIN_VALIDATOR [G]
inherit
WSF_VALIDATOR [LIST[G]]
WSF_VALIDATOR [LIST [G]]
redefine
state
end
@@ -16,9 +17,10 @@ inherit
create
make_min_validator
feature {NONE}
feature {NONE} -- Initialization
make_min_validator (m:INTEGER; e: STRING)
make_min_validator (m: INTEGER; e: STRING)
-- Initialize with specified minimum and error message which will be displayed on validation failure
do
make (e)
min := m
@@ -26,13 +28,12 @@ feature {NONE}
feature -- Implementation
is_valid (input:LIST[G]): BOOLEAN
is_valid (input: LIST [G]): BOOLEAN
do
Result:= input.count > min or input.count = min
Result := input.count > min or input.count = min
end
feature
feature -- State
state: JSON_OBJECT
do
@@ -40,6 +41,9 @@ feature
Result.put (create {JSON_NUMBER}.make_integer (min), "min")
end
feature -- Propertiess
min: INTEGER
-- The minimal allowed value
end

View File

@@ -14,9 +14,10 @@ inherit
create
make_with_message
feature {NONE}
feature {NONE} -- Initialization
make_with_message (e: STRING)
-- Initialize with specified error message which will be displayed on validation failure
do
make_regexp_validator ("", e)
end

View File

@@ -17,9 +17,10 @@ inherit
create
make_regexp_validator
feature {NONE}
feature {NONE} -- Initialization
make_regexp_validator (r, e: STRING)
-- Initialize with specified regular expression and error message which will be displayed on validation failure
do
make (e)
regexp_string := r
@@ -37,7 +38,7 @@ feature -- Implementation
Result := regexp.matches (input)
end
feature
feature -- State
state: JSON_OBJECT
do
@@ -47,6 +48,8 @@ feature
Result.put (create {JSON_STRING}.make_json (error), "error")
end
feature -- Properties
regexp_string: STRING
regexp: REGULAR_EXPRESSION

View File

@@ -7,13 +7,15 @@ note
deferred class
WSF_VALIDATABLE
feature
feature -- Specification
validate
-- Perform validation
deferred
end
is_valid: BOOLEAN
-- Result of last validation
deferred
end

View File

@@ -7,16 +7,18 @@ note
deferred class
WSF_VALIDATOR [G]
feature {NONE}
feature {NONE} -- Initialization
make (e: STRING)
-- Initialize with specified error message to be displayed on validation failure
do
error := e
end
feature
feature -- Access
state: JSON_OBJECT
-- JSON state of this validator
do
create Result.make
Result.put (create {JSON_STRING}.make_json (generator), "name")
@@ -24,9 +26,12 @@ feature
end
is_valid (input: G): BOOLEAN
-- Perform validation on given input and tell whether validation was successful or not
deferred
end
feature -- Properties
error: STRING
end