Project

General

Profile

« Previous | Next » 

Revision 398b6133

Added by Patrick Plitzner over 2 years ago

ref #6774 Refactor CheckBoxTreeComposite layout

View differences:

eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/AreasSelectionDialog.java
16 16
import java.util.stream.Collectors;
17 17

  
18 18
import org.eclipse.jface.dialogs.Dialog;
19
import org.eclipse.jface.layout.GridLayoutFactory;
20 19
import org.eclipse.swt.SWT;
20
import org.eclipse.swt.layout.GridData;
21 21
import org.eclipse.swt.widgets.Composite;
22 22
import org.eclipse.swt.widgets.Control;
23 23
import org.eclipse.swt.widgets.Shell;
......
59 59
        treeComposite.getViewer().setInput(areaVocabularies);
60 60
        Collections.sort(selectedAreas, (o1, o2)->o1.getOrderIndex()-o2.getOrderIndex());
61 61
        treeComposite.setCheckedElements(selectedAreas.toArray());
62
        GridLayoutFactory.fillDefaults().applyTo(treeComposite);
62
        treeComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
63 63
        return treeComposite;
64 64
    }
65 65

  
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/AvailableFeaturesWizardPage.java
15 15
import java.util.Set;
16 16
import java.util.stream.Collectors;
17 17

  
18
import org.eclipse.jface.layout.GridLayoutFactory;
19 18
import org.eclipse.jface.wizard.WizardPage;
20 19
import org.eclipse.swt.SWT;
20
import org.eclipse.swt.layout.GridData;
21 21
import org.eclipse.swt.widgets.Composite;
22 22

  
23 23
import eu.etaxonomy.cdm.api.service.ITermService;
......
56 56
        List<TermVocabularyDto> vocabularyDtos = CdmStore.getService(IVocabularyService.class).findVocabularyDtoByTermType(termType);
57 57
        treeComposite.getViewer().setComparator(new DefinedTermSorter());
58 58
        treeComposite.getViewer().setInput(vocabularyDtos);
59
        GridLayoutFactory.fillDefaults().applyTo(treeComposite);
59
        treeComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
60 60

  
61 61
		setControl(treeComposite);
62 62
	}
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/AbstractTermSelectionWizardPage.java
15 15
import java.util.UUID;
16 16

  
17 17
import org.apache.commons.lang.StringUtils;
18
import org.eclipse.jface.layout.GridLayoutFactory;
19 18
import org.eclipse.jface.viewers.CheckboxTreeViewer;
20 19
import org.eclipse.jface.wizard.WizardPage;
21 20
import org.eclipse.swt.SWT;
21
import org.eclipse.swt.layout.GridData;
22 22
import org.eclipse.swt.layout.GridLayout;
23 23
import org.eclipse.swt.widgets.Composite;
24 24

  
......
62 62
        treeComposite = new CheckBoxTreeComposite(parent, new TermDtoContentProvider(), new TermDtoLabelProvider(), SWT.NONE);
63 63
        treeComposite.getViewer().setComparator(new DefinedTermSorter());
64 64
        rememberCheckedValues(getCheckedValuesFromPreferences());
65
        GridLayoutFactory.fillDefaults().applyTo(treeComposite);
65
        treeComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
66 66
        setControl(treeComposite);
67 67
    }
68 68

  
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/CheckBoxTreeComposite.java
53 53
    public CheckBoxTreeComposite(Composite parent, ITreeContentProvider contentProvider, IBaseLabelProvider labelProvider, int style) {
54 54
        super(parent, style);
55 55
        GridLayout layout = new GridLayout();
56
        parent.setLayout(layout);
57
        Composite composite = new Composite(parent, SWT.NULL);
58
        composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
56
        layout.marginHeight = 0;
57
        setLayout(layout);
59 58

  
60
        GridLayout gl_composite = layout;
61
        gl_composite.marginHeight = 0;
62
        composite.setLayout(gl_composite);
63

  
64
        Composite toolbar = new Composite(composite, SWT.NONE);
59
        Composite toolbar = new Composite(this, SWT.NONE);
65 60
        toolbar.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false, 1, 1));
66 61
        GridLayout gl_toolbar = new GridLayout(4, false);
67 62
        gl_toolbar.horizontalSpacing = 4;
......
89 84
        btnSelectAllChildren.setImage(ImageResources.getImage(ImageResources.HIERARCHICAL));
90 85
        btnSelectAllChildren.setToolTipText(""); //$NON-NLS-1$
91 86

  
92
        Tree tree = new Tree(composite, SWT.BORDER | SWT.CHECK);
87
        Tree tree = new Tree(this, SWT.BORDER | SWT.CHECK);
93 88
        tree.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
94 89
        tree.addListener(SWT.Selection, event -> {
95 90
            if (event.detail == SWT.CHECK) {

Also available in: Unified diff