MCPcopy Create free account
hub / github.com/PCGen/pcgen / setVisible

Method setVisible

code/src/java/pcgen/gui2/dialog/ChooserDialog.java:137–163  ·  view source on GitHub ↗
(boolean b)

Source from the content-addressed store, hash-verified

135 }
136
137 @Override
138 public void setVisible(boolean b)
139 {
140 //
141 // Only do this if 1 entry and can add...
142 //
143 ListFacade<InfoFacade> availableList = chooser.getAvailableList();
144 if ((availableList != null) && (availableList.getSize() == 1) && (listModel.getSize() == 0) && b
145 && !chooser.isUserInput())
146 {
147 final int method = UIPropertyContext.getSingleChoiceAction();
148
149 if (method != Constants.CHOOSER_SINGLE_CHOICE_METHOD_NONE)
150 {
151 chooser.addSelected(availableList.getElementAt(0));
152
153 if (method == Constants.CHOOSER_SINGLE_CHOICE_METHOD_SELECT_EXIT)
154 {
155 chooser.commit();
156 committed = true;
157 return;
158 }
159 }
160 }
161
162 super.setVisible(b);
163 }
164
165 /**
166 * We don't want some things recalled in preferences (e.g. tree sorting) as they

Callers 1

showGeneralChooserMethod · 0.95

Calls 8

getSingleChoiceActionMethod · 0.95
getAvailableListMethod · 0.65
getSizeMethod · 0.65
isUserInputMethod · 0.65
addSelectedMethod · 0.65
getElementAtMethod · 0.65
commitMethod · 0.65
setVisibleMethod · 0.65

Tested by

no test coverage detected