Revision 63599147
Added by Katja Luther almost 10 years ago
eu.etaxonomy.taxeditor.store/plugin.xml | ||
---|---|---|
358 | 358 |
</command> |
359 | 359 |
<command |
360 | 360 |
commandId="eu.etaxonomy.taxeditor.store.datasource.update" |
361 |
label="Update" |
|
361 |
label="Update Datamodel"
|
|
362 | 362 |
style="push"> |
363 | 363 |
<visibleWhen |
364 | 364 |
checkEnabled="true"> |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/datasource/handler/UpdateDataSourceHandler.java | ||
---|---|---|
15 | 15 |
import org.eclipse.core.runtime.IStatus; |
16 | 16 |
import org.eclipse.core.runtime.Status; |
17 | 17 |
import org.eclipse.core.runtime.jobs.Job; |
18 |
import org.eclipse.jface.dialogs.MessageDialog; |
|
18 | 19 |
import org.eclipse.swt.widgets.Display; |
20 |
import org.eclipse.ui.handlers.HandlerUtil; |
|
19 | 21 |
import org.eclipse.ui.progress.IProgressConstants; |
20 | 22 |
|
21 | 23 |
import eu.etaxonomy.cdm.database.update.CdmUpdater; |
... | ... | |
43 | 45 |
final CdmMetaDataAwareDataSourceContainer container = getSelectedDataSourceContainer(event); |
44 | 46 |
|
45 | 47 |
final Display display = Display.getCurrent(); |
46 |
|
|
48 |
if(! MessageDialog.openConfirm(HandlerUtil.getActiveShell(event), "Confirm Deletion", "Are you sure you want to update the datasource?")){ |
|
49 |
return false; |
|
50 |
} |
|
47 | 51 |
Job job = new Job("Updating datasource " + container.getDataSource().getName()){ |
48 | 52 |
|
49 | 53 |
@Override |
50 | 54 |
protected IStatus run(IProgressMonitor monitor) { |
51 | 55 |
CdmUpdater updater = new CdmUpdater(); |
52 | 56 |
IStatus status = null; |
57 |
|
|
53 | 58 |
try{ |
54 | 59 |
if(updater.updateToCurrentVersion(container.getDataSource(), CdmProgressMonitorAdapter.CreateMonitor(monitor))){ |
55 | 60 |
display.asyncExec(new Runnable(){ |
Also available in: Unified diff
#3897