Revision 3be6ef3e
Added by Niels Hoffmann over 13 years ago
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/forms/CdmFormFactory.java | ||
---|---|---|
264 | 264 |
import eu.etaxonomy.taxeditor.section.taxon.TaxonBaseDetailSection; |
265 | 265 |
|
266 | 266 |
/** |
267 |
* |
|
267 |
* <p>CdmFormFactory class.</p> |
|
268 |
* |
|
268 | 269 |
* @author n.hoffmann |
269 | 270 |
* @created Feb 24, 2010 |
270 | 271 |
* @version 1.0 |
... | ... | |
283 | 284 |
private ISelectionProvider selectionProvider; |
284 | 285 |
|
285 | 286 |
/** |
286 |
* |
|
287 |
* @return |
|
287 |
* <p>LAYOUT</p> |
|
288 |
* |
|
289 |
* @return a {@link org.eclipse.ui.forms.widgets.TableWrapLayout} object. |
|
288 | 290 |
*/ |
289 | 291 |
public static final TableWrapLayout LAYOUT(){ |
290 | 292 |
return LAYOUT(1, false); |
291 | 293 |
} |
292 | 294 |
|
293 | 295 |
/** |
294 |
* |
|
295 |
* @param columns |
|
296 |
* @param equalWidth |
|
297 |
* @return |
|
296 |
* <p>LAYOUT</p> |
|
297 |
* |
|
298 |
* @param columns a int. |
|
299 |
* @param equalWidth a boolean. |
|
300 |
* @return a {@link org.eclipse.ui.forms.widgets.TableWrapLayout} object. |
|
298 | 301 |
*/ |
299 | 302 |
public static final TableWrapLayout LAYOUT(int columns, boolean equalWidth){ |
300 | 303 |
TableWrapLayout layout = new TableWrapLayout(); |
... | ... | |
309 | 312 |
return layout; |
310 | 313 |
} |
311 | 314 |
|
315 |
/** |
|
316 |
* <p>FILL</p> |
|
317 |
* |
|
318 |
* @return a {@link org.eclipse.ui.forms.widgets.TableWrapData} object. |
|
319 |
*/ |
|
312 | 320 |
public static final TableWrapData FILL(){ |
313 | 321 |
return FILL(1, 1); |
314 | 322 |
} |
315 | 323 |
|
316 | 324 |
/** |
317 |
* |
|
318 |
* @return |
|
325 |
* <p>FILL</p> |
|
326 |
* |
|
327 |
* @param horizontalSpan a int. |
|
328 |
* @param verticalSpan a int. |
|
329 |
* @return a {@link org.eclipse.ui.forms.widgets.TableWrapData} object. |
|
319 | 330 |
*/ |
320 | 331 |
public static final TableWrapData FILL(int horizontalSpan, int verticalSpan){ |
321 | 332 |
TableWrapData layoutData = new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.FILL_GRAB); |
... | ... | |
324 | 335 |
return layoutData; |
325 | 336 |
} |
326 | 337 |
|
338 |
/** |
|
339 |
* <p>LEFT</p> |
|
340 |
* |
|
341 |
* @return a {@link org.eclipse.ui.forms.widgets.TableWrapData} object. |
|
342 |
*/ |
|
327 | 343 |
public static final TableWrapData LEFT(){ |
328 | 344 |
return new TableWrapData(TableWrapData.LEFT, TableWrapData.TOP); |
329 | 345 |
} |
330 | 346 |
|
347 |
/** |
|
348 |
* <p>RIGHT</p> |
|
349 |
* |
|
350 |
* @return a {@link org.eclipse.ui.forms.widgets.TableWrapData} object. |
|
351 |
*/ |
|
331 | 352 |
public static final TableWrapData RIGHT(){ |
332 | 353 |
return new TableWrapData(TableWrapData.RIGHT, TableWrapData.TOP); |
333 | 354 |
} |
334 | 355 |
|
335 | 356 |
/** |
336 |
* |
|
337 |
* @return |
|
357 |
* <p>FILL_HORIZONTALLY</p> |
|
358 |
* |
|
359 |
* @return a {@link org.eclipse.ui.forms.widgets.TableWrapData} object. |
|
338 | 360 |
*/ |
339 | 361 |
public static final TableWrapData FILL_HORIZONTALLY(){ |
340 | 362 |
return FILL_HORIZONTALLY(1, 1); |
341 | 363 |
} |
342 | 364 |
|
343 | 365 |
/** |
344 |
* |
|
345 |
* @param horizontalSpan |
|
346 |
* @param verticalSpan |
|
347 |
* @return |
|
366 |
* <p>FILL_HORIZONTALLY</p> |
|
367 |
* |
|
368 |
* @param horizontalSpan a int. |
|
369 |
* @param verticalSpan a int. |
|
370 |
* @return a {@link org.eclipse.ui.forms.widgets.TableWrapData} object. |
|
348 | 371 |
*/ |
349 | 372 |
public static final TableWrapData FILL_HORIZONTALLY(int horizontalSpan, int verticalSpan){ |
350 | 373 |
TableWrapData layoutData = new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP); |
... | ... | |
353 | 376 |
return layoutData; |
354 | 377 |
} |
355 | 378 |
|
379 |
/** Constant <code>EMPTY_SELECTION</code> */ |
|
356 | 380 |
public static ISelection EMPTY_SELECTION = new ISelection() { |
357 | 381 |
public boolean isEmpty() { |
358 | 382 |
return true; |
... | ... | |
384 | 408 |
} |
385 | 409 |
|
386 | 410 |
/** |
387 |
* |
|
388 |
* @param display |
|
389 |
* @param selectionProvider |
|
411 |
* <p>Constructor for CdmFormFactory.</p> |
|
412 |
* |
|
413 |
* @param display a {@link org.eclipse.swt.widgets.Display} object. |
|
414 |
* @param selectionProvider a {@link org.eclipse.jface.viewers.ISelectionProvider} object. |
|
390 | 415 |
*/ |
391 | 416 |
public CdmFormFactory(Display display, ISelectionProvider selectionProvider) { |
392 | 417 |
super(display); |
... | ... | |
395 | 420 |
} |
396 | 421 |
|
397 | 422 |
/** |
398 |
* |
|
399 |
* @param display |
|
423 |
* <p>Constructor for CdmFormFactory.</p> |
|
424 |
* |
|
425 |
* @param display a {@link org.eclipse.swt.widgets.Display} object. |
|
400 | 426 |
*/ |
401 | 427 |
public CdmFormFactory(Display display){ |
402 | 428 |
super(display); |
... | ... | |
414 | 440 |
|
415 | 441 |
/** |
416 | 442 |
* Creates an instance initialized with the correct selectionProvider |
417 |
*
|
|
443 |
* |
|
418 | 444 |
* Make sure to remove the instance when the entityComposite disposes via |
419 | 445 |
* destroySelectionArbitrator(..) |
420 |
* @return |
|
446 |
* |
|
447 |
* @param entityElement a {@link eu.etaxonomy.taxeditor.forms.IEntityElement} object. |
|
448 |
* @return a {@link eu.etaxonomy.taxeditor.forms.SelectionArbitrator} object. |
|
421 | 449 |
*/ |
422 | 450 |
public SelectionArbitrator createSelectionArbitrator(IEntityElement entityElement){ |
423 | 451 |
SelectionArbitrator selectionArbitrator = new SelectionArbitrator(entityElement); |
... | ... | |
427 | 455 |
return selectionArbitrator; |
428 | 456 |
} |
429 | 457 |
|
458 |
/** |
|
459 |
* <p>destroySelectionArbitrator</p> |
|
460 |
* |
|
461 |
* @param selectionArbitrator a {@link eu.etaxonomy.taxeditor.forms.SelectionArbitrator} object. |
|
462 |
*/ |
|
430 | 463 |
public void destroySelectionArbitrator(SelectionArbitrator selectionArbitrator){ |
431 | 464 |
removeSelectionListener(selectionArbitrator); |
432 | 465 |
if(selectionProvider != null){ |
... | ... | |
436 | 469 |
} |
437 | 470 |
} |
438 | 471 |
|
472 |
/** {@inheritDoc} */ |
|
439 | 473 |
@Override |
440 | 474 |
public void adapt(Composite composite) { |
441 | 475 |
composite.addMouseListener(selectionMouseHandler); |
442 | 476 |
super.adapt(composite); |
443 | 477 |
} |
444 | 478 |
|
479 |
/** |
|
480 |
* <p>adapt</p> |
|
481 |
* |
|
482 |
* @param formElement a {@link eu.etaxonomy.taxeditor.forms.AbstractCdmFormElement} object. |
|
483 |
*/ |
|
445 | 484 |
public void adapt(AbstractCdmFormElement formElement){ |
446 | 485 |
formElement.setPropertyChangeListeners(propertyChangeListeners); |
447 | 486 |
} |
448 | 487 |
|
488 |
/** {@inheritDoc} */ |
|
449 | 489 |
@Override |
450 | 490 |
public void adapt(Control control, boolean trackFocus, boolean trackKeyboard) { |
451 | 491 |
if(trackFocus){ |
... | ... | |
454 | 494 |
super.adapt(control, trackFocus, trackKeyboard); |
455 | 495 |
} |
456 | 496 |
|
497 |
/** |
|
498 |
* <p>destroyElement</p> |
|
499 |
* |
|
500 |
* @param formElement a {@link eu.etaxonomy.taxeditor.forms.ICdmFormElement} object. |
|
501 |
*/ |
|
457 | 502 |
public void destroyElement(ICdmFormElement formElement){ |
458 | 503 |
// return if element was not initialized |
459 | 504 |
if(formElement == null){ |
... | ... | |
486 | 531 |
} |
487 | 532 |
|
488 | 533 |
|
534 |
/** |
|
535 |
* <p>createEmptyCell</p> |
|
536 |
* |
|
537 |
* @param parent a {@link org.eclipse.swt.widgets.Composite} object. |
|
538 |
* @return a {@link org.eclipse.swt.widgets.Label} object. |
|
539 |
*/ |
|
489 | 540 |
public Label createEmptyCell(Composite parent){ |
490 | 541 |
return this.createLabel(parent, null); |
491 | 542 |
} |
492 | 543 |
|
493 | 544 |
/** |
494 |
* |
|
495 |
* @param parent |
|
496 |
* @param labelString |
|
497 |
* @param textHeight |
|
498 |
* @param style |
|
499 |
* @return |
|
545 |
* <p>createMultilineTextWithLabel</p> |
|
546 |
* |
|
547 |
* @param labelString a {@link java.lang.String} object. |
|
548 |
* @param textHeight a int. |
|
549 |
* @param style a int. |
|
550 |
* @param parentElement a {@link eu.etaxonomy.taxeditor.forms.ICdmFormElement} object. |
|
551 |
* @return a {@link eu.etaxonomy.taxeditor.forms.TextWithLabelElement} object. |
|
500 | 552 |
*/ |
501 | 553 |
public TextWithLabelElement createMultilineTextWithLabel(ICdmFormElement parentElement, String labelString, int textHeight, int style){ |
502 | 554 |
TextWithLabelElement element = new TextWithLabelElement(this, parentElement, labelString, "", textHeight, style); |
... | ... | |
507 | 559 |
|
508 | 560 |
|
509 | 561 |
/** |
510 |
* @param textDataDetailElement |
|
511 |
* @param object |
|
512 |
* @param i |
|
513 |
* @param wrap |
|
514 |
* @return |
|
562 |
* <p>createMultiLanguageTextElement</p> |
|
563 |
* |
|
564 |
* @param parentElement a {@link eu.etaxonomy.taxeditor.forms.ICdmFormElement} object. |
|
565 |
* @param labelString a {@link java.lang.String} object. |
|
566 |
* @param multilanguageText a {@link java.util.Map} object. |
|
567 |
* @param textHeight a int. |
|
568 |
* @param style a int. |
|
569 |
* @return a {@link eu.etaxonomy.taxeditor.forms.MultilanguageTextElement} object. |
|
515 | 570 |
*/ |
516 | 571 |
public MultilanguageTextElement createMultiLanguageTextElement( |
517 | 572 |
ICdmFormElement parentElement, String labelString, Map<Language, LanguageString> multilanguageText, int textHeight, |
... | ... | |
524 | 579 |
|
525 | 580 |
|
526 | 581 |
/** |
527 |
* |
|
528 |
* @param parent |
|
529 |
* @param labelString |
|
530 |
* @param initialText |
|
531 |
* @param style |
|
532 |
* @return |
|
582 |
* <p>createTextWithLabelElement</p> |
|
583 |
* |
|
584 |
* @param labelString a {@link java.lang.String} object. |
|
585 |
* @param initialText a {@link java.lang.String} object. |
|
586 |
* @param style a int. |
|
587 |
* @param parentElement a {@link eu.etaxonomy.taxeditor.forms.ICdmFormElement} object. |
|
588 |
* @return a {@link eu.etaxonomy.taxeditor.forms.TextWithLabelElement} object. |
|
533 | 589 |
*/ |
534 | 590 |
public TextWithLabelElement createTextWithLabelElement(ICdmFormElement parentElement, String labelString, String initialText, int style){ |
535 | 591 |
TextWithLabelElement element = new TextWithLabelElement(this, parentElement, labelString, initialText, null, style); |
... | ... | |
538 | 594 |
return element; |
539 | 595 |
} |
540 | 596 |
|
597 |
/** |
|
598 |
* <p>createIntegerTextWithLabelElement</p> |
|
599 |
* |
|
600 |
* @param parentElement a {@link eu.etaxonomy.taxeditor.forms.ICdmFormElement} object. |
|
601 |
* @param labelString a {@link java.lang.String} object. |
|
602 |
* @param initialInteger a {@link java.lang.Integer} object. |
|
603 |
* @param style a int. |
|
604 |
* @return a {@link eu.etaxonomy.taxeditor.forms.NumberWithLabelElement} object. |
|
605 |
*/ |
|
541 | 606 |
public NumberWithLabelElement createIntegerTextWithLabelElement(ICdmFormElement parentElement, String labelString, Integer initialInteger, int style){ |
542 | 607 |
NumberWithLabelElement element = new NumberWithLabelElement(this, parentElement, labelString, initialInteger, style); |
543 | 608 |
adapt(element); |
... | ... | |
546 | 611 |
} |
547 | 612 |
|
548 | 613 |
|
614 |
/** |
|
615 |
* <p>createFloatTextWithLabelElement</p> |
|
616 |
* |
|
617 |
* @param parentElement a {@link eu.etaxonomy.taxeditor.forms.ICdmFormElement} object. |
|
618 |
* @param labelString a {@link java.lang.String} object. |
|
619 |
* @param initialFloat a float. |
|
620 |
* @param style a int. |
|
621 |
* @return a {@link eu.etaxonomy.taxeditor.forms.NumberWithLabelElement} object. |
|
622 |
*/ |
|
549 | 623 |
public NumberWithLabelElement createFloatTextWithLabelElement( |
550 | 624 |
ICdmFormElement parentElement, String labelString, float initialFloat, |
551 | 625 |
int style) { |
... | ... | |
555 | 629 |
return element; |
556 | 630 |
} |
557 | 631 |
|
632 |
/** |
|
633 |
* <p>createLanguageStringWithLabelElement</p> |
|
634 |
* |
|
635 |
* @param parentElement a {@link eu.etaxonomy.taxeditor.forms.ICdmFormElement} object. |
|
636 |
* @param labelString a {@link java.lang.String} object. |
|
637 |
* @param languageString a {@link eu.etaxonomy.cdm.model.common.LanguageString} object. |
|
638 |
* @param style a int. |
|
639 |
* @return a {@link eu.etaxonomy.taxeditor.forms.LanguageStringWithLabelElement} object. |
|
640 |
*/ |
|
558 | 641 |
public LanguageStringWithLabelElement createLanguageStringWithLabelElement(ICdmFormElement parentElement, String labelString, LanguageString languageString, int style){ |
559 | 642 |
LanguageStringWithLabelElement element = new LanguageStringWithLabelElement(this, parentElement, labelString, languageString, style); |
560 | 643 |
adapt(element); |
... | ... | |
562 | 645 |
return element; |
563 | 646 |
} |
564 | 647 |
|
648 |
/** |
|
649 |
* <p>createLanguageStringWithLabelElement</p> |
|
650 |
* |
|
651 |
* @param parentElement a {@link eu.etaxonomy.taxeditor.forms.ICdmFormElement} object. |
|
652 |
* @param labelString a {@link java.lang.String} object. |
|
653 |
* @param languageString a {@link eu.etaxonomy.cdm.model.common.LanguageString} object. |
|
654 |
* @param height a int. |
|
655 |
* @param style a int. |
|
656 |
* @return a {@link eu.etaxonomy.taxeditor.forms.LanguageStringWithLabelElement} object. |
|
657 |
*/ |
|
565 | 658 |
public LanguageStringWithLabelElement createLanguageStringWithLabelElement(ICdmFormElement parentElement, String labelString, LanguageString languageString, int height, int style){ |
566 | 659 |
LanguageStringWithLabelElement element = new LanguageStringWithLabelElement(this, parentElement, labelString, languageString, height, style); |
567 | 660 |
adapt(element); |
... | ... | |
570 | 663 |
} |
571 | 664 |
|
572 | 665 |
/** |
573 |
* |
|
574 |
* @param parentElement
|
|
575 |
* @param labelString
|
|
576 |
* @param initialText |
|
577 |
* @param style |
|
578 |
* @return |
|
666 |
* <p>createTextElement</p>
|
|
667 |
* |
|
668 |
* @param parentElement a {@link eu.etaxonomy.taxeditor.forms.ICdmFormElement} object.
|
|
669 |
* @param initialText a {@link java.lang.String} object.
|
|
670 |
* @param style a int.
|
|
671 |
* @return a {@link eu.etaxonomy.taxeditor.forms.TextWithLabelElement} object.
|
|
579 | 672 |
*/ |
580 | 673 |
public TextWithLabelElement createTextElement(ICdmFormElement parentElement, String initialText, int style){ |
581 | 674 |
TextWithLabelElement element = new TextWithLabelElement(this, parentElement, null, initialText, null, style); |
... | ... | |
584 | 677 |
return element; |
585 | 678 |
} |
586 | 679 |
|
680 |
/** |
|
681 |
* <p>createKeyValueViewerElement</p> |
|
682 |
* |
|
683 |
* @param parentElement a {@link eu.etaxonomy.taxeditor.forms.ICdmFormElement} object. |
|
684 |
* @param keyHeading a {@link java.lang.String} object. |
|
685 |
* @param valueHeading a {@link java.lang.String} object. |
|
686 |
* @param map a {@link java.util.Map} object. |
|
687 |
* @return a {@link eu.etaxonomy.taxeditor.forms.KeyValueViewerElement} object. |
|
688 |
*/ |
|
587 | 689 |
public KeyValueViewerElement createKeyValueViewerElement(ICdmFormElement parentElement, String keyHeading, String valueHeading, Map<Object, Object> map){ |
588 | 690 |
KeyValueViewerElement element = new KeyValueViewerElement(this, parentElement, keyHeading, valueHeading, map); |
589 | 691 |
adapt(element); |
... | ... | |
618 | 720 |
REFERENCE_SYSTEM |
619 | 721 |
} |
620 | 722 |
|
723 |
/** |
|
724 |
* <p>createTermComboElement</p> |
|
725 |
* |
|
726 |
* @param termComboType a {@link eu.etaxonomy.taxeditor.forms.CdmFormFactory.TermComboType} object. |
|
727 |
* @param parentElement a {@link eu.etaxonomy.taxeditor.forms.ICdmFormElement} object. |
|
728 |
* @param labelString a {@link java.lang.String} object. |
|
729 |
* @param selection a {@link eu.etaxonomy.cdm.model.common.DefinedTermBase} object. |
|
730 |
* @param style a int. |
|
731 |
* @return a {@link eu.etaxonomy.taxeditor.forms.term.AbstractTermComboElement} object. |
|
732 |
*/ |
|
621 | 733 |
public AbstractTermComboElement createTermComboElement(TermComboType termComboType, ICdmFormElement parentElement, String labelString, DefinedTermBase selection, int style){ |
622 | 734 |
AbstractTermComboElement element = null; |
623 | 735 |
|
... | ... | |
703 | 815 |
NOMENCLATURALCODE |
704 | 816 |
} |
705 | 817 |
|
818 |
/** |
|
819 |
* <p>createEnumComboElement</p> |
|
820 |
* |
|
821 |
* @param enumComboType a {@link eu.etaxonomy.taxeditor.forms.CdmFormFactory.EnumComboType} object. |
|
822 |
* @param parentElement a {@link eu.etaxonomy.taxeditor.forms.ICdmFormElement} object. |
|
823 |
* @param style a int. |
|
824 |
* @return a {@link eu.etaxonomy.taxeditor.forms.term.AbstractEnumComboElement} object. |
|
825 |
*/ |
|
706 | 826 |
public AbstractEnumComboElement createEnumComboElement(EnumComboType enumComboType, ICdmFormElement parentElement, int style){ |
707 | 827 |
AbstractEnumComboElement element = null; |
708 | 828 |
|
... | ... | |
720 | 840 |
} |
721 | 841 |
|
722 | 842 |
/** |
723 |
* |
|
724 |
* @param parent |
|
725 |
* @param imageUri |
|
726 |
* @param style |
|
727 |
* @return |
|
843 |
* <p>createBrowserElement</p> |
|
844 |
* |
|
845 |
* @param imageUri a {@link java.net.URI} object. |
|
846 |
* @param style a int. |
|
847 |
* @param parentElement a {@link eu.etaxonomy.taxeditor.forms.ICdmFormElement} object. |
|
848 |
* @return a {@link eu.etaxonomy.taxeditor.forms.BrowserElement} object. |
|
728 | 849 |
*/ |
729 | 850 |
public BrowserElement createBrowserElement(ICdmFormElement parentElement, URI imageUri, int style){ |
730 | 851 |
BrowserElement element = new BrowserElement(this, parentElement, imageUri, style); |
... | ... | |
733 | 854 |
return element; |
734 | 855 |
} |
735 | 856 |
|
857 |
/** |
|
858 |
* <p>createImageElement</p> |
|
859 |
* |
|
860 |
* @param parentElement a {@link eu.etaxonomy.taxeditor.forms.ICdmFormElement} object. |
|
861 |
* @param imageUri a {@link java.net.URI} object. |
|
862 |
* @param style a int. |
|
863 |
* @return a {@link eu.etaxonomy.taxeditor.forms.ImageElement} object. |
|
864 |
*/ |
|
736 | 865 |
public ImageElement createImageElement(ICdmFormElement parentElement, URI imageUri, int style) { |
737 | 866 |
ImageElement element = new ImageElement(this, parentElement, imageUri, style); |
738 | 867 |
adapt(element); |
... | ... | |
741 | 870 |
} |
742 | 871 |
|
743 | 872 |
/** |
744 |
* |
|
745 |
* @param parent |
|
746 |
* @param labelString |
|
747 |
* @param initialText |
|
748 |
* @param style |
|
749 |
* @return |
|
873 |
* <p>createTextActionElement</p> |
|
874 |
* |
|
875 |
* @param labelString a {@link java.lang.String} object. |
|
876 |
* @param initialText a {@link java.lang.String} object. |
|
877 |
* @param style a int. |
|
878 |
* @param parentElement a {@link eu.etaxonomy.taxeditor.forms.ICdmFormElement} object. |
|
879 |
* @param buttonLabel a {@link java.lang.String} object. |
|
880 |
* @return a {@link eu.etaxonomy.taxeditor.forms.TextActionElement} object. |
|
750 | 881 |
*/ |
751 | 882 |
public TextActionElement createTextActionElement(ICdmFormElement parentElement, String labelString, String buttonLabel, String initialText, int style){ |
752 | 883 |
TextActionElement element = new TextActionElement(this, parentElement, labelString, buttonLabel, initialText, style); |
... | ... | |
779 | 910 |
} |
780 | 911 |
|
781 | 912 |
/** |
782 |
* @param parent |
|
783 |
* @param string |
|
784 |
* @param b |
|
785 |
* @param taxonBasePropertySection |
|
786 |
* @return |
|
913 |
* <p>createCheckbox</p> |
|
914 |
* |
|
915 |
* @param parentElement a {@link eu.etaxonomy.taxeditor.forms.ICdmFormElement} object. |
|
916 |
* @param label a {@link java.lang.String} object. |
|
917 |
* @param initialState a boolean. |
|
918 |
* @param style a int. |
|
919 |
* @return a {@link eu.etaxonomy.taxeditor.forms.CheckboxElement} object. |
|
787 | 920 |
*/ |
788 | 921 |
public CheckboxElement createCheckbox(ICdmFormElement parentElement, String label, boolean initialState, int style) { |
789 | 922 |
CheckboxElement element = new CheckboxElement(this, parentElement, label, initialState, style | orientation); |
... | ... | |
796 | 929 |
|
797 | 930 |
/** |
798 | 931 |
* Creates a section as a part of the form. |
799 |
* |
|
800 |
* @param parent |
|
801 |
* the section parent |
|
802 |
* @param sectionStyle |
|
803 |
* the section style |
|
932 |
* |
|
804 | 933 |
* @return the section widget |
934 |
* @param section a {@link eu.etaxonomy.taxeditor.forms.AbstractFormSection} object. |
|
805 | 935 |
*/ |
806 | 936 |
public Section adapt(AbstractFormSection section) { |
807 | 937 |
section.setMenu(section.getLayoutComposite().getMenu()); |
... | ... | |
865 | 995 |
} |
866 | 996 |
} |
867 | 997 |
|
998 |
/** |
|
999 |
* <p>createToggleableTextField</p> |
|
1000 |
* |
|
1001 |
* @param parentElement a {@link eu.etaxonomy.taxeditor.forms.ICdmFormElement} object. |
|
1002 |
* @param labelString a {@link java.lang.String} object. |
|
1003 |
* @param initialText a {@link java.lang.String} object. |
|
1004 |
* @param initialState a boolean. |
|
1005 |
* @param style a int. |
|
1006 |
* @return a {@link eu.etaxonomy.taxeditor.forms.ToggleableTextElement} object. |
|
1007 |
*/ |
|
868 | 1008 |
public ToggleableTextElement createToggleableTextField(ICdmFormElement parentElement, |
869 | 1009 |
String labelString, String initialText, boolean initialState, int style) { |
870 | 1010 |
ToggleableTextElement element = new ToggleableTextElement(this, parentElement, |
... | ... | |
874 | 1014 |
return element; |
875 | 1015 |
} |
876 | 1016 |
|
1017 |
/** |
|
1018 |
* <p>createTimePeriodElement</p> |
|
1019 |
* |
|
1020 |
* @param parentElement a {@link eu.etaxonomy.taxeditor.forms.ICdmFormElement} object. |
|
1021 |
* @param labelString a {@link java.lang.String} object. |
|
1022 |
* @param timePeriod a {@link eu.etaxonomy.cdm.model.common.TimePeriod} object. |
|
1023 |
* @param style a int. |
|
1024 |
* @return a {@link eu.etaxonomy.taxeditor.forms.TimePeriodElement} object. |
|
1025 |
*/ |
|
877 | 1026 |
public TimePeriodElement createTimePeriodElement( |
878 | 1027 |
ICdmFormElement parentElement, String labelString, TimePeriod timePeriod, int style) { |
879 | 1028 |
TimePeriodElement element = new TimePeriodElement(this, parentElement, labelString, timePeriod, style); |
... | ... | |
884 | 1033 |
|
885 | 1034 |
|
886 | 1035 |
/** |
887 |
* @param formElement |
|
888 |
* @param exactLocation |
|
889 |
* @param style |
|
890 |
* @return |
|
1036 |
* <p>createPointElement</p> |
|
1037 |
* |
|
1038 |
* @param style a int. |
|
1039 |
* @param parentElement a {@link eu.etaxonomy.taxeditor.forms.ICdmFormElement} object. |
|
1040 |
* @param point a {@link eu.etaxonomy.cdm.model.location.Point} object. |
|
1041 |
* @return a {@link eu.etaxonomy.taxeditor.forms.PointElement} object. |
|
891 | 1042 |
*/ |
892 | 1043 |
public PointElement createPointElement(ICdmFormElement parentElement, |
893 | 1044 |
Point point, int style) { |
... | ... | |
897 | 1048 |
return element; |
898 | 1049 |
} |
899 | 1050 |
|
1051 |
/** |
|
1052 |
* <p>createDateDetailSection</p> |
|
1053 |
* |
|
1054 |
* @param parentElement a {@link eu.etaxonomy.taxeditor.forms.ICdmFormElement} object. |
|
1055 |
* @param style a int. |
|
1056 |
* @return a {@link eu.etaxonomy.taxeditor.forms.DateDetailSection} object. |
|
1057 |
*/ |
|
900 | 1058 |
public DateDetailSection createDateDetailSection(ICdmFormElement parentElement, int style){ |
901 | 1059 |
DateDetailSection section = new DateDetailSection(this, parentElement, style); |
902 | 1060 |
parentElement.addElement(section); |
... | ... | |
904 | 1062 |
return section; |
905 | 1063 |
} |
906 | 1064 |
|
1065 |
/** |
|
1066 |
* <p>createPartialElement</p> |
|
1067 |
* |
|
1068 |
* @param parentElement a {@link eu.etaxonomy.taxeditor.forms.ICdmFormElement} object. |
|
1069 |
* @param labelString a {@link java.lang.String} object. |
|
1070 |
* @param partial a {@link org.joda.time.Partial} object. |
|
1071 |
* @param style a int. |
|
1072 |
* @return a {@link eu.etaxonomy.taxeditor.forms.PartialElement} object. |
|
1073 |
*/ |
|
907 | 1074 |
public PartialElement createPartialElement(ICdmFormElement parentElement, String labelString, Partial partial, int style){ |
908 | 1075 |
PartialElement element = new PartialElement(this, parentElement, labelString, style); |
909 | 1076 |
adapt(element); |
... | ... | |
911 | 1078 |
return element; |
912 | 1079 |
} |
913 | 1080 |
|
1081 |
/** |
|
1082 |
* <p>addSelectionListener</p> |
|
1083 |
* |
|
1084 |
* @param listener a {@link org.eclipse.swt.events.SelectionListener} object. |
|
1085 |
*/ |
|
914 | 1086 |
public void addSelectionListener(SelectionListener listener){ |
915 | 1087 |
selectionListenerList.add(listener); |
916 | 1088 |
} |
917 | 1089 |
|
1090 |
/** |
|
1091 |
* <p>removeSelectionListener</p> |
|
1092 |
* |
|
1093 |
* @param listener a {@link org.eclipse.swt.events.SelectionListener} object. |
|
1094 |
*/ |
|
918 | 1095 |
public void removeSelectionListener(SelectionListener listener){ |
919 | 1096 |
if(listener == null){ |
920 | 1097 |
EditorUtil.error(this.getClass(), "Tried to remove a selection listener from this factories listeners but was null", null); |
... | ... | |
923 | 1100 |
} |
924 | 1101 |
} |
925 | 1102 |
|
1103 |
/** |
|
1104 |
* <p>addPropertyChangeListener</p> |
|
1105 |
* |
|
1106 |
* @param listener a {@link org.eclipse.jface.util.IPropertyChangeListener} object. |
|
1107 |
*/ |
|
926 | 1108 |
public void addPropertyChangeListener(IPropertyChangeListener listener) { |
927 | 1109 |
propertyChangeListeners.add(listener); |
928 | 1110 |
} |
929 | 1111 |
|
1112 |
/** |
|
1113 |
* <p>removePropertyChangeListener</p> |
|
1114 |
* |
|
1115 |
* @param listener a {@link org.eclipse.jface.util.IPropertyChangeListener} object. |
|
1116 |
*/ |
|
930 | 1117 |
public void removePropertyChangeListener(IPropertyChangeListener listener){ |
931 | 1118 |
propertyChangeListeners.remove(listener); |
932 | 1119 |
} |
933 | 1120 |
|
934 | 1121 |
|
935 | 1122 |
|
1123 |
/** |
|
1124 |
* <p>createHorizontalSeparator</p> |
|
1125 |
* |
|
1126 |
* @param parentElement a {@link eu.etaxonomy.taxeditor.forms.ICdmFormElement} object. |
|
1127 |
* @param style a int. |
|
1128 |
* @return a {@link org.eclipse.swt.widgets.Label} object. |
|
1129 |
*/ |
|
936 | 1130 |
public Label createHorizontalSeparator(ICdmFormElement parentElement, int style) { |
937 | 1131 |
Label separator = this.createSeparator(parentElement.getLayoutComposite(), SWT.HORIZONTAL | style); |
938 | 1132 |
separator.setLayoutData(FILL_HORIZONTALLY()); |
939 | 1133 |
return separator; |
940 | 1134 |
} |
941 | 1135 |
|
1136 |
/** |
|
1137 |
* <p>createVersionElement</p> |
|
1138 |
* |
|
1139 |
* @param parentElement a {@link eu.etaxonomy.taxeditor.forms.ICdmFormElement} object. |
|
1140 |
* @param entity a {@link eu.etaxonomy.cdm.model.common.VersionableEntity} object. |
|
1141 |
* @param style a int. |
|
1142 |
* @return a {@link eu.etaxonomy.taxeditor.section.supplemental.VersionElement} object. |
|
1143 |
*/ |
|
942 | 1144 |
public VersionElement createVersionElement(ICdmFormElement parentElement, VersionableEntity entity, |
943 | 1145 |
int style) { |
944 | 1146 |
VersionElement element = new VersionElement(this, parentElement, entity, style); |
... | ... | |
947 | 1149 |
return element; |
948 | 1150 |
} |
949 | 1151 |
|
1152 |
/** |
|
1153 |
* <p>createVersionSection</p> |
|
1154 |
* |
|
1155 |
* @param parentElement a {@link eu.etaxonomy.taxeditor.forms.ICdmFormElement} object. |
|
1156 |
* @param style a int. |
|
1157 |
* @return a {@link eu.etaxonomy.taxeditor.section.supplemental.VersionSection} object. |
|
1158 |
*/ |
|
950 | 1159 |
public VersionSection createVersionSection(ICdmFormElement parentElement, int style) { |
951 | 1160 |
VersionSection section = new VersionSection(this, parentElement, style); |
952 | 1161 |
parentElement.addElement(section); |
... | ... | |
954 | 1163 |
return section; |
955 | 1164 |
} |
956 | 1165 |
|
1166 |
/** |
|
1167 |
* <p>createEmptyElement</p> |
|
1168 |
* |
|
1169 |
* @param parentElement a {@link eu.etaxonomy.taxeditor.forms.ICdmFormElement} object. |
|
1170 |
* @return a {@link eu.etaxonomy.taxeditor.section.EmptyElement} object. |
|
1171 |
*/ |
|
957 | 1172 |
public EmptyElement createEmptyElement(ICdmFormElement parentElement) { |
958 | 1173 |
EmptyElement element = new EmptyElement(this, parentElement, null, SWT.NULL); |
959 | 1174 |
adapt(element); |
... | ... | |
961 | 1176 |
return element; |
962 | 1177 |
} |
963 | 1178 |
|
1179 |
/** |
|
1180 |
* <p>createHeadlineSection</p> |
|
1181 |
* |
|
1182 |
* @param parentElement a {@link eu.etaxonomy.taxeditor.forms.ICdmFormElement} object. |
|
1183 |
* @return a {@link eu.etaxonomy.taxeditor.section.supplemental.HeadlineSection} object. |
|
1184 |
*/ |
|
964 | 1185 |
public HeadlineSection createHeadlineSection(ICdmFormElement parentElement) { |
965 | 1186 |
HeadlineSection section = new HeadlineSection(this, parentElement, SWT.NULL); |
966 | 1187 |
parentElement.addElement(section); |
... | ... | |
969 | 1190 |
} |
970 | 1191 |
|
971 | 1192 |
|
1193 |
/** |
|
1194 |
* <p>createParsingMessageElement</p> |
|
1195 |
* |
|
1196 |
* @param parentElement a {@link eu.etaxonomy.taxeditor.forms.ICdmFormElement} object. |
|
1197 |
* @param parserProblem a {@link eu.etaxonomy.cdm.strategy.parser.ParserProblem} object. |
|
1198 |
* @param style a int. |
|
1199 |
* @return a {@link eu.etaxonomy.taxeditor.section.taxon.ParsingMessageElement} object. |
|
1200 |
*/ |
|
972 | 1201 |
public ParsingMessageElement createParsingMessageElement( |
973 | 1202 |
ICdmFormElement parentElement, ParserProblem parserProblem, int style) { |
974 | 1203 |
ParsingMessageElement element = new ParsingMessageElement(this, parentElement, parserProblem, style); |
... | ... | |
1009 | 1238 |
} |
1010 | 1239 |
|
1011 | 1240 |
/** |
1012 |
* |
|
1013 |
* @param detailType |
|
1014 |
* @param parentElement |
|
1015 |
* @param selectionProvider |
|
1016 |
* @param style |
|
1017 |
* @return |
|
1241 |
* <p>createCdmDetailSection</p> |
|
1242 |
* |
|
1243 |
* @param detailType a {@link eu.etaxonomy.taxeditor.forms.CdmFormFactory.DetailType} object. |
|
1244 |
* @param parentElement a {@link eu.etaxonomy.taxeditor.forms.ICdmFormElement} object. |
|
1245 |
* @param selectionProvider a {@link org.eclipse.jface.viewers.ISelectionProvider} object. |
|
1246 |
* @param style a int. |
|
1247 |
* @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object. |
|
1248 |
* @return a {@link eu.etaxonomy.taxeditor.forms.AbstractFormSection} object. |
|
1018 | 1249 |
*/ |
1019 | 1250 |
public AbstractFormSection createCdmDetailSection(DetailType detailType, ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){ |
1020 | 1251 |
AbstractFormSection section = null; |
... | ... | |
1090 | 1321 |
} |
1091 | 1322 |
|
1092 | 1323 |
/** |
1093 |
* |
|
1094 |
* @param detailType |
|
1095 |
* @param parent |
|
1096 |
* @param style |
|
1097 |
* @return |
|
1324 |
* <p>createCdmDetailElement</p> |
|
1325 |
* |
|
1326 |
* @param detailType a {@link eu.etaxonomy.taxeditor.forms.CdmFormFactory.DetailType} object. |
|
1327 |
* @param style a int. |
|
1328 |
* @param parentElement a {@link eu.etaxonomy.taxeditor.forms.ICdmFormElement} object. |
|
1329 |
* @return a {@link eu.etaxonomy.taxeditor.section.AbstractCdmDetailElement} object. |
|
1098 | 1330 |
*/ |
1099 | 1331 |
public AbstractCdmDetailElement createCdmDetailElement(DetailType detailType, ICdmFormElement parentElement, int style){ |
1100 | 1332 |
AbstractCdmDetailElement element = null; |
... | ... | |
1205 | 1437 |
} |
1206 | 1438 |
|
1207 | 1439 |
/** |
1208 |
* |
|
1209 |
* @param entityDetailType |
|
1210 |
* @param parent |
|
1211 |
* @param style |
|
1212 |
* @return |
|
1440 |
* <p>createEntityDetailSection</p> |
|
1441 |
* |
|
1442 |
* @param entityDetailType a {@link eu.etaxonomy.taxeditor.forms.CdmFormFactory.EntityDetailType} object. |
|
1443 |
* @param style a int. |
|
1444 |
* @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object. |
|
1445 |
* @param parentElement a {@link eu.etaxonomy.taxeditor.forms.ICdmFormElement} object. |
|
1446 |
* @return a {@link eu.etaxonomy.taxeditor.forms.AbstractFormSection} object. |
|
1213 | 1447 |
*/ |
1214 | 1448 |
public AbstractFormSection createEntityDetailSection(EntityDetailType entityDetailType, ConversationHolder conversation, ICdmFormElement parentElement, int style){ |
1215 | 1449 |
AbstractFormSection section = null; |
... | ... | |
1304 | 1538 |
} |
1305 | 1539 |
|
1306 | 1540 |
/** |
1307 |
* |
|
1308 |
* @param parent |
|
1309 |
* @param entity |
|
1310 |
* @param removeListener |
|
1311 |
* @param style |
|
1312 |
* @return |
|
1541 |
* <p>createEntityCollectionElement</p> |
|
1542 |
* |
|
1543 |
* @param removeListener a {@link org.eclipse.swt.events.SelectionListener} object. |
|
1544 |
* @param style a int. |
|
1545 |
* @param parentElement a {@link eu.etaxonomy.taxeditor.forms.AbstractFormSection} object. |
|
1546 |
* @param versionableEntity a {@link eu.etaxonomy.cdm.model.common.IVersionableEntity} object. |
|
1547 |
* @param backgroundColor a {@link org.eclipse.swt.graphics.Color} object. |
|
1548 |
* @return a {@link eu.etaxonomy.taxeditor.section.AbstractEntityCollectionElement} object. |
|
1313 | 1549 |
*/ |
1314 | 1550 |
public AbstractEntityCollectionElement createEntityCollectionElement(AbstractFormSection parentElement, IVersionableEntity versionableEntity, SelectionListener removeListener, Color backgroundColor, int style){ |
1315 | 1551 |
AbstractEntityCollectionElement element = null; |
... | ... | |
1412 | 1648 |
} |
1413 | 1649 |
|
1414 | 1650 |
/** |
1415 |
* |
|
1651 |
* <p>createSelectionElement</p> |
|
1652 |
* |
|
1653 |
* @param selectionType a {@link eu.etaxonomy.taxeditor.forms.CdmFormFactory.SelectionType} object. |
|
1654 |
* @param parentElement a {@link eu.etaxonomy.taxeditor.forms.ICdmFormElement} object. |
|
1655 |
* @param labelString a {@link java.lang.String} object. |
|
1416 | 1656 |
* @param selectionType |
1417 |
* @param parentElement |
|
1418 |
* @param labelString |
|
1419 |
* @param selection |
|
1420 |
* @param style |
|
1421 |
* @return |
|
1657 |
* @param selection a {@link eu.etaxonomy.cdm.model.common.IAnnotatableEntity} object. |
|
1658 |
* @param style a int. |
|
1659 |
* @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object. |
|
1660 |
* @return a {@link eu.etaxonomy.taxeditor.forms.selection.AbstractSelectionElement} object. |
|
1422 | 1661 |
*/ |
1423 | 1662 |
public AbstractSelectionElement createSelectionElement(SelectionType selectionType, ConversationHolder conversation, ICdmFormElement parentElement, String labelString, IAnnotatableEntity selection, int style){ |
1424 | 1663 |
AbstractSelectionElement element = null; |
... | ... | |
1478 | 1717 |
return element; |
1479 | 1718 |
} |
1480 | 1719 |
|
1720 |
/** |
|
1721 |
* <p>createNamedAreaSelectionElement</p> |
|
1722 |
* |
|
1723 |
* @param parentElement a {@link eu.etaxonomy.taxeditor.forms.ICdmFormElement} object. |
|
1724 |
* @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object. |
|
1725 |
* @param labelString a {@link java.lang.String} object. |
|
1726 |
* @param selection a {@link eu.etaxonomy.cdm.model.location.NamedArea} object. |
|
1727 |
* @param style a int. |
|
1728 |
* @return a {@link eu.etaxonomy.taxeditor.forms.selection.NamedAreaSelectionElement} object. |
|
1729 |
*/ |
|
1481 | 1730 |
public NamedAreaSelectionElement createNamedAreaSelectionElement(ICdmFormElement parentElement, ConversationHolder conversation, String labelString, NamedArea selection, int style){ |
1482 | 1731 |
NamedAreaSelectionElement element = new NamedAreaSelectionElement(this, conversation, parentElement, labelString, selection, style); |
1483 | 1732 |
adapt(element); |
... | ... | |
1485 | 1734 |
return element; |
1486 | 1735 |
} |
1487 | 1736 |
|
1737 |
/** {@inheritDoc} */ |
|
1488 | 1738 |
public LabelElement createLabel(ICdmFormElement parentElement, String text) { |
1489 | 1739 |
LabelElement labelElement = new LabelElement(this, parentElement, text); |
1490 | 1740 |
adapt(labelElement); |
... | ... | |
1492 | 1742 |
return labelElement; |
1493 | 1743 |
} |
1494 | 1744 |
|
1745 |
/** |
|
1746 |
* <p>Getter for the field <code>selectionProvider</code>.</p> |
|
1747 |
* |
|
1748 |
* @return a {@link org.eclipse.jface.viewers.ISelectionProvider} object. |
|
1749 |
*/ |
|
1495 | 1750 |
public ISelectionProvider getSelectionProvider() { |
1496 | 1751 |
return selectionProvider; |
1497 | 1752 |
} |
1498 | 1753 |
|
1754 |
/** |
|
1755 |
* <p>createDetailedDescriptionDetailElement</p> |
|
1756 |
* |
|
1757 |
* @param parentElement a {@link eu.etaxonomy.taxeditor.forms.ICdmFormElement} object. |
|
1758 |
* @param entity a {@link eu.etaxonomy.cdm.model.description.DescriptionElementBase} object. |
|
1759 |
* @param style a int. |
|
1760 |
* @return a {@link eu.etaxonomy.taxeditor.section.description.detail.AbstractDetailedDescriptionDetailElement} object. |
|
1761 |
*/ |
|
1499 | 1762 |
public AbstractDetailedDescriptionDetailElement createDetailedDescriptionDetailElement( |
1500 | 1763 |
ICdmFormElement parentElement, DescriptionElementBase entity, int style) { |
1501 | 1764 |
AbstractDetailedDescriptionDetailElement detailedDescriptionElement = null; |
... | ... | |
1534 | 1797 |
|
1535 | 1798 |
/** |
1536 | 1799 |
* Creates a styled text as a part of the form. |
1537 |
*
|
|
1800 |
* |
|
1538 | 1801 |
* @param parent |
1539 | 1802 |
* the text parent |
1540 | 1803 |
* @param value |
Also available in: Unified diff
performed javacscript:fix and worked on documentation