Skip to content

Instantly share code, notes, and snippets.

View yateam's full-sized avatar

Dmitriy Kukharev yateam

View GitHub Profile
@yateam
yateam / SGreetings.cpp
Created July 19, 2021 14:19
Slate UI Widget implementation
#include "SGreetings.h"
#include "SlateOptMacros.h"
#include "Widgets/Input/SEditableTextBox.h"
#define LOCTEXT_NAMESPACE "SGreetings"
const TArray<FText> SGreetings::Titles =
{
LOCTEXT("Mr", "Mr."),
LOCTEXT("Mrs", "Mrs."),
div(
id(widget.getRenderId()),
classNames(getWidgetTypeCssClass(widget), getModeClass()),
div(
title(widget.getTooltip()),
className("gw-header--icon"),
event(getMode() == Mode.ACTION, Tag.Event.CLICK, "id:" + widget.getRenderId()),
!Strings.isNullOrEmpty(icon.getSource()) ?
img().src(icon.getSource()) :
text(widget.getLabel())),
div()
.className("gw-CardViewWidget--tabbar")
.__(
getWidget().getChildren(CardWidget.class).stream().map(card ->
div()
.id(card.getRenderId())
.className("gw-CardViewWidget--tab")
.className(card.isCurrent(), "gw-active")
.event(Tag.Event.CLICK, "fireEvent")
.__(
div()
.withClass("gw-CardViewWidget--tabbar")
.with(
getWidget().getChildren(CardWidget.class).stream().map(card ->
div()
.withId(card.getRenderId())
.withClass("gw-CardViewWidget--tab")
.withCondClass(card.isCurrent(), "gw-active")
.withData("gw-click", "fireEvent")
.with(
@yateam
yateam / ContentBuilder.java
Last active December 22, 2016 23:38
Html Builder pattern
package template;
public class ContentBuilder extends ElementBuilder {
private String content;
public ContentBuilder(String content) {
this.content = content;
}
@Override
public String build() {