Project

General

Profile

« Previous | Next » 

Revision 7c5ba8e0

Added by Patrick Plitzner over 10 years ago

  • extracted design and layout of GUI objects from AbstractCdmFormElement to be able to use WindowBuilder
    • specifically tested it for GatheringEventDetailElement

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/detail/CdmSectionPart.java
1 1
// $Id$
2 2
/**
3 3
 * Copyright (C) 2007 EDIT
4
 * European Distributed Institute of Taxonomy 
4
 * European Distributed Institute of Taxonomy
5 5
 * http://www.e-taxonomy.eu
6
 * 
6
 *
7 7
 * The contents of this file are subject to the Mozilla Public License Version 1.1
8 8
 * See LICENSE.TXT at the top of this package for the full license terms.
9 9
 */
......
23 23
import eu.etaxonomy.taxeditor.model.PolytomousKeyRelationship;
24 24
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
25 25
import eu.etaxonomy.taxeditor.store.StoreUtil;
26
import eu.etaxonomy.taxeditor.ui.element.AbstractCdmFormElement;
27 26
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
27
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
28 28
import eu.etaxonomy.taxeditor.ui.section.ITaxonBaseDetailSection;
29 29
import eu.etaxonomy.taxeditor.ui.section.key.GeographicalScopeDetailSection;
30 30
import eu.etaxonomy.taxeditor.ui.section.key.PolytomousKeyDetailSection;
......
36 36
 * <p>
37 37
 * CdmSectionPart class.
38 38
 * </p>
39
 * 
39
 *
40 40
 * @author n.hoffmann
41 41
 * @created Feb 8, 2010
42 42
 * @version 1.0
......
50 50
	 * <p>
51 51
	 * Constructor for CdmSectionPart.
52 52
	 * </p>
53
	 * 
53
	 *
54 54
	 * @param section
55 55
	 *            a {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection}
56 56
	 *            object.
......
92 92
		if (input instanceof PolytomousKeyRelationship) {
93 93
			input = ((PolytomousKeyRelationship) input).getDestination();
94 94
		}
95
		
96
	    if ((input instanceof PolytomousKeyNode) && 
97
	            (formSection instanceof PolytomousKeyDetailSection || 
98
	                    formSection instanceof GeographicalScopeDetailSection || 
99
	                    formSection instanceof ScopeRestrictionSection || 
95

  
96
	    if ((input instanceof PolytomousKeyNode) &&
97
	            (formSection instanceof PolytomousKeyDetailSection ||
98
	                    formSection instanceof GeographicalScopeDetailSection ||
99
	                    formSection instanceof ScopeRestrictionSection ||
100 100
	                    formSection instanceof TaxonomicScopeSection)) {
101 101
	        input = ((PolytomousKeyNode)input).getKey();
102 102
	    }
103
	    
104
	    	
103

  
104

  
105 105
		formSection.setEntity((T) input);
106
		
106

  
107 107
		return true;
108 108
	}
109 109

  
110 110
	/*
111 111
	 * (non-Javadoc)
112
	 * 
112
	 *
113 113
	 * @see
114 114
	 * org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse
115 115
	 * .jface.util.PropertyChangeEvent)
......
119 119
	public void propertyChange(PropertyChangeEvent event) {
120 120
		if (event != null) {
121 121

  
122
			Object eventSource = event.getSource();			
123
			
122
			Object eventSource = event.getSource();
123

  
124 124
			if (formSection.equals(eventSource)){
125 125
				markDirty();
126 126
			}
127 127
			if((
128
						(eventSource instanceof AbstractCdmFormElement) 
129
						&& formSection.containsFormElement((AbstractCdmFormElement) eventSource))
128
						(eventSource instanceof ICdmFormElement)
129
						&& formSection.containsFormElement((ICdmFormElement) eventSource))
130 130
						) {
131 131
				markDirty();
132 132
			}

Also available in: Unified diff