use of eu.esdihumboldt.hale.ui.io.schema.SchemaImportWizard in project hale by halestudio.
the class SchemaUpdateComponent method updateSelectedSchema.
/**
*/
protected void updateSelectedSchema() {
ISelection sel = tableViewer.getSelection();
if (!sel.isEmpty() && sel instanceof IStructuredSelection) {
final IOConfiguration selected = (IOConfiguration) ((IStructuredSelection) sel).getFirstElement();
SchemaImportWizard wizard = new SchemaImportWizard() {
@Override
public boolean performFinish() {
if (!applyConfiguration()) {
return false;
}
IOConfiguration configuration = new IOConfiguration();
configuration.setActionId(getActionId());
configuration.setProviderId(getProviderFactory().getIdentifier());
getProvider().storeConfiguration(configuration.getProviderConfiguration());
// replace the previously selected I/O configuration
int index = configurations.indexOf(selected);
configurations.set(index, configuration);
// refresh table viewer to reflect the changes
tableViewer.refresh(true);
return true;
}
};
// configure advisor
// FIXME
SchemaImportAdvisor advisor = new SchemaImportAdvisor(SchemaSpaceID.TARGET);
advisor.setServiceProvider(HaleUI.getServiceProvider());
advisor.setActionId(SchemaIO.ACTION_LOAD_TARGET_SCHEMA);
wizard.setAdvisor(advisor, actionId);
// open wizard
Shell shell = Display.getCurrent().getActiveShell();
HaleWizardDialog dialog = new HaleWizardDialog(shell, wizard);
dialog.open();
}
}
Aggregations