Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
comete
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software Control System
Libraries
java
comete
Commits
840c553b
Commit
840c553b
authored
7 months ago
by
Raphael GIRARDOT
Browse files
Options
Downloads
Patches
Plain Diff
Added the possibility to set received text array as value list (useful for JAVAAPI-646)
parent
00212696
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
CometeSwing/src/main/java/fr/soleil/comete/swing/ComboBox.java
+39
-2
39 additions, 2 deletions
...eSwing/src/main/java/fr/soleil/comete/swing/ComboBox.java
with
39 additions
and
2 deletions
CometeSwing/src/main/java/fr/soleil/comete/swing/ComboBox.java
+
39
−
2
View file @
840c553b
...
@@ -63,7 +63,7 @@ import fr.soleil.lib.project.swing.ui.OpaqueAdaptedComboBoxUI;
...
@@ -63,7 +63,7 @@ import fr.soleil.lib.project.swing.ui.OpaqueAdaptedComboBoxUI;
*/
*/
public
class
ComboBox
extends
DynamicRenderingComboBox
<
Object
>
implements
IComboBox
,
IErrorNotifiableTarget
{
public
class
ComboBox
extends
DynamicRenderingComboBox
<
Object
>
implements
IComboBox
,
IErrorNotifiableTarget
{
private
static
final
long
serialVersionUID
=
-
2004666899812180381
L
;
private
static
final
long
serialVersionUID
=
4840821474974790614
L
;
private
final
Collection
<
IComboBoxListener
>
comboBoxListeners
;
private
final
Collection
<
IComboBoxListener
>
comboBoxListeners
;
private
int
horizontalAlignment
;
private
int
horizontalAlignment
;
...
@@ -75,6 +75,7 @@ public class ComboBox extends DynamicRenderingComboBox<Object> implements ICombo
...
@@ -75,6 +75,7 @@ public class ComboBox extends DynamicRenderingComboBox<Object> implements ICombo
protected
volatile
boolean
fieldEditable
;
protected
volatile
boolean
fieldEditable
;
protected
volatile
boolean
popupDisplayable
;
protected
volatile
boolean
popupDisplayable
;
protected
volatile
boolean
linkPopupVisibilityWithEditable
;
protected
volatile
boolean
linkPopupVisibilityWithEditable
;
protected
boolean
possibleValuesInTextArray
;
private
final
boolean
initialized
;
private
final
boolean
initialized
;
private
final
ErrorNotificationDelegate
errorNotificationDelegate
;
private
final
ErrorNotificationDelegate
errorNotificationDelegate
;
...
@@ -86,6 +87,7 @@ public class ComboBox extends DynamicRenderingComboBox<Object> implements ICombo
...
@@ -86,6 +87,7 @@ public class ComboBox extends DynamicRenderingComboBox<Object> implements ICombo
fieldEditable
=
super
.
isEditable
();
fieldEditable
=
super
.
isEditable
();
popupDisplayable
=
true
;
popupDisplayable
=
true
;
linkPopupVisibilityWithEditable
=
true
;
linkPopupVisibilityWithEditable
=
true
;
possibleValuesInTextArray
=
false
;
valueLock
=
new
Object
();
valueLock
=
new
Object
();
editing
=
false
;
editing
=
false
;
// Here, we use WeakHashMap to avoid memory leaks
// Here, we use WeakHashMap to avoid memory leaks
...
@@ -161,6 +163,37 @@ public class ComboBox extends DynamicRenderingComboBox<Object> implements ICombo
...
@@ -161,6 +163,37 @@ public class ComboBox extends DynamicRenderingComboBox<Object> implements ICombo
}
}
}
}
/**
* Returns whether {@link #setStringArray(String[])} method will set possible values.<br />
* <code>false</code> by default.
*
* @return Whether {@link #setStringArray(String[])} method will set possible values.
* <ul>
* <li>If <code>true</code>, {@link #setStringArray(String[])} will call
* {@link #setValueList(Object...)}.</li>
* <li>If <code>false</code>, {@link #setStringArray(String[])} will call
* {@link #setDisplayedList(String...)}.</li>
* </ul>
*/
public
boolean
isPossibleValuesInTextArray
()
{
return
possibleValuesInTextArray
;
}
/**
* Sets whether {@link #setStringArray(String[])} method will set possible values.
*
* @param possibleValuesInTextArray Whether {@link #setStringArray(String[])} method will set possible values.
* <ul>
* <li>If <code>true</code>, {@link #setStringArray(String[])} will call
* {@link #setValueList(Object...)}.</li>
* <li>If <code>false</code>, {@link #setStringArray(String[])} will call
* {@link #setDisplayedList(String...)}.</li>
* </ul>
*/
public
void
setPossibleValuesInTextArray
(
boolean
possibleValuesInTextArray
)
{
this
.
possibleValuesInTextArray
=
possibleValuesInTextArray
;
}
@Override
@Override
public
void
setEditable
(
boolean
editable
)
{
public
void
setEditable
(
boolean
editable
)
{
if
(
this
.
editable
!=
editable
)
{
if
(
this
.
editable
!=
editable
)
{
...
@@ -413,8 +446,12 @@ public class ComboBox extends DynamicRenderingComboBox<Object> implements ICombo
...
@@ -413,8 +446,12 @@ public class ComboBox extends DynamicRenderingComboBox<Object> implements ICombo
@Override
@Override
public
void
setStringArray
(
String
[]
value
)
{
public
void
setStringArray
(
String
[]
value
)
{
if
(
isPossibleValuesInTextArray
())
{
setObjectArray
(
value
);
}
else
{
setDisplayedList
(
value
);
setDisplayedList
(
value
);
}
}
}
@Override
@Override
public
Object
[]
getObjectArray
()
{
public
Object
[]
getObjectArray
()
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment