use of org.eclipse.jface.viewers.ViewerFilter in project InformationSystem by ObeoNetwork.
the class CinematicRootPropertiesEditionPartForm method createViewContainersTableComposition.
/**
* @param container
*/
protected Composite createViewContainersTableComposition(FormToolkit widgetFactory, Composite parent) {
this.viewContainers = new ReferencesTable(getDescription(CinematicViewsRepository.CinematicRoot.Properties.viewContainers, CinematicMessages.CinematicRootPropertiesEditionPart_ViewContainersLabel), new ReferencesTableListener() {
public void handleAdd() {
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(CinematicRootPropertiesEditionPartForm.this, CinematicViewsRepository.CinematicRoot.Properties.viewContainers, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.ADD, null, null));
viewContainers.refresh();
}
public void handleEdit(EObject element) {
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(CinematicRootPropertiesEditionPartForm.this, CinematicViewsRepository.CinematicRoot.Properties.viewContainers, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.EDIT, null, element));
viewContainers.refresh();
}
public void handleMove(EObject element, int oldIndex, int newIndex) {
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(CinematicRootPropertiesEditionPartForm.this, CinematicViewsRepository.CinematicRoot.Properties.viewContainers, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.MOVE, element, newIndex));
viewContainers.refresh();
}
public void handleRemove(EObject element) {
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(CinematicRootPropertiesEditionPartForm.this, CinematicViewsRepository.CinematicRoot.Properties.viewContainers, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.REMOVE, null, element));
viewContainers.refresh();
}
public void navigateTo(EObject element) {
}
});
for (ViewerFilter filter : this.viewContainersFilters) {
this.viewContainers.addFilter(filter);
}
this.viewContainers.setHelpText(propertiesEditionComponent.getHelpContent(CinematicViewsRepository.CinematicRoot.Properties.viewContainers, CinematicViewsRepository.FORM_KIND));
this.viewContainers.createControls(parent, widgetFactory);
this.viewContainers.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
if (e.item != null && e.item.getData() instanceof EObject) {
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(CinematicRootPropertiesEditionPartForm.this, CinematicViewsRepository.CinematicRoot.Properties.viewContainers, PropertiesEditionEvent.CHANGE, PropertiesEditionEvent.SELECTION_CHANGED, null, e.item.getData()));
}
}
});
GridData viewContainersData = new GridData(GridData.FILL_HORIZONTAL);
viewContainersData.horizontalSpan = 3;
this.viewContainers.setLayoutData(viewContainersData);
this.viewContainers.setLowerBound(0);
this.viewContainers.setUpperBound(-1);
viewContainers.setID(CinematicViewsRepository.CinematicRoot.Properties.viewContainers);
// $NON-NLS-1$
viewContainers.setEEFType("eef::AdvancedTableComposition");
// End of user code
return parent;
}
use of org.eclipse.jface.viewers.ViewerFilter in project InformationSystem by ObeoNetwork.
the class CinematicRootPropertiesEditionPartForm method createSubPackagesTableComposition.
/**
* @param container
*/
protected Composite createSubPackagesTableComposition(FormToolkit widgetFactory, Composite parent) {
this.subPackages = new ReferencesTable(getDescription(CinematicViewsRepository.CinematicRoot.Properties.subPackages, CinematicMessages.CinematicRootPropertiesEditionPart_SubPackagesLabel), new ReferencesTableListener() {
public void handleAdd() {
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(CinematicRootPropertiesEditionPartForm.this, CinematicViewsRepository.CinematicRoot.Properties.subPackages, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.ADD, null, null));
subPackages.refresh();
}
public void handleEdit(EObject element) {
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(CinematicRootPropertiesEditionPartForm.this, CinematicViewsRepository.CinematicRoot.Properties.subPackages, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.EDIT, null, element));
subPackages.refresh();
}
public void handleMove(EObject element, int oldIndex, int newIndex) {
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(CinematicRootPropertiesEditionPartForm.this, CinematicViewsRepository.CinematicRoot.Properties.subPackages, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.MOVE, element, newIndex));
subPackages.refresh();
}
public void handleRemove(EObject element) {
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(CinematicRootPropertiesEditionPartForm.this, CinematicViewsRepository.CinematicRoot.Properties.subPackages, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.REMOVE, null, element));
subPackages.refresh();
}
public void navigateTo(EObject element) {
}
});
for (ViewerFilter filter : this.subPackagesFilters) {
this.subPackages.addFilter(filter);
}
this.subPackages.setHelpText(propertiesEditionComponent.getHelpContent(CinematicViewsRepository.CinematicRoot.Properties.subPackages, CinematicViewsRepository.FORM_KIND));
this.subPackages.createControls(parent, widgetFactory);
this.subPackages.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
if (e.item != null && e.item.getData() instanceof EObject) {
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(CinematicRootPropertiesEditionPartForm.this, CinematicViewsRepository.CinematicRoot.Properties.subPackages, PropertiesEditionEvent.CHANGE, PropertiesEditionEvent.SELECTION_CHANGED, null, e.item.getData()));
}
}
});
GridData subPackagesData = new GridData(GridData.FILL_HORIZONTAL);
subPackagesData.horizontalSpan = 3;
this.subPackages.setLayoutData(subPackagesData);
this.subPackages.setLowerBound(0);
this.subPackages.setUpperBound(-1);
subPackages.setID(CinematicViewsRepository.CinematicRoot.Properties.subPackages);
// $NON-NLS-1$
subPackages.setEEFType("eef::AdvancedTableComposition");
// End of user code
return parent;
}
use of org.eclipse.jface.viewers.ViewerFilter in project InformationSystem by ObeoNetwork.
the class Package_PropertiesEditionPartForm method createFlowsTableComposition.
/**
* @param container
*/
protected Composite createFlowsTableComposition(FormToolkit widgetFactory, Composite parent) {
this.flows = new ReferencesTable(getDescription(CinematicViewsRepository.Package_.Properties.flows, CinematicMessages.Package_PropertiesEditionPart_FlowsLabel), new ReferencesTableListener() {
public void handleAdd() {
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(Package_PropertiesEditionPartForm.this, CinematicViewsRepository.Package_.Properties.flows, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.ADD, null, null));
flows.refresh();
}
public void handleEdit(EObject element) {
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(Package_PropertiesEditionPartForm.this, CinematicViewsRepository.Package_.Properties.flows, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.EDIT, null, element));
flows.refresh();
}
public void handleMove(EObject element, int oldIndex, int newIndex) {
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(Package_PropertiesEditionPartForm.this, CinematicViewsRepository.Package_.Properties.flows, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.MOVE, element, newIndex));
flows.refresh();
}
public void handleRemove(EObject element) {
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(Package_PropertiesEditionPartForm.this, CinematicViewsRepository.Package_.Properties.flows, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.REMOVE, null, element));
flows.refresh();
}
public void navigateTo(EObject element) {
}
});
for (ViewerFilter filter : this.flowsFilters) {
this.flows.addFilter(filter);
}
this.flows.setHelpText(propertiesEditionComponent.getHelpContent(CinematicViewsRepository.Package_.Properties.flows, CinematicViewsRepository.FORM_KIND));
this.flows.createControls(parent, widgetFactory);
this.flows.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
if (e.item != null && e.item.getData() instanceof EObject) {
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(Package_PropertiesEditionPartForm.this, CinematicViewsRepository.Package_.Properties.flows, PropertiesEditionEvent.CHANGE, PropertiesEditionEvent.SELECTION_CHANGED, null, e.item.getData()));
}
}
});
GridData flowsData = new GridData(GridData.FILL_HORIZONTAL);
flowsData.horizontalSpan = 3;
this.flows.setLayoutData(flowsData);
this.flows.setLowerBound(0);
this.flows.setUpperBound(-1);
flows.setID(CinematicViewsRepository.Package_.Properties.flows);
// $NON-NLS-1$
flows.setEEFType("eef::AdvancedTableComposition");
// End of user code
return parent;
}
use of org.eclipse.jface.viewers.ViewerFilter in project InformationSystem by ObeoNetwork.
the class Package_PropertiesEditionPartForm method createSubPackagesTableComposition.
/**
* @param container
*/
protected Composite createSubPackagesTableComposition(FormToolkit widgetFactory, Composite parent) {
this.subPackages = new ReferencesTable(getDescription(CinematicViewsRepository.Package_.Properties.subPackages, CinematicMessages.Package_PropertiesEditionPart_SubPackagesLabel), new ReferencesTableListener() {
public void handleAdd() {
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(Package_PropertiesEditionPartForm.this, CinematicViewsRepository.Package_.Properties.subPackages, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.ADD, null, null));
subPackages.refresh();
}
public void handleEdit(EObject element) {
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(Package_PropertiesEditionPartForm.this, CinematicViewsRepository.Package_.Properties.subPackages, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.EDIT, null, element));
subPackages.refresh();
}
public void handleMove(EObject element, int oldIndex, int newIndex) {
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(Package_PropertiesEditionPartForm.this, CinematicViewsRepository.Package_.Properties.subPackages, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.MOVE, element, newIndex));
subPackages.refresh();
}
public void handleRemove(EObject element) {
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(Package_PropertiesEditionPartForm.this, CinematicViewsRepository.Package_.Properties.subPackages, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.REMOVE, null, element));
subPackages.refresh();
}
public void navigateTo(EObject element) {
}
});
for (ViewerFilter filter : this.subPackagesFilters) {
this.subPackages.addFilter(filter);
}
this.subPackages.setHelpText(propertiesEditionComponent.getHelpContent(CinematicViewsRepository.Package_.Properties.subPackages, CinematicViewsRepository.FORM_KIND));
this.subPackages.createControls(parent, widgetFactory);
this.subPackages.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
if (e.item != null && e.item.getData() instanceof EObject) {
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(Package_PropertiesEditionPartForm.this, CinematicViewsRepository.Package_.Properties.subPackages, PropertiesEditionEvent.CHANGE, PropertiesEditionEvent.SELECTION_CHANGED, null, e.item.getData()));
}
}
});
GridData subPackagesData = new GridData(GridData.FILL_HORIZONTAL);
subPackagesData.horizontalSpan = 3;
this.subPackages.setLayoutData(subPackagesData);
this.subPackages.setLowerBound(0);
this.subPackages.setUpperBound(-1);
subPackages.setID(CinematicViewsRepository.Package_.Properties.subPackages);
// $NON-NLS-1$
subPackages.setEEFType("eef::AdvancedTableComposition");
// End of user code
return parent;
}
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(FlowViewsRepository.Transition.Properties.description))
transitionPart.setDescription(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, transition.getDescription()));
if (isAccessible(FlowViewsRepository.Transition.Properties.name))
transitionPart.setName(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, transition.getName()));
if (isAccessible(FlowViewsRepository.Transition.Properties.guard))
transitionPart.setGuard(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, transition.getGuard()));
if (isAccessible(FlowViewsRepository.Transition.Properties.modal)) {
transitionPart.setModal(transition.isModal());
}
if (isAccessible(FlowViewsRepository.Transition.Properties.from)) {
// init part
fromSettings = new EObjectFlatComboSettings(transition, FlowPackage.eINSTANCE.getTransition_From());
transitionPart.initFrom(fromSettings);
// set the button mode
transitionPart.setFromButtonMode(ButtonsModeEnum.BROWSE);
}
if (isAccessible(FlowViewsRepository.Transition.Properties.to)) {
// init part
toSettings = new EObjectFlatComboSettings(transition, FlowPackage.eINSTANCE.getTransition_To());
transitionPart.initTo(toSettings);
// set the button mode
transitionPart.setToButtonMode(ButtonsModeEnum.BROWSE);
}
if (isAccessible(FlowViewsRepository.Transition.Properties.on)) {
onSettings = new ReferencesTableSettings(transition, FlowPackage.eINSTANCE.getTransition_On());
transitionPart.initOn(onSettings);
}
if (isAccessible(FlowViewsRepository.Transition.Properties.from)) {
transitionPart.addFilterToFrom(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 FlowState);
}
});
// Start of user code for additional businessfilters for from
// End of user code
}
if (isAccessible(FlowViewsRepository.Transition.Properties.to)) {
transitionPart.addFilterToTo(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 FlowState);
}
});
// Start of user code for additional businessfilters for to
// End of user code
}
if (isAccessible(FlowViewsRepository.Transition.Properties.on)) {
transitionPart.addFilterToOn(new EObjectFilter(CinematicPackage.Literals.EVENT));
// Start of user code for additional businessfilters for on
// End of user code
}
// init values for referenced views
// init filters for referenced views
}
setInitializing(false);
}
Aggregations