Project

General

Profile

Revision 935960dc

ID935960dca04075d4f594318e65fe92d44ab8babd
Parent 5d3fd02f
Child 211add74

Added by Katja Luther over 2 years ago

ref #6176: the referencingObjectsCount is only called for wizards not in details view

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/AbstractFilteredCdmResourceSelectionDialog.java
10 10

  
11 11
package eu.etaxonomy.taxeditor.ui.dialog.selection;
12 12

  
13
import java.lang.reflect.Field;
14 13
import java.text.Collator;
15 14
import java.util.Comparator;
16 15
import java.util.HashSet;
......
70 69
	private final Set<T> transientCdmObjects = new HashSet<T>();
71 70
	private final String settings;
72 71
	protected final int limitOfInitialElements = 100;
73
	
72

  
74 73
	protected T cdmBaseToBeFiltered;
75 74

  
76 75

  
......
277 276
		// and all the clever caching prevents the content provider from knowing that the model has changed
278 277
		// I am aware, that this is a hack, but the FilteredSelectionDialog API does not offer a convenient
279 278
		// way to solve the problem.
280
		try {
281
			Field lastCompletedFilter = this.getClass().getSuperclass().getSuperclass().getDeclaredField("lastCompletedFilter");
282
			lastCompletedFilter.setAccessible(true);
283
			lastCompletedFilter.set(this, null);
284
		} catch (SecurityException e) {
285
			MessagingUtils.error(getClass(), e);
286
		} catch (NoSuchFieldException e) {
287
			MessagingUtils.error(getClass(), e);
288
		} catch (IllegalArgumentException e) {
289
			MessagingUtils.error(getClass(), e);
290
		} catch (IllegalAccessException e) {
291
			MessagingUtils.error(getClass(), e);
292
		}
279
//		try {
280
//			Field lastCompletedFilter = this.getClass().getSuperclass().getSuperclass().getDeclaredField("lastCompletedFilter");
281
//			lastCompletedFilter.setAccessible(true);
282
//			lastCompletedFilter.set(this, null);
283
//		} catch (SecurityException e) {
284
//			MessagingUtils.error(getClass(), e);
285
//		} catch (NoSuchFieldException e) {
286
//			MessagingUtils.error(getClass(), e);
287
//		} catch (IllegalArgumentException e) {
288
//			MessagingUtils.error(getClass(), e);
289
//		} catch (IllegalAccessException e) {
290
//			MessagingUtils.error(getClass(), e);
291
//		}
293 292

  
294 293
		// this also is not the nicest way to do it.
295 294
		// I am still amazed, that FilteredSelectionDialog does not offer any methods to change its data
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/AbstractCdmEntityWizardPage.java
106 106
		Color bgColor = getShell().getBackground();
107 107

  
108 108
		detailElement = createElement(rootElement);
109

  
109
		
110 110
		rootElement.setBackground(bgColor);
111 111
		control.setBackground(bgColor);
112 112
		scrolledForm.setBackground(bgColor);
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/CdmFormFactory.java
2117 2117
        return element;
2118 2118
    }
2119 2119

  
2120
    public ReferenceDetailElement createReferenceDetailElement(ICdmFormElement parentElement, int style){
2121
        ReferenceDetailElement element = new ReferenceDetailElement(this, parentElement, style);
2120
    public ReferenceDetailElement createReferenceDetailElement(ICdmFormElement parentElement, int style, boolean isWizard){
2121
        ReferenceDetailElement element = new ReferenceDetailElement(this, parentElement, style, isWizard);
2122 2122
        addAndAdaptElement(parentElement, element);
2123 2123
        return element;
2124 2124
    }
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/reference/ReferenceDetailElement.java
79 79
	private EnumComboElement<ReferenceType> combo_referenceType;
80 80

  
81 81
	private EntitySelectionElement<Reference> selection_inSeries;
82
	private boolean isWizard;
82 83

  
83 84
	/**
84 85
	 * <p>
......
95 96
	 *            a int.
96 97
	 */
97 98
	public ReferenceDetailElement(CdmFormFactory cdmFormFactory,
98
			ICdmFormElement formElement, int style) {
99
			ICdmFormElement formElement, int style, boolean isWizard) {
99 100
		super(cdmFormFactory, formElement);
101
		this.isWizard = isWizard;
100 102
	}
101 103

  
102 104
	/*
......
112 114
			Reference entity, int style) {
113 115
		ICdmFormElement o = this.getParentElement();
114 116
		Class clazz=o.getClass();
115
		setWarnForReferencingObjects(formElement);
117
		if (isWizard){
118
		    setWarnForReferencingObjects(formElement);
119
		}
116 120

  
117 121

  
118 122
		toggleable_cache = formFactory.createToggleableTextField(formElement,
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/reference/ReferenceDetailSection.java
94 94
	 */
95 95
	@Override
96 96
	protected AbstractCdmDetailElement<Reference> createCdmDetailElement(AbstractCdmDetailSection<Reference> parentElement, int style) {
97
	    return formFactory.createReferenceDetailElement(parentElement, style);
97
	    return formFactory.createReferenceDetailElement(parentElement, style, false);
98 98
	}
99 99

  
100 100
}
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/reference/ReferenceWizardPage.java
13 13
import org.eclipse.swt.SWT;
14 14

  
15 15
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
16
import eu.etaxonomy.cdm.api.service.CommonServiceImpl;
17
import eu.etaxonomy.cdm.api.service.ReferenceServiceImpl;
18 16
import eu.etaxonomy.cdm.model.reference.Reference;
19
import eu.etaxonomy.taxeditor.store.CdmStore;
20 17
import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage;
21 18
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
22 19
import eu.etaxonomy.taxeditor.ui.element.CdmPropertyChangeEvent;
......
53 50
	@Override
54 51
    public AbstractCdmDetailElement<Reference> createElement(ICdmFormElement rootElement){
55 52
		//TODO: looking for referencing objects
56
		ReferenceDetailElement referenceElement = formFactory.createReferenceDetailElement(rootElement, SWT.NULL);
53
		ReferenceDetailElement referenceElement = formFactory.createReferenceDetailElement(rootElement, SWT.NULL, true);
57 54
		referenceElement.addExceptionHandler(this);
58 55
		referenceElement.setEntity(entity);
59 56
		referenceElement.setWarnForReferencingObjectsVisible(true);

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)