Permalink
Browse files

[#89]: Relax input spec grammar by using Xtext options

More fixes to the outline view for all DSLs

Task-Url: http://github.com/roberthilbrich/assist-public/issues/89
  • Loading branch information...
RobertHilbrich committed Oct 12, 2018
1 parent f87e19d commit 3d87cad446adee26ec52be99324b3adccd509b3d
Showing with 341 additions and 29 deletions.
  1. +1 −1 ch.hilbri.assist.dse.dsl.ui/src/ch/hilbri/assist/dse/dsl/ui/labeling/DSEDslLabelProvider.xtend
  2. +1 −1 ....assist.mapping.dsl.ui/src/ch/hilbri/assist/mapping/dsl/ui/labeling/MappingDSLLabelProvider.xtend
  3. +2 −0 ch.hilbri.assist.model.edit/plugin.properties
  4. +28 −2 ch.hilbri.assist.model.edit/src/ch/hilbri/assist/model/provider/ComplexRelationItemProvider.java
  5. +5 −1 ...sist.model.edit/src/ch/hilbri/assist/model/provider/RestrictionDisjointExecutionItemProvider.java
  6. +5 −1 ...st.model.edit/src/ch/hilbri/assist/model/provider/RestrictionFinishAtTheSameTimeItemProvider.java
  7. +4 −2 ...odel.edit/src/ch/hilbri/assist/model/provider/RestrictionStartAfterOtherFinishedItemProvider.java
  8. +4 −2 ...model.edit/src/ch/hilbri/assist/model/provider/RestrictionStartAfterOtherStartedItemProvider.java
  9. +5 −1 ...ist.model.edit/src/ch/hilbri/assist/model/provider/RestrictionStartAtTheSameTimeItemProvider.java
  10. +36 −1 ch.hilbri.assist.model.edit/src/ch/hilbri/assist/model/provider/SimpleRelationItemProvider.java
  11. +2 −0 ch.hilbri.assist.model/model/ASSIST-Model.xcore
  12. +16 −0 ch.hilbri.assist.model/src-gen/ch/hilbri/assist/model/ComplexRelation.java
  13. +103 −2 ch.hilbri.assist.model/src-gen/ch/hilbri/assist/model/ModelPackage.java
  14. +16 −0 ch.hilbri.assist.model/src-gen/ch/hilbri/assist/model/SimpleRelation.java
  15. +26 −0 ch.hilbri.assist.model/src-gen/ch/hilbri/assist/model/impl/ComplexRelationImpl.java
  16. +22 −0 ch.hilbri.assist.model/src-gen/ch/hilbri/assist/model/impl/ModelPackageImpl.java
  17. +26 −0 ch.hilbri.assist.model/src-gen/ch/hilbri/assist/model/impl/SimpleRelationImpl.java
  18. +6 −15 ...cheduling.dsl.ui/src/ch/hilbri/assist/scheduling/dsl/ui/labeling/SchedulingDslLabelProvider.xtend
  19. +33 −0 ...ling.dsl.ui/src/ch/hilbri/assist/scheduling/dsl/ui/outline/SchedulingDslOutlineTreeProvider.xtend
@@ -80,7 +80,7 @@ class DSEDslLabelProvider extends DefaultEObjectLabelProvider {
}
def text(Task t) {
'Task' + t.getName
'Task ' + t.name
}
def image(Task t) {
@@ -76,7 +76,7 @@ class MappingDSLLabelProvider extends DefaultEObjectLabelProvider {
}
def text(Task t) {
'Task' + t.getName
'Task ' + t.getName
}
def image(Task t) {
@@ -566,3 +566,5 @@ _UI_TaskSwitchDelayProperty_type = Task Switch Delay Property
_UI_AssistModel_properties_feature = Properties
_UI_AssignedCoreProperty_type = Assigned Core Property
_UI_AssignedCoreProperty_value_feature = Value
_UI_SimpleRelation_taskNames_feature = Task Names
_UI_ComplexRelation_taskNames_feature = Task Names
@@ -48,6 +48,7 @@ public ComplexRelationItemProvider(AdapterFactory adapterFactory) {
addTasksPropertyDescriptor(object);
addOtherTaskPropertyDescriptor(object);
addDelayPropertyDescriptor(object);
addTaskNamesPropertyDescriptor(object);
}
return itemPropertyDescriptors;
}
@@ -119,6 +120,28 @@ protected void addDelayPropertyDescriptor(Object object) {
}
/**
* This adds a property descriptor for the Task Names feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addTaskNamesPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_ComplexRelation_taskNames_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_ComplexRelation_taskNames_feature", "_UI_ComplexRelation_type"),
ModelPackage.Literals.COMPLEX_RELATION__TASK_NAMES,
false,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
/**
* This returns ComplexRelation.gif.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -137,8 +160,10 @@ public Object getImage(Object object) {
*/
@Override
public String getText(Object object) {
ComplexRelation complexRelation = (ComplexRelation)object;
return getString("_UI_ComplexRelation_type") + " " + complexRelation.getDelay();
String label = ((ComplexRelation)object).getTaskNames();
return label == null || label.length() == 0 ?
getString("_UI_ComplexRelation_type") :
getString("_UI_ComplexRelation_type") + " " + label;
}
@@ -155,6 +180,7 @@ public void notifyChanged(Notification notification) {
switch (notification.getFeatureID(ComplexRelation.class)) {
case ModelPackage.COMPLEX_RELATION__DELAY:
case ModelPackage.COMPLEX_RELATION__TASK_NAMES:
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
return;
}
@@ -3,6 +3,7 @@
package ch.hilbri.assist.model.provider;
import ch.hilbri.assist.model.RestrictionDisjointExecution;
import java.util.Collection;
import java.util.List;
@@ -62,7 +63,10 @@ public Object getImage(Object object) {
*/
@Override
public String getText(Object object) {
return getString("_UI_RestrictionDisjointExecution_type");
String label = ((RestrictionDisjointExecution)object).getTaskNames();
return label == null || label.length() == 0 ?
getString("_UI_RestrictionDisjointExecution_type") :
getString("_UI_RestrictionDisjointExecution_type") + " " + label;
}
@@ -3,6 +3,7 @@
package ch.hilbri.assist.model.provider;
import ch.hilbri.assist.model.RestrictionFinishAtTheSameTime;
import java.util.Collection;
import java.util.List;
@@ -62,7 +63,10 @@ public Object getImage(Object object) {
*/
@Override
public String getText(Object object) {
return getString("_UI_RestrictionFinishAtTheSameTime_type");
String label = ((RestrictionFinishAtTheSameTime)object).getTaskNames();
return label == null || label.length() == 0 ?
getString("_UI_RestrictionFinishAtTheSameTime_type") :
getString("_UI_RestrictionFinishAtTheSameTime_type") + " " + label;
}
@@ -64,8 +64,10 @@ public Object getImage(Object object) {
*/
@Override
public String getText(Object object) {
RestrictionStartAfterOtherFinished restrictionStartAfterOtherFinished = (RestrictionStartAfterOtherFinished)object;
return getString("_UI_RestrictionStartAfterOtherFinished_type") + " " + restrictionStartAfterOtherFinished.getDelay();
String label = ((RestrictionStartAfterOtherFinished)object).getTaskNames();
return label == null || label.length() == 0 ?
getString("_UI_RestrictionStartAfterOtherFinished_type") :
getString("_UI_RestrictionStartAfterOtherFinished_type") + " " + label;
}
@@ -64,8 +64,10 @@ public Object getImage(Object object) {
*/
@Override
public String getText(Object object) {
RestrictionStartAfterOtherStarted restrictionStartAfterOtherStarted = (RestrictionStartAfterOtherStarted)object;
return getString("_UI_RestrictionStartAfterOtherStarted_type") + " " + restrictionStartAfterOtherStarted.getDelay();
String label = ((RestrictionStartAfterOtherStarted)object).getTaskNames();
return label == null || label.length() == 0 ?
getString("_UI_RestrictionStartAfterOtherStarted_type") :
getString("_UI_RestrictionStartAfterOtherStarted_type") + " " + label;
}
@@ -3,6 +3,7 @@
package ch.hilbri.assist.model.provider;
import ch.hilbri.assist.model.RestrictionStartAtTheSameTime;
import java.util.Collection;
import java.util.List;
@@ -62,7 +63,10 @@ public Object getImage(Object object) {
*/
@Override
public String getText(Object object) {
return getString("_UI_RestrictionStartAtTheSameTime_type");
String label = ((RestrictionStartAtTheSameTime)object).getTaskNames();
return label == null || label.length() == 0 ?
getString("_UI_RestrictionStartAtTheSameTime_type") :
getString("_UI_RestrictionStartAtTheSameTime_type") + " " + label;
}
@@ -5,6 +5,7 @@
import ch.hilbri.assist.model.ModelPackage;
import ch.hilbri.assist.model.SimpleRelation;
import java.util.Collection;
import java.util.List;
@@ -13,6 +14,8 @@
import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.ViewerNotification;
/**
* This is the item provider adapter for a {@link ch.hilbri.assist.model.SimpleRelation} object.
@@ -43,6 +46,7 @@ public SimpleRelationItemProvider(AdapterFactory adapterFactory) {
super.getPropertyDescriptors(object);
addTasksPropertyDescriptor(object);
addTaskNamesPropertyDescriptor(object);
}
return itemPropertyDescriptors;
}
@@ -70,6 +74,28 @@ protected void addTasksPropertyDescriptor(Object object) {
}
/**
* This adds a property descriptor for the Task Names feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addTaskNamesPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_SimpleRelation_taskNames_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_SimpleRelation_taskNames_feature", "_UI_SimpleRelation_type"),
ModelPackage.Literals.SIMPLE_RELATION__TASK_NAMES,
false,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
/**
* This returns SimpleRelation.gif.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -88,7 +114,10 @@ public Object getImage(Object object) {
*/
@Override
public String getText(Object object) {
return getString("_UI_SimpleRelation_type");
String label = ((SimpleRelation)object).getTaskNames();
return label == null || label.length() == 0 ?
getString("_UI_SimpleRelation_type") :
getString("_UI_SimpleRelation_type") + " " + label;
}
@@ -102,6 +131,12 @@ public String getText(Object object) {
@Override
public void notifyChanged(Notification notification) {
updateChildren(notification);
switch (notification.getFeatureID(SimpleRelation.class)) {
case ModelPackage.SIMPLE_RELATION__TASK_NAMES:
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
return;
}
super.notifyChanged(notification);
}
@@ -792,12 +792,14 @@ class SchedulingRestriction {}
// Basic kinds of relations
class SimpleRelation extends SchedulingRestriction {
refers Task[2..*] tasks
derived String taskNames get { tasks.join(', ') }
}
class ComplexRelation extends SchedulingRestriction {
refers Task[1..*] tasks
refers Task otherTask
int delay
derived String taskNames get { tasks.join(', ') }
}
// Concrete relations:
@@ -16,6 +16,7 @@
* <li>{@link ch.hilbri.assist.model.ComplexRelation#getTasks <em>Tasks</em>}</li>
* <li>{@link ch.hilbri.assist.model.ComplexRelation#getOtherTask <em>Other Task</em>}</li>
* <li>{@link ch.hilbri.assist.model.ComplexRelation#getDelay <em>Delay</em>}</li>
* <li>{@link ch.hilbri.assist.model.ComplexRelation#getTaskNames <em>Task Names</em>}</li>
* </ul>
*
* @see ch.hilbri.assist.model.ModelPackage#getComplexRelation()
@@ -91,4 +92,19 @@
*/
void setDelay(int value);
/**
* Returns the value of the '<em><b>Task Names</b></em>' attribute.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Task Names</em>' attribute isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Task Names</em>' attribute.
* @see ch.hilbri.assist.model.ModelPackage#getComplexRelation_TaskNames()
* @model unique="false" transient="true" changeable="false" volatile="true" derived="true"
* @generated
*/
String getTaskNames();
} // ComplexRelation
Oops, something went wrong.

0 comments on commit 3d87cad

Please sign in to comment.