Project

General

Profile

« Previous | Next » 

Revision 707b6237

Added by Niels Hoffmann over 12 years ago

Merged with trunk

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/supplemental/VersionElement.java
21 21
import eu.etaxonomy.taxeditor.ui.forms.CdmFormFactory;
22 22
import eu.etaxonomy.taxeditor.ui.forms.ICdmFormElement;
23 23
import eu.etaxonomy.taxeditor.ui.forms.IEntityElement;
24
import eu.etaxonomy.taxeditor.ui.forms.TextWithLabelElement;
24 25

  
25 26
/**
26 27
 * <p>VersionElement class.</p>
......
34 35
	private Label label_created;
35 36
	private Label label_updated;
36 37
	
37
	private Label label_uuid;
38
	private Label label_objectId;
38
	private TextWithLabelElement text_uuid;
39
	private TextWithLabelElement text_objectId;
39 40
	private VersionableEntity entity;
41
	private boolean showDebug;
40 42
	
41 43
	/**
42 44
	 * <p>Constructor for VersionElement.</p>
......
49 51
	public VersionElement(CdmFormFactory toolkit, ICdmFormElement parentElement, VersionableEntity entity, int style) {
50 52
		super(toolkit, parentElement);
51 53
		
52
		getLayoutComposite().setLayout(CdmFormFactory.LAYOUT());
53
		
54
		showDebug = PreferencesUtil.getPreferenceStore().getBoolean(PreferencesUtil.SHOW_DEBUG_INFORMATION);
55
				
54 56
		label_created = toolkit.createLabel(getLayoutComposite(), null);
55 57
		label_created.setLayoutData(CdmFormFactory.FILL_HORIZONTALLY());
56 58

  
57 59
		label_updated = toolkit.createLabel(getLayoutComposite(), null);
58 60
		label_updated.setLayoutData(CdmFormFactory.FILL_HORIZONTALLY());
59 61
		
60
		label_uuid = toolkit.createLabel(getLayoutComposite(), null);
61
		label_uuid.setLayoutData(CdmFormFactory.FILL_HORIZONTALLY());
62
		
63
		label_objectId = toolkit.createLabel(getLayoutComposite(), null);
64
		label_objectId.setLayoutData(CdmFormFactory.FILL_HORIZONTALLY());
62
		if(showDebug){
63
			text_uuid = toolkit.createTextWithLabelElement(parentElement, "UUID", null, style);
64
			
65
			text_objectId = toolkit.createTextWithLabelElement(parentElement, "Object ID", null, style);
66
		}
65 67
	}
66 68
	
67 69
	/**
......
83 85
				+ " by " + userFormat(entity.getUpdatedBy());
84 86
		label_updated.setText(updatedString);
85 87
		
86
		boolean showDebug = PreferencesUtil.getPreferenceStore().getBoolean(PreferencesUtil.SHOW_DEBUG_INFORMATION);
88
		
87 89
		
88 90
		if(showDebug){
89
			String uuidString = "UUID: " + entity.getUuid();
90
			label_uuid.setText(uuidString);
91
			label_uuid.setVisible(true);
91
			text_uuid.setText(entity.getUuid().toString());
92 92
			
93
			String objectIdString = "Object ID: " + entity.getId();
94
			label_objectId.setText(objectIdString);
95
			label_objectId.setVisible(true);
96
		}else{
97
			label_uuid.setVisible(false);
98
			label_objectId.setVisible(false);
93
			text_objectId.setText(entity.getId()+"");
99 94
		}
100 95
		
101 96
	}

Also available in: Unified diff