Search in sources :

Example 16 with PropertyContentEvent

use of org.eclipse.sapphire.PropertyContentEvent 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)

Example 17 with PropertyContentEvent

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

the class HookXmlEditor method adaptModel.

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

        @Override
        public void handleTypedEvent(PropertyContentEvent event) {
            handleCustomJspsPropertyChangedEvent(event);
        }
    };
    _ignoreCustomModelChanges = true;
    // $NON-NLS-1$
    model.attach(listener, Hook.PROP_CUSTOM_JSPS.name() + "/*");
    _ignoreCustomModelChanges = false;
}
Also used : FilteredListener(org.eclipse.sapphire.FilteredListener) PropertyContentEvent(org.eclipse.sapphire.PropertyContentEvent) FilteredListener(org.eclipse.sapphire.FilteredListener) Listener(org.eclipse.sapphire.Listener)

Example 18 with PropertyContentEvent

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

the class ServiceImplJavaTypeConstraintService method initJavaTypeConstraintService.

@Override
protected void initJavaTypeConstraintService() {
    super.initJavaTypeConstraintService();
    Property property = context().find(Property.class);
    JavaTypeConstraint javaTypeConstraintAnnotation = property.definition().getAnnotation(JavaTypeConstraint.class);
    Set<JavaTypeKind> kind = EnumSet.noneOf(JavaTypeKind.class);
    for (JavaTypeKind k : javaTypeConstraintAnnotation.kind()) {
        kind.add(k);
    }
    _kinds = kind;
    _behavior = javaTypeConstraintAnnotation.behavior();
    _service = context(ServiceWrapper.class);
    Listener listener = new FilteredListener<PropertyContentEvent>() {

        @Override
        public void handleTypedEvent(PropertyContentEvent event) {
            refresh();
        }
    };
    _service.attach(listener, "ServiceType");
}
Also used : JavaTypeKind(org.eclipse.sapphire.java.JavaTypeKind) FilteredListener(org.eclipse.sapphire.FilteredListener) PropertyContentEvent(org.eclipse.sapphire.PropertyContentEvent) JavaTypeConstraint(org.eclipse.sapphire.java.JavaTypeConstraint) ServiceWrapper(com.liferay.ide.hook.core.model.ServiceWrapper) FilteredListener(org.eclipse.sapphire.FilteredListener) Listener(org.eclipse.sapphire.Listener) Property(org.eclipse.sapphire.Property)

Example 19 with PropertyContentEvent

use of org.eclipse.sapphire.PropertyContentEvent 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)

Example 20 with PropertyContentEvent

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

the class SDKImportDerivedValueService method initDerivedValueService.

@Override
protected void initDerivedValueService() {
    super.initDerivedValueService();
    _listener = new FilteredListener<PropertyContentEvent>() {

        @Override
        protected void handleTypedEvent(PropertyContentEvent event) {
            refresh();
        }
    };
    ParentSDKProjectImportOp op = _op();
    op.property(ParentSDKProjectImportOp.PROP_SDK_LOCATION).attach(_listener);
}
Also used : PropertyContentEvent(org.eclipse.sapphire.PropertyContentEvent) ParentSDKProjectImportOp(com.liferay.ide.project.core.model.ParentSDKProjectImportOp)

Aggregations

PropertyContentEvent (org.eclipse.sapphire.PropertyContentEvent)25 FilteredListener (org.eclipse.sapphire.FilteredListener)14 Listener (org.eclipse.sapphire.Listener)14 NewLiferayPluginProjectOp (com.liferay.ide.project.core.model.NewLiferayPluginProjectOp)10 Assignable (com.liferay.ide.kaleo.core.model.Assignable)2 NewLiferayProfile (com.liferay.ide.project.core.model.NewLiferayProfile)2 Element (org.eclipse.sapphire.Element)2 Event (org.eclipse.sapphire.Event)2 Property (org.eclipse.sapphire.Property)2 PropertyDef (org.eclipse.sapphire.PropertyDef)2 ServiceWrapper (com.liferay.ide.hook.core.model.ServiceWrapper)1 Scriptable (com.liferay.ide.kaleo.core.model.Scriptable)1 Task (com.liferay.ide.kaleo.core.model.Task)1 User (com.liferay.ide.kaleo.core.model.User)1 PortletApp (com.liferay.ide.portlet.core.model.PortletApp)1 ParentSDKProjectImportOp (com.liferay.ide.project.core.model.ParentSDKProjectImportOp)1 SDKProjectsImportOp (com.liferay.ide.project.core.model.SDKProjectsImportOp)1 CoreException (org.eclipse.core.runtime.CoreException)1 DisposeEvent (org.eclipse.sapphire.DisposeEvent)1 PossibleValuesService (org.eclipse.sapphire.PossibleValuesService)1