Project

General

Profile

Revision b9492486

IDb9492486e1582d1de2daf0784e8a596dfc698037
Parent d4cccf9c
Child 4832aaf7

Added by Patrick Plitzner over 2 years ago

ref #8146 Add termType to feature tree composite and selection dialog

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/e4/FeatureTreeEditorComposite.java
28 28
import org.eclipse.swt.widgets.Text;
29 29
import org.eclipse.swt.widgets.Tree;
30 30

  
31
import eu.etaxonomy.cdm.model.common.TermType;
31 32
import eu.etaxonomy.cdm.model.description.FeatureTree;
32 33
import eu.etaxonomy.taxeditor.editor.definedterm.TermTransfer;
33 34
import eu.etaxonomy.taxeditor.featuretree.FeatureNodeTransfer;
......
89 90
            ISelectionChangedListener viewerSelectionChangedListener,
90 91
            IDirtyMarkable dirtyMarkable,
91 92
            ModifyListener textModifyListener) {
93
        init(label,
94
                null,
95
                dragSourceListener,
96
                dropTargetListener,
97
                null,
98
                viewerSelectionChangedListener,
99
                null,
100
                dirtyMarkable,
101
                textModifyListener);
102
    }
103

  
104
    public void init(String label, TermType termType,
105
            DragSourceListener dragSourceListener,
106
            DropTargetListener dropTargetListener,
107
            ISelectionChangedListener viewerSelectionChangedListener,
108
            IDirtyMarkable dirtyMarkable,
109
            ModifyListener textModifyListener) {
92 110
        this.init(label,
111
                termType,
93 112
                dragSourceListener,
94 113
                dropTargetListener,
95 114
                null,
......
104 123
            ISelectionChangedListener viewerSelectionChangedListener,
105 124
            SelectionListener openFeatureTreeSelectionListener,
106 125
            ModifyListener textModifyListener) {
107
        init(null, dragSourceListener,
126
        init(null,
127
                null,
128
                dragSourceListener,
108 129
                dropTargetListener,
109 130
                transfers,
110 131
                viewerSelectionChangedListener,
......
112 133
                null,
113 134
                textModifyListener);
114 135
    }
115
    private void init(String label, DragSourceListener dragSourceListener,
136
    private void init(String label,
137
            TermType termType,
138
            DragSourceListener dragSourceListener,
116 139
            DropTargetListener dropTargetListener,
117 140
            Transfer[] transfers,
118 141
            ISelectionChangedListener viewerSelectionChangedListener,
......
158 181
                @Override
159 182
                public void widgetSelected(SelectionEvent e) {
160 183
                    FeatureTree tree = FeatureTreeSelectionDialog.select(getDisplay().getActiveShell(),
161
                            null);
184
                            null, termType);
162 185
                    if(tree!=null){
163 186
                        setSelectedTree(tree);
164 187
                        if(dirtyMarkable!=null){
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/FeatureTreeSelectionDialog.java
72 72
                InputDialog dialog = new InputDialog(getShell(), Messages.FeatureTreeSelectionDialog_TREE_LABEL, Messages.FeatureTreeSelectionDialog_ENTER_LABEL, null, null);
73 73
                if (dialog.open() == Window.OK) {
74 74
                    // User clicked OK; update the label with the input
75
                    FeatureTree tree = FeatureTree.NewInstance();
75
                    FeatureTree tree = null;
76
                    if(termType!=null){
77
                        tree = FeatureTree.NewInstance(termType);
78
                    }
79
                    else{
80
                        tree = FeatureTree.NewInstance();
81
                    }
76 82
                    tree.setTitleCache(dialog.getValue(), true);
77 83
                    CdmStore.getService(IFeatureTreeService.class).merge(tree,true);
78 84
                    refresh();

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)