Project

General

Profile

« Previous | Next » 

Revision aa1f683f

Added by Patrick Plitzner almost 7 years ago

Delete unused GUI classes

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/CdmFormFactory.java
239 239
import eu.etaxonomy.taxeditor.ui.section.occurrence.derivedUnit.PreservedSpecimenCurrentDeterminationDetailSection;
240 240
import eu.etaxonomy.taxeditor.ui.section.occurrence.derivedUnit.PreservedSpecimenDetailElement;
241 241
import eu.etaxonomy.taxeditor.ui.section.occurrence.derivedUnit.PreservedSpecimenDetailSection;
242
import eu.etaxonomy.taxeditor.ui.section.occurrence.derivedUnit.PreservedSpecimenDeterminationDetailElement;
243
import eu.etaxonomy.taxeditor.ui.section.occurrence.derivedUnit.PreservedSpecimenDeterminationDetailSection;
244
import eu.etaxonomy.taxeditor.ui.section.occurrence.derivedUnit.PreservedSpecimenDeterminationHistoryDetailSection;
245 242
import eu.etaxonomy.taxeditor.ui.section.occurrence.derivedUnit.PreservedSpecimenGeneralDetailElement;
246 243
import eu.etaxonomy.taxeditor.ui.section.occurrence.derivedUnit.PreservedSpecimenGeneralDetailSection;
247 244
import eu.etaxonomy.taxeditor.ui.section.occurrence.derivedUnit.PreservedSpecimenSourceCollectionDetailSection;
......
1783 1780
        return section;
1784 1781
    }
1785 1782

  
1786
    public PreservedSpecimenDeterminationDetailSection createPreservedSpecimenDeterminationDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
1787
        PreservedSpecimenDeterminationDetailSection section = new PreservedSpecimenDeterminationDetailSection(this, conversation, parentElement, selectionProvider, style);
1788
        addAndAdaptSection(parentElement, section);
1789
        return section;
1790
    }
1791

  
1792 1783
    public TaxonRelationshipDetailSection createTaxonRelationshipDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
1793 1784
        TaxonRelationshipDetailSection section = new TaxonRelationshipDetailSection(this, conversation, parentElement, selectionProvider, style);
1794 1785
        addAndAdaptSection(parentElement, section);
......
2139 2130
        return element;
2140 2131
    }
2141 2132

  
2142
    public PreservedSpecimenDeterminationDetailElement createPreservedSpecimenDeterminationDetailElement(ICdmFormElement parentElement) {
2143
        PreservedSpecimenDeterminationDetailElement element = new PreservedSpecimenDeterminationDetailElement(this, parentElement);
2144
        addAndAdaptElement(parentElement, element);
2145
        return element;
2146
    }
2147

  
2148 2133
    public DeterminationDetailElement createDeterminationDetailElement(ICdmFormElement parentElement) {
2149 2134
        DeterminationDetailElement element = new DeterminationDetailElement(this, parentElement);
2150 2135
        addAndAdaptElement(parentElement, element);
......
2383 2368
        return section;
2384 2369
    }
2385 2370

  
2386
    public PreservedSpecimenDeterminationHistoryDetailSection createPreservedSpecimenDeterminationHistoryDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
2387
        PreservedSpecimenDeterminationHistoryDetailSection section = new PreservedSpecimenDeterminationHistoryDetailSection(this, conversation, parentElement, style);
2388
        addAndAdaptSection(parentElement, section);
2389
        return section;
2390
    }
2391

  
2392 2371
    public SpecimenCollectionDetailSection createSpecimenCollectionDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
2393 2372
        SpecimenCollectionDetailSection section = new SpecimenCollectionDetailSection(this, conversation, parentElement, style);
2394 2373
        addAndAdaptSection(parentElement, section);
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/derivedUnit/PreservedSpecimenDeterminationDetailElement.java
1
// $Id$
2
/**
3
* Copyright (C) 2007 EDIT
4
* European Distributed Institute of Taxonomy
5
* http://www.e-taxonomy.eu
6
*
7
* The contents of this file are subject to the Mozilla Public License Version 1.1
8
* See LICENSE.TXT at the top of this package for the full license terms.
9
*/
10

  
11
package eu.etaxonomy.taxeditor.ui.section.occurrence.derivedUnit;
12

  
13
import org.eclipse.ui.forms.widgets.ExpandableComposite;
14

  
15
import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
16
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
17
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
18
import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
19
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
20

  
21
/**
22
 * @author n.hoffmann
23
 * @created May 11, 2011
24
 * @version 1.0
25
 */
26
public class PreservedSpecimenDeterminationDetailElement extends AbstractCdmDetailElement<DerivedUnit> {
27

  
28
	private PreservedSpecimenCurrentDeterminationDetailSection section_currentDetermination;
29

  
30
	private PreservedSpecimenDeterminationHistoryDetailSection section_determinationHistory;
31

  
32
	/**
33
	 * @param formFactory
34
	 * @param formElement
35
	 */
36
	public PreservedSpecimenDeterminationDetailElement(CdmFormFactory formFactory,
37
			ICdmFormElement formElement) {
38
		super(formFactory, formElement);
39
	}
40

  
41
	/* (non-Javadoc)
42
	 * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement#createControls(eu.etaxonomy.taxeditor.ui.forms.ICdmFormElement, java.lang.Object, int)
43
	 */
44
	@Override
45
	protected void createControls(ICdmFormElement formElement,
46
	        DerivedUnit entity, int style) {
47

  
48
        section_currentDetermination = formFactory.createPreservedSpecimenCurrentDeterminationDetailSection(getConversationHolder(), formElement, ExpandableComposite.EXPANDED);
49
        section_currentDetermination.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
50
        section_currentDetermination.setEntity(entity);
51

  
52
        section_determinationHistory = formFactory.createPreservedSpecimenDeterminationHistoryDetailSection(getConversationHolder(), formElement, ExpandableComposite.TWISTIE);
53
        section_determinationHistory.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
54
        section_determinationHistory.setEntity(entity);
55

  
56
	}
57

  
58
	/* (non-Javadoc)
59
	 * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement#handleEvent(java.lang.Object)
60
	 */
61
	@Override
62
	public void handleEvent(Object eventSource) {
63
		if(eventSource == section_currentDetermination){
64
			section_determinationHistory.refresh();
65
		}
66
	}
67

  
68
}
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/derivedUnit/PreservedSpecimenDeterminationDetailSection.java
1
// $Id$
2
/**
3
* Copyright (C) 2007 EDIT
4
* European Distributed Institute of Taxonomy
5
* http://www.e-taxonomy.eu
6
*
7
* The contents of this file are subject to the Mozilla Public License Version 1.1
8
* See LICENSE.TXT at the top of this package for the full license terms.
9
*/
10

  
11
package eu.etaxonomy.taxeditor.ui.section.occurrence.derivedUnit;
12

  
13
import org.eclipse.jface.viewers.ISelectionProvider;
14

  
15
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
16
import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
17
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
18
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
19
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
20
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
21

  
22
/**
23
 * @author n.hoffmann
24
 * @created May 11, 2011
25
 * @version 1.0
26
 */
27
public class PreservedSpecimenDeterminationDetailSection extends AbstractCdmDetailSection<DerivedUnit> {
28

  
29
	/**
30
	 * @param formFactory
31
	 * @param conversation
32
	 * @param parentElement
33
	 * @param selectionProvider
34
	 * @param style
35
	 */
36
	public PreservedSpecimenDeterminationDetailSection(CdmFormFactory formFactory,
37
			ConversationHolder conversation, ICdmFormElement parentElement,
38
			ISelectionProvider selectionProvider, int style) {
39
		super(formFactory, conversation, parentElement, selectionProvider, style);
40
	}
41

  
42
	/* (non-Javadoc)
43
	 * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#getHeading()
44
	 */
45
	@Override
46
	public String getHeading() {
47
		return "Determinations";
48
	}
49

  
50
	/* (non-Javadoc)
51
	 * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
52
	 */
53
	@Override
54
	protected AbstractCdmDetailElement<DerivedUnit> createCdmDetailElement(AbstractCdmDetailSection<DerivedUnit> parentElement, int style) {
55
	    return formFactory.createPreservedSpecimenDeterminationDetailElement(parentElement);
56
	}
57

  
58
}
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/derivedUnit/PreservedSpecimenDeterminationHistoryDetailSection.java
1
// $Id$
2
/**
3
* Copyright (C) 2007 EDIT
4
* European Distributed Institute of Taxonomy
5
* http://www.e-taxonomy.eu
6
*
7
* The contents of this file are subject to the Mozilla Public License Version 1.1
8
* See LICENSE.TXT at the top of this package for the full license terms.
9
*/
10

  
11
package eu.etaxonomy.taxeditor.ui.section.occurrence.derivedUnit;
12

  
13
import java.util.Collection;
14
import java.util.HashSet;
15
import java.util.Set;
16

  
17
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
18
import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
19
import eu.etaxonomy.cdm.model.occurrence.DeterminationEvent;
20
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
21
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
22

  
23
/**
24
 * @author n.hoffmann
25
 * @created May 11, 2011
26
 * @version 1.0
27
 */
28
public class PreservedSpecimenDeterminationHistoryDetailSection extends
29
PreservedSpecimenAbstractDeterminationEventDetailSection {
30

  
31
	/**
32
	 * @param formFactory
33
	 * @param conversation
34
	 * @param parentElement
35
	 * @param style
36
	 */
37
	public PreservedSpecimenDeterminationHistoryDetailSection(CdmFormFactory formFactory,
38
			ConversationHolder conversation, ICdmFormElement parentElement,
39
			int style) {
40
		super(formFactory, conversation, parentElement, "Determination History", style);
41
	}
42

  
43
	/* (non-Javadoc)
44
	 * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#getCollection(java.lang.Object)
45
	 */
46
	@Override
47
	public Collection<DeterminationEvent> getCollection(DerivedUnit entity) {
48
	    if(entity!=null){
49
	        Set<DeterminationEvent> events = entity.getDeterminations();
50
	        Set<DeterminationEvent> result = new HashSet<DeterminationEvent>();
51
	        for (DeterminationEvent event : events){
52
	            if (event.getPreferredFlag() != true){
53
	                result.add(event);
54
	            }
55
	        }
56
	        return result;
57
	    }
58
		return null;
59
	}
60

  
61
	@Override
62
	public void refresh() {
63
		internalUpdateSection(false);
64
	}
65

  
66

  
67
	/* (non-Javadoc)
68
	 * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getTooltipString()
69
	 */
70
	/** {@inheritDoc} */
71
	@Override
72
	protected String getTooltipString() {
73
		return "Add a determination event to the history";
74
	}
75

  
76
}

Also available in: Unified diff