/**
  * {@inheritDoc}
  *
  * @see
  *     com.github.lbroudoux.dsl.eip.parts.TransformerPropertiesEditionPart#initFromChannels(org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableSettings)
  */
 public void initFromChannels(ReferencesTableSettings settings) {
   if (current.eResource() != null && current.eResource().getResourceSet() != null)
     this.resourceSet = current.eResource().getResourceSet();
   ReferencesTableContentProvider contentProvider = new ReferencesTableContentProvider();
   fromChannels.setContentProvider(contentProvider);
   fromChannels.setInput(settings);
   boolean eefElementEditorReadOnlyState =
       isReadOnly(EipViewsRepository.Transformer.Properties.fromChannels);
   if (eefElementEditorReadOnlyState && fromChannels.getTable().isEnabled()) {
     fromChannels.setEnabled(false);
     fromChannels.setToolTipText(EipMessages.Transformer_ReadOnly);
   } else if (!eefElementEditorReadOnlyState && !fromChannels.getTable().isEnabled()) {
     fromChannels.setEnabled(true);
   }
 }
 /**
  * {@inheritDoc}
  *
  * @see
  *     org.eclipse.emf.ecoretools.design.properties.ecore.parts.EClassPropertiesEditionPart#initESuperTypes(org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableSettings)
  */
 public void initESuperTypes(ReferencesTableSettings settings) {
   if (current.eResource() != null && current.eResource().getResourceSet() != null)
     this.resourceSet = current.eResource().getResourceSet();
   ReferencesTableContentProvider contentProvider = new ReferencesTableContentProvider();
   eSuperTypes.setContentProvider(contentProvider);
   eSuperTypes.setInput(settings);
   boolean eefElementEditorReadOnlyState =
       isReadOnly(EcoreViewsRepository.EClass.Inheritance.eSuperTypes);
   if (eefElementEditorReadOnlyState && eSuperTypes.getTable().isEnabled()) {
     eSuperTypes.setEnabled(false);
     eSuperTypes.setToolTipText(EcoreMessages.EClass_ReadOnly);
   } else if (!eefElementEditorReadOnlyState && !eSuperTypes.getTable().isEnabled()) {
     eSuperTypes.setEnabled(true);
   }
 }
  protected Composite createAppliedProfilesReferencesTable(
      FormToolkit widgetFactory, Composite parent) {
    this.appliedProfiles =
        new ReferencesTable(
            getDescription(
                CustomUmlViewsRepository.Profiles.appliedProfiles,
                CustomUmlMessages.ProfilesPropertiesEditionPart_AppliedProfilesLabel),
            new ReferencesTableListener() {
              public void handleAdd() {
                addAppliedProfiles();
              }

              public void handleEdit(EObject element) {
                editAppliedProfiles(element);
              }

              public void handleMove(EObject element, int oldIndex, int newIndex) {
                moveAppliedProfiles(element, oldIndex, newIndex);
              }

              public void handleRemove(EObject element) {
                removeFromAppliedProfiles(element);
              }

              public void navigateTo(EObject element) {}
            }) {
          @Override
          public AdapterFactoryLabelProvider getLabelProvider() {
            return new AdapterFactoryLabelProvider(adapterFactory) {
              @Override
              public String getColumnText(Object object, int columnIndex) {
                if (object instanceof Profile) {
                  Profile profile = (Profile) object;
                  if (columnIndex == tableColumnService.indexOf(TableColumnName.PROFILE)) {
                    return labelService.caseProfile(profile);
                  }
                }
                return "";
              }

              @Override
              public Image getColumnImage(Object object, int columnIndex) {
                return null;
              }
            };
          }
        };
    for (ViewerFilter filter : this.appliedProfilesFilters) {
      this.appliedProfiles.addFilter(filter);
    }
    this.appliedProfiles.setHelpText(
        propertiesEditionComponent.getHelpContent(
            CustomUmlViewsRepository.Profiles.appliedProfiles, UmlViewsRepository.FORM_KIND));
    this.appliedProfiles.createControls(parent, widgetFactory);
    this.appliedProfiles.addSelectionListener(
        new SelectionAdapter() {

          public void widgetSelected(SelectionEvent e) {
            if (e.item != null && e.item.getData() instanceof EObject) {
              propertiesEditionComponent.firePropertiesChanged(
                  new PropertiesEditionEvent(
                      ProfilesPropertiesEditionPartForm.this,
                      CustomUmlViewsRepository.Profiles.appliedProfiles,
                      PropertiesEditionEvent.CHANGE,
                      PropertiesEditionEvent.SELECTION_CHANGED,
                      null,
                      e.item.getData()));
            }
          }
        });
    GridData appliedProfilesData = new GridData(GridData.FILL_HORIZONTAL);
    appliedProfilesData.horizontalSpan = 3;
    this.appliedProfiles.setLayoutData(appliedProfilesData);
    this.appliedProfiles.disableMove();
    appliedProfiles.setID(CustomUmlViewsRepository.Profiles.appliedProfiles);
    appliedProfiles.setEEFType("eef::AdvancedReferencesTable"); // $NON-NLS-1$
    // Start of user code for createAppliedProfilesTableComposition
    Table table = appliedProfiles.getTable();
    TableColumn[] columns = table.getColumns();
    // dispose
    for (TableColumn tableColumn : columns) {
      tableColumn.dispose();
    }

    table.setHeaderVisible(true);
    tableColumnService.createMediumColumn(table, TableColumnName.PROFILE);

    // End of user code
    return parent;
  }