Skip to content

Commit

Permalink
add possibility to have custom configurations.
Browse files Browse the repository at this point in the history
  • Loading branch information
jadelkhoury committed Jan 6, 2023
1 parent 68552c8 commit 1351bfa
Show file tree
Hide file tree
Showing 15 changed files with 480 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@
<eLiterals name="Float" value="8" literal="Float"/>
<eLiterals name="Integer" value="9" literal="Integer"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Configuration" abstract="true"/>
<eClassifiers xsi:type="ecore:EClass" name="AuthenticationConfiguration">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="applicationName" lowerBound="1"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
Expand Down Expand Up @@ -359,6 +360,8 @@
eType="#//ProjectConfiguration" containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="authenticationConfiguration"
eType="#//AuthenticationConfiguration" containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="configurations" upperBound="-1"
eType="#//Configuration" containment="true"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="SpecificationConfiguration" abstract="true">
<eStructuralFeatures xsi:type="ecore:EReference" name="generalConfiguration" lowerBound="1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute adaptorInterface.ecore#//ShaclProperty/dataType"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference adaptorInterface.ecore#//ShaclProperty/class"/>
</genClasses>
<genClasses ecoreClass="adaptorInterface.ecore#//Configuration"/>
<genClasses ecoreClass="adaptorInterface.ecore#//AuthenticationConfiguration">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute adaptorInterface.ecore#//AuthenticationConfiguration/applicationName"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute adaptorInterface.ecore#//AuthenticationConfiguration/oauthRealm"/>
Expand All @@ -273,6 +274,7 @@
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference adaptorInterface.ecore#//ServerConfiguration/generalConfiguration"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference adaptorInterface.ecore#//ServerConfiguration/projectConfiguration"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference adaptorInterface.ecore#//ServerConfiguration/authenticationConfiguration"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference adaptorInterface.ecore#//ServerConfiguration/configurations"/>
</genClasses>
<genClasses image="false" ecoreClass="adaptorInterface.ecore#//SpecificationConfiguration">
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference adaptorInterface.ecore#//SpecificationConfiguration/generalConfiguration"/>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions org.eclipse.lyo.tools.adaptormodel.edit/plugin.properties
Original file line number Diff line number Diff line change
Expand Up @@ -280,3 +280,5 @@ _UI_AdaptorInterface_javaFilesBasePath_description = This property is deprecated
_UI_AdaptorInterface_jspFilesBasePath_description = This property is deprecated. \n Please do the following \n (1) Create a ServerConfiguration element instead.
_UI_AdaptorInterface_javascriptFilesBasePath_description = This property is deprecated. \n Please do the following \n (1) Create a ServerConfiguration element instead.
_UI_DomainSpecification_defaultVocabulary_description = For Resources and Resource Properties that do not explicitly refer to a Vocabulary Term, define a default Vocabulary (name, namespace URI and prefix). If not defined, the name, namespace URI and prefix of the the Domain Specification is used instead.
_UI_Configuration_type = Configuration
_UI_ServerConfiguration_configurations_feature = Configurations
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
/**
*/
package adaptorinterface.provider;


import java.util.Collection;
import java.util.List;

import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.common.util.ResourceLocator;

import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
import org.eclipse.emf.edit.provider.IItemLabelProvider;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.IItemPropertySource;
import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
import org.eclipse.emf.edit.provider.ItemProviderAdapter;

/**
* This is the item provider adapter for a {@link adaptorinterface.Configuration} object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public class ConfigurationItemProvider
extends ItemProviderAdapter
implements
IEditingDomainItemProvider,
IStructuredItemContentProvider,
ITreeItemContentProvider,
IItemLabelProvider,
IItemPropertySource {
/**
* This constructs an instance from a factory and a notifier.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ConfigurationItemProvider(AdapterFactory adapterFactory) {
super(adapterFactory);
}

/**
* This returns the property descriptors for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
if (itemPropertyDescriptors == null) {
super.getPropertyDescriptors(object);

}
return itemPropertyDescriptors;
}

/**
* This returns Configuration.gif.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object getImage(Object object) {
return overlayImage(object, getResourceLocator().getImage("full/obj16/Configuration"));
}

/**
* This returns the label text for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String getText(Object object) {
return getString("_UI_Configuration_type");
}


/**
* This handles model notifications by calling {@link #updateChildren} to update any cached
* children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void notifyChanged(Notification notification) {
updateChildren(notification);
super.notifyChanged(notification);
}

/**
* This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
* that can be created under this object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
super.collectNewChildDescriptors(newChildDescriptors, object);
}

/**
* Return the resource locator for this item provider's resources.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public ResourceLocator getResourceLocator() {
return AdaptorInterfaceEditPlugin.INSTANCE;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ public Collection<? extends EStructuralFeature> getChildrenFeatures(Object objec
childrenFeatures.add(AdaptorinterfacePackage.Literals.SERVER_CONFIGURATION__GENERAL_CONFIGURATION);
childrenFeatures.add(AdaptorinterfacePackage.Literals.SERVER_CONFIGURATION__PROJECT_CONFIGURATION);
childrenFeatures.add(AdaptorinterfacePackage.Literals.SERVER_CONFIGURATION__AUTHENTICATION_CONFIGURATION);
childrenFeatures.add(AdaptorinterfacePackage.Literals.SERVER_CONFIGURATION__CONFIGURATIONS);
}
return childrenFeatures;
}
Expand Down Expand Up @@ -262,6 +263,7 @@ public void notifyChanged(Notification notification) {
case AdaptorinterfacePackage.SERVER_CONFIGURATION__GENERAL_CONFIGURATION:
case AdaptorinterfacePackage.SERVER_CONFIGURATION__PROJECT_CONFIGURATION:
case AdaptorinterfacePackage.SERVER_CONFIGURATION__AUTHENTICATION_CONFIGURATION:
case AdaptorinterfacePackage.SERVER_CONFIGURATION__CONFIGURATIONS:
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
return;
}
Expand Down
Loading

0 comments on commit 1351bfa

Please sign in to comment.