/* InsertCommentHandler.java

	Purpose:
		
	Description:
		
	History:
		Wed, Dec 17, 2014 10:27:56 AM, Created by JerryChen

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

*/
package org.zkoss.zssex.ui.impl.ua;

import org.zkoss.zss.api.Ranges;
import org.zkoss.zss.api.model.Book;
import org.zkoss.zss.api.model.Sheet;


/**
 * 
 * @author JerryChen
 * @since 3.7.0
 */
public class InsertCommentHandler extends AbstractCommentHandler {

	@Override
	protected String getTitle() {
		return "Insert Comment";
	}

	@Override
	public boolean isEnabled(Book book, Sheet sheet) {
		return book != null && sheet != null && 
			!(sheet.isProtected() && !Ranges.range(sheet).getSheetProtection().isObjectsEditable());
	}
}