Mercurial > dive4elements > river
comparison gwt-client/src/main/java/org/dive4elements/river/client/client/ui/DatacageTwinPanel.java @ 9133:af73fdd96920
Title current/historical diff pair; limit on entries in diff'pair twin_panel
author | gernotbelger |
---|---|
date | Thu, 07 Jun 2018 11:41:10 +0200 |
parents | 28df64078f27 |
children | e3c2ae1887e8 |
comparison
equal
deleted
inserted
replaced
9132:8cc192731c7d | 9133:af73fdd96920 |
---|---|
11 import org.dive4elements.river.client.shared.model.DataList; | 11 import org.dive4elements.river.client.shared.model.DataList; |
12 import org.dive4elements.river.client.shared.model.User; | 12 import org.dive4elements.river.client.shared.model.User; |
13 | 13 |
14 import com.google.gwt.core.client.GWT; | 14 import com.google.gwt.core.client.GWT; |
15 import com.smartgwt.client.widgets.Canvas; | 15 import com.smartgwt.client.widgets.Canvas; |
16 import com.smartgwt.client.widgets.Label; | |
16 import com.smartgwt.client.widgets.grid.ListGrid; | 17 import com.smartgwt.client.widgets.grid.ListGrid; |
17 import com.smartgwt.client.widgets.layout.HLayout; | 18 import com.smartgwt.client.widgets.layout.HLayout; |
18 import com.smartgwt.client.widgets.layout.VLayout; | 19 import com.smartgwt.client.widgets.layout.VLayout; |
19 | 20 |
20 /** | 21 /** |
21 * A {@link AbstractPairRecommendationPanel} that uses a 'TwinDatacage' in the help-input area. | 22 * A {@link AbstractPairRecommendationPanel} that uses a 'TwinDatacage' in the help-input area. |
22 * DatacagePairWidget which is put in the input-helper area. | 23 * DatacagePairWidget which is put in the input-helper area. |
23 */ | 24 */ |
24 public abstract class DatacageTwinPanel | 25 public abstract class DatacageTwinPanel extends AbstractPairRecommendationPanel { |
25 extends AbstractPairRecommendationPanel { | |
26 | 26 |
27 private IDatacageTwinPanelInfo leftInfo; | 27 private final IDatacageTwinPanelInfo leftInfo; |
28 private IDatacageTwinPanelInfo rightInfo; | 28 private final IDatacageTwinPanelInfo rightInfo; |
29 | 29 |
30 public static interface IDatacageTwinPanelInfo extends IRecommendationInfo | 30 private final int maxCount; |
31 { | 31 private final String msgMaxCount; |
32 String getOuts(); | |
33 } | |
34 | |
35 public DatacageTwinPanel(final User user, IValidator validator, final IDatacageTwinPanelInfo leftInfo, final IDatacageTwinPanelInfo rightInfo ) { | |
36 super(user, validator, leftInfo, rightInfo); | |
37 | 32 |
38 this.leftInfo = leftInfo; | 33 public static interface IDatacageTwinPanelInfo extends IRecommendationInfo { |
39 this.rightInfo = rightInfo; | 34 String getOuts(); |
40 } | 35 } |
41 | 36 |
37 public DatacageTwinPanel(final User user, final IValidator validator, final IDatacageTwinPanelInfo leftInfo, final IDatacageTwinPanelInfo rightInfo, | |
38 final int maxCount, final String msgMaxCount) { | |
39 super(user, validator, leftInfo, rightInfo); | |
40 | |
41 this.maxCount = maxCount; | |
42 this.msgMaxCount = msgMaxCount; | |
43 this.leftInfo = leftInfo; | |
44 this.rightInfo = rightInfo; | |
45 } | |
46 | |
42 @Override | 47 @Override |
43 protected final Canvas createChooserWidgets(final Canvas widget, final DataList dataList, final User user, final ListGrid differencesList) { | 48 protected final Canvas createChooserWidgets(final Canvas widget, final DataList dataList, final User user, final ListGrid differencesList) { |
44 GWT.log("createData()"); | 49 GWT.log("createData()"); |
45 | 50 |
46 Canvas submit = getNextButton(); | 51 final Canvas submit = getNextButton(); |
47 | 52 |
48 VLayout layout = new VLayout(); | 53 final VLayout layout = new VLayout(); |
49 HLayout helperLayout = new HLayout(); | 54 final HLayout helperLayout = new HLayout(); |
50 | 55 |
51 final String leftOuts = leftInfo.getOuts(); | 56 final String leftOuts = this.leftInfo.getOuts(); |
52 final String rightOuts = rightInfo.getOuts(); | 57 final String rightOuts = this.rightInfo.getOuts(); |
53 | 58 |
54 helperLayout.addMember(new DatacagePairWidget(this.artifact, user, leftOuts, rightOuts, differencesList)); | 59 helperLayout.addMember(new DatacagePairWidget(this.artifact, user, leftOuts, rightOuts, differencesList, this.maxCount, this.msgMaxCount)); |
60 | |
61 if (dataList != null && dataList.get(0) != null && dataList.get(0).getDescription() != null) { | |
62 final Label title = new Label(dataList.get(0).getDescription()); | |
63 title.setHeight("25px"); | |
64 layout.addMember(title); | |
65 } | |
55 | 66 |
56 layout.addMember(widget); | 67 layout.addMember(widget); |
57 layout.addMember(submit); | 68 layout.addMember(submit); |
58 layout.setMembersMargin(10); | 69 layout.setMembersMargin(10); |
59 this.helperContainer.addMember(helperLayout); | 70 this.helperContainer.addMember(helperLayout); |
60 | 71 |
61 return layout; | 72 return layout; |
62 } | 73 } |
74 | |
63 } | 75 } |