use of com.liferay.ide.portlet.core.model.EventDefinition in project liferay-ide by liferay.
the class DefinePortletEventHandler method run.
/**
* (non-Javadoc)
*
* @see
* SapphireActionHandler#run(org.eclipse.sapphire.ui.
* SapphireRenderingContext)
*/
@Override
protected Object run(Presentation context) {
PortletApp rootModel = (PortletApp) context.part().getModelElement();
EventDefinition eventDefintion = rootModel.getEventDefinitions().insert();
// Select the node
MasterDetailsEditorPagePart page = getPart().nearest(MasterDetailsEditorPagePart.class);
MasterDetailsContentNodePart root = page.outline().getRoot();
MasterDetailsContentNodePart node = root.findNode(eventDefintion);
if (node != null) {
node.select();
}
return eventDefintion;
}
use of com.liferay.ide.portlet.core.model.EventDefinition 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()));
}
}
}
}
Aggregations