Revision 58a9767c
Added by Katja Luther over 6 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/IntextReferenceSection.java | ||
---|---|---|
24 | 24 |
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement; |
25 | 25 |
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection; |
26 | 26 |
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection; |
27 |
import eu.etaxonomy.taxeditor.util.RichtextHelper; |
|
27 | 28 |
|
28 | 29 |
public class IntextReferenceSection extends AbstractEntityCollectionSection<LanguageString, IntextReference> { |
29 | 30 |
private ILanguageStringProvider langStringElement; |
... | ... | |
69 | 70 |
|
70 | 71 |
@Override |
71 | 72 |
public void removeElement(IntextReference element) { |
72 |
int posStart = element.getStartPos(); |
|
73 |
int posEnd = element.getEndPos(); |
|
74 |
int posFirstEnd = getEntity().getText().indexOf(">", posStart); |
|
75 |
if (posFirstEnd >-1){ |
|
76 |
String removeString = getEntity().getText().substring(posStart, posFirstEnd+1); |
|
77 |
getEntity().setText(getEntity().getText().replace("", removeString)); |
|
78 |
removeString = getEntity().getText().substring(posEnd, getEntity().getText().indexOf(">", posEnd)); |
|
79 |
getEntity().setText(getEntity().getText().replace("", removeString)); |
|
80 |
} |
|
73 |
// int posStart = element.getStartPos();
|
|
74 |
// int posEnd = element.getEndPos();
|
|
75 |
// int posFirstEnd = getEntity().getText().indexOf(">", posStart);
|
|
76 |
// if (posFirstEnd >-1){
|
|
77 |
// String removeString = getEntity().getText().substring(posStart, posFirstEnd+1);
|
|
78 |
// getEntity().setText(getEntity().getText().replace("", removeString));
|
|
79 |
// removeString = getEntity().getText().substring(posEnd, getEntity().getText().indexOf(">", posEnd));
|
|
80 |
// getEntity().setText(getEntity().getText().replace("", removeString));
|
|
81 |
// }
|
|
81 | 82 |
|
83 |
String originalString = getEntity().getText(); |
|
84 |
String cdmMarkup = RichtextHelper.createCdmMarkUp(element, ".*"); |
|
85 |
String inlineString = RichtextHelper.findInlineString(originalString, cdmMarkup); |
|
86 |
getEntity().setText(originalString.replace(inlineString, "")); |
|
82 | 87 |
getEntity().removeIntextReference(element); |
83 | 88 |
|
84 | 89 |
langStringElement.setLanguageString(getEntity()); |
Also available in: Unified diff
remove the remove button for the selection and first implementation for removing intext reference