use of org.eclipse.emf.common.command.AbstractCommand in project tmdm-studio-se by Talend.
the class XSDEditor2 method innerSave.
private void innerSave(final IProgressMonitor monitor) {
IRepositoryViewObject viewObject = getCurrentViewObject();
final Item item = viewObject.getProperty().getItem();
int activePage = getActivePage();
//
final TransactionalEditingDomain editingDomain = (TransactionalEditingDomain) getAdapter(TransactionalEditingDomain.class);
if (editingDomain != null && (activePage != MODEL_PAGE_INDEX && activePage != SOURCE_PAGE_INDEX)) {
editingDomain.getCommandStack().execute(new AbstractCommand() {
@Override
public boolean canExecute() {
return true;
}
@Override
public void redo() {
// do nothing
}
@Override
public void execute() {
doSave(item, monitor);
}
});
} else {
doSave(item, monitor);
}
DeployService deployService = DeployService.getInstance();
if (deployService.isAutoDeploy()) {
deployService.autoDeploy(getSite().getShell(), viewObject);
} else {
MDMServerDef lastServerDef = RepositoryResourceUtil.getLastServerDef(item);
if (lastServerDef != null) {
CommandManager.getInstance().pushCommand(ICommand.CMD_MODIFY, viewObject);
}
}
}
Aggregations