Merge branch 'develop' into wset
authorPatrick Plitzner <p.plitzner@bgbm.org>
Wed, 6 Dec 2017 07:36:09 +0000 (08:36 +0100)
committerPatrick Plitzner <p.plitzner@bgbm.org>
Wed, 6 Dec 2017 07:36:09 +0000 (08:36 +0100)
1  2 
eu.etaxonomy.taxeditor.editor/META-INF/MANIFEST.MF
eu.etaxonomy.taxeditor.feature.platform/feature.xml
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/FeatureTreeSelectionDialog.java

@@@ -65,28 -60,39 +65,31 @@@ public class FeatureTreeSelectionDialo
                model.clear();
                for(FeatureTree featureTree : featureTrees){
                        UuidAndTitleCache<FeatureTree> element = new UuidAndTitleCache<FeatureTree>(FeatureTree.class, featureTree.getUuid(),featureTree.getId(), featureTree.getTitleCache());
-                       model.add(element);
+                       if (element.getTitleCache().matches(pattern)) {
+                 model.add(element);
+             }
                }
        }
  
 -//    /** {@inheritDoc} */
 -//    @Override
 -//    protected Control createExtendedContentArea(Composite parent) {
 -//            Link link = new Link(parent, SWT.NONE);
 -//            link.setText(getNewWizardLinkText());
 -//            link.addListener (SWT.Selection, new Listener () {
 -//                    @Override
 -//            public void handleEvent(Event event) {
 -//
 -//                        InputDialog input = new InputDialog(getShell(), "New feature tree", "Enter label for new feature tree", null, null);
 -//                            int status = input.open();
 -//                            if (status == IStatus.OK) {
 -//                                String label = input.getValue();
 -//                                if(label!=null){
 -//                                    FeatureTree featureTree = FeatureTree.NewInstance();
 -//                                    featureTree.setTitleCache(label, false);
 -//                                    CdmStore.getService(IFeatureTreeService.class).save(featureTree);
 -//                                UuidAndTitleCache<FeatureTree> uuidAndTitleCache = new UuidAndTitleCache<FeatureTree>(FeatureTree.class, featureTree.getUuid(),featureTree.getId(), featureTree.getTitleCache());
 -//                                model.add(uuidAndTitleCache);
 -//                                setPattern(featureTree);
 -//                                }
 -//                            }
 -//                    }
 -//            });
 -//            return link;
 -//    }
 +      @Override
 +    protected SelectionListener getNewWizardButtonSelectionListener(){
 +        return new SelectionAdapter() {
 +
 +            @Override
 +            public void widgetSelected(SelectionEvent e) {
 +                InputDialog dialog = new InputDialog(getShell(), "Feature tree label", "Enter label for feature tree", null, null);
 +                if (dialog.open() == Window.OK) {
 +                    // User clicked OK; update the label with the input
 +                    FeatureTree tree = FeatureTree.NewInstance();
 +                    CdmStore.getService(IFeatureTreeService.class).merge(tree,true);
 +                    tree.setTitleCache(dialog.getValue(), true);
 +                    refresh();
 +                    setPattern(tree);
 +                  }
 +            }
 +        };
 +    }
  
        /** {@inheritDoc} */
        @Override