Skip to content

Commit c0307a2

Browse files
authored
Merge pull request #244 from scijava/inputwidgets
Adds method to get InputWidget from InputPanel
2 parents a2310cc + ff3caa8 commit c0307a2

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/main/java/org/scijava/widget/AbstractInputPanel.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ public boolean supports(final InputWidget<?, ?> widget) {
6161
public void addWidget(final InputWidget<?, W> widget) {
6262
widgets.put(widget.get().getItem().getName(), widget);
6363
}
64+
65+
@Override
66+
public InputWidget<?, W> getWidget(final String name) {
67+
return widgets.get(name);
68+
}
6469

6570
@Override
6671
public Object getValue(final String name) {

src/main/java/org/scijava/widget/InputPanel.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,5 +70,8 @@ public interface InputPanel<P, W> extends UIComponent<P> {
7070

7171
/** Gets the type of the UI component housing the panel's widgets. */
7272
Class<W> getWidgetComponentType();
73+
74+
/** Gets the widget with the provided name. */
75+
InputWidget<?, W> getWidget(String name);
7376

7477
}

0 commit comments

Comments
 (0)