📄 undomanager.java
字号:
/*
* $Header: /home/cvs/WEBPUMP2.0/WebPumpIDE_Src/WebPumpIDE/src/com/webpump/ui/module/model/UndoManager.java,v 1.1.1.1 2004/07/01 09:07:50 wang_j Exp $
* $Revision: 1.1.1.1 $
* $Date: 2004/07/01 09:07:50 $
*
* ====================================================================
*
* The NanJing HopeRun(IT-FOREST) Software License, Version 2.0.0
*
* Copyright 2003-2004 by NanJing HopeRun(IT-FOREST) Information System Co., Ltd, CHINA and
* IT Forest Corporation
* All rights reserved.
*
* This software is the confidential and proprietary information of
* HopeRun(IT-FOREST) Information System Co., Ltd, CHINA and IT Forest Corporation.
* You shall not disclose such Confidential Information and shall use it only in
* accordance with the terms of the license agreement you entered into with
* HopeRun(IT-FOREST) Information System Co., Ltd, CHINA and IT Forest Corporation.
*/
package com.webpump.ui.module.model;
import org.eclipse.pde.internal.ui.editor.PDEMultiPageEditor;
import com.webpump.ui.base.data.BaseDataObject;
import com.webpump.ui.base.data.BaseObject;
import com.webpump.ui.base.gui.BaseUndoManager;
/**
* Class for undo manager
*
* @author shi_l
* @version 2.0.0 2004-2-19
*/
public class UndoManager extends BaseUndoManager {
public UndoManager(PDEMultiPageEditor editor) {
super(editor);
}
/* protected void execute(IModelChangedEvent event, boolean undo) {
Object[] elements = event.getChangedObjects();
int type = event.getChangeType();
String propertyName = event.getChangedProperty();
switch (type) {
case IModelChangedEvent.INSERT :
if (undo)
executeRemove(elements);
else
executeAdd(elements);
break;
case IModelChangedEvent.REMOVE :
if (undo) {
executeAdd(elements);
operations.remove(operations.size() - 1);
}
else
executeRemove(elements);
break;
case IModelChangedEvent.CHANGE :
if (event instanceof AttributeChangedEvent) {
executeAttributeChange((AttributeChangedEvent) event, undo);
} else {
if (undo)
executeChange(
elements[0],
propertyName,
event.getNewValue(),
event.getOldValue());
else
executeChange(
elements[0],
propertyName,
event.getOldValue(),
event.getNewValue());
}
}
}*/
/* private void executeAdd(Object[] elements) {
if (elements instanceof BaseObject[]) {
BaseDataObject objParent = (BaseDataObject) ((BaseObject) elements[0]).getParent();
objParent.add(elements);
}
}
*/
private void executeRemove(Object[] elements) {
if (elements instanceof BaseObject[]) {
BaseDataObject objParent = (BaseDataObject) ((BaseObject) elements[0]).getParent();
objParent.remove(elements);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -