blob: af258093faa9fdd170093258aad95ffba7e8ba39 [file] [log] [blame]
//------------------------------------------------------------------------------
// Copyright (c) 2005, 2006 IBM Corporation 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
//
// Contributors:
// IBM Corporation - initial implementation
//------------------------------------------------------------------------------
package org.eclipse.epf.authoring.ui.forms;
import org.eclipse.epf.authoring.ui.AuthoringUIResources;
import org.eclipse.epf.authoring.ui.AuthoringUIText;
import org.eclipse.epf.authoring.ui.filters.CustomCategoryFilter;
import org.eclipse.epf.library.edit.IFilter;
import org.eclipse.epf.library.edit.itemsfilter.FilterConstants;
import org.eclipse.epf.library.edit.itemsfilter.VariabilityBaseElementFilter;
import org.eclipse.epf.uma.CustomCategory;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorSite;
import org.eclipse.ui.forms.editor.FormEditor;
/**
* The Description page for the Domain editor.
*
* @author Kelvin Low
* @author Shilpa Toraskar
* @since 1.0
*/
public class CustomCategoryDescriptionPage extends DescriptionFormPage {
private static final String FORM_PAGE_ID = "customCategoryDescriptionPage"; //$NON-NLS-1$
private CustomCategory category;
/**
* Creates a new instance.
*/
public CustomCategoryDescriptionPage(FormEditor editor) {
super(editor, FORM_PAGE_ID, AuthoringUIText.DESCRIPTION_PAGE_TITLE);
}
/**
* @see org.eclipse.epf.authoring.ui.forms.DescriptionFormPage#init(org.eclipse.ui.IEditorSite, org.eclipse.ui.IEditorInput)
*/
public void init(IEditorSite site, IEditorInput input) {
super.init(site, input);
category = (CustomCategory) contentElement;
publishCategoryOn = true;
setIconSectionOn(true);
}
/**
* @see org.eclipse.epf.authoring.ui.forms.DescriptionFormPage#getContentElement()
*/
protected Object getContentElement() {
return category;
}
/**
* @see org.eclipse.epf.authoring.ui.forms.DescriptionFormPage#getTabString()
*/
protected String getTabString() {
return FilterConstants.CUSTOM_CATEGORIES;
}
/**
* @see org.eclipse.epf.authoring.ui.forms.DescriptionFormPage#getFilter()
*/
protected IFilter getFilter() {
filter = new CustomCategoryFilter();
// set additional filter for variability base element checking
((CustomCategoryFilter) filter)
.setAdditionalFilters(new IFilter[] { new VariabilityBaseElementFilter(
category) });
return filter;
}
/**
* @see org.eclipse.epf.authoring.ui.forms.DescriptionFormPage#loadSectionDescription()
*/
public void loadSectionDescription() {
this.generalSectionDescription = AuthoringUIResources.customcategory_generalInfoSection_desc;
this.detailSectionDescription = AuthoringUIResources.customcategory_detailSection_desc;
this.variabilitySectionDescription = AuthoringUIResources.customcategory_variabilitySection_desc;
this.versionSectionDescription = AuthoringUIResources.customcategory_versionInfoSection_desc;
this.iconSectionDescription = AuthoringUIResources.customcategory_IconSection_desc;
}
}