Project

General

Profile

« Previous | Next » 

Revision f561b00c

Added by Niels Hoffmann about 13 years ago

Refactoring selection elements so they can be configured

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/selection/AbstractSelectionElement.java
48 48
		IEnableableFormElement, ISelectableElement, IEntityElement<T>,
49 49
		ILabeledElement, IConversationEnabled {
50 50

  
51
	/**
52
	 * BITMAP
53
	 */
54
	public static final int NOTHING = 0; // 000
55
	public static final int ALL = 7; // 111
56
	public static final int EDITABLE = 1; // 001
57
	public static final int DELETABLE = 2; // 010
58
	public static final int SELECTABLE = 4; // 100
59

  
51 60
	protected T entity;
52 61

  
53 62
	protected Label label;
......
100 109
	 */
101 110
	public AbstractSelectionElement(CdmFormFactory formFactory,
102 111
			ConversationHolder conversation, ICdmFormElement parentElement,
103
			String labelString, T entity, boolean isEditable,
104
			boolean isSelectable, boolean isDeletable, int style) {
112
			String labelString, T entity, int mode, int style) {
105 113
		super(formFactory, parentElement);
106 114

  
107
		this.isEditable = isEditable;
108
		this.isDeletable = isDeletable;
115
		this.isEditable = (mode == (mode | EDITABLE));
116
		this.isDeletable = (mode == (mode | DELETABLE));
109 117

  
110 118
		this.labelString = labelString;
111 119

  
112 120
		this.conversation = conversation;
113 121

  
114
		if (isSelectable && formFactory.getSelectionProvider() != null) {
122
		if ((mode == (mode | SELECTABLE))
123
				&& formFactory.getSelectionProvider() != null) {
115 124
			selectionArbitrator = formFactory.createSelectionArbitrator(this);
116 125
		}
117 126

  

Also available in: Unified diff