use of org.jkiss.dbeaver.model.edit.DBECommandContext in project dbeaver by serge-rider.
the class UndoChangesHandler method updateElement.
@Override
public void updateElement(UIElement element, Map parameters) {
IWorkbenchWindow workbenchWindow = element.getServiceLocator().getService(IWorkbenchWindow.class);
if (workbenchWindow == null || workbenchWindow.getActivePage() == null) {
return;
}
final IEditorPart activeEditor = workbenchWindow.getActivePage().getActiveEditor();
if (activeEditor instanceof EntityEditor) {
final DBECommandContext commandContext = ((EntityEditor) activeEditor).getCommandContext();
String text = "Undo";
if (commandContext != null && commandContext.getUndoCommand() != null) {
text += " " + commandContext.getUndoCommand().getTitle();
}
element.setText(text);
}
}
Aggregations