package smart_gs.drawing_tool.action;

import javax.swing.JOptionPane;

import smart_gs.logical.Region;
import smart_gs.swingui.WorkspaceWindow;

public class ChangeRegionTitleAction {
	
	private Region region;
	
	public ChangeRegionTitleAction(Region region) {
		this.region = region;
	}

	public void execute() {
		String oldTitle = this.region.getView().getTitle();
		String title = JOptionPane.showInputDialog("Title", oldTitle);
		this.region.getView().setTitle(title);
		WorkspaceWindow.setUpdated(true);
	}

}
