/*******************************************************************************
 * 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.srm.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.BasicEList;
import org.eclipse.emf.common.util.EList;
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.EEFFeatureEditorDialog;
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.jface.window.Window;
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.marte.srm.SrmPackage;
import org.polarsys.time4sys.ui.views.srm.parts.GeneralPropertiesEditionPart;
import org.polarsys.time4sys.ui.views.srm.parts.SrmViewsRepository;
import org.polarsys.time4sys.ui.views.srm.providers.SrmMessages;

// End of user code

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

	protected Text name;
	protected Text elementSize;
	protected Text speedFactor;
	protected Text resMult;
	protected Text memorySizeFootprint;
	protected Button isProtected;
	protected Button isActive;
	protected Button isModifier;
	protected Button isWatchdog;
	protected Button isBuffered;
	protected Text activationCapacity;
	protected Text accessedElement;
	protected Text identifierElements;
	protected Button editIdentifierElements;
	private EList identifierElementsList;
	protected Text periodElements;
	protected Button editPeriodElements;
	private EList periodElementsList;
	protected Text stateElements;
	protected Button editStateElements;
	private EList stateElementsList;
	protected EObjectFlatComboViewer adressSpace;
	protected EObjectFlatComboViewer scheduler;
	protected EObjectFlatComboViewer mainScheduler;
	protected EObjectFlatComboViewer dependentScheduler;
	protected EObjectFlatComboViewer host;
	protected Text entryPoints;
	protected Button editEntryPoints;
	private EList entryPointsList;
	protected EMFComboViewer kind;
	protected Text isrEntryPoints;
	protected Button editIsrEntryPoints;
	private EList isrEntryPointsList;
	protected EObjectFlatComboViewer sourcePort;
	protected EObjectFlatComboViewer targetPort;
	protected EObjectFlatComboViewer start;
	protected EObjectFlatComboViewer set;
	protected EObjectFlatComboViewer get;
	protected EObjectFlatComboViewer reset;
	protected EObjectFlatComboViewer pause;
	protected ReferencesTable processingUnits;
	protected List<ViewerFilter> processingUnitsBusinessFilters = new ArrayList<ViewerFilter>();
	protected List<ViewerFilter> processingUnitsFilters = new ArrayList<ViewerFilter>();
	protected ReferencesTable schedulableResource;
	protected List<ViewerFilter> schedulableResourceBusinessFilters = new ArrayList<ViewerFilter>();
	protected List<ViewerFilter> schedulableResourceFilters = new ArrayList<ViewerFilter>();
	protected ReferencesTable scheduledResource;
	protected List<ViewerFilter> scheduledResourceBusinessFilters = new ArrayList<ViewerFilter>();
	protected List<ViewerFilter> scheduledResourceFilters = new ArrayList<ViewerFilter>();
	protected ReferencesTable ownedResource;
	protected List<ViewerFilter> ownedResourceBusinessFilters = new ArrayList<ViewerFilter>();
	protected List<ViewerFilter> ownedResourceFilters = 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 usedBy;
	protected List<ViewerFilter> usedByBusinessFilters = new ArrayList<ViewerFilter>();
	protected List<ViewerFilter> usedByFilters = 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 schedParams;
	protected List<ViewerFilter> schedParamsBusinessFilters = new ArrayList<ViewerFilter>();
	protected List<ViewerFilter> schedParamsFilters = new ArrayList<ViewerFilter>();
	protected ReferencesTable devices;
	protected List<ViewerFilter> devicesBusinessFilters = new ArrayList<ViewerFilter>();
	protected List<ViewerFilter> devicesFilters = new ArrayList<ViewerFilter>();
	protected ReferencesTable memories;
	protected List<ViewerFilter> memoriesBusinessFilters = new ArrayList<ViewerFilter>();
	protected List<ViewerFilter> memoriesFilters = new ArrayList<ViewerFilter>();
	protected ReferencesTable sharedDataResources;
	protected List<ViewerFilter> sharedDataResourcesBusinessFilters = new ArrayList<ViewerFilter>();
	protected List<ViewerFilter> sharedDataResourcesFilters = new ArrayList<ViewerFilter>();
	protected ReferencesTable messageResources;
	protected List<ViewerFilter> messageResourcesBusinessFilters = new ArrayList<ViewerFilter>();
	protected List<ViewerFilter> messageResourcesFilters = new ArrayList<ViewerFilter>();
	protected ReferencesTable notificationResources;
	protected List<ViewerFilter> notificationResourcesBusinessFilters = new ArrayList<ViewerFilter>();
	protected List<ViewerFilter> notificationResourcesFilters = 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(SrmViewsRepository.General.Properties.class);
		propertiesStep.addStep(SrmViewsRepository.General.Properties.name);
		propertiesStep.addStep(SrmViewsRepository.General.Properties.elementSize);
		propertiesStep.addStep(SrmViewsRepository.General.Properties.speedFactor);
		propertiesStep.addStep(SrmViewsRepository.General.Properties.resMult);
		propertiesStep.addStep(SrmViewsRepository.General.Properties.memorySizeFootprint);
		propertiesStep.addStep(SrmViewsRepository.General.Properties.isProtected);
		propertiesStep.addStep(SrmViewsRepository.General.Properties.isActive);
		propertiesStep.addStep(SrmViewsRepository.General.Properties.isModifier);
		propertiesStep.addStep(SrmViewsRepository.General.Properties.isWatchdog);
		propertiesStep.addStep(SrmViewsRepository.General.Properties.isBuffered);
		propertiesStep.addStep(SrmViewsRepository.General.Properties.activationCapacity);
		propertiesStep.addStep(SrmViewsRepository.General.Properties.accessedElement);
		propertiesStep.addStep(SrmViewsRepository.General.Properties.identifierElements);
		propertiesStep.addStep(SrmViewsRepository.General.Properties.periodElements);
		propertiesStep.addStep(SrmViewsRepository.General.Properties.stateElements);
		propertiesStep.addStep(SrmViewsRepository.General.Properties.adressSpace);
		propertiesStep.addStep(SrmViewsRepository.General.Properties.scheduler);
		propertiesStep.addStep(SrmViewsRepository.General.Properties.mainScheduler);
		propertiesStep.addStep(SrmViewsRepository.General.Properties.dependentScheduler);
		propertiesStep.addStep(SrmViewsRepository.General.Properties.host);
		propertiesStep.addStep(SrmViewsRepository.General.Properties.entryPoints);
		propertiesStep.addStep(SrmViewsRepository.General.Properties.kind);
		propertiesStep.addStep(SrmViewsRepository.General.Properties.isrEntryPoints);
		propertiesStep.addStep(SrmViewsRepository.General.Properties.sourcePort);
		propertiesStep.addStep(SrmViewsRepository.General.Properties.targetPort);
		propertiesStep.addStep(SrmViewsRepository.General.Properties.start);
		propertiesStep.addStep(SrmViewsRepository.General.Properties.set);
		propertiesStep.addStep(SrmViewsRepository.General.Properties.get);
		propertiesStep.addStep(SrmViewsRepository.General.Properties.reset);
		propertiesStep.addStep(SrmViewsRepository.General.Properties.pause);
		propertiesStep.addStep(SrmViewsRepository.General.Properties.processingUnits);
		propertiesStep.addStep(SrmViewsRepository.General.Properties.schedulableResource);
		propertiesStep.addStep(SrmViewsRepository.General.Properties.scheduledResource);
		propertiesStep.addStep(SrmViewsRepository.General.Properties.ownedResource);
		propertiesStep.addStep(SrmViewsRepository.General.Properties.ownedElement);
		propertiesStep.addStep(SrmViewsRepository.General.Properties.ownedPort);
		propertiesStep.addStep(SrmViewsRepository.General.Properties.ownedConnector);
		propertiesStep.addStep(SrmViewsRepository.General.Properties.usedBy);
		propertiesStep.addStep(SrmViewsRepository.General.Properties.brokedResource);
		propertiesStep.addStep(SrmViewsRepository.General.Properties.managedResource);
		propertiesStep.addStep(SrmViewsRepository.General.Properties.schedParams);
		propertiesStep.addStep(SrmViewsRepository.General.Properties.devices);
		propertiesStep.addStep(SrmViewsRepository.General.Properties.memories);
		propertiesStep.addStep(SrmViewsRepository.General.Properties.sharedDataResources);
		propertiesStep.addStep(SrmViewsRepository.General.Properties.messageResources);
		propertiesStep.addStep(SrmViewsRepository.General.Properties.notificationResources);

		composer = new PartComposer(generalStep) {

			@Override
			public Composite addToPart(Composite parent, Object key) {
				if (key == SrmViewsRepository.General.Properties.class) {
					return createPropertiesGroup(parent);
				}
				if (key == SrmViewsRepository.General.Properties.name) {
					return createNameText(parent);
				}
				if (key == SrmViewsRepository.General.Properties.elementSize) {
					return createElementSizeText(parent);
				}
				if (key == SrmViewsRepository.General.Properties.speedFactor) {
					return createSpeedFactorText(parent);
				}
				if (key == SrmViewsRepository.General.Properties.resMult) {
					return createResMultText(parent);
				}
				if (key == SrmViewsRepository.General.Properties.memorySizeFootprint) {
					return createMemorySizeFootprintText(parent);
				}
				if (key == SrmViewsRepository.General.Properties.isProtected) {
					return createIsProtectedCheckbox(parent);
				}
				if (key == SrmViewsRepository.General.Properties.isActive) {
					return createIsActiveCheckbox(parent);
				}
				if (key == SrmViewsRepository.General.Properties.isModifier) {
					return createIsModifierCheckbox(parent);
				}
				if (key == SrmViewsRepository.General.Properties.isWatchdog) {
					return createIsWatchdogCheckbox(parent);
				}
				if (key == SrmViewsRepository.General.Properties.isBuffered) {
					return createIsBufferedCheckbox(parent);
				}
				if (key == SrmViewsRepository.General.Properties.activationCapacity) {
					return createActivationCapacityText(parent);
				}
				if (key == SrmViewsRepository.General.Properties.accessedElement) {
					return createAccessedElementText(parent);
				}
				if (key == SrmViewsRepository.General.Properties.identifierElements) {
					return createIdentifierElementsMultiValuedEditor(parent);
				}
				if (key == SrmViewsRepository.General.Properties.periodElements) {
					return createPeriodElementsMultiValuedEditor(parent);
				}
				if (key == SrmViewsRepository.General.Properties.stateElements) {
					return createStateElementsMultiValuedEditor(parent);
				}
				if (key == SrmViewsRepository.General.Properties.adressSpace) {
					return createAdressSpaceFlatComboViewer(parent);
				}
				if (key == SrmViewsRepository.General.Properties.scheduler) {
					return createSchedulerFlatComboViewer(parent);
				}
				if (key == SrmViewsRepository.General.Properties.mainScheduler) {
					return createMainSchedulerFlatComboViewer(parent);
				}
				if (key == SrmViewsRepository.General.Properties.dependentScheduler) {
					return createDependentSchedulerFlatComboViewer(parent);
				}
				if (key == SrmViewsRepository.General.Properties.host) {
					return createHostFlatComboViewer(parent);
				}
				if (key == SrmViewsRepository.General.Properties.entryPoints) {
					return createEntryPointsMultiValuedEditor(parent);
				}
				if (key == SrmViewsRepository.General.Properties.kind) {
					return createKindEMFComboViewer(parent);
				}
				if (key == SrmViewsRepository.General.Properties.isrEntryPoints) {
					return createIsrEntryPointsMultiValuedEditor(parent);
				}
				if (key == SrmViewsRepository.General.Properties.sourcePort) {
					return createSourcePortFlatComboViewer(parent);
				}
				if (key == SrmViewsRepository.General.Properties.targetPort) {
					return createTargetPortFlatComboViewer(parent);
				}
				if (key == SrmViewsRepository.General.Properties.start) {
					return createStartFlatComboViewer(parent);
				}
				if (key == SrmViewsRepository.General.Properties.set) {
					return createSetFlatComboViewer(parent);
				}
				if (key == SrmViewsRepository.General.Properties.get) {
					return createGetFlatComboViewer(parent);
				}
				if (key == SrmViewsRepository.General.Properties.reset) {
					return createResetFlatComboViewer(parent);
				}
				if (key == SrmViewsRepository.General.Properties.pause) {
					return createPauseFlatComboViewer(parent);
				}
				if (key == SrmViewsRepository.General.Properties.processingUnits) {
					return createProcessingUnitsAdvancedReferencesTable(parent);
				}
				if (key == SrmViewsRepository.General.Properties.schedulableResource) {
					return createSchedulableResourceAdvancedReferencesTable(parent);
				}
				if (key == SrmViewsRepository.General.Properties.scheduledResource) {
					return createScheduledResourceAdvancedReferencesTable(parent);
				}
				if (key == SrmViewsRepository.General.Properties.ownedResource) {
					return createOwnedResourceAdvancedTableComposition(parent);
				}
				if (key == SrmViewsRepository.General.Properties.ownedElement) {
					return createOwnedElementAdvancedTableComposition(parent);
				}
				if (key == SrmViewsRepository.General.Properties.ownedPort) {
					return createOwnedPortAdvancedTableComposition(parent);
				}
				if (key == SrmViewsRepository.General.Properties.ownedConnector) {
					return createOwnedConnectorAdvancedTableComposition(parent);
				}
				if (key == SrmViewsRepository.General.Properties.usedBy) {
					return createUsedByAdvancedReferencesTable(parent);
				}
				if (key == SrmViewsRepository.General.Properties.brokedResource) {
					return createBrokedResourceAdvancedReferencesTable(parent);
				}
				if (key == SrmViewsRepository.General.Properties.managedResource) {
					return createManagedResourceAdvancedReferencesTable(parent);
				}
				if (key == SrmViewsRepository.General.Properties.schedParams) {
					return createSchedParamsAdvancedTableComposition(parent);
				}
				if (key == SrmViewsRepository.General.Properties.devices) {
					return createDevicesAdvancedReferencesTable(parent);
				}
				if (key == SrmViewsRepository.General.Properties.memories) {
					return createMemoriesAdvancedReferencesTable(parent);
				}
				if (key == SrmViewsRepository.General.Properties.sharedDataResources) {
					return createSharedDataResourcesAdvancedReferencesTable(parent);
				}
				if (key == SrmViewsRepository.General.Properties.messageResources) {
					return createMessageResourcesAdvancedReferencesTable(parent);
				}
				if (key == SrmViewsRepository.General.Properties.notificationResources) {
					return createNotificationResourcesAdvancedReferencesTable(parent);
				}
				return parent;
			}
		};
		composer.compose(view);
	}

	/**
	 * 
	 */
	protected Composite createPropertiesGroup(Composite parent) {
		Group propertiesGroup = new Group(parent, SWT.NONE);
		propertiesGroup.setText(SrmMessages.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, SrmViewsRepository.General.Properties.name,
				SrmMessages.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, SrmViewsRepository.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, SrmViewsRepository.General.Properties.name,
								PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, name.getText()));
				}
			}

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

		// End of user code
		return parent;
	}

	protected Composite createElementSizeText(Composite parent) {
		createDescription(parent, SrmViewsRepository.General.Properties.elementSize,
				SrmMessages.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, SrmViewsRepository.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,
								SrmViewsRepository.General.Properties.elementSize, PropertiesEditi