本文整理汇总了Java中org.eclipse.core.commands.operations.IOperationHistory.dispose方法的典型用法代码示例。如果您正苦于以下问题:Java IOperationHistory.dispose方法的具体用法?Java IOperationHistory.dispose怎么用?Java IOperationHistory.dispose使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.core.commands.operations.IOperationHistory
的用法示例。
在下文中一共展示了IOperationHistory.dispose方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: execute
import org.eclipse.core.commands.operations.IOperationHistory; //导入方法依赖的package包/类
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
TmxEditorViewer viewer = TmxEditorViewer.getInstance();
if(viewer == null){
return null;
}
TmxEditor editor = viewer.getTmxEditor();
if(editor == null){
return null;
}
String srcLang = editor.getSrcLang();
String tgtLang = editor.getTgtLang();
TmxTU tu = TmxEditorUtils.createTmxTu(srcLang, tgtLang);
editor.addTu(tu);
IOperationHistory histor = OperationHistoryFactory.getOperationHistory();
histor.dispose(PlatformUI.getWorkbench().getOperationSupport().getUndoContext(), true, true, true);
return null;
}
示例2: execute
import org.eclipse.core.commands.operations.IOperationHistory; //导入方法依赖的package包/类
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
TmxEditorViewer viewer = TmxEditorViewer.getInstance();
if (viewer == null) {
return null;
}
TmxEditor editor = viewer.getTmxEditor();
if (editor == null) {
return null;
}
if (editor.getTmxDataAccess().getDisplayTuCount() == 0
|| editor.getTmxEditorImpWithNattable().getSelectedRows().length == 0) {
OpenMessageUtils.openMessage(IStatus.INFO, Messages.getString("tmxeditor.deleteTuHandler.noSelectedMsg"));
return null;
}
boolean confirm = MessageDialog.openConfirm(HandlerUtil.getActiveShell(event),
Messages.getString("tmxeditor.deleteTuHandler.warn.msg"),
Messages.getString("tmxeditor.deleteTuHandler.warn.desc"));
if (!confirm) {
return null;
}
editor.deleteSelectedTu();
IOperationHistory histor = OperationHistoryFactory.getOperationHistory();
histor.dispose(PlatformUI.getWorkbench().getOperationSupport().getUndoContext(), true, true, true);
return null;
}
示例3: closeTmx
import org.eclipse.core.commands.operations.IOperationHistory; //导入方法依赖的package包/类
/**
* 关闭TmxEditor,同时关闭AbstractDataAccess
**/
public boolean closeTmx() {
if (tmxEditor == null) {
return true;
}
if (!tmxEditor.closeTmxEditor()) {
return false;
}
tmxEditor = null;
Control[] childs = container.getChildren();
for (Control c : childs) {
if (c != null && !c.isDisposed()) {
c.dispose();
}
}
fireCloseEvent();
IOperationHistory operationHistory = OperationHistoryFactory.getOperationHistory();
operationHistory.dispose(getSite().getWorkbenchWindow().getWorkbench().getOperationSupport().getUndoContext(),
true, true, true);
setFocus();
String title = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell().getText();
String[] s = title.split("-");
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell().setText(s[0]);
return true;
}
示例4: handleCancelation
import org.eclipse.core.commands.operations.IOperationHistory; //导入方法依赖的package包/类
private void handleCancelation(final EObject theSemanticElement, final TransactionalEditingDomain theDomain,
final CommandStack theCommandStack) {
final IWorkspaceCommandStack theWorkspaceCommandStack = (IWorkspaceCommandStack) theCommandStack;
if (theLastOperationCreatedTheElement(theSemanticElement, theWorkspaceCommandStack)) {
theCommandStack.undo();
final IOperationHistory theOperationHistory = theWorkspaceCommandStack.getOperationHistory();
theOperationHistory.dispose(theWorkspaceCommandStack.getDefaultUndoContext(), false, true, false);
}
}
开发者ID:info-sharing-environment,项目名称:NIEM-Modeling-Tool,代码行数:10,代码来源:ClassifierNamePopupEditorConfiguration.java
示例5: dispose
import org.eclipse.core.commands.operations.IOperationHistory; //导入方法依赖的package包/类
@Override
public void dispose() {
UndoRedoUtils.disposeUndoRedo(getEditorSite().getActionBars());
super.dispose();
if (editingDomain != null) {
editingDomain.removeResourceSetListener(pageExtentListener);
}
if (listener != null) {
listener.dispose();
listener = null;
}
if (dirtyMonitor != null) {
dirtyMonitor.dispose();
dirtyMonitor = null;
}
if (synchronizer != null) {
synchronizer.dispose();
synchronizer = null;
}
if (editingDomain != null) {
editingDomain.dispose();
ResourceSet resourceSet = editingDomain.getResourceSet();
editingDomain = null;
for (Resource r : resourceSet.getResources()) {
r.unload();
}
}
if (timeline != null) {
timeline.dispose();
timeline = null;
}
if (timelineModel != null) {
timelineModel = null;
}
if (profileSynchronizer != null) {
profileSynchronizer.dispose();
profileSynchronizer = null;
}
IWorkbenchPartSite site = getSite();
if (site != null) {
ISelectionProvider provider = site.getSelectionProvider();
if (provider != null) {
provider.setSelection(StructuredSelection.EMPTY);
}
}
if (undoContext != null) {
IOperationHistory history = OperationHistoryFactory.getOperationHistory();
history.dispose(undoContext, true, true, true);
undoContext = null;
}
}