Project

General

Profile

« Previous | Next » 

Revision cd074e7b

Added by Niels Hoffmann about 13 years ago

fixes #1118

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/forms/AbstractCdmFormElement.java
164 164
			// dispose of the controls
165 165
			removeControls(childElement);
166 166
		}
167
		removeControls(this);
167 168
		elements.clear();
168 169
	}
169 170
	
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/forms/BrowserElement.java
37 37
		formFactory.createLabel(getLayoutComposite(), "");
38 38
		
39 39
		browser = new Browser(getLayoutComposite(), SWT.NONE);
40
		addControl(browser);
40 41
		
41 42
		getLayoutComposite().setLayoutData(CdmFormFactory.FILL());
42 43
		
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/feature/FeatureDistributionDetailElement.java
18 18
import java.util.Map;
19 19
import java.util.Set;
20 20

  
21
import org.apache.log4j.Logger;
22
import org.eclipse.swt.events.ControlAdapter;
23
import org.eclipse.swt.events.ControlEvent;
21
import org.eclipse.swt.SWT;
22
import org.eclipse.swt.widgets.Label;
24 23

  
24
import eu.etaxonomy.cdm.common.UriUtils;
25 25
import eu.etaxonomy.cdm.ext.geo.EditGeoServiceUtilities;
26 26
import eu.etaxonomy.cdm.model.common.Language;
27 27
import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
28 28
import eu.etaxonomy.cdm.model.description.Distribution;
29 29
import eu.etaxonomy.cdm.model.description.PresenceAbsenceTermBase;
30 30
import eu.etaxonomy.taxeditor.model.FeatureNodeContainer;
31
import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
31 32
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
32 33
import eu.etaxonomy.taxeditor.store.CdmStore;
33 34
import eu.etaxonomy.taxeditor.ui.forms.BrowserElement;
......
44 45
 */
45 46
public class FeatureDistributionDetailElement extends AbstractCdmDetailElement<FeatureNodeContainer> {
46 47
	
47
	private static final Logger logger = Logger
48
	.getLogger(FeatureDistributionDetailElement.class);
49

  
50 48
	private BrowserElement image;
51 49
	
52 50
	/**
......
68 66
	@Override
69 67
	protected void createControls(ICdmFormElement formElement, FeatureNodeContainer entity,
70 68
			int style) {
69
		String serviceUriString = PreferencesUtil.getPreferenceStore().getString(IPreferenceKeys.EDIT_MAP_SERVICE_ACCES_POINT);
70
		String message = null;
71
		try {
72
			URI serviceUri = new URI(serviceUriString);
73
			if(UriUtils.isServiceAvailable(serviceUri)){
74
				image = formFactory.createBrowserElement(formElement, null, style);
75
				String mapUriString = getMapUriString(getEntity());
76
				image.setImageUriString(mapUriString);
77
				formElement.getLayoutComposite().layout();
78
				message = mapUriString; 
79
				return;
80
			} else {
81
				message = String.format("The service is not available: %s", serviceUriString);
82
			}
83
		} catch (URISyntaxException e) {
84
			message = String.format("The URI has problems: %s", serviceUriString);
85
		}
71 86
		
72
		image = formFactory.createBrowserElement(formElement, null, style);
73
		image.setImageUriString(getMapUriString(getEntity()));
74
		formElement.getLayoutComposite().layout();
87
		Label label = formFactory.createLabel(getLayoutComposite(), message, SWT.WRAP);
88
		addControl(label);
89
		label.setLayoutData(CdmFormFactory.FILL(2, 1));
75 90
	}
76 91

  
77 92

  
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/feature/FeatureDistributionDetailSection.java
10 10

  
11 11
package eu.etaxonomy.taxeditor.ui.section.feature;
12 12

  
13
import org.apache.log4j.Logger;
14 13
import org.eclipse.jface.viewers.ISelectionProvider;
15 14

  
16 15
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
17 16
import eu.etaxonomy.cdm.model.description.Feature;
18 17
import eu.etaxonomy.taxeditor.ui.forms.CdmFormFactory;
19
import eu.etaxonomy.taxeditor.ui.forms.ICdmFormElement;
20 18
import eu.etaxonomy.taxeditor.ui.forms.CdmFormFactory.DetailType;
19
import eu.etaxonomy.taxeditor.ui.forms.ICdmFormElement;
21 20
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
22 21

  
23 22
/**
......
29 28
 */
30 29
public class FeatureDistributionDetailSection extends AbstractCdmDetailSection<Feature> {
31 30
	
32

  
33
	private static final Logger logger = Logger
34
			.getLogger(FeatureDistributionDetailSection.class);
35

  
36 31
	/**
37 32
	 * <p>Constructor for FeatureDistributionDetailSection.</p>
38 33
	 *
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/datasource/CdmDataSourceViewPart.java
281 281
	@Override
282 282
	public void showBusy(boolean busy) {
283 283
		super.showBusy(busy);
284
		viewer.getTable().setEnabled(!busy);
284
//		viewer.getTable().setEnabled(!busy);
285 285
		if(busy){
286 286
			partNameCache = getPartName();
287 287
			setPartName("Loading datasources");

Also available in: Unified diff