Search in sources :

Example 1 with PublicRenderParameter

use of com.liferay.ide.portlet.core.model.PublicRenderParameter in project liferay-ide by liferay.

the class PublicRenderParameterValuesService method compute.

/**
 * (non-Javadoc)
 *
 * @see org.eclipse.sapphire.modeling.PossibleValuesService#fillPossibleValues(java.
 *      util.SortedSet)
 */
@Override
protected void compute(Set<String> values) {
    PortletApp portletApp = context(PortletApp.class);
    ElementList<PublicRenderParameter> publicRenderParameters = portletApp.getPublicRenderParameters();
    for (PublicRenderParameter renderParameter : publicRenderParameters) {
        String indentifer = renderParameter.getIdentifier().content();
        values.add(indentifer);
    }
}
Also used : PublicRenderParameter(com.liferay.ide.portlet.core.model.PublicRenderParameter) PortletApp(com.liferay.ide.portlet.core.model.PortletApp)

Example 2 with PublicRenderParameter

use of com.liferay.ide.portlet.core.model.PublicRenderParameter in project liferay-ide by liferay.

the class QNamesPossibleValuesService method compute.

/**
 * (non-Javadoc)
 *
 * @see org.eclipse.sapphire.modeling.PossibleValuesService#fillPossibleValues(java.
 *      util.SortedSet)
 */
@Override
protected void compute(Set<String> values) {
    Element Element = context(Element.class);
    // values.add( param( "0" ) );
    PortletApp portletApp = context(Element.class).nearest(PortletApp.class);
    if (Element instanceof EventDefinitionRef) {
        ElementList<EventDefinition> eventDefs = portletApp.getEventDefinitions();
        for (EventDefinition eventDefinition : eventDefs) {
            if ((eventDefinition.getNamespaceURI().content() != null) && (eventDefinition.getLocalPart().content() != null)) {
                values.add(getQName(eventDefinition.getNamespaceURI().content(false), eventDefinition.getLocalPart().content()));
            }
        }
    } else if (Element instanceof SupportedPublicRenderParameter) {
        ElementList<PublicRenderParameter> publicRenderParameters = portletApp.getPublicRenderParameters();
        for (PublicRenderParameter publicRenderParam : publicRenderParameters) {
            if ((publicRenderParam.getNamespaceURI().content() != null) && (publicRenderParam.getLocalPart().content() != null)) {
                values.add(getQName(publicRenderParam.getNamespaceURI().content(false), publicRenderParam.getLocalPart().content()));
            }
        }
    }
}
Also used : EventDefinitionRef(com.liferay.ide.portlet.core.model.EventDefinitionRef) Element(org.eclipse.sapphire.Element) ElementList(org.eclipse.sapphire.ElementList) EventDefinition(com.liferay.ide.portlet.core.model.EventDefinition) SupportedPublicRenderParameter(com.liferay.ide.portlet.core.model.SupportedPublicRenderParameter) SupportedPublicRenderParameter(com.liferay.ide.portlet.core.model.SupportedPublicRenderParameter) PublicRenderParameter(com.liferay.ide.portlet.core.model.PublicRenderParameter) PortletApp(com.liferay.ide.portlet.core.model.PortletApp)

Aggregations

PortletApp (com.liferay.ide.portlet.core.model.PortletApp)2 PublicRenderParameter (com.liferay.ide.portlet.core.model.PublicRenderParameter)2 EventDefinition (com.liferay.ide.portlet.core.model.EventDefinition)1 EventDefinitionRef (com.liferay.ide.portlet.core.model.EventDefinitionRef)1 SupportedPublicRenderParameter (com.liferay.ide.portlet.core.model.SupportedPublicRenderParameter)1 Element (org.eclipse.sapphire.Element)1 ElementList (org.eclipse.sapphire.ElementList)1