- Transfer[] transfers = new Transfer[] { FeatureNodeTransfer
- .getInstance() };
- viewer.addDragSupport(ops, transfers, dragSourceListener);
- viewer.addDropSupport(ops, transfers, dropTargetListener);
-
- viewer.addSelectionChangedListener(viewerSelectionChangedListener);
+ if(transfers==null){
+ transfers = new Transfer[] {
+ FeatureNodeTransfer.getInstance(),
+ TermTransfer.getInstance(),
+ };
+ }
+ if(dragSourceListener!=null){
+ viewer.addDragSupport(ops, transfers, dragSourceListener);
+ }
+ if(dropTargetListener!=null){
+ viewer.addDropSupport(ops, transfers, dropTargetListener);
+ }
+
+ if(viewerSelectionChangedListener!=null){
+ viewer.addSelectionChangedListener(viewerSelectionChangedListener);
+ }
+
+ if(textModifyListener!=null){
+ text_title.addModifyListener(textModifyListener);
+ }
+
+ //add specific selection listener
+ if(openFeatureTreeSelectionListener!=null){
+ btnOpenFeatureTree.addSelectionListener(openFeatureTreeSelectionListener);
+ }
+ else{
+ //add default selection listener
+ btnOpenFeatureTree.addSelectionListener(new SelectionAdapter(){
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ TermTree<T> tree = FeatureTreeSelectionDialog.select(getDisplay().getActiveShell(),
+ null, termType);
+ if(tree!=null){
+ setSelectedTree(tree);
+ if(dirtyMarkable!=null){
+ dirtyMarkable.forceDirty();
+ }
+ }
+ }
+ });
+ }
+ }