This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.ArrayDeque; | |
import java.util.Collection; | |
import java.util.HashMap; | |
import java.util.Map; | |
import java.util.Set; | |
import java.util.stream.Collectors; | |
public class VersionedMap<KEY,VALUE> implements Map<KEY,VALUE> { | |
private Map<KEY, ArrayDeque<VALUE>> store = new HashMap<>(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright 2000-2021 Vaadin Ltd. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); you may not | |
* use this file except in compliance with the License. You may obtain a copy of | |
* the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.tatu.vaadin20.components.simplecombo; | |
import java.util.List; | |
import java.util.Objects; | |
import java.util.stream.Collectors; | |
import com.vaadin.flow.component.AttachEvent; | |
import com.vaadin.flow.component.ComponentEventListener; | |
import com.vaadin.flow.component.DetachEvent; | |
import com.vaadin.flow.component.HasHelper; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.tatu.vaadin20.components; | |
import com.vaadin.flow.component.Component; | |
import com.vaadin.flow.component.Html; | |
import com.vaadin.flow.dom.Element; | |
import com.vaadin.flow.dom.ShadowRoot; | |
public class CustomComponent extends Component { | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MyTextArea extends TextArea { | |
int position; | |
public MyTextArea() { | |
getElement().addEventListener("keyup", event -> { | |
getElement().executeJs("return this.inputElement.selectionStart").then(Integer.class, pos -> { | |
position = pos; | |
System.out.println(position); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.tatu.vaadin20.views; | |
import com.vaadin.flow.component.button.Button; | |
import com.vaadin.flow.component.customfield.CustomField; | |
import com.vaadin.flow.component.html.Span; | |
import com.vaadin.flow.component.orderedlayout.VerticalLayout; | |
import com.vaadin.flow.component.textfield.TextField; | |
import com.vaadin.flow.data.binder.Binder; | |
import com.vaadin.flow.router.Route; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.vaadin.tatu; | |
/* | |
* Dependencies to pom.xml | |
* | |
* <dependency> | |
* <groupId>org.vaadin.artur.exampledata</groupId> | |
* <artifactId>exampledata</artifactId> | |
* <version>1.1.0</version> | |
* </dependency> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function loadingIndicator(percent : number) : void { | |
const indicator = document.getElementsByClassName("v-loading-indicator")[0] as HTMLElement; | |
if (percent > 0) { | |
indicator.style.display = "block"; | |
indicator.style.opacity = "1"; | |
indicator.style.animation = "unset"; | |
indicator.style.width = percent+"%"; | |
} else { | |
indicator.style.display = "none"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vaadin-tabs[theme~="binder"] > vaadin-tab { | |
background: var(--lumo-contrast-10pct); | |
} | |
vaadin-tabs[theme~="binder"][orientation="horizontal"] > vaadin-tab { | |
border: 1px solid var(--lumo-contrast-30pct); | |
border-bottom: none; | |
border-top-left-radius: var(--lumo-border-radius-m); | |
border-top-right-radius: var(--lumo-border-radius-m); | |
} |
OlderNewer