Revision df043e9b
Added by Patrick Plitzner over 6 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/FeatureTreeSelectionDialog.java | ||
---|---|---|
13 | 13 |
import java.util.List; |
14 | 14 |
import java.util.UUID; |
15 | 15 |
|
16 |
import org.eclipse.jface.dialogs.InputDialog; |
|
17 |
import org.eclipse.jface.window.Window; |
|
18 |
import org.eclipse.swt.events.SelectionAdapter; |
|
19 |
import org.eclipse.swt.events.SelectionEvent; |
|
20 |
import org.eclipse.swt.events.SelectionListener; |
|
16 | 21 |
import org.eclipse.swt.widgets.Shell; |
17 | 22 |
|
18 | 23 |
import eu.etaxonomy.cdm.api.service.IFeatureTreeService; |
... | ... | |
64 | 69 |
} |
65 | 70 |
} |
66 | 71 |
|
67 |
// /** {@inheritDoc} */ |
|
68 |
// @Override |
|
69 |
// protected Control createExtendedContentArea(Composite parent) { |
|
70 |
// Link link = new Link(parent, SWT.NONE); |
|
71 |
// link.setText(getNewWizardLinkText()); |
|
72 |
// link.addListener (SWT.Selection, new Listener () { |
|
73 |
// @Override |
|
74 |
// public void handleEvent(Event event) { |
|
75 |
// |
|
76 |
// InputDialog input = new InputDialog(getShell(), "New feature tree", "Enter label for new feature tree", null, null); |
|
77 |
// int status = input.open(); |
|
78 |
// if (status == IStatus.OK) { |
|
79 |
// String label = input.getValue(); |
|
80 |
// if(label!=null){ |
|
81 |
// FeatureTree featureTree = FeatureTree.NewInstance(); |
|
82 |
// featureTree.setTitleCache(label, false); |
|
83 |
// CdmStore.getService(IFeatureTreeService.class).save(featureTree); |
|
84 |
// UuidAndTitleCache<FeatureTree> uuidAndTitleCache = new UuidAndTitleCache<FeatureTree>(FeatureTree.class, featureTree.getUuid(),featureTree.getId(), featureTree.getTitleCache()); |
|
85 |
// model.add(uuidAndTitleCache); |
|
86 |
// setPattern(featureTree); |
|
87 |
// } |
|
88 |
// } |
|
89 |
// } |
|
90 |
// }); |
|
91 |
// return link; |
|
92 |
// } |
|
72 |
@Override |
|
73 |
protected SelectionListener getNewWizardButtonSelectionListener(){ |
|
74 |
return new SelectionAdapter() { |
|
75 |
|
|
76 |
@Override |
|
77 |
public void widgetSelected(SelectionEvent e) { |
|
78 |
InputDialog dialog = new InputDialog(getShell(), "Feature tree label", "Enter label for feature tree", null, null); |
|
79 |
if (dialog.open() == Window.OK) { |
|
80 |
// User clicked OK; update the label with the input |
|
81 |
FeatureTree tree = FeatureTree.NewInstance(); |
|
82 |
CdmStore.getService(IFeatureTreeService.class).merge(tree,true); |
|
83 |
tree.setTitleCache(dialog.getValue()); |
|
84 |
refresh(); |
|
85 |
setPattern(tree); |
|
86 |
} |
|
87 |
} |
|
88 |
}; |
|
89 |
} |
|
93 | 90 |
|
94 | 91 |
/** {@inheritDoc} */ |
95 | 92 |
@Override |
Also available in: Unified diff
ref #6786 Fix creating new tree