use of org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent in project InformationSystem by ObeoNetwork.
the class FinalStatePropertiesEditionPartForm method createDescriptionText.
protected Composite createDescriptionText(FormToolkit widgetFactory, Composite parent) {
createDescription(parent, StatemachineViewsRepository.FinalState.Properties.description, StatemachineMessages.FinalStatePropertiesEditionPart_DescriptionLabel);
// $NON-NLS-1$
description = widgetFactory.createText(parent, "");
description.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER);
widgetFactory.paintBordersFor(parent);
GridData descriptionData = new GridData(GridData.FILL_HORIZONTAL);
description.setLayoutData(descriptionData);
description.addFocusListener(new FocusAdapter() {
/**
* @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(FinalStatePropertiesEditionPartForm.this, StatemachineViewsRepository.FinalState.Properties.description, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, description.getText()));
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(FinalStatePropertiesEditionPartForm.this, StatemachineViewsRepository.FinalState.Properties.description, PropertiesEditionEvent.FOCUS_CHANGED, PropertiesEditionEvent.FOCUS_LOST, null, description.getText()));
}
}
/**
* @see org.eclipse.swt.events.FocusAdapter#focusGained(org.eclipse.swt.events.FocusEvent)
*/
@Override
public void focusGained(FocusEvent e) {
if (propertiesEditionComponent != null) {
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(FinalStatePropertiesEditionPartForm.this, null, PropertiesEditionEvent.FOCUS_CHANGED, PropertiesEditionEvent.FOCUS_GAINED, null, null));
}
}
});
description.addKeyListener(new KeyAdapter() {
/**
* @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(FinalStatePropertiesEditionPartForm.this, StatemachineViewsRepository.FinalState.Properties.description, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, description.getText()));
}
}
});
EditingUtils.setID(description, StatemachineViewsRepository.FinalState.Properties.description);
// $NON-NLS-1$
EditingUtils.setEEFtype(description, "eef::Text");
// $NON-NLS-1$
FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(StatemachineViewsRepository.FinalState.Properties.description, StatemachineViewsRepository.FORM_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 InitialStatePropertiesEditionPartForm method addOutcomingTransitions.
/**
*/
protected void addOutcomingTransitions() {
TabElementTreeSelectionDialog dialog = new TabElementTreeSelectionDialog(outcomingTransitions.getInput(), outcomingTransitionsFilters, outcomingTransitionsBusinessFilters, "outcomingTransitions", 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(InitialStatePropertiesEditionPartForm.this, StatemachineViewsRepository.InitialState.Properties.outcomingTransitions, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.ADD, null, elem));
}
outcomingTransitions.refresh();
}
};
dialog.open();
}
use of org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent in project InformationSystem by ObeoNetwork.
the class InitialStatePropertiesEditionPartForm method createDescriptionText.
protected Composite createDescriptionText(FormToolkit widgetFactory, Composite parent) {
createDescription(parent, StatemachineViewsRepository.InitialState.Properties.description, StatemachineMessages.InitialStatePropertiesEditionPart_DescriptionLabel);
// $NON-NLS-1$
description = widgetFactory.createText(parent, "");
description.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER);
widgetFactory.paintBordersFor(parent);
GridData descriptionData = new GridData(GridData.FILL_HORIZONTAL);
description.setLayoutData(descriptionData);
description.addFocusListener(new FocusAdapter() {
/**
* @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(InitialStatePropertiesEditionPartForm.this, StatemachineViewsRepository.InitialState.Properties.description, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, description.getText()));
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(InitialStatePropertiesEditionPartForm.this, StatemachineViewsRepository.InitialState.Properties.description, PropertiesEditionEvent.FOCUS_CHANGED, PropertiesEditionEvent.FOCUS_LOST, null, description.getText()));
}
}
/**
* @see org.eclipse.swt.events.FocusAdapter#focusGained(org.eclipse.swt.events.FocusEvent)
*/
@Override
public void focusGained(FocusEvent e) {
if (propertiesEditionComponent != null) {
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(InitialStatePropertiesEditionPartForm.this, null, PropertiesEditionEvent.FOCUS_CHANGED, PropertiesEditionEvent.FOCUS_GAINED, null, null));
}
}
});
description.addKeyListener(new KeyAdapter() {
/**
* @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(InitialStatePropertiesEditionPartForm.this, StatemachineViewsRepository.InitialState.Properties.description, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, description.getText()));
}
}
});
EditingUtils.setID(description, StatemachineViewsRepository.InitialState.Properties.description);
// $NON-NLS-1$
EditingUtils.setEEFtype(description, "eef::Text");
// $NON-NLS-1$
FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(StatemachineViewsRepository.InitialState.Properties.description, StatemachineViewsRepository.FORM_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 InitialStatePropertiesEditionPartForm method moveIncomingTransitions.
/**
*/
protected void moveIncomingTransitions(EObject element, int oldIndex, int newIndex) {
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(InitialStatePropertiesEditionPartForm.this, StatemachineViewsRepository.InitialState.Properties.incomingTransitions, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.MOVE, element, newIndex));
incomingTransitions.refresh();
}
use of org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent in project InformationSystem by ObeoNetwork.
the class InitialStatePropertiesEditionPartForm method removeFromOutcomingTransitions.
/**
*/
protected void removeFromOutcomingTransitions(EObject element) {
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(InitialStatePropertiesEditionPartForm.this, StatemachineViewsRepository.InitialState.Properties.outcomingTransitions, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.REMOVE, null, element));
outcomingTransitions.refresh();
}
Aggregations