Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
NomadCommandSystem
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Instrument Control
NomadCommandSystem
Commits
d6764c72
Commit
d6764c72
authored
May 24, 2019
by
Cristina Cocho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added attribute view_max_length for text widgets
parent
a83a9a61
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
28 additions
and
1 deletion
+28
-1
ChangeLog
ChangeLog
+1
-0
src/main/java/fr/ill/ics/core/property/Property.java
src/main/java/fr/ill/ics/core/property/Property.java
+10
-1
src/main/java/fr/ill/ics/core/property/PropertyFactory.java
src/main/java/fr/ill/ics/core/property/PropertyFactory.java
+3
-0
src/main/java/fr/ill/ics/core/property/parser/PropertyParser.java
.../java/fr/ill/ics/core/property/parser/PropertyParser.java
+2
-0
src/main/java/fr/ill/ics/core/property/parser/descriptor/XMLPropertyDescriptor.java
...ore/property/parser/descriptor/XMLPropertyDescriptor.java
+12
-0
No files found.
ChangeLog
View file @
d6764c72
3.2.1 29/04/2019
------
* Overwritten equals method in Property class.
* Added attribute "view_max_length" used in text widgets.
3.2.0 11/02/2019
------
...
...
src/main/java/fr/ill/ics/core/property/Property.java
View file @
d6764c72
...
...
@@ -147,6 +147,7 @@ public abstract class Property implements ServerPropertyChangeListener, ICommand
private
boolean
isCheckable
=
true
;
private
int
maxLength
;
private
int
viewMaxLength
;
private
boolean
maxLengthOnlyForTextFieldSize
=
false
;
// private long lastPropertyChangedTime;
private
String
errorMessage
;
...
...
@@ -169,7 +170,7 @@ public abstract class Property implements ServerPropertyChangeListener, ICommand
this
.
name
=
PropertyDatabase
.
getInstance
().
getPropertyName
(
id
);
maxLength
=
getDefaultMaxLength
();
viewMaxLength
=
getDefaultMaxLength
();
// Set property change listeners initial size to 2
this
.
propertyChangeListeners
=
new
HashSet
<
IPropertyChangeListener
>(
1
);
...
...
@@ -738,6 +739,10 @@ public abstract class Property implements ServerPropertyChangeListener, ICommand
public
int
getMaxLength
()
{
return
maxLength
;
}
public
int
getViewMaxLength
()
{
return
viewMaxLength
;
}
public
boolean
maxLengthOnlyForTextFieldSize
()
{
return
maxLengthOnlyForTextFieldSize
;
...
...
@@ -751,6 +756,10 @@ public abstract class Property implements ServerPropertyChangeListener, ICommand
this
.
maxLength
=
maxlength
;
}
public
void
setViewMaxLength
(
int
viewMaxLength
)
{
this
.
viewMaxLength
=
viewMaxLength
;
}
public
final
boolean
acceptsValue
(
String
value
,
boolean
isFinalValue
)
{
if
(
propertyFormat
.
verifiesValue
())
{
// the propertyFormat is in charge of the control
...
...
src/main/java/fr/ill/ics/core/property/PropertyFactory.java
View file @
d6764c72
...
...
@@ -138,6 +138,9 @@ public class PropertyFactory {
// max length
property
.
setMaxLength
(
propertyDescriptor
.
getMaxLength
());
// max view length
property
.
setViewMaxLength
(
propertyDescriptor
.
getViewMaxLength
());
// add conditions
Iterator
<
ConditionDescriptor
>
it
=
propertyDescriptor
.
getConditionsIterator
();
...
...
src/main/java/fr/ill/ics/core/property/parser/PropertyParser.java
View file @
d6764c72
...
...
@@ -77,6 +77,7 @@ public class PropertyParser extends GenericParser {
private
final
static
String
ATTRIBUTE_MAX_EXCLUDED
=
"max_excluded"
;
private
final
static
String
ATTRIBUTE_DECIMAL_FORMAT_PROPERTY_NAME
=
"property_name"
;
protected
final
static
String
ATTRIBUTE_SIZE_PROPERTY
=
"size_property"
;
protected
final
static
String
ATTRIBUTE_VIEW_MAX_LENGTH
=
"view_max_length"
;
protected
String
controllerType
;
private
Map
properties
;
// KEY=property name VALUE=PropertyDescriptor instance
...
...
@@ -102,6 +103,7 @@ public class PropertyParser extends GenericParser {
propertyDescriptor
=
new
XMLPropertyDescriptor
(
getAttribute
(
attributes
,
ATTRIBUTE_PROPERTY_NAME
),
getAttribute
(
attributes
,
ATTRIBUTE_PROPERTY_TYPE
));
propertyDescriptor
.
setMaxLength
(
getAttribute
(
attributes
,
ATTRIBUTE_MAX_LENGTH
));
propertyDescriptor
.
setUndoable
(
getAttribute
(
attributes
,
ATTRIBUTE_IS_UNDOABLE
));
propertyDescriptor
.
setViewMaxLength
(
getAttribute
(
attributes
,
ATTRIBUTE_VIEW_MAX_LENGTH
));
// Store it in the map
properties
.
put
(
propertyDescriptor
.
getPropertyName
(),
propertyDescriptor
);
...
...
src/main/java/fr/ill/ics/core/property/parser/descriptor/XMLPropertyDescriptor.java
View file @
d6764c72
...
...
@@ -37,6 +37,7 @@ public class XMLPropertyDescriptor {
private
String
format
=
PropertyParser
.
TAG_NO_FORMAT
;
private
int
nbDecimalPlaces
=
DEFAULT_NB_PLACES
;
private
String
decimalFormatPropertyName
;
private
int
viewMaxLength
=
DEFAULT_STRING_MAX_LENGTH
;
private
Set
<
ConditionDescriptor
>
conditions
=
new
HashSet
<
ConditionDescriptor
>();
// set of ConditionDescriptor instances
...
...
@@ -109,6 +110,17 @@ public class XMLPropertyDescriptor {
}
catch
(
NumberFormatException
nbe
)
{
}
}
public
int
getViewMaxLength
()
{
return
viewMaxLength
;
}
public
void
setViewMaxLength
(
String
viewMaxLength
)
{
try
{
this
.
viewMaxLength
=
Integer
.
parseInt
(
viewMaxLength
);
}
catch
(
NumberFormatException
nbe
)
{
}
}
public
int
getNbDecimalPlaces
()
{
return
nbDecimalPlaces
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment