Project

General

Profile

« Previous | Next » 

Revision 90cf504a

Added by Cherian Mathew almost 9 years ago

Fixed layout issues.
StatusComposite : added async operation for disableing components when reloading taxa

View differences:

src/main/java/eu/etaxonomy/cdm/vaadin/component/ConceptRelationshipComposite.java
284 284
        // d3ConceptRelationShipTree
285 285
        d3ConceptRelationShipTree = new D3ConceptRelationshipTree();
286 286
        d3ConceptRelationShipTree.setImmediate(false);
287
        d3ConceptRelationShipTree.setWidth("-1px");
287
        d3ConceptRelationShipTree.setWidth("100.0%");
288 288
        d3ConceptRelationShipTree.setHeight("-1px");
289 289
        mainLayout.addComponent(d3ConceptRelationShipTree);
290 290
        mainLayout.setExpandRatio(d3ConceptRelationShipTree, 1.0f);
src/main/java/eu/etaxonomy/cdm/vaadin/component/StatusComposite.java
10 10
package eu.etaxonomy.cdm.vaadin.component;
11 11

  
12 12
import java.sql.SQLException;
13
import java.util.ArrayList;
14 13
import java.util.Arrays;
15
import java.util.List;
16 14
import java.util.Set;
17 15
import java.util.UUID;
18 16

  
......
66 64
import eu.etaxonomy.cdm.vaadin.session.CdmChangeEvent;
67 65
import eu.etaxonomy.cdm.vaadin.session.ICdmChangeListener;
68 66
import eu.etaxonomy.cdm.vaadin.session.SelectionEvent;
67
import eu.etaxonomy.cdm.vaadin.util.CdmVaadinOperation;
69 68
import eu.etaxonomy.cdm.vaadin.util.CdmVaadinSessionUtilities;
70 69
import eu.etaxonomy.cdm.vaadin.util.CdmVaadinUtilities;
71 70
import eu.etaxonomy.cdm.vaadin.view.IStatusComposite;
......
102 101
    private static final Logger logger = Logger.getLogger(StatusComposite.class);
103 102
    private StatusComponentListener listener;
104 103

  
105
    private Object currentClickedTaxonItemId;
106 104

  
107 105
    private final boolean taxaTreeTableMultiSelectMode = true;
108 106

  
......
122 120
    private static final String PROPERTY_FILTER_ID = "filter";
123 121
    private static final String PROPERTY_SELECTED_ID = "selected";
124 122

  
125
    private static final String FILTER_NOT_RESOLVED = "not resolved";
126 123
    private static final String FILTER_UNPLACED = "unplaced";
127 124
    private static final String FILTER_UNFINISHED = "unfinished";
128 125
    private static final String FILTER_UNPUBLISHED = "unpublished";
......
135 132

  
136 133
    private boolean isFiltertableInitialised = false;
137 134

  
138
    private String selectedTaxaTableMenuItem = null;
135

  
139 136

  
140 137
    ContextMenu taxaTableContextMenu;
141 138

  
142
    private List<String> columnIds;
143 139

  
144 140
    /**
145 141
     * The constructor should first build the main layout, set the
......
179 175
    }
180 176

  
181 177
    public void init() {
182
        taxaTreeTable.setSelectable(true);
183 178
        initClassificationComboBox();
179
        setExpandRatios();
180
    }
181

  
182
    private void setExpandRatios() {
183
        mainLayout.setRowExpandRatio(0, 1);
184
        mainLayout.setRowExpandRatio(1, 5);
185
        mainLayout.setRowExpandRatio(2, 1);
186
        mainLayout.setRowExpandRatio(3, 35);
187
        mainLayout.setRowExpandRatio(4, 1);
184 188
    }
185 189

  
186 190
    public void setEnabledAll(boolean enabled) {
......
208 212
    }
209 213

  
210 214
    private void initTaxaTable() {
215
        taxaTreeTable.setSelectable(true);
211 216
        taxaTreeTable.setMultiSelect(taxaTreeTableMultiSelectMode);
212
        taxaTreeTable.setImmediate(false);
217
        taxaTreeTable.setImmediate(true);
213 218
        taxaTreeTable.setDragMode(TableDragMode.ROW);
214
        columnIds = new ArrayList<String>();
215
        columnIds.add(LeafNodeTaxonContainer.NAME_ID);
219

  
216 220
        taxaTreeTable.setColumnExpandRatio(LeafNodeTaxonContainer.NAME_ID, 1);
217
        columnIds.add(LeafNodeTaxonContainer.PB_ID);
218 221
        taxaTreeTable.setColumnWidth(LeafNodeTaxonContainer.PB_ID, 25);
219 222

  
220 223

  
......
386 389
            public void valueChange(ValueChangeEvent event) {
387 390
                if (classificationComboBox.getValue() != null) {
388 391
                    Object selected = classificationComboBox.getValue();
389
                    int classificationId = (Integer)((RowId)selected).getId()[0];
390
                    refreshTaxaTable(classificationId);
391
                    initFilterTable();
392
                    setEnabledAll(true);
392
                    final int classificationId = (Integer)((RowId)selected).getId()[0];
393

  
394
                    setEnabledAll(false);
395
                    filterTable.setReadOnly(true);
396
                    taxaTreeTable.setSelectable(false);
397

  
398
                    CdmVaadinUtilities.exec(new CdmVaadinOperation(100, null) {
399

  
400
                        @Override
401
                        public boolean execute() {
402
                            setProgress("loading taxa");
403
                            return true;
404
                        }
405

  
406
                        @Override
407
                        public void postOpUIUpdate(boolean isOpSuccess) {
408
                            refreshTaxaTable(classificationId);
409
                            initFilterTable();
410
                            setEnabledAll(true);
411
                            filterTable.setReadOnly(false);
412
                            taxaTreeTable.setSelectable(true);
413
                        }
414
                    });
415

  
416

  
393 417
                }
394 418
            }
395 419
        });
......
705 729
        mainLayout = new GridLayout();
706 730
        mainLayout.setImmediate(false);
707 731
        mainLayout.setWidth("340px");
708
        mainLayout.setHeight("840px");
732
        mainLayout.setHeight("100%");
709 733
        mainLayout.setMargin(true);
710
        mainLayout.setRows(6);
734
        mainLayout.setSpacing(true);
735
        mainLayout.setRows(5);
711 736

  
712 737
        // top-level component properties
713 738
        setWidth("340px");
714
        setHeight("840px");
739
        setHeight("100.0%");
715 740

  
716 741
        // classificationComboBox
717 742
        classificationComboBox = new ComboBox();
718 743
        classificationComboBox.setImmediate(false);
719 744
        classificationComboBox.setWidth("100.0%");
720
        classificationComboBox.setHeight("-1px");
745
        classificationComboBox.setHeight("100.0%");
721 746
        mainLayout.addComponent(classificationComboBox, 0, 0);
722 747

  
723 748
        // filterVerticalLayout
......
727 752

  
728 753
        // searchHorizontalLayout
729 754
        searchHorizontalLayout = buildSearchHorizontalLayout();
730
        mainLayout.addComponent(searchHorizontalLayout, 0, 3);
755
        mainLayout.addComponent(searchHorizontalLayout, 0, 2);
731 756
        mainLayout.setComponentAlignment(searchHorizontalLayout, new Alignment(48));
732 757

  
733 758
        // taxaTreeTable
734 759
        taxaTreeTable = new TreeTable();
735 760
        taxaTreeTable.setImmediate(false);
736 761
        taxaTreeTable.setWidth("100.0%");
737
        taxaTreeTable.setHeight("614px");
738
        mainLayout.addComponent(taxaTreeTable, 0, 4);
762
        taxaTreeTable.setHeight("100.0%");
763
        mainLayout.addComponent(taxaTreeTable, 0, 3);
739 764
        mainLayout.setComponentAlignment(taxaTreeTable, new Alignment(20));
740 765

  
741 766
        // inViewLabel
742 767
        inViewLabel = new Label();
743 768
        inViewLabel.setImmediate(false);
744 769
        inViewLabel.setWidth("100.0%");
745
        inViewLabel.setHeight("-1px");
770
        inViewLabel.setHeight("100.0%");
746 771
        inViewLabel.setValue("in view : ");
747
        mainLayout.addComponent(inViewLabel, 0, 5);
772
        mainLayout.addComponent(inViewLabel, 0, 4);
748 773

  
749 774
        return mainLayout;
750 775
    }
......
757 782
        filterVerticalLayout = new VerticalLayout();
758 783
        filterVerticalLayout.setImmediate(false);
759 784
        filterVerticalLayout.setWidth("100.0%");
760
        filterVerticalLayout.setHeight("-1px");
785
        filterVerticalLayout.setHeight("100.0%");
761 786
        filterVerticalLayout.setMargin(false);
762 787

  
763 788
        // filterLabel
......
772 797
        filterTable = new Table();
773 798
        filterTable.setImmediate(false);
774 799
        filterTable.setWidth("100.0%");
775
        filterTable.setHeight("74px");
800
        filterTable.setHeight("100.0%");
776 801
        filterVerticalLayout.addComponent(filterTable);
802
        filterVerticalLayout.setExpandRatio(filterTable, 1.0f);
777 803
        filterVerticalLayout.setComponentAlignment(filterTable, new Alignment(48));
778 804

  
779 805
        return filterVerticalLayout;
......
787 813
        searchHorizontalLayout = new HorizontalLayout();
788 814
        searchHorizontalLayout.setImmediate(false);
789 815
        searchHorizontalLayout.setWidth("100.0%");
790
        searchHorizontalLayout.setHeight("-1px");
816
        searchHorizontalLayout.setHeight("100.0%");
791 817
        searchHorizontalLayout.setMargin(false);
792 818
        searchHorizontalLayout.setSpacing(true);
793 819

  
src/main/java/eu/etaxonomy/cdm/vaadin/view/ConceptRelationshipView.java
215 215
        statusCompositeLeft = new StatusComposite();
216 216
        statusCompositeLeft.setImmediate(false);
217 217
        statusCompositeLeft.setWidth("-1px");
218
        statusCompositeLeft.setHeight("-1px");
218
        statusCompositeLeft.setHeight("100.0%");
219 219
        mainLayout.addComponent(statusCompositeLeft);
220
        mainLayout.setExpandRatio(statusCompositeLeft, 1.0f);
220 221

  
221 222
        // conceptRelationshipComposite
222 223
        conceptRelationshipComposite = new ConceptRelationshipComposite();
223 224
        conceptRelationshipComposite.setImmediate(false);
224 225
        conceptRelationshipComposite.setWidth("-1px");
225
        conceptRelationshipComposite.setHeight("-1px");
226
        conceptRelationshipComposite.setHeight("100.0%");
226 227
        mainLayout.addComponent(conceptRelationshipComposite);
227
        mainLayout.setExpandRatio(conceptRelationshipComposite, 1.0f);
228
        mainLayout.setExpandRatio(conceptRelationshipComposite, 2.0f);
228 229
        mainLayout.setComponentAlignment(conceptRelationshipComposite, new Alignment(20));
229 230

  
230 231
        // statusCompositeRight
231 232
        statusCompositeRight = new StatusComposite();
232 233
        statusCompositeRight.setImmediate(false);
233 234
        statusCompositeRight.setWidth("-1px");
234
        statusCompositeRight.setHeight("-1px");
235
        statusCompositeRight.setHeight("100.0%");
235 236
        mainLayout.addComponent(statusCompositeRight);
237
        mainLayout.setExpandRatio(statusCompositeRight, 1.0f);
238
        mainLayout.setComponentAlignment(statusCompositeRight, new Alignment(6));
236 239

  
237 240
        return mainLayout;
238 241
    }

Also available in: Unified diff