/* DeletePictureHandler.java

{{IS_NOTE
	Purpose:
		
	Description:
		
	History:
		2013/8/5 , Created by dennis
}}IS_NOTE

Copyright (C) 2013 Potix Corporation. All Rights Reserved.

{{IS_RIGHT
}}IS_RIGHT
*/
package org.zkoss.zssex.ui.impl.ua;

import org.zkoss.util.resource.Labels;
import org.zkoss.zk.ui.event.Event;
import org.zkoss.zss.api.Range;
import org.zkoss.zss.api.Ranges;
import org.zkoss.zss.api.model.Picture;
import org.zkoss.zss.api.model.Sheet;
import org.zkoss.zss.api.model.Book.BookType;
import org.zkoss.zss.ui.UserActionContext;
import org.zkoss.zss.ui.event.WidgetKeyEvent;

/**
 * @author dennis
 *
 */
public class DeletePictureHandler extends AbstractObjectHandler {
	private static final long serialVersionUID = -1188225515731012183L;

	/* (non-Javadoc)
	 * @see org.zkoss.zss.ui.UserActionHandler#process(org.zkoss.zss.ui.UserActionContext)
	 */
	@Override
	protected boolean processAction(final UserActionContext ctx) {
		Picture picture = (Picture)ctx.getData("picture");
		Range range = Ranges.range(ctx.getSheet());
		range.deletePicture(picture);
		return true;
	}

}
