use of org.eclipse.sapphire.Element in project liferay-ide by liferay.
the class WorkflowDefinitionLayoutPersistenceService method _save.
private void _save() {
_refreshPersistedPartsCache();
/*
* For nodes that are placed using default node positions and connection
* bend points that are calculated using connection router, we don't
* modify the corresponding model properties in order to allow "revert"
* in source editor to work correctly. So we need to do an explicit save
* of the node bounds and connection bend points here.
*/
_removeWorkflowNodeListeners();
_removeBendpointListeners();
for (DiagramNodePart nodePart : _part().getNodes()) {
Element modelElement = nodePart.getLocalModelElement();
WorkflowNode workflowNode = (WorkflowNode) modelElement;
if (!workflowNode.disposed()) {
_writeWorkflowNodeBoundsToMetaData(workflowNode, nodePart);
DiagramNodeBounds nodePartBounds = nodePart.getNodeBounds();
nodePartBounds.setAutoLayout(false);
nodePart.setNodeBounds(nodePartBounds);
}
}
for (DiagramConnectionPart connPart : _part().getConnections()) {
Element modelElement = connPart.getLocalModelElement();
Transition transition = (Transition) modelElement;
if (!transition.disposed()) {
_writeTransitionBendPoints(transition, connPart);
}
}
_addWorkflowNodeListeners();
_addBendpointListeners();
}
use of org.eclipse.sapphire.Element in project liferay-ide by liferay.
the class TemplateOpenActionHandler method notification.
protected Notification notification(Presentation context) {
ISapphirePart part = context.part();
if (part instanceof DetailSectionPart) {
DetailSectionPart pageBook = part.nearest(DetailSectionPart.class);
FormPart currentPage = pageBook.getCurrentPage();
Element element = currentPage.getLocalModelElement();
return element.nearest(Notification.class);
}
SapphirePart spPart = context.part();
Element element = spPart.getLocalModelElement();
return element.nearest(Notification.class);
}
use of org.eclipse.sapphire.Element in project liferay-ide by liferay.
the class ListSelectionEditHandler method run.
@Override
protected Object run(Presentation context) {
Object retval = null;
ListSelectionService selectionService = getSelectionService();
if (selectionService != null) {
List<Element> selection = selectionService.selection();
retval = edit(selection.get(0), context);
}
return retval;
}
use of org.eclipse.sapphire.Element in project liferay-ide by liferay.
the class NotificationsListAddActionHandler method run.
@Override
protected Object run(Presentation context) {
Element newElement = (Element) super.run(context);
ActionNotification newNotification = newElement.nearest(ActionNotification.class);
addNotificationDefaults(newNotification);
return newNotification;
}
use of org.eclipse.sapphire.Element in project liferay-ide by liferay.
the class ActionsDiagramNodeEditHandlerFactory method dispose.
@Override
public void dispose() {
super.dispose();
Element element = getElement();
element.detach(_listener, getListPropertyName());
}
Aggregations