Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ types.d.ts
/frontend/index.html
vite.generated.ts
/src/main/dev-bundle
/src/main/bundles
/src/main/frontend/generated
/src/main/frontend/index.html
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.flowingcode.vaadin.addons</groupId>
<artifactId>twincolgrid</artifactId>
<version>3.1.1-SNAPSHOT</version>
<version>3.2.0-SNAPSHOT</version>
<name>TwinColGrid add-on</name>
<description>Dual list component based on Vaadin Grids</description>
<url>https://www.flowingcode.com/en/open-source/</url>
Expand Down
49 changes: 49 additions & 0 deletions src/main/java/com/flowingcode/vaadin/addons/twincolgrid/Label.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*-
* #%L
* TwinColGrid add-on
* %%
* Copyright (C) 2017 - 2025 Flowing Code
* %%
* 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
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
package com.flowingcode.vaadin.addons.twincolgrid;

import com.vaadin.flow.component.Component;
import com.vaadin.flow.component.HasStyle;
import com.vaadin.flow.component.HasText;
import com.vaadin.flow.component.Tag;
import com.vaadin.flow.component.Text;

@Tag(Tag.LABEL)
class Label extends Component implements HasText, HasStyle {

public Label() {}

public Label(String text) {
getElement().appendChild(new Text(text).getElement());
}

public void setFor(Component forComponent) {
if (forComponent == null) {
throw new IllegalArgumentException("The provided component cannot be null");
}
setFor(forComponent.getId()
.orElseThrow(() -> new IllegalArgumentException("The provided component must have an id")));
}

public void setFor(String forId) {
getElement().setAttribute("for", forId);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
import com.vaadin.flow.component.grid.HeaderRow;
import com.vaadin.flow.component.grid.dnd.GridDropLocation;
import com.vaadin.flow.component.grid.dnd.GridDropMode;
import com.vaadin.flow.component.html.Label;
import com.vaadin.flow.component.html.Span;
import com.vaadin.flow.component.icon.VaadinIcon;
import com.vaadin.flow.component.orderedlayout.HorizontalLayout;
Expand Down