Search in sources :

Example 1 with ElementDisposeEvent

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

the class WindowStatesPossibleValueService method initPossibleValuesService.

@Override
protected void initPossibleValuesService() {
    super.initPossibleValuesService();
    PortletApp portletApp = context(PortletApp.class);
    Listener listener = new FilteredListener<PropertyContentEvent>() {

        @Override
        protected void handleTypedEvent(PropertyContentEvent event) {
            refreshValues();
        }
    };
    portletApp.attach(listener, PortletApp.PROP_CUSTOM_WINDOW_STATES.name());
    refreshValues();
    portletApp.attach(new FilteredListener<ElementDisposeEvent>() {

        @Override
        protected void handleTypedEvent(ElementDisposeEvent event) {
            portletApp.detach(listener, PortletApp.PROP_CUSTOM_WINDOW_STATES.name());
        }
    });
    this.initialized = true;
}
Also used : FilteredListener(org.eclipse.sapphire.FilteredListener) PropertyContentEvent(org.eclipse.sapphire.PropertyContentEvent) FilteredListener(org.eclipse.sapphire.FilteredListener) Listener(org.eclipse.sapphire.Listener) ElementDisposeEvent(org.eclipse.sapphire.modeling.ElementDisposeEvent) PortletApp(com.liferay.ide.portlet.core.model.PortletApp)

Aggregations

PortletApp (com.liferay.ide.portlet.core.model.PortletApp)1 FilteredListener (org.eclipse.sapphire.FilteredListener)1 Listener (org.eclipse.sapphire.Listener)1 PropertyContentEvent (org.eclipse.sapphire.PropertyContentEvent)1 ElementDisposeEvent (org.eclipse.sapphire.modeling.ElementDisposeEvent)1