use of org.eclipse.vorto.perspective.view.ModelUploadDialog in project vorto by eclipse.
the class ShareModelAction method run.
@Override
public void run() {
IModelElement modelElement = getSelectedElement();
try {
UploadResult uploadResult = modelRepo.upload(modelElement.getModelFile().getName(), ByteStreams.toByteArray(modelElement.getModelFile().getContents()));
ModelUploadDialog uploadDialog = new ModelUploadDialog(getViewer().getControl().getShell(), uploadResult);
uploadDialog.create();
int result = uploadDialog.open();
if (uploadResult.statusOk() && result == Window.OK) {
modelRepo.commit(uploadResult.getHandleId());
MessageDisplayFactory.getMessageDisplay().displaySuccess("Model " + modelElement.getModelFile().getName() + " saved to repository.");
}
} catch (Exception e) {
ExceptionHandlerFactory.getHandler().handle(e);
}
}
Aggregations