use of org.eclipse.jface.viewers.ViewerFilter in project InformationSystem by ObeoNetwork.
the class TaskTaskPropertiesEditionComponent method initPart.
/**
* {@inheritDoc}
*
* @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#initPart(java.lang.Object, int, org.eclipse.emf.ecore.EObject,
* org.eclipse.emf.ecore.resource.ResourceSet)
*/
public void initPart(Object key, int kind, EObject elt, ResourceSet allResource) {
setInitializing(true);
if (editingPart != null && key == partKey) {
editingPart.setContext(elt, allResource);
final Task task = (Task) elt;
final TaskPropertiesEditionPart taskPart = (TaskPropertiesEditionPart) editingPart;
// init values
if (isAccessible(GraalViewsRepository.Task.Properties.description))
taskPart.setDescription(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, task.getDescription()));
if (isAccessible(GraalViewsRepository.Task.Properties.subActivities)) {
subActivitiesSettings = new ReferencesTableSettings(task, GraalPackage.eINSTANCE.getActivity_SubActivities());
taskPart.initSubActivities(subActivitiesSettings);
}
if (isAccessible(GraalViewsRepository.Task.Properties.actors)) {
actorsSettings = new ReferencesTableSettings(task, GraalPackage.eINSTANCE.getTask_Actors());
taskPart.initActors(actorsSettings);
}
if (isAccessible(GraalViewsRepository.Task.Properties.id))
taskPart.setId(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, task.getId()));
if (isAccessible(GraalViewsRepository.Task.Properties.name))
taskPart.setName(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, task.getName()));
if (isAccessible(GraalViewsRepository.Task.Properties.uses)) {
usesSettings = new ReferencesTableSettings(task, GraalPackage.eINSTANCE.getTask_Uses());
taskPart.initUses(usesSettings);
}
if (isAccessible(GraalViewsRepository.Task.Properties.preconditions))
taskPart.setPreconditions(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, task.getPreconditions()));
if (isAccessible(GraalViewsRepository.Task.Properties.postconditions))
taskPart.setPostconditions(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, task.getPostconditions()));
if (isAccessible(GraalViewsRepository.Task.Properties.subActivities)) {
taskPart.addFilterToSubActivities(new ViewerFilter() {
/**
* {@inheritDoc}
*
* @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
*/
public boolean select(Viewer viewer, Object parentElement, Object element) {
// $NON-NLS-1$
return (element instanceof String && element.equals("")) || (element instanceof Loop);
}
});
// Start of user code for additional businessfilters for subActivities
// End of user code
}
if (isAccessible(GraalViewsRepository.Task.Properties.actors)) {
taskPart.addFilterToActors(new EObjectFilter(GraalPackage.Literals.ACTOR));
// Start of user code for additional businessfilters for actors
// End of user code
}
if (isAccessible(GraalViewsRepository.Task.Properties.uses)) {
taskPart.addFilterToUses(new EObjectFilter(GraalPackage.Literals.TASK));
// Start of user code for additional businessfilters for uses
// End of user code
}
// init values for referenced views
// init filters for referenced views
}
setInitializing(false);
}
use of org.eclipse.jface.viewers.ViewerFilter in project InformationSystem by ObeoNetwork.
the class TransitionTransitionPropertiesEditionComponent method initPart.
/**
* {@inheritDoc}
*
* @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#initPart(java.lang.Object, int, org.eclipse.emf.ecore.EObject,
* org.eclipse.emf.ecore.resource.ResourceSet)
*/
public void initPart(Object key, int kind, EObject elt, ResourceSet allResource) {
setInitializing(true);
if (editingPart != null && key == partKey) {
editingPart.setContext(elt, allResource);
final Transition transition = (Transition) elt;
final TransitionPropertiesEditionPart transitionPart = (TransitionPropertiesEditionPart) editingPart;
// init values
if (isAccessible(GraalViewsRepository.Transition.Properties.description))
transitionPart.setDescription(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, transition.getDescription()));
if (isAccessible(GraalViewsRepository.Transition.Properties.guard))
transitionPart.setGuard(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, transition.getGuard()));
if (isAccessible(GraalViewsRepository.Transition.Properties.source)) {
// init part
sourceSettings = new EObjectFlatComboSettings(transition, GraalPackage.eINSTANCE.getTransition_Source());
transitionPart.initSource(sourceSettings);
// set the button mode
transitionPart.setSourceButtonMode(ButtonsModeEnum.BROWSE);
}
if (isAccessible(GraalViewsRepository.Transition.Properties.target)) {
// init part
targetSettings = new EObjectFlatComboSettings(transition, GraalPackage.eINSTANCE.getTransition_Target());
transitionPart.initTarget(targetSettings);
// set the button mode
transitionPart.setTargetButtonMode(ButtonsModeEnum.BROWSE);
}
if (isAccessible(GraalViewsRepository.Transition.Properties.kind)) {
transitionPart.initKind(EEFUtils.choiceOfValues(transition, GraalPackage.eINSTANCE.getTransition_Kind()), transition.getKind());
}
if (isAccessible(GraalViewsRepository.Transition.Properties.source)) {
transitionPart.addFilterToSource(new ViewerFilter() {
/**
* {@inheritDoc}
*
* @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
*/
public boolean select(Viewer viewer, Object parentElement, Object element) {
return (element instanceof Node);
}
});
// Start of user code for additional businessfilters for source
// End of user code
}
if (isAccessible(GraalViewsRepository.Transition.Properties.target)) {
transitionPart.addFilterToTarget(new ViewerFilter() {
/**
* {@inheritDoc}
*
* @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
*/
public boolean select(Viewer viewer, Object parentElement, Object element) {
return (element instanceof Node);
}
});
// Start of user code for additional businessfilters for target
// End of user code
}
// init values for referenced views
// init filters for referenced views
}
setInitializing(false);
}
use of org.eclipse.jface.viewers.ViewerFilter in project InformationSystem by ObeoNetwork.
the class LoopLoopPropertiesEditionComponent method initPart.
/**
* {@inheritDoc}
*
* @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#initPart(java.lang.Object, int, org.eclipse.emf.ecore.EObject,
* org.eclipse.emf.ecore.resource.ResourceSet)
*/
public void initPart(Object key, int kind, EObject elt, ResourceSet allResource) {
setInitializing(true);
if (editingPart != null && key == partKey) {
editingPart.setContext(elt, allResource);
final Loop loop = (Loop) elt;
final LoopPropertiesEditionPart loopPart = (LoopPropertiesEditionPart) editingPart;
// init values
if (isAccessible(GraalViewsRepository.Loop.Properties.description))
loopPart.setDescription(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, loop.getDescription()));
if (isAccessible(GraalViewsRepository.Loop.Properties.subActivities)) {
subActivitiesSettings = new ReferencesTableSettings(loop, GraalPackage.eINSTANCE.getActivity_SubActivities());
loopPart.initSubActivities(subActivitiesSettings);
}
if (isAccessible(GraalViewsRepository.Loop.Properties.lowerBound)) {
loopPart.setLowerBound(EEFConverterUtil.convertToString(EcorePackage.Literals.EINT, loop.getLowerBound()));
}
if (isAccessible(GraalViewsRepository.Loop.Properties.upperBound)) {
loopPart.setUpperBound(EEFConverterUtil.convertToString(EcorePackage.Literals.EINT, loop.getUpperBound()));
}
if (isAccessible(GraalViewsRepository.Loop.Properties.subActivities)) {
loopPart.addFilterToSubActivities(new ViewerFilter() {
/**
* {@inheritDoc}
*
* @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
*/
public boolean select(Viewer viewer, Object parentElement, Object element) {
// $NON-NLS-1$
return (element instanceof String && element.equals("")) || (element instanceof Loop);
}
});
// Start of user code for additional businessfilters for subActivities
// End of user code
}
// init values for referenced views
// init filters for referenced views
}
setInitializing(false);
}
use of org.eclipse.jface.viewers.ViewerFilter in project InformationSystem by ObeoNetwork.
the class TaskReferenceTaskReferencePropertiesEditionComponent method initPart.
/**
* {@inheritDoc}
*
* @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#initPart(java.lang.Object, int, org.eclipse.emf.ecore.EObject,
* org.eclipse.emf.ecore.resource.ResourceSet)
*/
public void initPart(Object key, int kind, EObject elt, ResourceSet allResource) {
setInitializing(true);
if (editingPart != null && key == partKey) {
editingPart.setContext(elt, allResource);
final TaskReference taskReference = (TaskReference) elt;
final TaskReferencePropertiesEditionPart taskReferencePart = (TaskReferencePropertiesEditionPart) editingPart;
// init values
if (isAccessible(GraalViewsRepository.TaskReference.Properties.description))
taskReferencePart.setDescription(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, taskReference.getDescription()));
if (isAccessible(GraalViewsRepository.TaskReference.Properties.outgoingTransitions)) {
outgoingTransitionsSettings = new ReferencesTableSettings(taskReference, GraalPackage.eINSTANCE.getNode_OutgoingTransitions());
taskReferencePart.initOutgoingTransitions(outgoingTransitionsSettings);
}
if (isAccessible(GraalViewsRepository.TaskReference.Properties.incomingTransitions)) {
incomingTransitionsSettings = new ReferencesTableSettings(taskReference, GraalPackage.eINSTANCE.getNode_IncomingTransitions());
taskReferencePart.initIncomingTransitions(incomingTransitionsSettings);
}
if (isAccessible(GraalViewsRepository.TaskReference.Properties.task)) {
// init part
taskSettings = new EObjectFlatComboSettings(taskReference, GraalPackage.eINSTANCE.getTaskReference_Task());
taskReferencePart.initTask(taskSettings);
// set the button mode
taskReferencePart.setTaskButtonMode(ButtonsModeEnum.BROWSE);
}
if (isAccessible(GraalViewsRepository.TaskReference.Properties.outgoingTransitions)) {
taskReferencePart.addFilterToOutgoingTransitions(new EObjectFilter(GraalPackage.Literals.TRANSITION));
// Start of user code for additional businessfilters for outgoingTransitions
// End of user code
}
if (isAccessible(GraalViewsRepository.TaskReference.Properties.incomingTransitions)) {
taskReferencePart.addFilterToIncomingTransitions(new EObjectFilter(GraalPackage.Literals.TRANSITION));
// Start of user code for additional businessfilters for incomingTransitions
// End of user code
}
if (isAccessible(GraalViewsRepository.TaskReference.Properties.task)) {
taskReferencePart.addFilterToTask(new ViewerFilter() {
/**
* {@inheritDoc}
*
* @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
*/
public boolean select(Viewer viewer, Object parentElement, Object element) {
return (element instanceof Task);
}
});
// Start of user code for additional businessfilters for task
// End of user code
}
// init values for referenced views
// init filters for referenced views
}
setInitializing(false);
}
use of org.eclipse.jface.viewers.ViewerFilter in project InformationSystem by ObeoNetwork.
the class CategoryPropertiesEditionPartImpl method createRequirementsAdvancedTableComposition.
/**
* @param container
*/
protected Composite createRequirementsAdvancedTableComposition(Composite parent) {
this.requirements = new ReferencesTable(getDescription(RequirementViewsRepository.Category.Category_.requirements, RequirementMessages.CategoryPropertiesEditionPart_RequirementsLabel), new ReferencesTableListener() {
public void handleAdd() {
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(CategoryPropertiesEditionPartImpl.this, RequirementViewsRepository.Category.Category_.requirements, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.ADD, null, null));
requirements.refresh();
}
public void handleEdit(EObject element) {
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(CategoryPropertiesEditionPartImpl.this, RequirementViewsRepository.Category.Category_.requirements, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.EDIT, null, element));
requirements.refresh();
}
public void handleMove(EObject element, int oldIndex, int newIndex) {
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(CategoryPropertiesEditionPartImpl.this, RequirementViewsRepository.Category.Category_.requirements, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.MOVE, element, newIndex));
requirements.refresh();
}
public void handleRemove(EObject element) {
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(CategoryPropertiesEditionPartImpl.this, RequirementViewsRepository.Category.Category_.requirements, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.REMOVE, null, element));
requirements.refresh();
}
public void navigateTo(EObject element) {
}
});
for (ViewerFilter filter : this.requirementsFilters) {
this.requirements.addFilter(filter);
}
this.requirements.setHelpText(propertiesEditionComponent.getHelpContent(RequirementViewsRepository.Category.Category_.requirements, RequirementViewsRepository.SWT_KIND));
this.requirements.createControls(parent);
this.requirements.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
if (e.item != null && e.item.getData() instanceof EObject) {
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(CategoryPropertiesEditionPartImpl.this, RequirementViewsRepository.Category.Category_.requirements, PropertiesEditionEvent.CHANGE, PropertiesEditionEvent.SELECTION_CHANGED, null, e.item.getData()));
}
}
});
GridData requirementsData = new GridData(GridData.FILL_HORIZONTAL);
requirementsData.horizontalSpan = 3;
this.requirements.setLayoutData(requirementsData);
this.requirements.setLowerBound(0);
this.requirements.setUpperBound(-1);
requirements.setID(RequirementViewsRepository.Category.Category_.requirements);
// $NON-NLS-1$
requirements.setEEFType("eef::AdvancedTableComposition");
// End of user code
return parent;
}
Aggregations