当前位置: 首页>>代码示例>>Java>>正文


Java IOperationHistory.dispose方法代码示例

本文整理汇总了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;
}
 
开发者ID:heartsome,项目名称:tmxeditor8,代码行数:19,代码来源:AddTuHandler.java

示例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;
}
 
开发者ID:heartsome,项目名称:tmxeditor8,代码行数:27,代码来源:DeleteTuHandler.java

示例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;
}
 
开发者ID:heartsome,项目名称:tmxeditor8,代码行数:28,代码来源:TmxEditorViewer.java

示例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;
	}
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:52,代码来源:ChartEditor.java


注:本文中的org.eclipse.core.commands.operations.IOperationHistory.dispose方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。