/* $Id: ReleaseProtectedRegionAction.java 125 2011-03-09 09:49:51Z ohura $ */
package smart_gs.drawing_tool.action;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

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

public class ReleaseProtectedRegionAction implements ActionListener {
	private Region region;
	public ReleaseProtectedRegionAction(Region region){
		this.region = region;
	}
	
	public void execute(){
//		region.getSpread().getCurrentSheet().releaseRegion(region);
//		region.releaseProtection();
		if(region != null){
			region.setProtection(Region.NORMAL);
			region.getView().setIsProtected(Region.NORMAL);
			WorkspaceWindow.setUpdated(true);
		}
	}
	public void actionPerformed(ActionEvent arg0) {
		// TODO Auto-generated method stub
		this.execute();
	}

}
