Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
af3
kernel
Commits
4746cf00
Commit
4746cf00
authored
Sep 14, 2016
by
Simon Barner
Browse files
- Instead of listing the number of selected elements, print the following list of labels:
- INamedElement: getName() - otherwise: toString()
parent
e03c17cd
Changes
1
Hide whitespace changes
Inline
Side-by-side
org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/annotation/editingsupport/MultiSelectionEditingSupport.java
View file @
4746cf00
...
...
@@ -19,6 +19,7 @@ package org.fortiss.tooling.base.ui.annotation.editingsupport;
import
java.util.ArrayList
;
import
java.util.Collection
;
import
java.util.Iterator
;
import
org.eclipse.emf.ecore.EStructuralFeature
;
import
org.eclipse.jface.viewers.CellEditor
;
...
...
@@ -29,6 +30,7 @@ import org.fortiss.tooling.base.annotation.AnnotationEntry;
import
org.fortiss.tooling.base.annotation.valueprovider.EStructuralFeatureDescriptor
;
import
org.fortiss.tooling.base.model.element.IAnnotatedSpecification
;
import
org.fortiss.tooling.kernel.extension.data.ITopLevelElement
;
import
org.fortiss.tooling.kernel.model.INamedElement
;
import
org.fortiss.tooling.kernel.service.IPersistencyService
;
/**
...
...
@@ -37,7 +39,7 @@ import org.fortiss.tooling.kernel.service.IPersistencyService;
* @author barner
* @author $Author$
* @version $Rev$
* @ConQAT.Rating
GREEN
Hash:
F34CC0DE59A4E4ADC4040E26C276A653
* @ConQAT.Rating
YELLOW
Hash:
2FCECDA1772C304CCD3D3B3784749B69
*
*/
public
class
MultiSelectionEditingSupport
extends
AnnotationEditingSupportBase
{
...
...
@@ -123,11 +125,23 @@ public class MultiSelectionEditingSupport extends AnnotationEditingSupportBase {
Object
value
=
entry
.
getSpecificationValue
(
specClass
,
instanceKey
);
if
(
value
instanceof
Collection
<?>)
{
return
"["
+
((
Collection
<?>)
value
).
size
()
+
" selected]"
;
StringBuffer
valueCollectionString
=
new
StringBuffer
();
for
(
Iterator
<?>
iter
=
((
Collection
<?>)
value
).
iterator
();
iter
.
hasNext
();)
{
Object
v
=
iter
.
next
();
if
(
v
instanceof
INamedElement
)
{
valueCollectionString
.
append
(((
INamedElement
)
v
).
getName
());
}
else
{
valueCollectionString
.
append
(
v
.
toString
());
}
if
(
iter
.
hasNext
())
{
valueCollectionString
.
append
(
", "
);
}
}
return
"["
+
valueCollectionString
+
"]"
;
}
}
return
"[
0 selected
]"
;
return
"[]"
;
}
/** {@inheritDoc} */
...
...
Write
Preview
Supports
Markdown
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