Skip to content

Commit

Permalink
Added Project Workloads DSL
Browse files Browse the repository at this point in the history
- added the abstract syntax, textual syntax and graphical syntax of the Project Workloads DSL
- added a runtime sample that contains a model and a diagram
  • Loading branch information
ionutpredoaia committed Mar 15, 2023
1 parent 41630ce commit db7de75
Show file tree
Hide file tree
Showing 207 changed files with 15,947 additions and 10 deletions.
2 changes: 0 additions & 2 deletions README.md

This file was deleted.

6 changes: 1 addition & 5 deletions .classpath → graphite/.classpath
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11">
<attributes>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="output" path="bin"/>
Expand Down
File renamed without changes.
2 changes: 2 additions & 0 deletions graphite/.settings/org.eclipse.core.resources.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
eclipse.preferences.version=1
encoding/<project>=UTF-8
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions plugin.properties → graphite/plugin.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ providerName = Ionut Predoaia

xtextWidgetId=graphite.xtextwidgetViewer

editorId=pcs.presentation.PcsEditorID
fileExtensions=pcs
editorId=workload.presentation.WorkloadEditor
fileExtensions=workload
2 changes: 1 addition & 1 deletion plugin.xml → graphite/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
point="org.eclipse.xtext.extension_resourceServiceProvider">
<resourceServiceProvider
class="graphite.xtextxmi.ExecutableExtensionFactory:org.eclipse.xtext.ui.resource.generic.EmfResourceUIServiceProvider"
uriExtension="pcs">
uriExtension="workload">
</resourceServiceProvider>
</extension>

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 7 additions & 0 deletions workload.emf.edit/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="output" path="bin"/>
</classpath>
28 changes: 28 additions & 0 deletions workload.emf.edit/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>workload.emf.edit</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
</natures>
</projectDescription>
2 changes: 2 additions & 0 deletions workload.emf.edit/.settings/org.eclipse.core.resources.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
eclipse.preferences.version=1
encoding/<project>=UTF-8
16 changes: 16 additions & 0 deletions workload.emf.edit/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: workload.emf.edit;singleton:=true
Automatic-Module-Name: workload.emf.edit
Bundle-Version: 1.0.0.qualifier
Bundle-ClassPath: .
Bundle-Activator: workload.provider.WorkloadEditPlugin$Implementation
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: JavaSE-11
Export-Package: workload.provider
Require-Bundle: org.eclipse.core.runtime,
workload.emf;visibility:=reexport,
org.eclipse.emf.edit;visibility:=reexport
Bundle-ActivationPolicy: lazy
10 changes: 10 additions & 0 deletions workload.emf.edit/build.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#

bin.includes = .,\
icons/,\
META-INF/,\
plugin.xml,\
plugin.properties
jars.compile.order = .
source.. = src/
output.. = bin/
Binary file added workload.emf.edit/icons/full/obj16/CostCentre.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added workload.emf.edit/icons/full/obj16/Effort.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added workload.emf.edit/icons/full/obj16/Person.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added workload.emf.edit/icons/full/obj16/Project.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added workload.emf.edit/icons/full/obj16/Task.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 37 additions & 0 deletions workload.emf.edit/plugin.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#

pluginName = workload.emf Edit Support
providerName = www.example.org

_UI_CreateChild_text = {0}
_UI_CreateChild_text2 = {1} {0}
_UI_CreateChild_text3 = {1}
_UI_CreateChild_tooltip = Create New {0} Under {1} Feature
_UI_CreateChild_description = Create a new child of type {0} for the {1} feature of the selected {2}.
_UI_CreateSibling_description = Create a new sibling of type {0} for the selected {2}, under the {1} feature of their parent.

_UI_PropertyDescriptor_description = The {0} of the {1}

_UI_Project_type = Project
_UI_Task_type = Task
_UI_Person_type = Person
_UI_Effort_type = Effort
_UI_CostCentre_type = Cost Centre
_UI_Unknown_type = Object

_UI_Unknown_datatype= Value

_UI_Project_tasks_feature = Tasks
_UI_Project_people_feature = People
_UI_Task_name_feature = Name
_UI_Task_effortsExpression_feature = Efforts Expression
_UI_Task_efforts_feature = Efforts
_UI_Task_leader_feature = Leader
_UI_Task_dependencies_feature = Dependencies
_UI_Person_name_feature = Name
_UI_Effort_person_feature = Person
_UI_Effort_months_feature = Months
_UI_CostCentre_name_feature = Name
_UI_CostCentre_efforts_feature = Efforts
_UI_Unknown_feature = Unspecified

22 changes: 22 additions & 0 deletions workload.emf.edit/plugin.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.0"?>

<!--
-->

<plugin>

<extension point="org.eclipse.emf.edit.itemProviderAdapterFactories">
<!-- @generated workload -->
<factory
uri="ProjectWorkloadsDSL"
class="workload.provider.WorkloadItemProviderAdapterFactory"
supportedTypes=
"org.eclipse.emf.edit.provider.IEditingDomainItemProvider
org.eclipse.emf.edit.provider.IStructuredItemContentProvider
org.eclipse.emf.edit.provider.ITreeItemContentProvider
org.eclipse.emf.edit.provider.IItemLabelProvider
org.eclipse.emf.edit.provider.IItemPropertySource"/>
</extension>

</plugin>
169 changes: 169 additions & 0 deletions workload.emf.edit/src/workload/provider/CostCentreItemProvider.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
/**
*/
package workload.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.ComposeableAdapterFactory;
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.ItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.ItemProviderAdapter;
import org.eclipse.emf.edit.provider.ViewerNotification;

import workload.CostCentre;
import workload.WorkloadPackage;

/**
* This is the item provider adapter for a {@link workload.CostCentre} object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public class CostCentreItemProvider 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 CostCentreItemProvider(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);

addNamePropertyDescriptor(object);
addEffortsPropertyDescriptor(object);
}
return itemPropertyDescriptors;
}

/**
* This adds a property descriptor for the Name feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addNamePropertyDescriptor(Object object) {
itemPropertyDescriptors
.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
getResourceLocator(), getString("_UI_CostCentre_name_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_CostCentre_name_feature",
"_UI_CostCentre_type"),
WorkloadPackage.Literals.COST_CENTRE__NAME, true, false, false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
}

/**
* This adds a property descriptor for the Efforts feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addEffortsPropertyDescriptor(Object object) {
itemPropertyDescriptors
.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
getResourceLocator(), getString("_UI_CostCentre_efforts_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_CostCentre_efforts_feature",
"_UI_CostCentre_type"),
WorkloadPackage.Literals.COST_CENTRE__EFFORTS, true, false, true, null, null, null));
}

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

/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected boolean shouldComposeCreationImage() {
return true;
}

/**
* This returns the label text for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String getText(Object object) {
String label = ((CostCentre) object).getName();
return label == null || label.length() == 0 ? getString("_UI_CostCentre_type")
: getString("_UI_CostCentre_type") + " " + label;
}

/**
* 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);

switch (notification.getFeatureID(CostCentre.class)) {
case WorkloadPackage.COST_CENTRE__NAME:
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
return;
}
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 WorkloadEditPlugin.INSTANCE;
}

}
Loading

0 comments on commit db7de75

Please sign in to comment.