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


Java OperationHistoryEvent.DONE属性代码示例

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


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

示例1: decodeEventType

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,代码行数:16,代码来源:OperationHistoryMonitor.java

示例2: historyNotification

@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,代码行数:19,代码来源:Timeline.java

示例3: historyNotification

@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,代码行数:18,代码来源:AbstractUndoableOperationAction.java

示例4: historyNotification

@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,代码行数:17,代码来源:AbstractPlanEditorHandler.java

示例5: historyNotification

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,代码行数:39,代码来源:UndoManager2.java

示例6: aboutToNotify

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,代码行数:13,代码来源:UndoableOperation2ChangeAdapter.java

示例7: performHistoryNotification

private void performHistoryNotification(final OperationHistoryEvent event) {
  RefactoringDescriptor descriptor = getRefactoringDescriptor(event.getOperation());
  if (descriptor != null) {
    RefactoringDescriptorProxyAdapter proxy = new RefactoringDescriptorProxyAdapter(descriptor);
    switch (event.getEventType()) {
      case OperationHistoryEvent.ABOUT_TO_EXECUTE:
        {
          if (checkDescriptor(descriptor, event.getOperation())) {
            fireRefactoringExecutionEvent(proxy, RefactoringExecutionEvent.ABOUT_TO_PERFORM);
          }
          break;
        }
      case OperationHistoryEvent.DONE:
        {
          if (!RefactoringDescriptor.ID_UNKNOWN.equals(descriptor.getID())) {
            long timeStamp =
                fOverrideTimeStamp >= 0 ? fOverrideTimeStamp : System.currentTimeMillis();
            descriptor.setTimeStamp(timeStamp);
          }

          fireRefactoringHistoryEvent(proxy, RefactoringHistoryEvent.PUSHED);
          fireRefactoringExecutionEvent(proxy, RefactoringExecutionEvent.PERFORMED);
          break;
        }
      case OperationHistoryEvent.ABOUT_TO_UNDO:
        {
          fireRefactoringExecutionEvent(proxy, RefactoringExecutionEvent.ABOUT_TO_UNDO);
          break;
        }
      case OperationHistoryEvent.UNDONE:
        {
          fireRefactoringHistoryEvent(proxy, RefactoringHistoryEvent.POPPED);
          fireRefactoringExecutionEvent(proxy, RefactoringExecutionEvent.UNDONE);
          break;
        }
      case OperationHistoryEvent.ABOUT_TO_REDO:
        {
          fireRefactoringExecutionEvent(proxy, RefactoringExecutionEvent.ABOUT_TO_REDO);
          break;
        }
      case OperationHistoryEvent.REDONE:
        {
          fireRefactoringHistoryEvent(proxy, RefactoringHistoryEvent.PUSHED);
          fireRefactoringExecutionEvent(proxy, RefactoringExecutionEvent.REDONE);
          break;
        }
    }
  }
}
 
开发者ID:eclipse,项目名称:che,代码行数:49,代码来源:RefactoringHistoryService.java

示例8: historyNotification

@Override
public void historyNotification(OperationHistoryEvent event) {
	IUndoableOperation eventOperation = event.getOperation();
	IUndoContext inputUndoContext = getUndoContext();
	IUndoContext[] operationContexts = eventOperation.getContexts();
	boolean matches = false;
	for (IUndoContext operationContext : operationContexts) {
		matches = operationContext.matches(inputUndoContext);
		if (matches) {
			break;
		}
	}
	if (!matches) {
		return;
	}
	switch (event.getEventType()) {
	case OperationHistoryEvent.REDONE: {
		if (eventOperation == cleanStateOperation) {
			dirty = false;
			fireDirtyStateChanged();
		} else if (!dirty) {
			dirty = true;
			fireDirtyStateChanged();
		}
		break;
	}
	case OperationHistoryEvent.DONE: {
		if (!dirty) {
			dirty = true;
			fireDirtyStateChanged();
		}
		break;
	}
	case OperationHistoryEvent.UNDONE: {
		IUndoableOperation undoOperation = event.getHistory().getUndoOperation(inputUndoContext);
		if (undoOperation == cleanStateOperation) {
			dirty = false;
			fireDirtyStateChanged();
		} else if (!dirty) {
			dirty = true;
			fireDirtyStateChanged();
		}
		break;
	}
	default:
		// nothing to do yet
		break;
	}
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:49,代码来源:AbstractEnsembleEditorModel.java


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