use of org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent in project InformationSystem by ObeoNetwork.
the class StatePropertiesEditionPartImpl method createDescriptionText.
protected Composite createDescriptionText(Composite parent) {
createDescription(parent, StatemachineViewsRepository.State.Properties.description, StatemachineMessages.StatePropertiesEditionPart_DescriptionLabel);
description = SWTUtils.createScrollableText(parent, SWT.BORDER);
GridData descriptionData = new GridData(GridData.FILL_HORIZONTAL);
description.setLayoutData(descriptionData);
description.addFocusListener(new FocusAdapter() {
/**
* {@inheritDoc}
*
* @see org.eclipse.swt.events.FocusAdapter#focusLost(org.eclipse.swt.events.FocusEvent)
*/
@Override
@SuppressWarnings("synthetic-access")
public void focusLost(FocusEvent e) {
if (propertiesEditionComponent != null)
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(StatePropertiesEditionPartImpl.this, StatemachineViewsRepository.State.Properties.description, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, description.getText()));
}
});
description.addKeyListener(new KeyAdapter() {
/**
* {@inheritDoc}
*
* @see org.eclipse.swt.events.KeyAdapter#keyPressed(org.eclipse.swt.events.KeyEvent)
*/
@Override
@SuppressWarnings("synthetic-access")
public void keyPressed(KeyEvent e) {
if (e.character == SWT.CR) {
if (propertiesEditionComponent != null)
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(StatePropertiesEditionPartImpl.this, StatemachineViewsRepository.State.Properties.description, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, description.getText()));
}
}
});
EditingUtils.setID(description, StatemachineViewsRepository.State.Properties.description);
// $NON-NLS-1$
EditingUtils.setEEFtype(description, "eef::Text");
// $NON-NLS-1$
SWTUtils.createHelpButton(parent, propertiesEditionComponent.getHelpContent(StatemachineViewsRepository.State.Properties.description, StatemachineViewsRepository.SWT_KIND), null);
// End of user code
return parent;
}
use of org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent in project InformationSystem by ObeoNetwork.
the class StatePropertiesEditionPartImpl method addIncomingTransitions.
/**
*/
protected void addIncomingTransitions() {
TabElementTreeSelectionDialog dialog = new TabElementTreeSelectionDialog(incomingTransitions.getInput(), incomingTransitionsFilters, incomingTransitionsBusinessFilters, "incomingTransitions", propertiesEditionComponent.getEditingContext().getAdapterFactory(), current.eResource()) {
@Override
public void process(IStructuredSelection selection) {
for (Iterator<?> iter = selection.iterator(); iter.hasNext(); ) {
EObject elem = (EObject) iter.next();
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(StatePropertiesEditionPartImpl.this, StatemachineViewsRepository.State.Properties.incomingTransitions, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.ADD, null, elem));
}
incomingTransitions.refresh();
}
};
dialog.open();
}
use of org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent in project InformationSystem by ObeoNetwork.
the class StatePropertiesEditionPartImpl method moveOutcomingTransitions.
/**
*/
protected void moveOutcomingTransitions(EObject element, int oldIndex, int newIndex) {
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(StatePropertiesEditionPartImpl.this, StatemachineViewsRepository.State.Properties.outcomingTransitions, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.MOVE, element, newIndex));
outcomingTransitions.refresh();
}
use of org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent in project InformationSystem by ObeoNetwork.
the class StatePropertiesEditionPartImpl method removeFromOutcomingTransitions.
/**
*/
protected void removeFromOutcomingTransitions(EObject element) {
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(StatePropertiesEditionPartImpl.this, StatemachineViewsRepository.State.Properties.outcomingTransitions, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.REMOVE, null, element));
outcomingTransitions.refresh();
}
use of org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent in project InformationSystem by ObeoNetwork.
the class TransitionPropertiesEditionPartImpl method createFromFlatComboViewer.
/**
* @param parent the parent composite
*/
protected Composite createFromFlatComboViewer(Composite parent) {
createDescription(parent, StatemachineViewsRepository.Transition.Properties.from, StatemachineMessages.TransitionPropertiesEditionPart_FromLabel);
from = new EObjectFlatComboViewer(parent, !propertiesEditionComponent.isRequired(StatemachineViewsRepository.Transition.Properties.from, StatemachineViewsRepository.SWT_KIND));
from.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
from.addSelectionChangedListener(new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(TransitionPropertiesEditionPartImpl.this, StatemachineViewsRepository.Transition.Properties.from, PropertiesEditionEvent.CHANGE, PropertiesEditionEvent.SET, null, getFrom()));
}
});
GridData fromData = new GridData(GridData.FILL_HORIZONTAL);
from.setLayoutData(fromData);
from.setID(StatemachineViewsRepository.Transition.Properties.from);
// $NON-NLS-1$
SWTUtils.createHelpButton(parent, propertiesEditionComponent.getHelpContent(StatemachineViewsRepository.Transition.Properties.from, StatemachineViewsRepository.SWT_KIND), null);
// End of user code
return parent;
}
Aggregations