/*******************************************************************************
 * Copyright (c) 2010 Oak Ridge National Laboratory.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 ******************************************************************************/
package org.csstudio.opibuilder.model;

import org.osgi.framework.Version;



/**The abstract widget model for all PV related widgets. 
 * @author Xihui Chen
 *
 */
public abstract class AbstractPVWidgetModel extends AbstractWidgetModel implements IPVWidgetModel{


	private PVWidgetModelDelegate delegate;
	
	public AbstractPVWidgetModel() {
	}
	
	public PVWidgetModelDelegate getDelegate(){
		if(delegate == null)
			delegate = new PVWidgetModelDelegate(this);
		return delegate;
	}
	
	@Override
	protected void configureBaseProperties() {
		super.configureBaseProperties();		
		getDelegate().configureBaseProperties();
	}
	
	@Override
	public void processVersionDifference(Version boyVersionOnFile) {
		super.processVersionDifference(boyVersionOnFile);
		delegate.processVersionDifference(boyVersionOnFile);		
	}

	public boolean isBorderAlarmSensitve(){
		return getDelegate().isBorderAlarmSensitve();
	}
	
	public boolean isForeColorAlarmSensitve(){
		return getDelegate().isForeColorAlarmSensitve();
	}
	
	public boolean isBackColorAlarmSensitve(){
		return getDelegate().isBackColorAlarmSensitve();
	}
	
	public boolean isAlarmPulsing(){
		return getDelegate().isAlarmPulsing();
	}	
	
	public String getPVName(){
		return getDelegate().getPVName();
	}

	@Override
	/**
	 * Override to prevent unsightly unresolved macros including
	 * $(pv_name) or $(pv_value).
	 */
	public String getTooltip() {
		String rawTooltip = getRawTooltip();
		if ((rawTooltip.contains(PROP_PVNAME) || rawTooltip.contains(PROP_PVVALUE))
				&& (getPVName().equals(""))) {
			return "";
		} else {
			return super.getTooltip();
		}
	}
}

@@ -1714,27 +1714,16 @@
 ();%0A%09%7D%0A%0A
-%09@Override%0A
 %09/**%0A%09 *
@@ -1817,16 +1817,27 @@
 ).%0A%09 */%0A
+%09@Override%0A
 %09public 

Put annotation in standard place.