use of org.eclipse.sapphire.ui.forms.DetailSectionPart in project liferay-ide by liferay.
the class ScriptableOpenActionHandler method scriptable.
protected Scriptable scriptable(Presentation context) {
Scriptable retval = null;
ISapphirePart part = context.part();
if (part instanceof DetailSectionPart) {
DetailSectionPart pageBook = part.nearest(DetailSectionPart.class);
FormPart currentPage = pageBook.getCurrentPage();
Element element = currentPage.getLocalModelElement();
retval = element.nearest(Scriptable.class);
} else {
Element modelElement = context.part().getLocalModelElement();
if (modelElement instanceof Task) {
Task task = modelElement.nearest(Task.class);
ElementHandle<Scriptable> scriptable = task.getScriptedAssignment();
retval = scriptable.content(false);
} else {
retval = modelElement.nearest(Scriptable.class);
}
}
return retval;
}
use of org.eclipse.sapphire.ui.forms.DetailSectionPart in project liferay-ide by liferay.
the class TemplateOpenActionHandler method notification.
protected Notification notification(Presentation context) {
ISapphirePart part = context.part();
if (part instanceof DetailSectionPart) {
DetailSectionPart pageBook = part.nearest(DetailSectionPart.class);
FormPart currentPage = pageBook.getCurrentPage();
Element element = currentPage.getLocalModelElement();
return element.nearest(Notification.class);
}
SapphirePart spPart = context.part();
Element element = spPart.getLocalModelElement();
return element.nearest(Notification.class);
}
Aggregations