✨ added parameters when adding SwingItem.List
This commit is contained in:
@@ -250,6 +250,25 @@ public record SwingItem<C extends Component>(C component) {
|
|||||||
return this.add((String) null, item);
|
return this.add((String) null, item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public <O extends Component> Builder<C> add(
|
||||||
|
@NotNull SwingItem.List<?, ?> item,
|
||||||
|
@Nullable Object constraints
|
||||||
|
) {
|
||||||
|
return this.add(item, constraints, -1);
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("rawtypes")
|
||||||
|
public <O extends Component> Builder<C> add(
|
||||||
|
@NotNull SwingItem.List<?, ?> item,
|
||||||
|
@Nullable Object constraints,
|
||||||
|
int index
|
||||||
|
) {
|
||||||
|
if (this.component instanceof JList list) {
|
||||||
|
list.add(item.panel, constraints, index);
|
||||||
|
}
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public <O extends Component> Builder<C> add(
|
public <O extends Component> Builder<C> add(
|
||||||
@Nullable String name,
|
@Nullable String name,
|
||||||
@NotNull SwingItem.List<?, ?> item
|
@NotNull SwingItem.List<?, ?> item
|
||||||
|
|||||||
Reference in New Issue
Block a user