Search in sources :

Example 11 with Listener

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

the class GroupIdDefaultValueService method initDefaultValueService.

@Override
protected void initDefaultValueService() {
    super.initDefaultValueService();
    Listener listener = new FilteredListener<PropertyContentEvent>() {

        @Override
        protected void handleTypedEvent(PropertyContentEvent event) {
            refresh();
        }
    };
    NewLiferayPluginProjectOp op = _op();
    op.getLocation().attach(listener);
    op.getProjectName().attach(listener);
}
Also used : FilteredListener(org.eclipse.sapphire.FilteredListener) PropertyContentEvent(org.eclipse.sapphire.PropertyContentEvent) FilteredListener(org.eclipse.sapphire.FilteredListener) Listener(org.eclipse.sapphire.Listener) NewLiferayPluginProjectOp(com.liferay.ide.project.core.model.NewLiferayPluginProjectOp)

Example 12 with Listener

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

the class PluginTypeValidationService method initValidationService.

@Override
protected void initValidationService() {
    super.initValidationService();
    Listener listener = new FilteredListener<PropertyContentEvent>() {

        @Override
        protected void handleTypedEvent(PropertyContentEvent event) {
            refresh();
        }
    };
    NewLiferayPluginProjectOp op = _op();
    op.getProjectProvider().attach(listener);
}
Also used : FilteredListener(org.eclipse.sapphire.FilteredListener) PropertyContentEvent(org.eclipse.sapphire.PropertyContentEvent) FilteredListener(org.eclipse.sapphire.FilteredListener) Listener(org.eclipse.sapphire.Listener) NewLiferayPluginProjectOp(com.liferay.ide.project.core.model.NewLiferayPluginProjectOp)

Example 13 with Listener

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

the class ColumnImageService method initImageService.

@Override
protected void initImageService() {
    _listener = new FilteredListener<PropertyEvent>() {

        @Override
        protected void handleTypedEvent(PropertyEvent event) {
            refresh();
        }
    };
    context(Element.class).attach(_listener, Column.PROP_PRIMARY.name());
    attach(new Listener() {

        @Override
        public void handle(Event event) {
            if (event instanceof DisposeEvent) {
                context(Element.class).detach(_listener, Column.PROP_PRIMARY.name());
            }
        }
    });
}
Also used : 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)

Example 14 with Listener

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

the class AddFilesFromOSGiBundleAction method init.

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

        @Override
        protected void handleTypedEvent(PropertyContentEvent event) {
            refreshEnablementState();
        }
    };
    element.attach(listener, NewModuleFragmentOp.PROP_HOST_OSGI_BUNDLE.name());
    attach(new Listener() {

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

Example 15 with Listener

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

the class ScriptPropertyEditorCondition method initCondition.

@Override
protected void initCondition(ISapphirePart part, String parameter) {
    super.initCondition(part, parameter);
    /*
		 * TODO replace with visible when
		 *
		 * SapphireIfElseDirectiveDef ifDef =
		 * this.getPart().definition().nearest( SapphireIfElseDirectiveDef.class
		 * );
		 *
		 * String param = ifDef.getConditionParameter().content();
		 *
		 * for( ScriptLanguageType type :
		 * ScriptLanguageType.class.getEnumConstants() ) { if(
		 * type.name().equals( param ) ) { this.paramType = type; break; } }
		 */
    Scriptable scriptable = _scriptable();
    Listener listener = new FilteredListener<PropertyContentEvent>() {

        @Override
        protected void handleTypedEvent(PropertyContentEvent event) {
            ScriptPropertyEditorCondition.this.updateConditionState();
        }
    };
    scriptable.attach(listener, "ScriptLanguage");
}
Also used : FilteredListener(org.eclipse.sapphire.FilteredListener) PropertyContentEvent(org.eclipse.sapphire.PropertyContentEvent) FilteredListener(org.eclipse.sapphire.FilteredListener) Listener(org.eclipse.sapphire.Listener) Scriptable(com.liferay.ide.kaleo.core.model.Scriptable)

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