Revision b86c0b46
Added by Patrick Plitzner over 5 years ago
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/character/CharacterEditor.java | ||
---|---|---|
57 | 57 |
import eu.etaxonomy.cdm.model.description.FeatureTree; |
58 | 58 |
import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap; |
59 | 59 |
import eu.etaxonomy.taxeditor.editor.AppModelId; |
60 |
import eu.etaxonomy.taxeditor.editor.l10n.Messages; |
|
60 | 61 |
import eu.etaxonomy.taxeditor.featuretree.e4.FeatureNodeDragListener; |
61 | 62 |
import eu.etaxonomy.taxeditor.featuretree.e4.FeatureNodeDropAdapter; |
62 | 63 |
import eu.etaxonomy.taxeditor.featuretree.e4.FeatureTreeEditorComposite; |
... | ... | |
131 | 132 |
|
132 | 133 |
structuresTreeEditorComposite = addFeatureTreeEditor(composite); |
133 | 134 |
initFeatureTreeComposite(structuresTreeEditorComposite, null, null); |
134 |
structuresTreeEditorComposite.getLabel_title().setText("Structures");
|
|
135 |
structuresTreeEditorComposite.getLabel_title().setText(Messages.CharacterEditor_STRUCTURES);
|
|
135 | 136 |
|
136 | 137 |
Composite composite_1 = new Composite(sashForm, SWT.NONE); |
137 | 138 |
formToolkit.adapt(composite_1); |
... | ... | |
142 | 143 |
|
143 | 144 |
propertiesTreeEditorComposite = addFeatureTreeEditor(composite_1); |
144 | 145 |
initFeatureTreeComposite(propertiesTreeEditorComposite, new CharacterDragListener(structuresTreeEditorComposite.getViewer(), propertiesTreeEditorComposite.getViewer()), null); |
145 |
propertiesTreeEditorComposite.getLabel_title().setText("Properties");
|
|
146 |
propertiesTreeEditorComposite.getLabel_title().setText(Messages.CharacterEditor_PROPERTIES);
|
|
146 | 147 |
|
147 | 148 |
Composite composite_3 = new Composite(sashForm, SWT.NONE); |
148 | 149 |
formToolkit.adapt(composite_3); |
... | ... | |
152 | 153 |
composite_3.setLayout(gl_composite_3); |
153 | 154 |
|
154 | 155 |
btnAddCharacter = new Button(composite_3, SWT.NONE); |
155 |
btnAddCharacter.setText(">>"); |
|
156 |
btnAddCharacter.setText(">>"); //$NON-NLS-1$
|
|
156 | 157 |
formToolkit.adapt(btnAddCharacter, true, true); |
157 | 158 |
|
158 | 159 |
characterTreeEditorComposite = addFeatureTreeEditor(composite_3); |
159 | 160 |
initFeatureTreeComposite(characterTreeEditorComposite, new FeatureNodeDragListener(characterTreeEditorComposite.getViewer()), new CharacterDropAdapter(this, characterTreeEditorComposite.getViewer())); |
160 |
characterTreeEditorComposite.getLabel_title().setText("Characters");
|
|
161 |
characterTreeEditorComposite.getLabel_title().setText(Messages.CharacterEditor_CHARACTERS);
|
|
161 | 162 |
|
162 | 163 |
//add context menu to character viewer//create context menu |
163 | 164 |
menuService.registerContextMenu(characterTreeEditorComposite.getViewer().getControl(), |
... | ... | |
201 | 202 |
ISelection structureTreeSelection = structuresTreeEditorComposite.getViewer().getSelection(); |
202 | 203 |
ISelection propertyTreeSelection = propertiesTreeEditorComposite.getViewer().getSelection(); |
203 | 204 |
if(structureTreeSelection==null || propertyTreeSelection==null || characterTreeEditorComposite.getFeatureTree()==null){ |
204 |
MessagingUtils.warningDialog("Cannot perform action", CharacterEditor.this,
|
|
205 |
"You have to select a structure, a property and a feature tree to perform this action.");
|
|
205 |
MessagingUtils.warningDialog(Messages.CharacterEditor_CANNOT_PERFORM_TITLE, CharacterEditor.this,
|
|
206 |
Messages.CharacterEditor_CANNOT_PERFORM_MESSAGE);
|
|
206 | 207 |
return; |
207 | 208 |
} |
208 | 209 |
List<Character> characters = createCharacters((TreeSelection)structureTreeSelection, (TreeSelection)propertyTreeSelection); |
... | ... | |
230 | 231 |
while(propertiesIterator.hasNext()){ |
231 | 232 |
FeatureNode propertyNode = propertiesIterator.next(); |
232 | 233 |
//create new Character |
233 |
String label = structureNode.getFeature().generateTitle()+" "+propertyNode.getFeature().generateTitle(); |
|
234 |
Character character = Character.NewInstance(structureNode, propertyNode, "", label, label); |
|
234 |
String label = structureNode.getFeature().generateTitle()+" "+propertyNode.getFeature().generateTitle(); //$NON-NLS-1$
|
|
235 |
Character character = Character.NewInstance(structureNode, propertyNode, "", label, label); //$NON-NLS-1$
|
|
235 | 236 |
characters.add(HibernateProxyHelper.deproxy(CdmStore.getService(ITermService.class).save(character), Character.class)); |
236 | 237 |
} |
237 | 238 |
} |
Also available in: Unified diff
ref #7923 i18n