| | |
| | | */ |
| | | public ChooseVersionPanel(GuiApplication application) { |
| | | super(application); |
| | | createBuildLoader(); |
| | | getBuildLoader(); |
| | | } |
| | | |
| | | /** |
| | |
| | | return getMsg("upgrade-choose-version-panel-instructions"); |
| | | } |
| | | |
| | | private RemoteBuildListComboBoxModelCreator createBuildLoader() { |
| | | private RemoteBuildListComboBoxModelCreator getBuildLoader() { |
| | | if (bld == null) { |
| | | RemoteBuildManager rbm = |
| | | ((Upgrader) getApplication()).getRemoteBuildManager(); |
| | |
| | | throws IOException |
| | | { |
| | | this.rbm = rbm; |
| | | this.in = rbm.getDailyBuildsInputStream(getMainWindow(), |
| | | "Reading build information"); |
| | | |
| | | // This is a lengthy operation that must be |
| | | // performed in the event thread. So try |
| | | // to do this work now during construction |
| | | // rather than when the panel becomes visible |
| | | // for the first time. If we fail we'll try |
| | | // again later. |
| | | try { |
| | | getInputStream(); |
| | | } catch (IOException e) { |
| | | LOG.log(Level.INFO, "Error obtaining build list input stream", e); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public java.util.List<Build> processBackgroundTask() throws Exception { |
| | | return rbm.listBuilds(in); |
| | | return rbm.listBuilds(getInputStream()); |
| | | } |
| | | |
| | | /** |
| | |
| | | }); |
| | | } |
| | | } |
| | | |
| | | private InputStream getInputStream() throws IOException { |
| | | if (this.in == null) { |
| | | this.in = rbm.getDailyBuildsInputStream(getMainWindow(), |
| | | "Reading build information"); |
| | | } |
| | | return this.in; |
| | | } |
| | | } |
| | | |
| | | } |