Revision 6735a2ab src/gr/ebs/gss/client/AbstractPropertiesDialog.java
b/src/gr/ebs/gss/client/AbstractPropertiesDialog.java | ||
---|---|---|
30 | 30 |
import com.google.gwt.event.dom.client.KeyCodes; |
31 | 31 |
import com.google.gwt.user.client.DeferredCommand; |
32 | 32 |
import com.google.gwt.user.client.Event.NativePreviewEvent; |
33 |
import com.google.gwt.user.client.ui.Anchor; |
|
33 | 34 |
import com.google.gwt.user.client.ui.DialogBox; |
34 | 35 |
import com.google.gwt.user.client.ui.FlowPanel; |
35 |
import com.google.gwt.user.client.ui.HTML;
|
|
36 |
import com.google.gwt.user.client.ui.Label;
|
|
36 | 37 |
import com.google.gwt.user.client.ui.TabPanel; |
37 | 38 |
import com.google.gwt.user.client.ui.TextBox; |
38 | 39 |
|
... | ... | |
85 | 86 |
allTagsContent.clear(); |
86 | 87 |
TagsResource tagr = getResult(); |
87 | 88 |
List<String> userTags = tagr.getTags(); |
88 |
HTML tag = null;
|
|
89 |
Anchor tag = null;
|
|
89 | 90 |
for(String usrTag : userTags){ |
90 |
tag = new HTML(usrTag.toString()+" ", true);
|
|
91 |
tag = new Anchor(usrTag.toString(), false);
|
|
91 | 92 |
tag.addStyleName("gss-tag"); |
92 | 93 |
allTagsContent.add(tag); |
93 |
tag.addClickHandler( new ClickHandler() { |
|
94 |
|
|
94 |
Label separator = new Label(", "); |
|
95 |
separator.addStyleName("gss-tag"); |
|
96 |
allTagsContent.add(separator); |
|
97 |
tag.addClickHandler(new ClickHandler() { |
|
98 |
|
|
95 | 99 |
@Override |
96 | 100 |
public void onClick(ClickEvent event) { |
97 | 101 |
String existing = tags.getText(); |
98 | 102 |
if (MULTIPLE_VALUES_TEXT.equals(existing)) existing = ""; |
99 |
String newTag = ((HTML) event.getSource()).getText().trim();
|
|
103 |
String newTag = ((Anchor) event.getSource()).getText().trim();
|
|
100 | 104 |
// insert the new tag only if it is not in the list |
101 | 105 |
// already |
102 | 106 |
if (existing.indexOf(newTag) == -1 && !existing.trim().endsWith(newTag)) |
Also available in: Unified diff