Project

General

Profile

« Previous | Next » 

Revision 081d99b4

Added by Patrick Plitzner about 6 years ago

ref #7086 Add property and label to character details view

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/ColorResources.java
54 54
		registerColor(registry, Resources.COLOR_COMPOSITE_IRRELEVANT, 241,139,18);
55 55
		registerColor(registry, Resources.SEARCH_VIEW_FOREGROUND, 192, 192, 192);
56 56
		registerColor(registry, Resources.SEARCH_VIEW_FOCUS, 0, 0, 0);
57
		registerColor(registry, Resources.BLACK, 0, 0, 0);
57 58
		registerColor(registry, Resources.COLOR_LIST_BACKGROUND, 150,150,150);
58 59
		registerColor(registry, Resources.COLOR_FONT_DEFAULT, 0,0,0);
59 60
		registerColor(registry, Resources.COLOR_TEXT_DISABLED, 150,150,150);
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/Resources.java
1 1
/**
2 2
* Copyright (C) 2007 EDIT
3
* European Distributed Institute of Taxonomy 
3
* European Distributed Institute of Taxonomy
4 4
* http://www.e-taxonomy.eu
5
* 
5
*
6 6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7 7
* See LICENSE.TXT at the top of this package for the full license terms.
8 8
*/
......
19 19
 * @version 1.0
20 20
 */
21 21
public interface Resources {
22
	
22

  
23 23
	/* ***************************************************************************************
24 24
	FONTS
25
	************************************************************************************** */	
25
	************************************************************************************** */
26 26
	/** Constant <code>ACCEPTED_TAXON_FONT="eu.etaxonomy.taxeditor.preferences.font"{trunked}</code> */
27 27
	public static final String ACCEPTED_TAXON_FONT = "eu.etaxonomy.taxeditor.preferences.fontDefinition.nameEditor.accepted";
28 28
	/** Constant <code>SYNONYM_FONT="eu.etaxonomy.taxeditor.preferences.font"{trunked}</code> */
......
33 33
	public static final String CONCEPT_FONT = "eu.etaxonomy.taxeditor.preferences.fontDefinition.nameEditor.concept";
34 34
	/** Constant <code>FONT_DEFAULT_PROMPT="eu.etaxonomy.taxeditor.preferences.font"{trunked}</code> */
35 35
	public static final String FONT_DEFAULT_PROMPT = "eu.etaxonomy.taxeditor.preferences.fontDefinition.nameEditor.default";
36
	
36

  
37 37
	/** Constant <code>FONT_SEARCH_VIEW_ACCEPTED="eu.etaxonomy.taxeditor.preferences.font"{trunked}</code> */
38 38
	public static final String FONT_SEARCH_VIEW_ACCEPTED = "eu.etaxonomy.taxeditor.preferences.fontDefinition.searchView.accepted";
39 39
	/** Constant <code>FONT_SEARCH_VIEW_SYNONYM="eu.etaxonomy.taxeditor.preferences.font"{trunked}</code> */
40 40
	public static final String FONT_SEARCH_VIEW_SYNONYM = "eu.etaxonomy.taxeditor.preferences.fontDefinition.searchView.synonym";
41 41
	/** Constant <code>FONT_SEARCH_VIEW_OTHER="eu.etaxonomy.taxeditor.preferences.font"{trunked}</code> */
42 42
	public static final String FONT_SEARCH_VIEW_OTHER = "eu.etaxonomy.taxeditor.preferences.fontDefinition.searchView.other";
43
	
43

  
44 44
	/* ***************************************************************************************
45 45
	COLORS
46 46
	************************************************************************************** */
......
50 50
	public static final String COLOR_CONTROL_SELECTED = "eu.etaxonomy.taxeditor.preferences.colorDefinition.nameEditor.colorContainerSelected";
51 51
	/** Constant <code>COLOR_CONTROL_SELECTED_FOCUS="eu.etaxonomy.taxeditor.preferences.colo"{trunked}</code> */
52 52
	public static final String COLOR_CONTROL_SELECTED_FOCUS = "eu.etaxonomy.taxeditor.preferences.colorDefinition.nameEditor.colorContainerSelectedFocus";
53
	
53

  
54 54
	/** Constant <code>COLOR_COMPOSITE_BACKGROUND="eu.etaxonomy.taxeditor.preferences.colo"{trunked}</code> */
55 55
	public static final String COLOR_COMPOSITE_BACKGROUND = "eu.etaxonomy.taxeditor.preferences.colorDefinition.colorCompositeBackground";
56 56
	/** Constant <code>COLOR_COMPOSITE_IRRELEVANT="eu.etaxonomy.taxeditor.preferences.colo"{trunked}</code> */
57 57
	public static final String COLOR_COMPOSITE_IRRELEVANT = "eu.etaxonomy.taxeditor.preferences.colorDefinition.colorCompositeIrrelevant";
58
	
58

  
59 59
	/** Constant <code>SEARCH_VIEW_FOREGROUND="eu.etaxonomy.taxeditor.preferences.colo"{trunked}</code> */
60 60
	public static final String SEARCH_VIEW_FOREGROUND = "eu.etaxonomy.taxeditor.preferences.colorDefinition.searchView.foreground";
61 61
	/** Constant <code>SEARCH_VIEW_FOCUS="eu.etaxonomy.taxeditor.preferences.colo"{trunked}</code> */
62 62
	public static final String SEARCH_VIEW_FOCUS = "eu.etaxonomy.taxeditor.preferences.colorDefinition.searchView.focus";
63 63

  
64
	public static final String BLACK = "eu.etaxonomy.taxeditor.preferences.colorDefinition.black";
65

  
64 66
	/** Constant <code>COLOR_LIST_BACKGROUND="eu.etaxonomy.taxeditor.preferences.colo"{trunked}</code> */
65 67
	public static final String COLOR_LIST_BACKGROUND = "eu.etaxonomy.taxeditor.preferences.colorDefinition.listBackground";
66 68
	/** Constant <code>COLOR_FONT_DEFAULT="eu.etaxonomy.taxeditor.preferences.colo"{trunked}</code> */
......
69 71
	public static final String COLOR_TEXT_DISABLED = "eu.etaxonomy.taxeditor.preferences.colorDefinition.textDisabled";
70 72
	/** Constant <code>COLOR_TEXT_DISABLED_BACKGROUND="eu.etaxonomy.taxeditor.preferences.colo"{trunked}</code> */
71 73
	public static final String COLOR_TEXT_DISABLED_BACKGROUND = "eu.etaxonomy.taxeditor.preferences.colorDefinition.textBackgroundDisabled";
72
	
74

  
73 75
	/** Constant <code>COLOR_DRAG_ENTER="eu.etaxonomy.taxeditor.preferences.colo"{trunked}</code> */
74 76
	public static final String COLOR_DRAG_ENTER = "eu.etaxonomy.taxeditor.preferences.colorDefinition.nameEditor.colorContainerDragEnter";
75 77
	/** Constant <code>COLOR_LIST_EVEN="eu.etaxonomy.taxeditor.preferences.colo"{trunked}</code> */
76 78
	public static final String COLOR_LIST_EVEN = "eu.etaxonomy.taxeditor.preferences.colorDefinition.listBackgroundEven";
77 79
	/** Constant <code>COLOR_LIST_ODD="eu.etaxonomy.taxeditor.preferences.colo"{trunked}</code> */
78 80
	public static final String COLOR_LIST_ODD = "eu.etaxonomy.taxeditor.preferences.colorDefinition.listBackgroundOdd";
79
	
81

  
80 82
	public static final String COLOR_PARSE_ERROR = "eu.etaxonomy.taxeditor.preferences.colorDefinition.parseError";
81
	
83

  
82 84
	public static final String COLOR_DISABLED_EDITOR = "eu.etaxonomy.taxeditor.preferences.colorDefinition.disabledEditor";
83
	
85

  
84 86
	public static final String COLOR_EDITOR_ERROR = "eu.etaxonomy.taxeditor.preferences.colorDefinition.editorError";
85
	
86
	
87

  
88

  
87 89
}
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/feature/CharacterDetailElement.java
8 8
*/
9 9
package eu.etaxonomy.taxeditor.ui.section.feature;
10 10

  
11
import org.eclipse.swt.widgets.Label;
11 12
import org.eclipse.ui.forms.widgets.ExpandableComposite;
12 13

  
13 14
import eu.etaxonomy.cdm.model.description.Character;
15
import eu.etaxonomy.taxeditor.model.ColorResources;
16
import eu.etaxonomy.taxeditor.preference.Resources;
14 17
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
15 18
import eu.etaxonomy.taxeditor.ui.element.CheckboxElement;
16 19
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
17 20
import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
18
import eu.etaxonomy.taxeditor.ui.section.vocabulary.DefinedTermDetailElement;
21
import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
22
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
19 23
import eu.etaxonomy.taxeditor.ui.section.vocabulary.MeasurementUnitCollectionSection;
20 24
import eu.etaxonomy.taxeditor.ui.section.vocabulary.RecommendedModifierVocabulariesCollectionSection;
21 25
import eu.etaxonomy.taxeditor.ui.section.vocabulary.StateVocabularyCollectionSection;
......
27 31
 * @since Dec 21, 2017
28 32
 *
29 33
 */
30
public class CharacterDetailElement extends DefinedTermDetailElement<Character> {
34
public class CharacterDetailElement extends AbstractCdmDetailElement<Character> {
31 35

  
32 36
    private ICdmFormElement parentFormElement;
33 37

  
......
50 54

  
51 55
	@Override
52 56
	protected void createControls(ICdmFormElement formElement, Character entity, int style) {
53
	    super.createControls(formElement, entity, style);
54 57
	    this.parentFormElement = formElement;
58
	    Label lblStructure = new Label(formElement.getLayoutComposite(), style);
59
	    lblStructure.setText("Structure");
60
	    Label lblStructureText = new Label(formElement.getLayoutComposite(), style);
61
	    lblStructureText.setText(entity.getStructure().getFeature().getLabel());
62
	    lblStructureText.setForeground(ColorResources.getColor(Resources.BLACK));
63
	    Label lblProperty = new Label(formElement.getLayoutComposite(), style);
64
	    lblProperty.setText("Property");
65
	    Label lblPropertyText = new Label(formElement.getLayoutComposite(), style);
66
	    lblPropertyText.setForeground(ColorResources.getColor(Resources.BLACK));
67
	    lblPropertyText.setText(entity.getProperty().getFeature().getLabel());
55 68
	    supportsQuantitativeData = formFactory.createCheckbox(formElement, "Supports Quantitative Data", entity.isSupportsQuantitativeData(), style);
56 69
	    supportsCategoricalData = formFactory.createCheckbox(formElement, "Supports Categorical Data", entity.isSupportsCategoricalData(), style);
57 70

  
......
79 92
                           );
80 93
            sectionModifierVocabularies.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
81 94
            sectionModifierVocabularies.setEntity(getEntity());
82

  
83
            //if any type is selected disable supportsTextData
84
            entity.setSupportsTextData(false);
85 95
        }
86 96
    }
87 97

  
88 98
	@Override
89 99
	public void handleEvent(Object eventSource) {
90
	    super.handleEvent(eventSource);
100
	    if(eventSource == supportsQuantitativeData || eventSource == supportsCategoricalData){
101
	        //if any type is selected disable supportsTextData
102
	        getEntity().setSupportsTextData(false);
103
	    }
91 104
	    if(eventSource == supportsQuantitativeData){
92 105
	        getEntity().setSupportsQuantitativeData(supportsQuantitativeData.getSelection());
93 106
	        if(supportsQuantitativeData.getSelection()){

Also available in: Unified diff