⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 renamenodecommand.java

📁 eclipse开发笔记
💻 JAVA
字号:
package hellogef.command;

import hellogef.model.NodeModel;

import org.eclipse.gef.commands.Command;

public class RenameNodeCommand extends Command {

	private NodeModel node;

	private String newName;

	private String oldName;

	public void setName(String name) {
		this.newName = name;
	}

	public void setNode(NodeModel node) {
		this.node = node;
	}

	public void execute() {
		oldName = this.node.getName();
		this.node.setName(newName);
	}

	public void redo() {
		node.setName(newName);
	}

	public void undo() {
		node.setName(oldName);
	}

	public String getLabel() {
		return "Rename Node";
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -