ref #9393: disable sec selection if reused taxon is used
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / ui / section / classification / TaxonNodeDetailElement.java
1 /**
2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
5 *
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
8 */
9 package eu.etaxonomy.taxeditor.ui.section.classification;
10
11 import java.util.ArrayList;
12 import java.util.Collection;
13 import java.util.HashMap;
14 import java.util.Map;
15
16 import org.apache.commons.lang3.StringUtils;
17 import org.eclipse.jface.resource.JFaceResources;
18 import org.eclipse.swt.SWT;
19 import org.eclipse.swt.graphics.Font;
20 import org.eclipse.swt.widgets.Control;
21 import org.eclipse.swt.widgets.Label;
22 import org.eclipse.swt.widgets.Text;
23
24 import eu.etaxonomy.cdm.common.CdmUtils;
25 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
26 import eu.etaxonomy.cdm.model.common.Language;
27 import eu.etaxonomy.cdm.model.common.LanguageString;
28 import eu.etaxonomy.cdm.model.description.DescriptionElementSource;
29 import eu.etaxonomy.cdm.model.metadata.CdmPreference;
30 import eu.etaxonomy.cdm.model.metadata.PreferencePredicate;
31 import eu.etaxonomy.cdm.model.metadata.PublishEnum;
32 import eu.etaxonomy.cdm.model.name.TaxonName;
33 import eu.etaxonomy.cdm.model.reference.Reference;
34 import eu.etaxonomy.cdm.model.taxon.Classification;
35 import eu.etaxonomy.cdm.model.taxon.Taxon;
36 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
37 import eu.etaxonomy.cdm.model.taxon.TaxonNodeStatus;
38 import eu.etaxonomy.taxeditor.l10n.Messages;
39 import eu.etaxonomy.taxeditor.model.AbstractUtility;
40 import eu.etaxonomy.taxeditor.preference.CdmPreferenceCache;
41 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
42 import eu.etaxonomy.taxeditor.preference.Resources;
43 import eu.etaxonomy.taxeditor.store.CdmStore;
44 import eu.etaxonomy.taxeditor.store.StoreUtil;
45 import eu.etaxonomy.taxeditor.ui.combo.EnumComboElement;
46 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
47 import eu.etaxonomy.taxeditor.ui.element.CheckboxElement;
48 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
49 import eu.etaxonomy.taxeditor.ui.element.IEnableableFormElement;
50 import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
51 import eu.etaxonomy.taxeditor.ui.element.MultilanguageTextElement;
52 import eu.etaxonomy.taxeditor.ui.element.SelectionArbitrator;
53 import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
54 import eu.etaxonomy.taxeditor.ui.section.supplemental.AbstractSingleSourceElement;
55 import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
56 import eu.etaxonomy.taxeditor.ui.selection.TaxonNodeSelectionElement;
57
58 /**
59 * @author n.hoffmann
60 * @created Sep 27, 2010
61 */
62 public class TaxonNodeDetailElement extends AbstractSingleSourceElement<TaxonNode> {
63
64 private static final String STATUS_NOTES = Messages.TaxonNodeWizardPage_STATUS_NOTES;
65 private static final String CLASSIFICATION_STR = Messages.TaxonNodeWizardPage_CLASSIFICATION;
66 private static final String REUSE_EXISTING_TAXON = Messages.TaxonNodeWizardPage_REUSE_EXISTING_TAXON;
67 private static final String REUSE_EXISTING_NAME = Messages.TaxonNodeWizardPage_REUSE_EXISTING_NAME;
68 private static final String SECUNDUM_REFERENCE = Messages.TaxonNodeWizardPage_SECUNDUM_REFERENCE;
69
70 private static final Font FONT_BOLD = JFaceResources.getFontRegistry().getBold(JFaceResources.DEFAULT_FONT);
71
72 private boolean createNew = false;
73 private Classification classification;
74 private TaxonNode parentNode;
75 private Taxon taxon;
76 private boolean complete;
77 private TaxonNodeStatus status = null;
78 private Map<Language, LanguageString> multilanguageTextCache;
79
80 private TaxonNodeSelectionElement selection_parentTaxonNode;
81 private EntitySelectionElement<Taxon> selection_reuseExistingTaxon;
82 private EntitySelectionElement<TaxonName> selection_reuseExistingName;
83 private EntitySelectionElement<Reference> selection_SecRef;
84
85 // private OriginalSourceElement singleSourceSection;
86
87 private TextWithLabelElement textTaxonSec;
88 private TextWithLabelElement microReference;
89 private TextWithLabelElement textNewTaxonName;
90 private TaxonNodeAgentRelationCollectionSection selectionNodeAgentRelation;
91 private EnumComboElement<TaxonNodeStatus> combo_status;
92 private CheckboxElement checkbox_publish;
93 private MultilanguageTextElement multiLanguageTextStatusNotes;
94 String defaultPublish;
95
96 public TaxonNodeDetailElement(CdmFormFactory formFactory,
97 ICdmFormElement formElement, boolean isCreateNew) {
98 super(formFactory, formElement);
99 createNew = isCreateNew;
100 }
101
102 public Map<Language, LanguageString> getMultiLanguageTextExcludedNotes() {
103 return multiLanguageTextStatusNotes.getMultilanguageText();
104 }
105
106 public TaxonNodeStatus getTaxonNodeStatus(){
107 return status;
108 }
109
110 public Reference getRef() {
111 return getEntity().getCitation();
112 }
113 public TaxonName getExistingName() {
114 return selection_reuseExistingName.getEntity();
115 }
116 public String getMicroReference() {
117 return microReference.getText();
118 }
119
120 @Override
121 public void createControls(ICdmFormElement formElement,TaxonNode entity, int style) {
122 // taxon = entity.getTaxon();
123
124 Label taxonTitle = new Label(getLayoutComposite(), SWT.NULL);
125 taxonTitle.setText(Messages.TaxonNodeWizardPage_TAXON_INFORMATION);
126 taxonTitle.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
127 taxonTitle.setFont(FONT_BOLD);
128
129
130
131 if (isCreateNew()){
132 textNewTaxonName = formFactory.createTextWithLabelElement(formElement,
133 Messages.TaxonNodeWizardPage_NEW_TAXON, "", style);
134 textNewTaxonName.setFocus();
135 textNewTaxonName.setIndent(10);
136
137 selection_reuseExistingTaxon = formFactory
138 .createSelectionElement(Taxon.class,//getConversationHolder(),
139 formElement,
140 REUSE_EXISTING_TAXON, null,
141 EntitySelectionElement.DELETABLE, style);
142 selection_reuseExistingTaxon.setIndent(10);
143 selection_reuseExistingName = formFactory
144 .createSelectionElement(TaxonName.class,//getConversationHolder(),
145 formElement,
146 REUSE_EXISTING_NAME, taxon != null? taxon.getName(): null,
147 EntitySelectionElement.DELETABLE, style);
148 selection_reuseExistingName.setIndent(10);
149 selection_SecRef = formFactory
150 .createSelectionElement(Reference.class,//getConversationHolder(),
151 formElement, SECUNDUM_REFERENCE, taxon != null? taxon.getSec(): null,
152 EntitySelectionElement.DELETABLE, style, 100);
153 selection_SecRef.setIndent(10);
154 microReference = formFactory.createTextWithLabelElement(formElement, "Secundum Details", "", style);
155
156 microReference.setIndent(10);
157 checkbox_publish = formFactory.createCheckbox(formElement,
158 Messages.TaxonNodeWizardPage_TAXON_IS_PUBLISH, true, style);
159
160 checkbox_publish.setEnabled(isCreateNew());
161 checkbox_publish.setIndent(10);
162 Label spacer = new Label(getLayoutComposite(), SWT.NULL);
163 spacer.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 2));
164 Label nodeTitle = new Label(getLayoutComposite(), SWT.NULL);
165 nodeTitle.setText("Taxon Node");
166 nodeTitle.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
167 nodeTitle.setFont(FONT_BOLD);
168 // LabelElement nodeTitle = formFactory.createLabel(formElement, Messages.TaxonNodeWizardPage_TAXON_INFORMATION);
169 // nodeTitle.setLayout(LayoutConstants.FILL_HORIZONTALLY(2, 1));
170 // nodeTitle.setBackground(getPersistentBackground());
171 // nodeTitle.setBold();
172
173 selection_parentTaxonNode = formFactory
174 .createTaxonNodeSelectionElement(getConversationHolder(), formElement, Messages.TaxonNodeWizardPage_PARENT, parentNode,
175 EntitySelectionElement.SELECTABLE, style, 100);
176 selection_parentTaxonNode.setIndent(10);
177 selection_parentTaxonNode.setEnabled(false);
178
179
180
181 }else{
182 taxon = getEntity().getTaxon();
183 selection_reuseExistingTaxon = formFactory
184 .createSelectionElement(Taxon.class, formElement,
185 Messages.TaxonNodeWizardPage_TAXON, taxon,
186 EntitySelectionElement.DELETABLE, SWT.NULL);
187
188 selection_reuseExistingTaxon.setIndent(10);
189 textTaxonSec = formFactory.createTextWithLabelElement(formElement,SECUNDUM_REFERENCE, "", SWT.NULL);
190 textTaxonSec.setIndent(10);
191 microReference = formFactory.createTextWithLabelElement(formElement, "Secundum Details", "", SWT.NULL);
192 microReference.setIndent(10);
193
194 if (entity.getTaxon().getSec() != null){
195 textTaxonSec.setText(taxon.getSec().getTitleCache());
196 }
197 textTaxonSec.setEnabled(false);
198 microReference.setEnabled(false);
199 Label spacer = new Label(getLayoutComposite(), SWT.NULL);
200 spacer.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 2));
201
202 Label nodeTitle = new Label(getLayoutComposite(), SWT.NULL);
203 nodeTitle.setText("Taxon Node");
204 nodeTitle.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
205 nodeTitle.setFont(FONT_BOLD);
206
207 // LabelElement nodeTitle = formFactory.createLabel(formElement, "Taxon Node");
208 // nodeTitle.setLayout(LayoutConstants.FILL_HORIZONTALLY(2, 1));
209 // nodeTitle.setBackground(getPersistentBackground());
210 // nodeTitle.setBold();
211
212
213 if (entity.getParent().getTaxon() == null){
214 TextWithLabelElement textParent = formFactory.createTextWithLabelElement(
215 formElement,CLASSIFICATION_STR, entity.getClassification().getTitleCache(), SWT.NULL);
216 textParent.setEnabled(false);
217 textParent.setIndent(10);
218 }else{
219 TextWithLabelElement textParent = formFactory.createTextWithLabelElement(
220 formElement, Messages.TaxonNodeWizardPage_PARENT, entity.getParent().getTaxon().getTitleCache(), SWT.NULL);
221 textParent.setEnabled(false);
222 textParent.setIndent(10);
223 }
224 }
225
226
227 combo_status = formFactory.createEnumComboElement(TaxonNodeStatus.class, formElement, SWT.NULL, true);
228 if (!isCreateNew()){
229 combo_status.setSelection(entity.getStatus());
230 }
231 combo_status.setIndent(10);
232 if(isCreateNew()){
233
234 defaultPublish = PreferencesUtil.getStringValue(PreferencePredicate.DefaultBehaviourForPublishFlag.getKey());
235 setDefaultPublish();
236 } else{
237 setTreeNode(entity);
238 complete = true;
239 }
240
241 if (isCreateNew()){
242 preFillTaxonName();
243 }
244
245 multiLanguageTextStatusNotes = formFactory.createMultiLanguageTextElement(formElement, STATUS_NOTES, null, 50, style);
246 if (!isCreateNew()){
247 multiLanguageTextStatusNotes.setMultilanguageText(entity.getStatusNote());
248 multiLanguageTextStatusNotes.setEnabled(entity.getStatus() != null);
249 }
250 multiLanguageTextStatusNotes.setIndent(10);
251 singleSourceSection = formFactory.createOriginalSourceElement(formElement, entity, "");
252 if (isCreateNew() || entity.getSource() == null){
253 DescriptionElementSource source = DescriptionElementSource.NewPrimarySourceInstance(null, null);
254 entity.setSource(source);
255 singleSourceSection.setEntity(source);
256 }else{
257 singleSourceSection.setEntity(entity.getSource());
258
259 }
260 singleSourceSection.setIndent(10);
261 // singleSourceSection.set
262
263 // super.createControls(formElement, entity, style);
264
265 setSourceLabel(Messages.TaxonNodeWizardPage_PLACEMENT_SOURCE);
266
267
268 selectionNodeAgentRelation = formFactory.createTaxonNodeAgentRelationCollectionSection(formElement, getConversationHolder(), StoreUtil.getSectionStyle(TaxonNodeAgentRelationCollectionSection.class, entity.getClass().getCanonicalName()));
269 selectionNodeAgentRelation.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
270 selectionNodeAgentRelation.setEntity(entity);
271 selectionNodeAgentRelation.setIndent(10);
272 selectionNodeAgentRelation.setFont(AbstractUtility.getFont(Resources.COLOR_FONT_DEFAULT));
273 setBackground(getPersistentBackground());
274
275 }
276
277 private void setDefaultPublish() {
278 if (defaultPublish != null && defaultPublish.equals(PublishEnum.Publish.getKey())){
279 checkbox_publish.setSelection(true);
280 } else if (defaultPublish != null && defaultPublish.equals(PublishEnum.NotPublish.getKey())){
281 checkbox_publish.setSelection(false);
282 }else{
283 if(this.getParentTreeNode() != null && this.getParentTreeNode().isInstanceOf(TaxonNode.class) && this.getParentTreeNode().getTaxon() != null){
284 checkbox_publish.setSelection(this.getParentTreeNode().getTaxon().isPublish());
285 }else{
286 checkbox_publish.setSelection(true);
287 }
288 }
289 }
290
291 private void preFillTaxonName() {
292 TaxonNode node = parentNode;
293 if(node != null && node.getTaxon()!=null){
294 Taxon taxon = HibernateProxyHelper.deproxy(node.getTaxon(), Taxon.class);
295 if(taxon.getName()!=null){
296 TaxonName name = HibernateProxyHelper.deproxy(node.getTaxon().getName());
297 if (!isCreateNew()){
298 textNewTaxonName.setText(name.getNameCache());
299 } else if( ! name.isSupraGeneric() && name.getRank() != null){
300 String taxonName = "";
301 if(name.isGenus() || name.isInfraGeneric()|| name.isSpeciesAggregate() ){
302 taxonName = name.getGenusOrUninomial();
303 }
304 else if(name.isSpecies() || name.isInfraSpecific() ){
305 taxonName = CdmUtils.concat(" ", name.getGenusOrUninomial(),name.getSpecificEpithet());
306 }
307 if (StringUtils.isNotBlank(taxonName)){
308 textNewTaxonName.setText(taxonName + " ");
309 if(textNewTaxonName.getMainControl() instanceof Text){
310 Text text = (Text)textNewTaxonName.getMainControl();
311 text.setSelection(textNewTaxonName.getText().length());
312 }
313 }
314 }
315 }
316 }
317 }
318
319 @Override
320 public void handleEvent(Object eventSource) {
321 if (eventSource == selection_parentTaxonNode) {
322 setParentTreeNode(selection_parentTaxonNode.getEntity());
323 } else if (eventSource == selection_reuseExistingTaxon) {
324 if (selection_reuseExistingTaxon.getEntity() != null){
325 setTaxon(selection_reuseExistingTaxon.getEntity());
326 if (getTaxon().getSec()!= null){
327 microReference.setText(getTaxon().getSecMicroReference());
328 if (isCreateNew()){
329 selection_SecRef.setEntity(getTaxon().getSec());
330
331 }else{
332 textTaxonSec.setText((getTaxon().getSec().getTitleCache()));
333 }
334 }else{
335 microReference.setText("");
336 if (isCreateNew()){
337 selection_SecRef.setEntity(null);
338
339 }else{
340 textTaxonSec.setText("");
341 }
342 }
343 checkbox_publish.setSelected(getTaxon().isPublish());
344 }else{
345 selection_SecRef.setEntity(null);
346 setDefaultPublish();
347 }
348 boolean enabled = selection_reuseExistingTaxon.getEntity() == null;
349 if (selection_reuseExistingName != null){
350 selection_reuseExistingName.setEnabled(enabled);
351 }
352 if (selection_SecRef != null){
353 selection_SecRef.setEnabled(enabled);
354 }
355 if (textNewTaxonName != null){
356 textNewTaxonName.setEnabled(enabled);
357 }
358 complete = true;
359 } else if (eventSource == selection_reuseExistingName) {
360 boolean enabled = selection_reuseExistingName.getEntity() == null;
361 setTaxon(HibernateProxyHelper.deproxy(selection_reuseExistingName.getEntity()));
362 if (selection_reuseExistingTaxon != null){
363 selection_reuseExistingTaxon.setEnabled(enabled);
364 }
365 textNewTaxonName.setEnabled(enabled);
366 complete = !textNewTaxonName.getText().isEmpty();
367 }
368
369 if (eventSource == combo_status) {
370 status = combo_status.getSelection();
371 if (status == null){
372 if (multiLanguageTextStatusNotes.getMultilanguageText() != null && !multiLanguageTextStatusNotes.getMultilanguageText().isEmpty()){
373 multilanguageTextCache = new HashMap<>();
374 for (LanguageString langString: multiLanguageTextStatusNotes.getMultilanguageText().values()){
375 multilanguageTextCache.put(langString.getLanguage(), langString);
376 }
377 // multilanguageTextCache = multiLanguageTextStatusNotes.getMultilanguageText();
378 }
379 multiLanguageTextStatusNotes.setMultilanguageText(new HashMap<>());
380 // multiLanguageTextStatusNotes.refresh();
381
382 }else if (multilanguageTextCache != null ){
383
384 multiLanguageTextStatusNotes.setMultilanguageText(multilanguageTextCache);
385 multilanguageTextCache = null;
386 }
387 if (!isCreateNew()){
388 getEntity().setStatus(status);
389 if (status == null){
390 getEntity().getStatusNote().clear();
391 multiLanguageTextStatusNotes.setMultilanguageText(new HashMap<>());
392 multiLanguageTextStatusNotes.refresh();
393 }else{
394 if (multiLanguageTextStatusNotes.getMultilanguageText() != null){
395 for (LanguageString lang:multiLanguageTextStatusNotes.getMultilanguageText().values()){
396 getEntity().putStatusNote(lang);
397 }
398 }
399 }
400 }
401
402 multiLanguageTextStatusNotes.setEnabled(status != null);
403
404 complete = true;
405 }
406
407 if (eventSource == textNewTaxonName) {
408 boolean enabled = CdmUtils.isBlank(textNewTaxonName.getText());
409 if (selection_reuseExistingTaxon != null){
410 selection_reuseExistingTaxon.setEnabled(enabled);
411 }
412 selection_reuseExistingName.setEnabled(enabled);
413
414 complete = CdmUtils.isNotBlank(textNewTaxonName.getText());
415 }
416
417 if (eventSource == selectionNodeAgentRelation){
418 boolean allComplete = true;
419 for (ICdmFormElement element : selectionNodeAgentRelation.getElements()){
420 allComplete &=((TaxonNodeAgentRelationCollectionElement)element).isComplete();
421 }
422 complete = !isCreateNew() && allComplete;
423 }
424 }
425
426 public Classification getClassification() {
427 return classification;
428 }
429
430 public TaxonNode getParentTreeNode() {
431 return parentNode;
432 }
433
434 public void setParentTreeNode(TaxonNode parentTreeNode) {
435 this.parentNode = parentTreeNode;
436 updateContent();
437 if (parentTreeNode.getTaxon() == null) {
438 classification = parentTreeNode.getClassification();
439 if (selection_parentTaxonNode != null){
440 selection_parentTaxonNode.setEntity(classification.getRootNode());
441 selection_parentTaxonNode.setClassification(classification);
442 selection_SecRef.setEntity(classification.getReference());
443 }
444 } else {
445 classification = HibernateProxyHelper
446 .deproxy(parentTreeNode.getClassification());
447 if (selection_parentTaxonNode != null){
448 selection_parentTaxonNode.setEntity(HibernateProxyHelper.deproxy(parentTreeNode));
449 selection_parentTaxonNode.setClassification(classification);
450 selection_SecRef.setEntity(parentTreeNode.getTaxon().getSec());
451 }
452 }
453 }
454
455 @Override
456 protected void updateControlStates(){
457 Collection<Object> except = new ArrayList<Object>();
458 for(ICdmFormElement formElement:getElements()){
459 if(formElement instanceof IEnableableFormElement && !((IEnableableFormElement) formElement).isEnabled()){
460 except.add(formElement);
461 }
462 }
463 if (isCreateNew() ){
464 enabled = true;
465 }else{
466 enabled = getEntity() != null && CdmStore.currentAuthentiationHasPermission(StoreUtil.getCdmEntity(getEntity()), requiredCrud);
467 }
468 setEnabled(enabled, except);
469 }
470
471 private void setTreeNode(TaxonNode treeNode) {
472 classification = HibernateProxyHelper
473 .deproxy(treeNode.getClassification());
474 if (isCreateNew()){
475 selection_parentTaxonNode.setEntity(treeNode.getParent());
476 selection_parentTaxonNode.setClassification(treeNode.getParent().getClassification());
477 selection_SecRef.setEntity(treeNode.getTaxon().getSec());
478 }
479 }
480
481 private void setTaxon(Taxon taxon) {
482 this.taxon = taxon;
483 if (!isCreateNew()){
484 getEntity().setTaxon(taxon);
485 }
486 this.set_publish(taxon.isPublish());
487 if (isCreateNew()){
488 textNewTaxonName.setText(taxon.getName().getTitleCache());
489 if (taxon.getSec() != null){
490 selection_SecRef.setEntity(taxon.getSec());
491 }
492 }else{
493 if (taxon.getSec() != null) {
494 this.textTaxonSec.setText(taxon.getSec().getTitleCache());
495 }
496 }
497 }
498
499 private void setTaxon(TaxonName taxonName) {
500 Reference secundum = null;
501 if (getParentTreeNode() != null) {
502 if (this.selection_SecRef.getEntity() != null){
503 secundum = this.selection_SecRef.getEntity();
504 }
505 }
506
507 }
508
509 public String getTaxonName() {
510 return textNewTaxonName.getText();
511 }
512 public Taxon getTaxon() {
513 return taxon;
514 }
515
516 public Reference getSecReference(){
517 return selection_SecRef.getSelection();
518 }
519
520 public Control getMainControl(){
521 return textNewTaxonName.getMainControl();
522 }
523
524 public boolean isComplete() {
525 boolean allComplete = true;
526 if (!isCreateNew()){
527 for (ICdmFormElement element : selectionNodeAgentRelation.getElements()){
528 allComplete &=((TaxonNodeAgentRelationCollectionElement)element).isComplete();
529 }
530 complete = allComplete;
531 }
532 return complete;
533 }
534
535 public boolean isCreateNew() {
536 return createNew;
537 }
538
539 public boolean is_publish() {
540 boolean isPublishPreference = true;
541 CdmPreference defaultPublish = CdmPreferenceCache.instance().get(PreferencePredicate.DefaultBehaviourForPublishFlag.getKey());
542 if (defaultPublish != null && defaultPublish.getValue()!= null && defaultPublish.getValue().equals(PublishEnum.NotPublish.getKey())){
543 isPublishPreference = false;
544 }
545 return checkbox_publish!=null?checkbox_publish.getSelection():isPublishPreference;
546 }
547
548 public void set_publish(boolean publish) {
549 this.checkbox_publish.setSelection(publish);
550 }
551
552 /**
553 * Updates all widgets to display the latest data
554 */
555 @Override
556 protected void updateContent() {
557 removeElements();
558 if (isCreateNew()){
559 createControls(this, parentNode, SWT.NONE);
560 }else{
561 createControls(this, getEntity(), SWT.NONE);
562 }
563 updateControlStates();
564 }
565
566 @Override
567 public SelectionArbitrator getSelectionArbitrator() {
568 // TODO Auto-generated method stub
569 return null;
570 }
571 }