Project

General

Profile

Revision 3e194787

ID3e194787899d08624921b3b5cbb109ebcc74b4f5
Parent fdefb4bc
Child 69410b96

Added by Patrick Plitzner over 2 years ago

fix #6197 Move excluded and unplaced from Taxon to TaxonNode in
TaxEditor

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/classification/TaxonNodeDetailElement.java
59 59

  
60 60
	private TaxonNodeAgentRelationCollectionSection selectionNodeAgentRelation;
61 61

  
62

  
63 62
	private CheckboxElement checkbox_openInEditor;
64 63

  
64
    private CheckboxElement checkbox_excluded;
65

  
66
    private CheckboxElement checkbox_unplaced;
67

  
65 68
	private boolean openInEditor;
66 69

  
67 70
	private boolean complete;
......
116 119
            setTreeNode(entity);
117 120
            complete = true;
118 121
        }
122
		if (entity instanceof TaxonNode) {
123
		    checkbox_excluded = formFactory.createCheckbox(formElement,
124
		            "Taxon is excluded", ((TaxonNode) entity).isExcluded(), style);
125
		    checkbox_unplaced = formFactory.createCheckbox(formElement,
126
		            "Taxon is unplaced", ((TaxonNode) entity).isUnplaced(), style);
127
		}
128

  
119 129
		if (!isCreateNew()){
120 130
            selectionNodeAgentRelation = formFactory.createTaxonNodeAgentRelationCollectionSection(formElement, getConversationHolder(), style);
121 131
            selectionNodeAgentRelation.setEntity((TaxonNode)entity);
......
177 187
			        textNewTaxonName.setText(null);
178 188
			    }
179 189
				complete = !textNewTaxonName.getText().isEmpty();
180
				
190

  
181 191

  
182 192
		} else if (eventSource == selection_reuseExistingName) {
183 193
		    boolean enabled = selection_reuseExistingName.getEntity() == null;
......
193 203
			selection_reuseExistingTaxon.setEnabled(enabled);
194 204
			selection_reuseExistingName.setEnabled(enabled);
195 205

  
196
			complete = !textNewTaxonName.getText().isEmpty();
206
			complete = CdmUtils.isNotBlank(textNewTaxonName.getText());
207
		} else if (eventSource == checkbox_excluded) {
208
		    ((TaxonNode) getEntity()).setExcluded(checkbox_excluded.getSelection());
209
		} else if (eventSource == checkbox_unplaced) {
210
		    ((TaxonNode) getEntity()).setUnplaced(checkbox_unplaced.getSelection());
197 211
		} else if (eventSource == checkbox_openInEditor) {
198 212
			setOpenInEditor(checkbox_openInEditor.getSelection());
199 213
		} else if (eventSource == selectionNodeAgentRelation){
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/taxon/TaxonBaseDetailElement.java
14 14

  
15 15
import org.eclipse.jface.util.PropertyChangeEvent;
16 16
import org.eclipse.swt.SWT;
17
import org.eclipse.ui.forms.widgets.ExpandableComposite;
18 17

  
19 18
import eu.etaxonomy.cdm.model.reference.Reference;
20
import eu.etaxonomy.cdm.model.taxon.Synonym;
21 19
import eu.etaxonomy.cdm.model.taxon.Taxon;
22 20
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
23 21
import eu.etaxonomy.cdm.persistence.hibernate.permission.Role;
......
27 25
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
28 26
import eu.etaxonomy.taxeditor.ui.element.CheckboxElement;
29 27
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
30
import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
31 28
import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
32 29
import eu.etaxonomy.taxeditor.ui.section.AbstractIdentifiableEntityDetailElement;
33 30
import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
......
53 50

  
54 51
	private TextWithLabelElement text_appendedPhrase;
55 52

  
56
	private CheckboxElement checkbox_excluded;
57

  
58
	private CheckboxElement checkbox_unplaced;
59

  
60 53
	private CheckboxElement checkbox_published;
61 54

  
62 55
//	private SynonymRelationshipDetailSection sectionSynonymRelationship;
......
111 104
		if (!PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.IS_RL)) {
112 105
			checkbox_useNameCache = formFactory.createCheckbox(formElement,
113 106
					"Exclude Authorship", entity.isUseNameCache(), style);
114

  
115
//#3925		
116
//			if (entity instanceof Taxon) {
117
//				checkbox_excluded = formFactory.createCheckbox(formElement,
118
//						"Taxon is excluded", ((Taxon) entity).isExcluded(), style);
119
//				checkbox_unplaced = formFactory.createCheckbox(formElement,
120
//						"Taxon is unplaced", ((Taxon) entity).isUnplaced(), style);
121
//			}
122

  
123 107
			checkbox_doubtful = formFactory.createCheckbox(formElement,
124 108
					entity.getClass().getSimpleName() + " is doubtful", entity.isDoubtful(), style);
125 109
		}
......
157 141
		super.updateContent();
158 142
		toggleable_cache.setEnabled(getEntity().isProtectedTitleCache());
159 143
		setIrrelevant(toggleable_cache.getState(),
160
				Arrays.asList(new Object[] { toggleable_cache, checkbox_published, checkbox_unplaced, checkbox_excluded }));
144
				Arrays.asList(new Object[] { toggleable_cache, checkbox_published}));
161 145
	}
162 146

  
163 147
	@Override
......
182 166
			getEntity().setAppendedPhrase(text_appendedPhrase.getText());
183 167
		}else if (eventSource == text_secundum_microreference) {
184 168
            getEntity().setSecMicroReference(text_secundum_microreference.getText());
185
//#3925
186
//        }else if (eventSource == checkbox_excluded) {
187
//			((Taxon) getEntity()).setExcluded(checkbox_excluded.getSelection());
188
//		} else if (eventSource == checkbox_unplaced) {
189
//		    ((Taxon) getEntity()).setUnplaced(checkbox_unplaced.getSelection());
190 169
		} else if (eventSource == checkbox_published) {
191 170
		    ((Taxon)getEntity()).setPublish(checkbox_published.getSelection());
192 171
		}
......
196 175
        boolean pushedState = toggleable_cache.getState();
197 176

  
198 177
        getEntity().setTitleCache(toggleable_cache.getText(), pushedState);
199
        setIrrelevant(pushedState, Arrays.asList(new Object[] { toggleable_cache, checkbox_published, checkbox_unplaced, checkbox_excluded}));
178
        setIrrelevant(pushedState, Arrays.asList(new Object[] { toggleable_cache, checkbox_published}));
200 179
        updateToggleableCacheField();
201 180
    }
202 181
}

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)