use of com.liferay.ide.kaleo.core.model.Notification in project liferay-ide by liferay.
the class EditNotificationHandler method edit.
@Override
public Object edit(Element modelElement, Presentation context) {
Notification notification = modelElement.nearest(Notification.class);
IKaleoEditorHelper kaleoEditorHelper = KaleoUI.getKaleoEditorHelper(notification.getTemplateLanguage().text(true));
kaleoEditorHelper.openEditor(getPart(), notification, Notification.PROP_TEMPLATE);
return null;
}
use of com.liferay.ide.kaleo.core.model.Notification in project liferay-ide by liferay.
the class TemplateOpenActionHandler method run.
@Override
protected Object run(Presentation context) {
try {
Notification notification = notification(context);
IKaleoEditorHelper kaleoEditorHelper = KaleoUI.getKaleoEditorHelper(notification.getTemplateLanguage().text(true));
kaleoEditorHelper.openEditor(context.part(), notification, Notification.PROP_TEMPLATE);
} catch (Exception e) {
KaleoUI.logError("Could not open template editor.", e);
}
return null;
}
use of com.liferay.ide.kaleo.core.model.Notification in project liferay-ide by liferay.
the class NotificationsDiagramNodeEditHandlerFactory method create.
@Override
public List<SapphireActionHandler> create() {
ListFactory<SapphireActionHandler> factory = ListFactory.start();
Element element = getElement();
if (element == null) {
return factory.result();
}
List<ActionNotification> notifications = getNotifications();
if (_listener == null) {
_listener = new FilteredListener<PropertyEvent>() {
@Override
public void handleTypedEvent(PropertyEvent event) {
broadcast(new Event());
}
};
}
element.attach(_listener, getListPropertyName());
for (Notification notification : notifications) {
notification.getName().attach(_listener);
factory.add(new TemplateOpenActionHandler() {
@Override
public void init(SapphireAction sapphireAction, ActionHandlerDef def) {
super.init(sapphireAction, def);
String name = notification.getName().content(true);
setLabel(empty(name) ? "<null>" : name);
addImage(ActionNotification.TYPE.image());
}
@Override
protected Notification notification(Presentation context) {
return notification;
}
});
}
return factory.result();
}
Aggregations