Revision 4a579136
Added by Andreas Kohlbecker about 6 years ago
src/main/java/eu/etaxonomy/vaadin/mvp/AbstractCdmPopupEditor.java | ||
---|---|---|
15 | 15 |
|
16 | 16 |
import com.vaadin.server.FontAwesome; |
17 | 17 |
import com.vaadin.shared.ui.MarginInfo; |
18 |
import com.vaadin.ui.AbstractComponentContainer; |
|
19 | 18 |
import com.vaadin.ui.Button; |
20 | 19 |
import com.vaadin.ui.Component; |
21 | 20 |
import com.vaadin.ui.Layout; |
... | ... | |
99 | 98 |
getPresenter().setGrantsForCurrentUser(crud); |
100 | 99 |
} |
101 | 100 |
|
102 |
/** |
|
103 |
* {@inheritDoc} |
|
104 |
*/ |
|
105 |
@Override |
|
106 |
public void setReadOnly(boolean readOnly) { |
|
107 |
super.setReadOnly(readOnly); |
|
108 |
recursiveReadonly(readOnly, (AbstractComponentContainer)getFieldLayout()); |
|
109 |
} |
|
110 |
|
|
111 |
/** |
|
112 |
* @param readOnly |
|
113 |
* @param layout |
|
114 |
*/ |
|
115 |
protected void recursiveReadonly(boolean readOnly, AbstractComponentContainer layout) { |
|
116 |
for(Component c : layout){ |
|
117 |
c.setReadOnly(readOnly); |
|
118 |
if(c instanceof AbstractComponentContainer){ |
|
119 |
recursiveReadonly(readOnly, layout); |
|
120 |
} |
|
121 |
} |
|
122 |
} |
|
123 |
|
|
124 |
|
|
125 |
|
|
126 | 101 |
|
127 | 102 |
|
128 | 103 |
} |
Also available in: Unified diff
refactoring editor setReadonly()