/*******************************************************************************
 * Copyright (c) 2016, 2017 Artal Technologies 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:
 *     Aurelien Didier (Artal Technologies) - initial API and implementation
 *******************************************************************************/
/**
 * Generated with Acceleo
 */
package org.polarsys.time4sys.ui.views.grm.parts.impl;

// Start of user code for imports
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import org.eclipse.emf.common.util.Enumerator;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
import org.eclipse.emf.eef.runtime.EEFRuntimePlugin;
import org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent;
import org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent;
import org.eclipse.emf.eef.runtime.api.parts.ISWTPropertiesEditionPart;
import org.eclipse.emf.eef.runtime.context.impl.EObjectPropertiesEditionContext;
import org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent;
import org.eclipse.emf.eef.runtime.impl.parts.CompositePropertiesEditionPart;
import org.eclipse.emf.eef.runtime.policies.PropertiesEditingPolicy;
import org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider;
import org.eclipse.emf.eef.runtime.ui.parts.PartComposer;
import org.eclipse.emf.eef.runtime.ui.parts.sequence.BindingCompositionSequence;
import org.eclipse.emf.eef.runtime.ui.parts.sequence.CompositionSequence;
import org.eclipse.emf.eef.runtime.ui.parts.sequence.CompositionStep;
import org.eclipse.emf.eef.runtime.ui.utils.EditingUtils;
import org.eclipse.emf.eef.runtime.ui.widgets.ButtonsModeEnum;
import org.eclipse.emf.eef.runtime.ui.widgets.EMFComboViewer;
import org.eclipse.emf.eef.runtime.ui.widgets.EObjectFlatComboViewer;
import org.eclipse.emf.eef.runtime.ui.widgets.ReferencesTable;
import org.eclipse.emf.eef.runtime.ui.widgets.ReferencesTable.ReferencesTableListener;
import org.eclipse.emf.eef.runtime.ui.widgets.SWTUtils;
import org.eclipse.emf.eef.runtime.ui.widgets.TabElementTreeSelectionDialog;
import org.eclipse.emf.eef.runtime.ui.widgets.eobjflatcombo.EObjectFlatComboSettings;
import org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableContentProvider;
import org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableSettings;
import org.eclipse.jface.viewers.ArrayContentProvider;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.ViewerFilter;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.FocusAdapter;
import org.eclipse.swt.events.FocusEvent;
import org.eclipse.swt.events.KeyAdapter;
import org.eclipse.swt.events.KeyEvent;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Text;
import org.polarsys.time4sys.ui.views.grm.parts.GeneralPropertiesEditionPart;
import org.polarsys.time4sys.ui.views.grm.parts.GrmViewsRepository;
import org.polarsys.time4sys.ui.views.grm.providers.GrmMessages;

// End of user code

/**
 * 
 * 
 */
public class GeneralPropertiesEditionPartImpl extends CompositePropertiesEditionPart
		implements ISWTPropertiesEditionPart, GeneralPropertiesEditionPart {

	protected Text name;
	protected Button isPeriodic;
	protected Text value;
	protected Text elementSize;
	protected Text resMult;
	protected Text msgSize;
	protected Text packetSize;
	protected Text event;
	protected Text speedFactor;
	protected Button isProtected;
	protected Button isActive;
	protected Text otherProtocol;
	protected EMFComboViewer protocol;
	protected EMFComboViewer transmMode;
	protected EObjectFlatComboViewer start;
	protected EObjectFlatComboViewer set;
	protected EObjectFlatComboViewer get;
	protected EObjectFlatComboViewer reset;
	protected EObjectFlatComboViewer pause;
	protected EObjectFlatComboViewer scheduler;
	protected EObjectFlatComboViewer type;
	protected EObjectFlatComboViewer host;
	protected EObjectFlatComboViewer dependentScheduler;
	protected EObjectFlatComboViewer mainScheduler;
	protected EObjectFlatComboViewer sourcePort;
	protected EObjectFlatComboViewer targetPort;
	protected ReferencesTable usedBy;
	protected List<ViewerFilter> usedByBusinessFilters = new ArrayList<ViewerFilter>();
	protected List<ViewerFilter> usedByFilters = new ArrayList<ViewerFilter>();
	protected ReferencesTable usedResource;
	protected List<ViewerFilter> usedResourceBusinessFilters = new ArrayList<ViewerFilter>();
	protected List<ViewerFilter> usedResourceFilters = new ArrayList<ViewerFilter>();
	protected ReferencesTable processingUnits;
	protected List<ViewerFilter> processingUnitsBusinessFilters = new ArrayList<ViewerFilter>();
	protected List<ViewerFilter> processingUnitsFilters = new ArrayList<ViewerFilter>();
	protected ReferencesTable workload;
	protected List<ViewerFilter> workloadBusinessFilters = new ArrayList<ViewerFilter>();
	protected List<ViewerFilter> workloadFilters = new ArrayList<ViewerFilter>();
	protected ReferencesTable brokedResource;
	protected List<ViewerFilter> brokedResourceBusinessFilters = new ArrayList<ViewerFilter>();
	protected List<ViewerFilter> brokedResourceFilters = new ArrayList<ViewerFilter>();
	protected ReferencesTable managedResource;
	protected List<ViewerFilter> managedResourceBusinessFilters = new ArrayList<ViewerFilter>();
	protected List<ViewerFilter> managedResourceFilters = new ArrayList<ViewerFilter>();
	protected ReferencesTable schedulableResource;
	protected List<ViewerFilter> schedulableResourceBusinessFilters = new ArrayList<ViewerFilter>();
	protected List<ViewerFilter> schedulableResourceFilters = new ArrayList<ViewerFilter>();
	protected ReferencesTable virtualProcessingUnit;
	protected List<ViewerFilter> virtualProcessingUnitBusinessFilters = new ArrayList<ViewerFilter>();
	protected List<ViewerFilter> virtualProcessingUnitFilters = new ArrayList<ViewerFilter>();
	protected ReferencesTable protectParams;
	protected List<ViewerFilter> protectParamsBusinessFilters = new ArrayList<ViewerFilter>();
	protected List<ViewerFilter> protectParamsFilters = new ArrayList<ViewerFilter>();
	protected ReferencesTable schedParams;
	protected List<ViewerFilter> schedParamsBusinessFilters = new ArrayList<ViewerFilter>();
	protected List<ViewerFilter> schedParamsFilters = new ArrayList<ViewerFilter>();
	protected ReferencesTable requiredAmount;
	protected List<ViewerFilter> requiredAmountBusinessFilters = new ArrayList<ViewerFilter>();
	protected List<ViewerFilter> requiredAmountFilters = new ArrayList<ViewerFilter>();
	protected ReferencesTable ownedElement;
	protected List<ViewerFilter> ownedElementBusinessFilters = new ArrayList<ViewerFilter>();
	protected List<ViewerFilter> ownedElementFilters = new ArrayList<ViewerFilter>();
	protected ReferencesTable ownedPort;
	protected List<ViewerFilter> ownedPortBusinessFilters = new ArrayList<ViewerFilter>();
	protected List<ViewerFilter> ownedPortFilters = new ArrayList<ViewerFilter>();
	protected ReferencesTable ownedConnector;
	protected List<ViewerFilter> ownedConnectorBusinessFilters = new ArrayList<ViewerFilter>();
	protected List<ViewerFilter> ownedConnectorFilters = new ArrayList<ViewerFilter>();
	protected ReferencesTable ownedResource;
	protected List<ViewerFilter> ownedResourceBusinessFilters = new ArrayList<ViewerFilter>();
	protected List<ViewerFilter> ownedResourceFilters = new ArrayList<ViewerFilter>();
	protected ReferencesTable ownedService;
	protected List<ViewerFilter> ownedServiceBusinessFilters = new ArrayList<ViewerFilter>();
	protected List<ViewerFilter> ownedServiceFilters = new ArrayList<ViewerFilter>();
	protected ReferencesTable usage;
	protected List<ViewerFilter> usageBusinessFilters = new ArrayList<ViewerFilter>();
	protected List<ViewerFilter> usageFilters = new ArrayList<ViewerFilter>();
	protected ReferencesTable accCtrlPolicy;
	protected List<ViewerFilter> accCtrlPolicyBusinessFilters = new ArrayList<ViewerFilter>();
	protected List<ViewerFilter> accCtrlPolicyFilters = new ArrayList<ViewerFilter>();
	protected ReferencesTable resCtrlPolicy;
	protected List<ViewerFilter> resCtrlPolicyBusinessFilters = new ArrayList<ViewerFilter>();
	protected List<ViewerFilter> resCtrlPolicyFilters = new ArrayList<ViewerFilter>();

	/**
	 * Default constructor
	 * 
	 * @param editionComponent
	 *            the {@link IPropertiesEditionComponent} that manage this part
	 * 
	 */
	public GeneralPropertiesEditionPartImpl(IPropertiesEditionComponent editionComponent) {
		super(editionComponent);
	}

	/**
	 * {@inheritDoc}
	 * 
	 * @see org.eclipse.emf.eef.runtime.api.parts.ISWTPropertiesEditionPart#
	 *      createFigure(org.eclipse.swt.widgets.Composite)
	 * 
	 */
	public Composite createFigure(final Composite parent) {
		view = new Composite(parent, SWT.NONE);
		GridLayout layout = new GridLayout();
		layout.numColumns = 3;
		view.setLayout(layout);
		createControls(view);
		return view;
	}

	/**
	 * {@inheritDoc}
	 * 
	 * @see org.eclipse.emf.eef.runtime.api.parts.ISWTPropertiesEditionPart#
	 *      createControls(org.eclipse.swt.widgets.Composite)
	 * 
	 */
	public void createControls(Composite view) {
		CompositionSequence generalStep = new BindingCompositionSequence(propertiesEditionComponent);
		CompositionStep propertiesStep = generalStep.addStep(GrmViewsRepository.General.Properties.class);
		propertiesStep.addStep(GrmViewsRepository.General.Properties.name);
		propertiesStep.addStep(GrmViewsRepository.General.Properties.isPeriodic);
		propertiesStep.addStep(GrmViewsRepository.General.Properties.value);
		propertiesStep.addStep(GrmViewsRepository.General.Properties.elementSize);
		propertiesStep.addStep(GrmViewsRepository.General.Properties.resMult);
		propertiesStep.addStep(GrmViewsRepository.General.Properties.msgSize);
		propertiesStep.addStep(GrmViewsRepository.General.Properties.packetSize);
		propertiesStep.addStep(GrmViewsRepository.General.Properties.event);
		propertiesStep.addStep(GrmViewsRepository.General.Properties.speedFactor);
		propertiesStep.addStep(GrmViewsRepository.General.Properties.isProtected);
		propertiesStep.addStep(GrmViewsRepository.General.Properties.isActive);
		propertiesStep.addStep(GrmViewsRepository.General.Properties.otherProtocol);
		propertiesStep.addStep(GrmViewsRepository.General.Properties.protocol);
		propertiesStep.addStep(GrmViewsRepository.General.Properties.transmMode);
		propertiesStep.addStep(GrmViewsRepository.General.Properties.start);
		propertiesStep.addStep(GrmViewsRepository.General.Properties.set);
		propertiesStep.addStep(GrmViewsRepository.General.Properties.get);
		propertiesStep.addStep(GrmViewsRepository.General.Properties.reset);
		propertiesStep.addStep(GrmViewsRepository.General.Properties.pause);
		propertiesStep.addStep(GrmViewsRepository.General.Properties.scheduler);
		propertiesStep.addStep(GrmViewsRepository.General.Properties.type);
		propertiesStep.addStep(GrmViewsRepository.General.Properties.host);
		propertiesStep.addStep(GrmViewsRepository.General.Properties.dependentScheduler);
		propertiesStep.addStep(GrmViewsRepository.General.Properties.mainScheduler);
		propertiesStep.addStep(GrmViewsRepository.General.Properties.sourcePort);
		propertiesStep.addStep(GrmViewsRepository.General.Properties.targetPort);
		propertiesStep.addStep(GrmViewsRepository.General.Properties.usedBy);
		propertiesStep.addStep(GrmViewsRepository.General.Properties.usedResource);
		propertiesStep.addStep(GrmViewsRepository.General.Properties.processingUnits);
		propertiesStep.addStep(GrmViewsRepository.General.Properties.workload);
		propertiesStep.addStep(GrmViewsRepository.General.Properties.brokedResource);
		propertiesStep.addStep(GrmViewsRepository.General.Properties.managedResource);
		propertiesStep.addStep(GrmViewsRepository.General.Properties.schedulableResource);
		propertiesStep.addStep(GrmViewsRepository.General.Properties.virtualProcessingUnit);
		propertiesStep.addStep(GrmViewsRepository.General.Properties.protectParams);
		propertiesStep.addStep(GrmViewsRepository.General.Properties.schedParams);
		propertiesStep.addStep(GrmViewsRepository.General.Properties.requiredAmount);
		propertiesStep.addStep(GrmViewsRepository.General.Properties.ownedElement);
		propertiesStep.addStep(GrmViewsRepository.General.Properties.ownedPort);
		propertiesStep.addStep(GrmViewsRepository.General.Properties.ownedConnector);
		propertiesStep.addStep(GrmViewsRepository.General.Properties.ownedResource);
		propertiesStep.addStep(GrmViewsRepository.General.Properties.ownedService);
		propertiesStep.addStep(GrmViewsRepository.General.Properties.usage);
		propertiesStep.addStep(GrmViewsRepository.General.Properties.accCtrlPolicy);
		propertiesStep.addStep(GrmViewsRepository.General.Properties.resCtrlPolicy);

		composer = new PartComposer(generalStep) {

			@Override
			public Composite addToPart(Composite parent, Object key) {
				if (key == GrmViewsRepository.General.Properties.class) {
					return createPropertiesGroup(parent);
				}
				if (key == GrmViewsRepository.General.Properties.name) {
					return createNameText(parent);
				}
				if (key == GrmViewsRepository.General.Properties.isPeriodic) {
					return createIsPeriodicCheckbox(parent);
				}
				if (key == GrmViewsRepository.General.Properties.value) {
					return createValueText(parent);
				}
				if (key == GrmViewsRepository.General.Properties.elementSize) {
					return createElementSizeText(parent);
				}
				if (key == GrmViewsRepository.General.Properties.resMult) {
					return createResMultText(parent);
				}
				if (key == GrmViewsRepository.General.Properties.msgSize) {
					return createMsgSizeText(parent);
				}
				if (key == GrmViewsRepository.General.Properties.packetSize) {
					return createPacketSizeText(parent);
				}
				if (key == GrmViewsRepository.General.Properties.event) {
					return createEventText(parent);
				}
				if (key == GrmViewsRepository.General.Properties.speedFactor) {
					return createSpeedFactorText(parent);
				}
				if (key == GrmViewsRepository.General.Properties.isProtected) {
					return createIsProtectedCheckbox(parent);
				}
				if (key == GrmViewsRepository.General.Properties.isActive) {
					return createIsActiveCheckbox(parent);
				}
				if (key == GrmViewsRepository.General.Properties.otherProtocol) {
					return createOtherProtocolText(parent);
				}
				if (key == GrmViewsRepository.General.Properties.protocol) {
					return createProtocolEMFComboViewer(parent);
				}
				if (key == GrmViewsRepository.General.Properties.transmMode) {
					return createTransmModeEMFComboViewer(parent);
				}
				if (key == GrmViewsRepository.General.Properties.start) {
					return createStartFlatComboViewer(parent);
				}
				if (key == GrmViewsRepository.General.Properties.set) {
					return createSetFlatComboViewer(parent);
				}
				if (key == GrmViewsRepository.General.Properties.get) {
					return createGetFlatComboViewer(parent);
				}
				if (key == GrmViewsRepository.General.Properties.reset) {
					return createResetFlatComboViewer(parent);
				}
				if (key == GrmViewsRepository.General.Properties.pause) {
					return createPauseFlatComboViewer(parent);
				}
				if (key == GrmViewsRepository.General.Properties.scheduler) {
					return createSchedulerFlatComboViewer(parent);
				}
				if (key == GrmViewsRepository.General.Properties.type) {
					return createTypeFlatComboViewer(parent);
				}
				if (key == GrmViewsRepository.General.Properties.host) {
					return createHostFlatComboViewer(parent);
				}
				if (key == GrmViewsRepository.General.Properties.dependentScheduler) {
					return createDependentSchedulerFlatComboViewer(parent);
				}
				if (key == GrmViewsRepository.General.Properties.mainScheduler) {
					return createMainSchedulerFlatComboViewer(parent);
				}
				if (key == GrmViewsRepository.General.Properties.sourcePort) {
					return createSourcePortFlatComboViewer(parent);
				}
				if (key == GrmViewsRepository.General.Properties.targetPort) {
					return createTargetPortFlatComboViewer(parent);
				}
				if (key == GrmViewsRepository.General.Properties.usedBy) {
					return createUsedByAdvancedReferencesTable(parent);
				}
				if (key == GrmViewsRepository.General.Properties.usedResource) {
					return createUsedResourceAdvancedReferencesTable(parent);
				}
				if (key == GrmViewsRepository.General.Properties.processingUnits) {
					return createProcessingUnitsAdvancedReferencesTable(parent);
				}
				if (key == GrmViewsRepository.General.Properties.workload) {
					return createWorkloadAdvancedReferencesTable(parent);
				}
				if (key == GrmViewsRepository.General.Properties.brokedResource) {
					return createBrokedResourceAdvancedReferencesTable(parent);
				}
				if (key == GrmViewsRepository.General.Properties.managedResource) {
					return createManagedResourceAdvancedReferencesTable(parent);
				}
				if (key == GrmViewsRepository.General.Properties.schedulableResource) {
					return createSchedulableResourceAdvancedReferencesTable(parent);
				}
				if (key == GrmViewsRepository.General.Properties.virtualProcessingUnit) {
					return createVirtualProcessingUnitAdvancedReferencesTable(parent);
				}
				if (key == GrmViewsRepository.General.Properties.protectParams) {
					return createProtectParamsAdvancedTableComposition(parent);
				}
				if (key == GrmViewsRepository.General.Properties.schedParams) {
					return createSchedParamsAdvancedTableComposition(parent);
				}
				if (key == GrmViewsRepository.General.Properties.requiredAmount) {
					return createRequiredAmountAdvancedTableComposition(parent);
				}
				if (key == GrmViewsRepository.General.Properties.ownedElement) {
					return createOwnedElementAdvancedTableComposition(parent);
				}
				if (key == GrmViewsRepository.General.Properties.ownedPort) {
					return createOwnedPortAdvancedTableComposition(parent);
				}
				if (key == GrmViewsRepository.General.Properties.ownedConnector) {
					return createOwnedConnectorAdvancedTableComposition(parent);
				}
				if (key == GrmViewsRepository.General.Properties.ownedResource) {
					return createOwnedResourceAdvancedTableComposition(parent);
				}
				if (key == GrmViewsRepository.General.Properties.ownedService) {
					return createOwnedServiceAdvancedTableComposition(parent);
				}
				if (key == GrmViewsRepository.General.Properties.usage) {
					return createUsageAdvancedReferencesTable(parent);
				}
				if (key == GrmViewsRepository.General.Properties.accCtrlPolicy) {
					return createAccCtrlPolicyAdvancedTableComposition(parent);
				}
				if (key == GrmViewsRepository.General.Properties.resCtrlPolicy) {
					return createResCtrlPolicyAdvancedTableComposition(parent);
				}
				return parent;
			}
		};
		composer.compose(view);
	}

	/**
	 * 
	 */
	protected Composite createPropertiesGroup(Composite parent) {
		Group propertiesGroup = new Group(parent, SWT.NONE);
		propertiesGroup.setText(GrmMessages.GeneralPropertiesEditionPart_PropertiesGroupLabel);
		GridData propertiesGroupData = new GridData(GridData.FILL_HORIZONTAL);
		propertiesGroupData.horizontalSpan = 3;
		propertiesGroup.setLayoutData(propertiesGroupData);
		GridLayout propertiesGroupLayout = new GridLayout();
		propertiesGroupLayout.numColumns = 3;
		propertiesGroup.setLayout(propertiesGroupLayout);
		return propertiesGroup;
	}

	protected Composite createNameText(Composite parent) {
		createDescription(parent, GrmViewsRepository.General.Properties.name,
				GrmMessages.GeneralPropertiesEditionPart_NameLabel);
		name = SWTUtils.createScrollableText(parent, SWT.BORDER);
		GridData nameData = new GridData(GridData.FILL_HORIZONTAL);
		name.setLayoutData(nameData);
		name.addFocusListener(new FocusAdapter() {

			/**
			 * {@inheritDoc}
			 * 
			 * @see org.eclipse.swt.events.FocusAdapter#focusLost(org.eclipse.swt.events.FocusEvent)
			 * 
			 */
			@Override
			@SuppressWarnings("synthetic-access")
			public void focusLost(FocusEvent e) {
				if (propertiesEditionComponent != null)
					propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(
							GeneralPropertiesEditionPartImpl.this, GrmViewsRepository.General.Properties.name,
							PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, name.getText()));
			}

		});
		name.addKeyListener(new KeyAdapter() {

			/**
			 * {@inheritDoc}
			 * 
			 * @see org.eclipse.swt.events.KeyAdapter#keyPressed(org.eclipse.swt.events.KeyEvent)
			 * 
			 */
			@Override
			@SuppressWarnings("synthetic-access")
			public void keyPressed(KeyEvent e) {
				if (e.character == SWT.CR) {
					if (propertiesEditionComponent != null)
						propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(
								GeneralPropertiesEditionPartImpl.this, GrmViewsRepository.General.Properties.name,
								PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, name.getText()));
				}
			}

		});
		EditingUtils.setID(name, GrmViewsRepository.General.Properties.name);
		EditingUtils.setEEFtype(name, "eef::Text"); //$NON-NLS-1$
		SWTUtils.createHelpButton(parent, propertiesEditionComponent
				.getHelpContent(GrmViewsRepository.General.Properties.name, GrmViewsRepository.SWT_KIND), null); // $NON-NLS-1$
		// Start of user code for createNameText

		// End of user code
		return parent;
	}

	protected Composite createIsPeriodicCheckbox(Composite parent) {
		isPeriodic = new Button(parent, SWT.CHECK);
		isPeriodic.setText(getDescription(GrmViewsRepository.General.Properties.isPeriodic,
				GrmMessages.GeneralPropertiesEditionPart_IsPeriodicLabel));
		isPeriodic.addSelectionListener(new SelectionAdapter() {

			/**
			 * {@inheritDoc}
			 *
			 * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
			 * 
			 */
			public void widgetSelected(SelectionEvent e) {
				if (propertiesEditionComponent != null)
					propertiesEditionComponent
							.firePropertiesChanged(new PropertiesEditionEvent(GeneralPropertiesEditionPartImpl.this,
									GrmViewsRepository.General.Properties.isPeriodic, PropertiesEditionEvent.COMMIT,
									PropertiesEditionEvent.SET, null, new Boolean(isPeriodic.getSelection())));
			}

		});
		GridData isPeriodicData = new GridData(GridData.FILL_HORIZONTAL);
		isPeriodicData.horizontalSpan = 2;
		isPeriodic.setLayoutData(isPeriodicData);
		EditingUtils.setID(isPeriodic, GrmViewsRepository.General.Properties.isPeriodic);
		EditingUtils.setEEFtype(isPeriodic, "eef::Checkbox"); //$NON-NLS-1$
		SWTUtils.createHelpButton(parent, propertiesEditionComponent
				.getHelpContent(GrmViewsRepository.General.Properties.isPeriodic, GrmViewsRepository.SWT_KIND), null); // $NON-NLS-1$
		// Start of user code for createIsPeriodicCheckbox

		// End of user code
		return parent;
	}

	protected Composite createValueText(Composite parent) {
		createDescription(parent, GrmViewsRepository.General.Properties.value,
				GrmMessages.GeneralPropertiesEditionPart_ValueLabel);
		value = SWTUtils.createScrollableText(parent, SWT.BORDER);
		GridData valueData = new GridData(GridData.FILL_HORIZONTAL);
		value.setLayoutData(valueData);
		value.addFocusListener(new FocusAdapter() {

			/**
			 * {@inheritDoc}
			 * 
			 * @see org.eclipse.swt.events.FocusAdapter#focusLost(org.eclipse.swt.events.FocusEvent)
			 * 
			 */
			@Override
			@SuppressWarnings("synthetic-access")
			public void focusLost(FocusEvent e) {
				if (propertiesEditionComponent != null)
					propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(
							GeneralPropertiesEditionPartImpl.this, GrmViewsRepository.General.Properties.value,
							PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, value.getText()));
			}

		});
		value.addKeyListener(new KeyAdapter() {

			/**
			 * {@inheritDoc}
			 * 
			 * @see org.eclipse.swt.events.KeyAdapter#keyPressed(org.eclipse.swt.events.KeyEvent)
			 * 
			 */
			@Override
			@SuppressWarnings("synthetic-access")
			public void keyPressed(KeyEvent e) {
				if (e.character == SWT.CR) {
					if (propertiesEditionComponent != null)
						propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(
								GeneralPropertiesEditionPartImpl.this, GrmViewsRepository.General.Properties.value,
								PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, value.getText()));
				}
			}

		});
		EditingUtils.setID(value, GrmViewsRepository.General.Properties.value);
		EditingUtils.setEEFtype(value, "eef::Text"); //$NON-NLS-1$
		SWTUtils.createHelpButton(parent, propertiesEditionComponent
				.getHelpContent(GrmViewsRepository.General.Properties.value, GrmViewsRepository.SWT_KIND), null); // $NON-NLS-1$
		// Start of user code for createValueText

		// End of user code
		return parent;
	}

	protected Composite createElementSizeText(Composite parent) {
		createDescription(parent, GrmViewsRepository.General.Properties.elementSize,
				GrmMessages.GeneralPropertiesEditionPart_ElementSizeLabel);
		elementSize = SWTUtils.createScrollableText(parent, SWT.BORDER);
		GridData elementSizeData = new GridData(GridData.FILL_HORIZONTAL);
		elementSize.setLayoutData(elementSizeData);
		elementSize.addFocusListener(new FocusAdapter() {

			/**
			 * {@inheritDoc}
			 * 
			 * @see org.eclipse.swt.events.FocusAdapter#focusLost(org.eclipse.swt.events.FocusEvent)
			 * 
			 */
			@Override
			@SuppressWarnings("synthetic-access")
			public void focusLost(FocusEvent e) {
				if (propertiesEditionComponent != null)
					propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(
							GeneralPropertiesEditionPartImpl.this, GrmViewsRepository.General.Properties.elementSize,
							PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, elementSize.getText()));
			}

		});
		elementSize.addKeyListener(new KeyAdapter() {

			/**
			 * {@inheritDoc}
			 * 
			 * @see org.eclipse.swt.events.KeyAdapter#keyPressed(org.eclipse.swt.events.KeyEvent)
			 * 
			 */
			@Override
			@SuppressWarnings("synthetic-access")
			public void keyPressed(KeyEvent e) {
				if (e.character == SWT.CR) {
					if (propertiesEditionComponent != null)
						propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(
								GeneralPropertiesEditionPartImpl.this,
								GrmViewsRepository.General.Properties.elementSize, PropertiesEditionEvent.COMMIT,
								PropertiesEditionEvent.SET, null, elementSize.getText()));
				}
			}

		});
		EditingUtils.setID(elementSize, GrmViewsRepository.General.Properties.elementSize);
		EditingUtils.setEEFtype(elementSize, "eef::Text"); //$NON-NLS-1$
		SWTUtils.createHelpButton(parent, propertiesEditionComponent
				.getHelpContent(GrmViewsRepository.General.Properties.elementSize, GrmViewsRepository.SWT_KIND), null); // $NON-NLS-1$
		// Start of user code for createElementSizeText

		// End of user code
		return parent;
	}

	protected Composite createResMultText(Composite parent) {
		createDescription(parent, GrmViewsRepository.General.Properties.resMult,
				GrmMessages.GeneralPropertiesEditionPart_ResMultLabel);
		resMult = SWTUtils.createScrollableText(parent, SWT.BORDER);
		GridData resMultData = new GridData(GridData.FILL_HORIZONTAL);
		resMult.setLayoutData(resMultData);
		resMult.addFocusListener(new FocusAdapter() {

			/**
			 * {@inheritDoc}
			 * 
			 * @see org.eclipse.swt.events.FocusAdapter#focusLost(org.eclipse.swt.events.Focu