• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java OperationHistoryEvent类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.eclipse.core.commands.operations.OperationHistoryEvent的典型用法代码示例。如果您正苦于以下问题:Java OperationHistoryEvent类的具体用法?Java OperationHistoryEvent怎么用?Java OperationHistoryEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



OperationHistoryEvent类属于org.eclipse.core.commands.operations包,在下文中一共展示了OperationHistoryEvent类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: historyNotification

import org.eclipse.core.commands.operations.OperationHistoryEvent; //导入依赖的package包/类
@Override
	public void historyNotification(OperationHistoryEvent event) {
		
		IUndoableOperation op = event.getOperation();
		String typeString = decodeEventType(event.getEventType());
//		System.out.println("type='"+typeString+"' operation='"+op+"' of type '"+op.getClass().getName()+"' e="+op.canExecute()+" u="+op.canUndo()+" r="+op.canRedo());
//		for(IUndoContext c : op.getContexts()) {
//			System.out.println("\t"+c.getLabel());
//		}
		
		switch(event.getEventType()) {
			case OperationHistoryEvent.OPERATION_ADDED:
			case OperationHistoryEvent.OPERATION_CHANGED:
			case OperationHistoryEvent.OPERATION_REMOVED:
			case OperationHistoryEvent.ABOUT_TO_EXECUTE:
			case OperationHistoryEvent.ABOUT_TO_REDO:
			case OperationHistoryEvent.ABOUT_TO_UNDO:
				break;
			default:
				EnsembleUsageLogger.logUsage(op.getLabel() + " - " + typeString + "\n" + op.toString());
		}
		
	}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:24,代码来源:OperationHistoryMonitor.java


示例2: decodeEventType

import org.eclipse.core.commands.operations.OperationHistoryEvent; //导入依赖的package包/类
private static String decodeEventType(int eventType) {
	String typeString = null;
	switch(eventType) {
		case OperationHistoryEvent.ABOUT_TO_EXECUTE:typeString="ABOUT_TO_EXECUTE";break;
		case OperationHistoryEvent.ABOUT_TO_REDO:typeString="ABOUT_TO_REDO";break;
		case OperationHistoryEvent.ABOUT_TO_UNDO:typeString="ABOUT_TO_UNDO";break;
		case OperationHistoryEvent.DONE:typeString="DONE";break;
		case OperationHistoryEvent.OPERATION_ADDED:typeString="OPERATION_ADDED";break;
		case OperationHistoryEvent.OPERATION_CHANGED:typeString="OPERATION_CHANGED";break;
		case OperationHistoryEvent.OPERATION_NOT_OK:typeString="OPERATION_NOT_OK";break;
		case OperationHistoryEvent.OPERATION_REMOVED:typeString="OPERATION_REMOVED";break;
		case OperationHistoryEvent.REDONE:typeString="REDONE";break;
		case OperationHistoryEvent.UNDONE:typeString="UNDONE";break;
	}
	return typeString;
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:17,代码来源:OperationHistoryMonitor.java


示例3: historyNotification

import org.eclipse.core.commands.operations.OperationHistoryEvent; //导入依赖的package包/类
@Override
public void historyNotification(OperationHistoryEvent event) {
	switch (event.getEventType()) {
	case OperationHistoryEvent.ABOUT_TO_EXECUTE:
	case OperationHistoryEvent.ABOUT_TO_REDO:
	case OperationHistoryEvent.ABOUT_TO_UNDO:
		if (WidgetUtils.inDisplayThread()) {
			Animation.markBegin();
		}
		break;
	case OperationHistoryEvent.DONE:
	case OperationHistoryEvent.REDONE:
	case OperationHistoryEvent.UNDONE:
		if (WidgetUtils.inDisplayThread()) {
			Animation.run(150);
		}
		break;
	}
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:20,代码来源:Timeline.java


示例4: historyNotification

import org.eclipse.core.commands.operations.OperationHistoryEvent; //导入依赖的package包/类
@Override
public void historyNotification(OperationHistoryEvent event) {
	int type = event.getEventType();
	if ((type == OperationHistoryEvent.DONE)
		|| (type == OperationHistoryEvent.REDONE)
		|| (type == OperationHistoryEvent.UNDONE)) {
		IUndoableOperation operation = event.getOperation();
		if ((undoContext == null) || operation.hasContext(undoContext) || operation.getContexts().length == 0) {
			Display display = WidgetUtils.getDisplay();
			display.asyncExec(new Runnable() {
				@Override
				public void run() {
					updateEnablement();
				}
			});
		}
	}
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:19,代码来源:AbstractUndoableOperationAction.java


示例5: historyNotification

import org.eclipse.core.commands.operations.OperationHistoryEvent; //导入依赖的package包/类
@Override
public void historyNotification(OperationHistoryEvent event) {
	int eventType = event.getEventType();
	if (eventType == OperationHistoryEvent.DONE ||
			eventType == OperationHistoryEvent.UNDONE ||
			eventType == OperationHistoryEvent.REDONE) {
		IEditorPart activeEditor = getActiveEditor();
		if (activeEditor != null) {
			WidgetUtils.runInDisplayThread(activeEditor.getSite().getShell(), new Runnable() {
				@Override
				public void run() {
					selectionChanged(activeSelectionProvider.getSelection());
				}
			});
		}
	}
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:18,代码来源:AbstractPlanEditorHandler.java


示例6: historyNotification

import org.eclipse.core.commands.operations.OperationHistoryEvent; //导入依赖的package包/类
public void historyNotification(OperationHistoryEvent event) {
	final int type = event.getEventType();
	switch (type) {
		case OperationHistoryEvent.UNDONE:
		case OperationHistoryEvent.REDONE:
		case OperationHistoryEvent.OPERATION_ADDED:
		case OperationHistoryEvent.OPERATION_REMOVED:
		case OperationHistoryEvent.OPERATION_NOT_OK:
			// if this is one of our operations
			if (event.getOperation().hasContext(this.context)) {
				this.update.update();
			}
	}
}
 
开发者ID:cplutte,项目名称:bts,代码行数:15,代码来源:OperationHistoryListener.java


示例7: historyNotification

import org.eclipse.core.commands.operations.OperationHistoryEvent; //导入依赖的package包/类
public void historyNotification(OperationHistoryEvent event) {
  IUndoableOperation op = event.getOperation();
  if (op instanceof TriggeredOperations) {
    op = ((TriggeredOperations) op).getTriggeringOperation();
  }
  UndoableOperation2ChangeAdapter changeOperation = null;
  if (op instanceof UndoableOperation2ChangeAdapter) {
    changeOperation = (UndoableOperation2ChangeAdapter) op;
  }
  if (changeOperation == null) return;
  Change change = changeOperation.getChange();
  switch (event.getEventType()) {
    case OperationHistoryEvent.ABOUT_TO_EXECUTE:
    case OperationHistoryEvent.ABOUT_TO_UNDO:
    case OperationHistoryEvent.ABOUT_TO_REDO:
      fireAboutToPerformChange(change);
      break;
    case OperationHistoryEvent.DONE:
    case OperationHistoryEvent.UNDONE:
    case OperationHistoryEvent.REDONE:
      fireChangePerformed(change);
      fireUndoStackChanged();
      fireRedoStackChanged();
      break;
    case OperationHistoryEvent.OPERATION_NOT_OK:
      fireChangePerformed(change);
      break;
    case OperationHistoryEvent.OPERATION_ADDED:
      // would be better to have different events for this
      fireUndoStackChanged();
      fireRedoStackChanged();
      break;
    case OperationHistoryEvent.OPERATION_REMOVED:
      // would be better to have different events for this
      fireUndoStackChanged();
      fireRedoStackChanged();
      break;
  }
}
 
开发者ID:eclipse,项目名称:che,代码行数:40,代码来源:UndoManager2.java


示例8: aboutToNotify

import org.eclipse.core.commands.operations.OperationHistoryEvent; //导入依赖的package包/类
public void aboutToNotify(OperationHistoryEvent event) {
  switch (event.getEventType()) {
    case OperationHistoryEvent.ABOUT_TO_EXECUTE:
    case OperationHistoryEvent.ABOUT_TO_UNDO:
    case OperationHistoryEvent.ABOUT_TO_REDO:
    case OperationHistoryEvent.DONE:
    case OperationHistoryEvent.UNDONE:
    case OperationHistoryEvent.REDONE:
    case OperationHistoryEvent.OPERATION_NOT_OK:
      ResourcesPlugin.getWorkspace().checkpoint(false);
      break;
  }
}
 
开发者ID:eclipse,项目名称:che,代码行数:14,代码来源:UndoableOperation2ChangeAdapter.java


示例9: notifyAboutToExecute

import org.eclipse.core.commands.operations.OperationHistoryEvent; //导入依赖的package包/类
private void notifyAboutToExecute(IUndoableOperation operation) {
	if (DEBUG_OPERATION_HISTORY_NOTIFICATION) {
		Tracing.printTrace("OPERATIONHISTORY", "ABOUT_TO_EXECUTE " //$NON-NLS-1$ //$NON-NLS-2$
				+ operation);
	}

	notifyListeners(new OperationHistoryEvent(
			OperationHistoryEvent.ABOUT_TO_EXECUTE, this, operation));
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:10,代码来源:DefaultOperationHistory.java


示例10: notifyAboutToRedo

import org.eclipse.core.commands.operations.OperationHistoryEvent; //导入依赖的package包/类
private void notifyAboutToRedo(IUndoableOperation operation) {
	if (DEBUG_OPERATION_HISTORY_NOTIFICATION) {
		Tracing.printTrace("OPERATIONHISTORY", "ABOUT_TO_REDO " //$NON-NLS-1$ //$NON-NLS-2$
				+ operation);
	}

	notifyListeners(new OperationHistoryEvent(
			OperationHistoryEvent.ABOUT_TO_REDO, this, operation));
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:10,代码来源:DefaultOperationHistory.java


示例11: notifyAboutToUndo

import org.eclipse.core.commands.operations.OperationHistoryEvent; //导入依赖的package包/类
private void notifyAboutToUndo(IUndoableOperation operation) {
	if (DEBUG_OPERATION_HISTORY_NOTIFICATION) {
		Tracing.printTrace("OPERATIONHISTORY", "ABOUT_TO_UNDO " //$NON-NLS-1$ //$NON-NLS-2$
				+ operation);
	}

	notifyListeners(new OperationHistoryEvent(
			OperationHistoryEvent.ABOUT_TO_UNDO, this, operation));
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:10,代码来源:DefaultOperationHistory.java


示例12: notifyAdd

import org.eclipse.core.commands.operations.OperationHistoryEvent; //导入依赖的package包/类
private void notifyAdd(IUndoableOperation operation) {
	if (DEBUG_OPERATION_HISTORY_NOTIFICATION) {
		Tracing.printTrace("OPERATIONHISTORY", "OPERATION_ADDED " //$NON-NLS-1$ //$NON-NLS-2$
				+ operation);
	}

	notifyListeners(new OperationHistoryEvent(
			OperationHistoryEvent.OPERATION_ADDED, this, operation));
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:10,代码来源:DefaultOperationHistory.java


示例13: notifyDone

import org.eclipse.core.commands.operations.OperationHistoryEvent; //导入依赖的package包/类
private void notifyDone(IUndoableOperation operation) {
	if (DEBUG_OPERATION_HISTORY_NOTIFICATION) {
		Tracing.printTrace("OPERATIONHISTORY", "DONE " + operation); //$NON-NLS-1$ //$NON-NLS-2$
	}

	notifyListeners(new OperationHistoryEvent(OperationHistoryEvent.DONE,
			this, operation));
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:9,代码来源:DefaultOperationHistory.java


示例14: notifyNotOK

import org.eclipse.core.commands.operations.OperationHistoryEvent; //导入依赖的package包/类
private void notifyNotOK(IUndoableOperation operation, IStatus status) {
	if (DEBUG_OPERATION_HISTORY_NOTIFICATION) {
		Tracing.printTrace("OPERATIONHISTORY", "OPERATION_NOT_OK " //$NON-NLS-1$ //$NON-NLS-2$
				+ operation);
	}

	notifyListeners(new OperationHistoryEvent(
			OperationHistoryEvent.OPERATION_NOT_OK, this, operation, status));
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:10,代码来源:DefaultOperationHistory.java


示例15: notifyRedone

import org.eclipse.core.commands.operations.OperationHistoryEvent; //导入依赖的package包/类
private void notifyRedone(IUndoableOperation operation) {
	if (DEBUG_OPERATION_HISTORY_NOTIFICATION) {
		Tracing.printTrace("OPERATIONHISTORY", "REDONE " + operation); //$NON-NLS-1$ //$NON-NLS-2$
	}

	notifyListeners(new OperationHistoryEvent(OperationHistoryEvent.REDONE,
			this, operation));
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:9,代码来源:DefaultOperationHistory.java


示例16: notifyRemoved

import org.eclipse.core.commands.operations.OperationHistoryEvent; //导入依赖的package包/类
private void notifyRemoved(IUndoableOperation operation) {
	if (DEBUG_OPERATION_HISTORY_NOTIFICATION) {
		Tracing.printTrace("OPERATIONHISTORY", "OPERATION_REMOVED " //$NON-NLS-1$ //$NON-NLS-2$
				+ operation);
	}

	notifyListeners(new OperationHistoryEvent(
			OperationHistoryEvent.OPERATION_REMOVED, this, operation));
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:10,代码来源:DefaultOperationHistory.java


示例17: notifyUndone

import org.eclipse.core.commands.operations.OperationHistoryEvent; //导入依赖的package包/类
private void notifyUndone(IUndoableOperation operation) {
	if (DEBUG_OPERATION_HISTORY_NOTIFICATION) {
		Tracing.printTrace("OPERATIONHISTORY", "UNDONE " + operation); //$NON-NLS-1$ //$NON-NLS-2$
	}

	notifyListeners(new OperationHistoryEvent(OperationHistoryEvent.UNDONE,
			this, operation));
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:9,代码来源:DefaultOperationHistory.java


示例18: notifyChanged

import org.eclipse.core.commands.operations.OperationHistoryEvent; //导入依赖的package包/类
private void notifyChanged(IUndoableOperation operation) {
	if (DEBUG_OPERATION_HISTORY_NOTIFICATION) {
		Tracing.printTrace("OPERATIONHISTORY", "OPERATION_CHANGED " //$NON-NLS-1$//$NON-NLS-2$
				+ operation);
	}

	notifyListeners(new OperationHistoryEvent(
			OperationHistoryEvent.OPERATION_CHANGED, this, operation));
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:10,代码来源:DefaultOperationHistory.java


示例19: historyNotification

import org.eclipse.core.commands.operations.OperationHistoryEvent; //导入依赖的package包/类
@Override
public void historyNotification(OperationHistoryEvent event) {
	IStatus status = event.getStatus();
	if ((status != null) && !status.isOK()) {
		testStatus = status;
	}
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:8,代码来源:TestOperationJob.java


示例20: historyNotification

import org.eclipse.core.commands.operations.OperationHistoryEvent; //导入依赖的package包/类
@Override
public void historyNotification(OperationHistoryEvent event)
{
	if (event.getOperation() instanceof MapOperation)
	{
		System.out.println("Undo-History Event: " + event);
		panel.redraw();
	}
}
 
开发者ID:TheWhiteShadow3,项目名称:cuina,代码行数:10,代码来源:TerrainEditor.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java VertexReader类代码示例发布时间:2022-05-22
下一篇:
Java Map类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap