Project

General

Profile

« Previous | Next » 

Revision 19744d89

Added by Andreas Müller over 2 years ago

cleanup

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/StateDataElement.java
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
*/
9

  
10 9
package eu.etaxonomy.taxeditor.ui.section.description;
11 10

  
12 11
import java.util.ArrayList;
......
33 32
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement;
34 33

  
35 34
/**
36
 * <p>StateDataElement class.</p>
37
 *
38 35
 * @author n.hoffmann
39 36
 * @created Sep 15, 2010
40
 * @version 1.0
41 37
 */
42 38
public class StateDataElement extends AbstractEntityCollectionElement<StateData> {
43 39

  
......
45 41
	private ModifierSection section_modifiers;
46 42
	private TextWithLabelElement text_modifyingText;
47 43

  
48
	/**
49
	 * <p>Constructor for StateDataElement.</p>
50
	 *
51
	 * @param formFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
52
	 * @param section a {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection} object.
53
	 * @param entity a {@link eu.etaxonomy.cdm.model.description.StateData} object.
54
	 * @param removeListener a {@link org.eclipse.swt.events.SelectionListener} object.
55
	 * @param style a int.
56
	 */
57 44
	public StateDataElement(CdmFormFactory formFactory,
58 45
			AbstractFormSection section, StateData entity,
59 46
			SelectionListener removeListener, int style) {
60 47
		super(formFactory, section, entity, removeListener, null, style);
61 48
	}
62 49

  
63
	/** {@inheritDoc} */
64 50
	@Override
65 51
	public void setEntity(StateData entity) {
66 52
		this.entity = entity;
67
		List<State> stateTerms = new ArrayList<State>();
53
		List<State> stateTerms = new ArrayList<>();
68 54
		Set<TermVocabulary<State>> stateVocabularies = getEntity().getCategoricalData().getFeature().getSupportedCategoricalEnumerations();
69 55
		for (TermVocabulary<State> termVocabulary : stateVocabularies) {
70 56
		    stateTerms.addAll(termVocabulary.getTerms());
......
83 69
		}
84 70
	}
85 71

  
86
	/** {@inheritDoc} */
87 72
	@Override
88 73
	public void createControls(ICdmFormElement element, int style) {
89 74
		combo_state = formFactory.createDefinedTermComboElement(TermType.State, element, "State", null, style);
......
98 83

  
99 84
	}
100 85

  
101
	/** {@inheritDoc} */
102 86
	@Override
103 87
	public void handleEvent(Object eventSource) {
104 88
		if(eventSource == combo_state){
......
110 94
		}
111 95
	}
112 96

  
113
	public void setEnabled(boolean enable){
97
	@Override
98
    public void setEnabled(boolean enable){
114 99
		if (combo_state != null){
115 100
			combo_state.setEnabled(enable);
116 101
		}
117 102
	    if (section_modifiers != null){
118 103
	    	section_modifiers.setEnabled(enable);
119 104
	    }
120
	    if (text_modifyingText != null){	   
105
	    if (text_modifyingText != null){
121 106
	    	text_modifyingText.setEnabled(enable);
122 107
	    }
123 108
	}
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/StateDataSection.java
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
*/
9

  
10 9
package eu.etaxonomy.taxeditor.ui.section.description;
11 10

  
12 11
import java.util.Collection;
......
22 21
import eu.etaxonomy.taxeditor.ui.section.DefaultCdmBaseComparator;
23 22

  
24 23
/**
25
 * <p>StateDataSection class.</p>
26
 *
27 24
 * @author n.hoffmann
28 25
 * @created Sep 15, 2010
29
 * @version 1.0
30 26
 */
31 27
public class StateDataSection extends AbstractEntityCollectionSection<CategoricalData, StateData> implements IEnableableFormElement {
32 28

  
33
	/**
34
	 * <p>Constructor for StateDataSection.</p>
35
	 *
36
	 * @param formFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
37
	 * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
38
	 * @param parentElement a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} object.
39
	 * @param style a int.
40
	 */
41 29
	public StateDataSection(CdmFormFactory formFactory,
42 30
			ConversationHolder conversation, ICdmFormElement parentElement,
43 31
			int style) {
44 32
		super(formFactory, conversation, parentElement, "State Data", style);
45 33
	}
46 34

  
47
	/** {@inheritDoc} */
48 35
	@Override
49 36
	public Collection<StateData> getCollection(CategoricalData entity) {
50 37
		return entity.getStateData();
......
55 42
        return new DefaultCdmBaseComparator<>();
56 43
	}
57 44

  
58
	/** {@inheritDoc} */
59 45
	@Override
60 46
	public StateData createNewElement() {
61 47
		return StateData.NewInstance();
62 48
	}
63 49

  
64
	/** {@inheritDoc} */
65 50
	@Override
66 51
	public void addElement(StateData element) {
67 52
		getEntity().addStateData(element);
68 53
	}
69 54

  
70
	/** {@inheritDoc} */
71 55
	@Override
72 56
	public void removeElement(StateData element) {
73 57
		getEntity().removeStateData(element);
74 58
	}
75 59

  
76
	/** {@inheritDoc} */
77 60
	@Override
78 61
	public String getEmptyString() {
79 62
		return "No state data yet.";
80 63
	}
81 64

  
82
	/** {@inheritDoc} */
83 65
	@Override
84 66
	protected String getTooltipString() {
85 67
		return "Create new state data";
86 68
	}
87 69

  
88
    /**
89
     * {@inheritDoc}
90
     */
91 70
    @Override
92 71
    public StateData addExisting() {
93 72
        return null;
94 73
    }
95 74

  
96
    /**
97
     * {@inheritDoc}
98
     */
99 75
    @Override
100 76
    public boolean allowAddExisting() {
101 77
        return false;
102 78
    }
103

  
104

  
105
}
79
}
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/ui/dialogs/CdmServerInfoTest.java
45 45
        }
46 46
    }
47 47

  
48
    @Ignore // this should be targetting integration or production
48
    @Ignore // this should be targeting integration or production
49 49
    @Test
50 50
    public void pingInstancesTest() {
51 51
        CdmServerInfo csii = new CdmServerInfo(new CdmServerInfoConfig("edit-test", "test.e-taxonomy.eu", 8080, "cdmserver/", false));
......
72 72
        }
73 73
    }
74 74

  
75
    @Ignore // this should be targetting integration or production
75
    @Ignore // this should be targeting integration or production
76 76
    @Test
77 77
    public void refreshInstancesTest() throws CdmServerException {
78 78
        CdmServerInfo cdmServerInfo = new CdmServerInfo(new CdmServerInfoConfig("edit-test", "test.e-taxonomy.eu", 8080, "cdmserver/", false));

Also available in: Unified diff