Search in sources :

Example 31 with Element

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();
}
Also used : Element(org.eclipse.sapphire.Element) DiagramConnectionPart(org.eclipse.sapphire.ui.diagram.DiagramConnectionPart) CanTransition(com.liferay.ide.kaleo.core.model.CanTransition) Transition(com.liferay.ide.kaleo.core.model.Transition) WorkflowNode(com.liferay.ide.kaleo.core.model.WorkflowNode) DiagramNodePart(org.eclipse.sapphire.ui.diagram.editor.DiagramNodePart) DiagramNodeBounds(org.eclipse.sapphire.ui.diagram.editor.DiagramNodeBounds)

Example 32 with Element

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);
}
Also used : FormPart(org.eclipse.sapphire.ui.forms.FormPart) Element(org.eclipse.sapphire.Element) ISapphirePart(org.eclipse.sapphire.ui.ISapphirePart) DetailSectionPart(org.eclipse.sapphire.ui.forms.DetailSectionPart) SapphirePart(org.eclipse.sapphire.ui.SapphirePart) ISapphirePart(org.eclipse.sapphire.ui.ISapphirePart)

Example 33 with Element

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;
}
Also used : Element(org.eclipse.sapphire.Element) ListSelectionService(org.eclipse.sapphire.ui.ListSelectionService)

Example 34 with Element

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;
}
Also used : Element(org.eclipse.sapphire.Element) ActionNotification(com.liferay.ide.kaleo.core.model.ActionNotification) TaskActionNotification(com.liferay.ide.kaleo.core.model.TaskActionNotification)

Example 35 with Element

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());
}
Also used : Element(org.eclipse.sapphire.Element)

Aggregations

Element (org.eclipse.sapphire.Element)58 IProject (org.eclipse.core.resources.IProject)13 IFile (org.eclipse.core.resources.IFile)12 Property (org.eclipse.sapphire.Property)8 ValueProperty (org.eclipse.sapphire.ValueProperty)8 IPath (org.eclipse.core.runtime.IPath)7 Event (org.eclipse.sapphire.Event)6 PropertyEvent (org.eclipse.sapphire.PropertyEvent)6 FilteredListener (org.eclipse.sapphire.FilteredListener)5 Listener (org.eclipse.sapphire.Listener)5 Path (org.eclipse.sapphire.modeling.Path)5 IType (org.eclipse.jdt.core.IType)4 JavaModelException (org.eclipse.jdt.core.JavaModelException)4 DisposeEvent (org.eclipse.sapphire.DisposeEvent)4 SapphirePart (org.eclipse.sapphire.ui.SapphirePart)4 Task (com.liferay.ide.kaleo.core.model.Task)3 DynamicElement (com.liferay.ide.portal.core.structures.model.DynamicElement)3 ArrayList (java.util.ArrayList)3 IWorkspaceRoot (org.eclipse.core.resources.IWorkspaceRoot)3 IClasspathEntry (org.eclipse.jdt.core.IClasspathEntry)3