Project

General

Profile

Revision 9f7e89bc

ID9f7e89bc2034a67fe1c630c5f45b247fd5e16be8
Parent e03ab30b
Child b0ab81b7

Added by Patrick Plitzner almost 6 years ago

  • refactored LanguageStringWithLabelElement (isMultiLine flag)

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/CdmFormFactory.java
718 718
		return element;
719 719
	}
720 720

  
721
    /**
722
     * <p>
723
     * createLanguageStringWithLabelElement
724
     * </p>
725
     *
726
     * @param parentElement
727
     *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
728
     *            object.
729
     * @param labelString
730
     *            a {@link java.lang.String} object.
731
     * @param languageString
732
     *            a {@link eu.etaxonomy.cdm.model.common.LanguageString} object.
733
     * @param style
734
     *            a int.
735
     * @return a
736
     *         {@link eu.etaxonomy.taxeditor.ui.element.LanguageStringWithLabelElement}
737
     *         object.
738
     */
739 721
    public LanguageStringWithLabelElement createLanguageStringWithLabelElement(ICdmFormElement parentElement,
740 722
            String labelString, LanguageString languageString, int style) {
741
        LanguageStringWithLabelElement element = new LanguageStringWithLabelElement(this, parentElement, labelString,
742
                languageString, style);
743
        adapt(element);
744
        parentElement.addElement(element);
745
        return element;
723
        return createLanguageStringWithLabelElement(parentElement, labelString, languageString, null, false, style);
746 724
    }
747 725

  
748
    /**
749
     * <p>
750
     * createLanguageStringWithLabelElement
751
     * </p>
752
     *
753
     * @param parentElement
754
     *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
755
     *            object.
756
     * @param labelString
757
     *            a {@link java.lang.String} object.
758
     * @param languageString
759
     *            a {@link eu.etaxonomy.cdm.model.common.LanguageString} object.
760
     * @param height
761
     *            a int.
762
     * @param style
763
     *            a int.
764
     * @return a
765
     *         {@link eu.etaxonomy.taxeditor.ui.element.LanguageStringWithLabelElement}
766
     *         object.
767
     */
768 726
    public LanguageStringWithLabelElement createLanguageStringWithLabelElement(ICdmFormElement parentElement,
769
            String labelString, LanguageString languageString, int height, int style) {
727
            String labelString, LanguageString languageString, Integer height, boolean isMultiLine, int style) {
770 728
        LanguageStringWithLabelElement element = new LanguageStringWithLabelElement(this, parentElement, labelString,
771
                languageString, height, style);
729
                languageString, height, isMultiLine, style);
772 730
        adapt(element);
773 731
        parentElement.addElement(element);
774 732
        return element;
775 733
    }
776 734

  
777

  
778 735
    /**
779 736
     * <p>
780 737
     * createKeyValueViewerElement
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/LanguageStringWithLabelElement.java
54 54
	protected LanguageStringWithLabelElement(CdmFormFactory formFactory,
55 55
			ICdmFormElement parentElement, String labelString,
56 56
			LanguageString languageString, Integer height, int style) {
57
		super(formFactory, parentElement, labelString, null, height, true, style);
57
		this(formFactory, parentElement, labelString, languageString, height, true, style);
58
	}
59

  
60
	protected LanguageStringWithLabelElement(CdmFormFactory formFactory,
61
	        ICdmFormElement parentElement, String labelString,
62
	        LanguageString languageString, Integer height, boolean isMultiLine, int style) {
63
	    super(formFactory, parentElement, labelString, null, height, isMultiLine, style);
64

  
65
	    setLanguageString(languageString);
58 66

  
59
		setLanguageString(languageString);
60 67
	}
61 68

  
62 69
	/**
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/MultilanguageTextElement.java
119 119

  
120 120
		element_languageString = this.formFactory
121 121
				.createLanguageStringWithLabelElement(formElement, labelString,
122
						null, textHeight, style);
122
						null, textHeight, true, style);
123 123

  
124 124
		if (PreferencesUtil.isMultilanguageTextEditingCapability()) {
125 125
			createMultilanguageTextEditingElements(formElement,
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/media/MediaMetaElement.java
71 71
    public void createControls(ICdmFormElement element, int style) {
72 72
        text_title = formFactory.createLanguageStringWithLabelElement(element, "Title", null, style);
73 73
        selection_artist = formFactory.createSelectionElement(AgentBase.class, getConversationHolder(), element, "Artist", null, EntitySelectionElement.ALL, style);
74
        text_description = formFactory.createLanguageStringWithLabelElement(element, "Description", null, 100, style);
74
        text_description = formFactory.createLanguageStringWithLabelElement(element, "Description", null, 100, true, style);
75 75
        mediaDetailElement = formFactory.createMediaDetailElement(element);
76 76
    }
77 77

  
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/translation/TranslationWizardPage.java
147 147

  
148 148
		LanguageString preferredLanguageString = MultilanguageTextHelper.getPreferredLanguageString(multilanguageText, getLanguages());
149 149

  
150
		text_source = formFactory.createLanguageStringWithLabelElement(element, null, preferredLanguageString, TEXT_HEIGHT, SWT.NULL);
150
		text_source = formFactory.createLanguageStringWithLabelElement(element, null, preferredLanguageString, TEXT_HEIGHT, true, SWT.NULL);
151 151

  
152 152
//		text_source.setEnabled(false);
153 153

  
......
186 186
			}
187 187
		});
188 188

  
189
		text_target = formFactory.createLanguageStringWithLabelElement(element, null, null, TEXT_HEIGHT, SWT.NULL);
189
		text_target = formFactory.createLanguageStringWithLabelElement(element, null, null, TEXT_HEIGHT, true, SWT.NULL);
190 190

  
191 191
		//
192 192
		// The automated translation did rely on the Google Translate API. Unfortunately this service is not free anymore.

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)