Search in sources :

Example 1 with Listener

use of org.eclipse.sapphire.Listener in project liferay-ide by liferay.

the class CreateDirectoryActionHandler method init.

@Override
public void init(SapphireAction action, ActionHandlerDef def) {
    super.init(action, def);
    Element element = getModelElement();
    ValueProperty property = (ValueProperty) property().definition();
    Listener listener = new FilteredListener<PropertyEvent>() {

        @Override
        public void handleTypedEvent(PropertyEvent event) {
            refreshEnablementState();
        }
    };
    element.attach(listener, property.name());
    attach(new Listener() {

        @Override
        public void handle(Event event) {
            if (event instanceof DisposeEvent) {
                element.detach(listener, property.name());
            }
        }
    });
}
Also used : FilteredListener(org.eclipse.sapphire.FilteredListener) FilteredListener(org.eclipse.sapphire.FilteredListener) Listener(org.eclipse.sapphire.Listener) Element(org.eclipse.sapphire.Element) Event(org.eclipse.sapphire.Event) DisposeEvent(org.eclipse.sapphire.DisposeEvent) PropertyEvent(org.eclipse.sapphire.PropertyEvent) PropertyEvent(org.eclipse.sapphire.PropertyEvent) DisposeEvent(org.eclipse.sapphire.DisposeEvent) ValueProperty(org.eclipse.sapphire.ValueProperty)

Example 2 with Listener

use of org.eclipse.sapphire.Listener in project liferay-ide by liferay.

the class CustomJspsEnablementService method initEnablementService.

@Override
protected void initEnablementService() {
    Listener listener = new FilteredListener<PropertyEvent>() {

        protected void handleTypedEvent(PropertyEvent event) {
            refresh();
        }
    };
    ElementHandle<Element> element = _hook().property(Hook.PROP_CUSTOM_JSP_DIR);
    element.attach(listener, CustomJspDir.PROP_VALUE.name());
}
Also used : FilteredListener(org.eclipse.sapphire.FilteredListener) FilteredListener(org.eclipse.sapphire.FilteredListener) Listener(org.eclipse.sapphire.Listener) Element(org.eclipse.sapphire.Element) PropertyEvent(org.eclipse.sapphire.PropertyEvent)

Example 3 with Listener

use of org.eclipse.sapphire.Listener in project liferay-ide by liferay.

the class LayoutTplEditor method createModel.

@Override
protected Element createModel() {
    IFile file = getFile();
    _bootstrapStyle = _isBootstrapStyle();
    _is62 = _is62();
    LayoutTplElement layoutTpl = LayoutTplElementsFactory.INSTANCE.newLayoutTplFromFile(file, _bootstrapStyle, _is62);
    if (layoutTpl == null) {
        layoutTpl = createEmptyDiagramModel();
    }
    Listener listener = new Listener() {

        @Override
        public void handle(Event event) {
            setDesignPageChanged(true);
            firePropertyChange(PROP_DIRTY);
        }
    };
    layoutTpl.attach(listener, "*");
    return layoutTpl;
}
Also used : IFile(org.eclipse.core.resources.IFile) IModelStateListener(org.eclipse.wst.sse.core.internal.provisional.IModelStateListener) Listener(org.eclipse.sapphire.Listener) Event(org.eclipse.sapphire.Event) LayoutTplElement(com.liferay.ide.layouttpl.core.model.LayoutTplElement)

Example 4 with Listener

use of org.eclipse.sapphire.Listener in project liferay-ide by liferay.

the class TaskScriptedAssignmentCondition method initCondition.

@Override
protected void initCondition(ISapphirePart part, String parameter) {
    super.initCondition(part, parameter);
    Task task = _task();
    Listener assignmentTypeListener = new FilteredListener<PropertyContentEvent>() {

        @Override
        public void handleTypedEvent(PropertyContentEvent event) {
            updateConditionState();
        }
    };
    if (task != null) {
        task.attach(assignmentTypeListener, Task.PROP_SCRIPTED_ASSIGNMENT.name());
    }
    updateConditionState();
}
Also used : FilteredListener(org.eclipse.sapphire.FilteredListener) PropertyContentEvent(org.eclipse.sapphire.PropertyContentEvent) Task(com.liferay.ide.kaleo.core.model.Task) FilteredListener(org.eclipse.sapphire.FilteredListener) Listener(org.eclipse.sapphire.Listener)

Example 5 with Listener

use of org.eclipse.sapphire.Listener in project liferay-ide by liferay.

the class WorkflowDefinitionLayoutPersistenceService method _addDiagramPartListener.

private void _addDiagramPartListener() {
    _diagramPartListener = new Listener() {

        @Override
        public void handle(Event event) {
            if (event instanceof DiagramNodeEvent) {
                DiagramNodeEvent nodeEvent = (DiagramNodeEvent) event;
                _handleDiagramNodeEvent(nodeEvent);
            } else if (event instanceof DiagramPageEvent) {
                DiagramPageEvent pageEvent = (DiagramPageEvent) event;
                _handleDiagramPageEvent(pageEvent);
            } else if (event instanceof PreAutoLayoutEvent) {
                _autoLayout = true;
            } else if (event instanceof PostAutoLayoutEvent) {
                _autoLayout = false;
            } else if (event instanceof ConnectionAddEvent) {
                ConnectionAddEvent addEvent = (ConnectionAddEvent) event;
                handleConnectionAddEvent(addEvent);
            } else if (event instanceof ConnectionDeleteEvent) {
                handleConnectionDeleteEvent((ConnectionDeleteEvent) event);
            }
        }
    };
    _part().attach(_diagramPartListener);
}
Also used : ConnectionAddEvent(org.eclipse.sapphire.ui.diagram.ConnectionAddEvent) DiagramPageEvent(org.eclipse.sapphire.ui.diagram.editor.DiagramPageEvent) FilteredListener(org.eclipse.sapphire.FilteredListener) Listener(org.eclipse.sapphire.Listener) PostAutoLayoutEvent(org.eclipse.sapphire.ui.diagram.editor.SapphireDiagramEditorPagePart.PostAutoLayoutEvent) DiagramNodeAddEvent(org.eclipse.sapphire.ui.diagram.editor.DiagramNodeAddEvent) PostAutoLayoutEvent(org.eclipse.sapphire.ui.diagram.editor.SapphireDiagramEditorPagePart.PostAutoLayoutEvent) PreAutoLayoutEvent(org.eclipse.sapphire.ui.diagram.editor.SapphireDiagramEditorPagePart.PreAutoLayoutEvent) DiagramPageEvent(org.eclipse.sapphire.ui.diagram.editor.DiagramPageEvent) Event(org.eclipse.sapphire.Event) ConnectionBendpointsEvent(org.eclipse.sapphire.ui.diagram.ConnectionBendpointsEvent) DiagramNodeMoveEvent(org.eclipse.sapphire.ui.diagram.editor.DiagramNodeMoveEvent) ConnectionDeleteEvent(org.eclipse.sapphire.ui.diagram.ConnectionDeleteEvent) DiagramNodeEvent(org.eclipse.sapphire.ui.diagram.editor.DiagramNodeEvent) ConnectionAddEvent(org.eclipse.sapphire.ui.diagram.ConnectionAddEvent) PropertyEvent(org.eclipse.sapphire.PropertyEvent) DiagramNodeDeleteEvent(org.eclipse.sapphire.ui.diagram.editor.DiagramNodeDeleteEvent) DiagramNodeEvent(org.eclipse.sapphire.ui.diagram.editor.DiagramNodeEvent) ConnectionDeleteEvent(org.eclipse.sapphire.ui.diagram.ConnectionDeleteEvent) PreAutoLayoutEvent(org.eclipse.sapphire.ui.diagram.editor.SapphireDiagramEditorPagePart.PreAutoLayoutEvent)

Aggregations

Listener (org.eclipse.sapphire.Listener)23 FilteredListener (org.eclipse.sapphire.FilteredListener)20 PropertyContentEvent (org.eclipse.sapphire.PropertyContentEvent)14 Event (org.eclipse.sapphire.Event)10 Element (org.eclipse.sapphire.Element)7 PropertyEvent (org.eclipse.sapphire.PropertyEvent)6 DisposeEvent (org.eclipse.sapphire.DisposeEvent)5 NewLiferayPluginProjectOp (com.liferay.ide.project.core.model.NewLiferayPluginProjectOp)3 Property (org.eclipse.sapphire.Property)3 NewLiferayProfile (com.liferay.ide.project.core.model.NewLiferayProfile)2 PropertyDef (org.eclipse.sapphire.PropertyDef)2 ValueProperty (org.eclipse.sapphire.ValueProperty)2 ServiceWrapper (com.liferay.ide.hook.core.model.ServiceWrapper)1 Assignable (com.liferay.ide.kaleo.core.model.Assignable)1 Scriptable (com.liferay.ide.kaleo.core.model.Scriptable)1 Task (com.liferay.ide.kaleo.core.model.Task)1 LayoutTplElement (com.liferay.ide.layouttpl.core.model.LayoutTplElement)1 PortletApp (com.liferay.ide.portlet.core.model.PortletApp)1 IFile (org.eclipse.core.resources.IFile)1 ImageData (org.eclipse.sapphire.ImageData)1