/******************************************************************************* | |
* Copyright (c) 2011, 2012 Ericsson AB and others. | |
* | |
* 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 | |
* | |
* Description: | |
* | |
* This class encapsulates the properties for the Rule Area UI model element | |
* | |
* Contributors: | |
* Sebastien Dubois - Created for Mylyn Review R4E project | |
* | |
******************************************************************************/ | |
package org.eclipse.mylyn.reviews.r4e.ui.internal.properties.general; | |
import org.eclipse.mylyn.reviews.r4e.ui.internal.model.R4EUIModelElement; | |
import org.eclipse.mylyn.reviews.r4e.ui.internal.model.R4EUIRuleArea; | |
import org.eclipse.mylyn.reviews.r4e.ui.internal.utils.R4EUIConstants; | |
import org.eclipse.ui.views.properties.IPropertyDescriptor; | |
import org.eclipse.ui.views.properties.PropertyDescriptor; | |
/** | |
* @author Sebastien Dubois | |
* @version $Revision: 1.0 $ | |
*/ | |
public class RuleAreaProperties extends ModelElementProperties { | |
// ------------------------------------------------------------------------ | |
// Constants | |
// ------------------------------------------------------------------------ | |
/** | |
* Field RULE_AREA_NAME_ID. (value is ""ruleAreaElement.name"") | |
*/ | |
protected static final String RULE_AREA_NAME_ID = "ruleAreaElement.name"; | |
/** | |
* Field RULE_AREA_NAME_PROPERTY_DESCRIPTOR. | |
*/ | |
protected static final PropertyDescriptor RULE_AREA_NAME_PROPERTY_DESCRIPTOR = new PropertyDescriptor( | |
RULE_AREA_NAME_ID, R4EUIConstants.NAME_LABEL); | |
/** | |
* Field DESCRIPTORS. | |
*/ | |
private static final IPropertyDescriptor[] DESCRIPTORS = { RULE_AREA_NAME_PROPERTY_DESCRIPTOR }; | |
// ------------------------------------------------------------------------ | |
// Constructors | |
// ------------------------------------------------------------------------ | |
/** | |
* Constructor for ReviewGroupProperties. | |
* | |
* @param aElement | |
* R4EUIModelElement | |
*/ | |
public RuleAreaProperties(R4EUIModelElement aElement) { | |
super(aElement); | |
} | |
// ------------------------------------------------------------------------ | |
// Methods | |
// ------------------------------------------------------------------------ | |
/** | |
* Method getPropertyDescriptors. | |
* | |
* @return IPropertyDescriptor[] | |
* @see org.eclipse.ui.views.properties.IPropertySource#getPropertyDescriptors() | |
*/ | |
@Override | |
public IPropertyDescriptor[] getPropertyDescriptors() { | |
return DESCRIPTORS; | |
} | |
/** | |
* Method getPropertyValue. | |
* | |
* @param aId | |
* Object | |
* @return Object | |
* @see org.eclipse.ui.views.properties.IPropertySource#getPropertyValue(Object) | |
*/ | |
@Override | |
public Object getPropertyValue(Object aId) { | |
if (null != getElement()) { | |
if (RULE_AREA_NAME_ID.equals(aId)) { | |
return ((R4EUIRuleArea) getElement()).getArea().getName(); | |
} | |
} | |
return null; | |
} | |
} |