private void appendMessage(final String message) { WidgetUtils.invokeSwingAction(() -> _executionLogTextArea.append(message)); }
/** * Cancels the file download. * * @param hideWindowImmediately * determines if the download progress window should be hidden * immediately or only when the progress of cancelling the * download has occurred gracefully. */ public void cancelDownload(final boolean hideWindowImmediately) { logger.info("Cancel of download requested"); _cancelled = true; if (hideWindowImmediately && _downloadProgressWindow != null) { WidgetUtils.invokeSwingAction(_downloadProgressWindow::close); } }
/** * Sets the value of the progress bar, if the new value is greater than the * previous value. * * @param newValue * @return whether or not the value was greater, and thus updated */ public boolean setValueIfGreater(final int newValue) { final boolean greater = _value.setIfSignificantToUser(newValue); if (greater) { WidgetUtils.invokeSwingAction(() -> DCProgressBar.super.setValue(newValue)); } return greater; }
@Override public void open() { WidgetUtils.invokeSwingAction(() -> { if ("true".equals(System.getProperty(SYSTEM_PROPERTY_HIDE_WINDOWS))) { // simulate that the window has opened. initialize(); return; } setVisible(true); }); }
@Override public void componentSuccess(final AnalysisJob job, final ComponentJob componentJob, final AnalyzerResult result) { final StringBuilder sb = new StringBuilder(); sb.append("Component "); sb.append(LabelUtils.getLabel(componentJob)); sb.append(" finished."); if (result == null) { _progressInformationPanel.addUserLog(sb.toString()); } else { sb.append(" Adding result..."); _progressInformationPanel.addUserLog(sb.toString()); WidgetUtils.invokeSwingAction(() -> addResult(componentJob, result)); } }
@Override public void uncaughtException(final Thread t, final Throwable e) { if (isIgnoreIssue(e)) { logger.debug("Ignoring uncaught exception", e); return; } if (e instanceof RestrictedFunctionalityException) { logger.debug("Handling restricted functionality exception", e); final StringBuilder sb = new StringBuilder(e.getMessage()); final RestrictedFunctionalityCallToAction[] callToActions = ((RestrictedFunctionalityException) e).getCallToActions(); for (final RestrictedFunctionalityCallToAction callToAction : callToActions) { sb.append('\n'); sb.append(" - " + callToAction.getName() + " - " + callToAction.getHref()); } final String detailedMessage = sb.toString(); WidgetUtils .invokeSwingAction(() -> WidgetUtils.showErrorMessage("Restricted functionality", detailedMessage)); return; } logger.error("Thread " + t.getName() + " threw uncaught exception", e); WidgetUtils.invokeSwingAction(() -> WidgetUtils.showErrorMessage("Unexpected error!", e)); }
@Override public void jobSuccess(final AnalysisJob job, final AnalysisJobMetrics metrics) { WidgetUtils.invokeSwingAction(() -> { updateButtonVisibility(false); _progressInformationPanel.onSuccess(); if (_tabbedPane.getTabCount() > 1) { // switch to the first available result panel _tabbedPane.setSelectedIndex(1); } }); }
public void addProgressBar(final Table table, final int expectedRows) { final TableProgressInformationPanel tableProgressInformationPanel = getTableProgressInformationPanel(table, expectedRows); WidgetUtils.invokeSwingAction(() -> { _progressBarPanel.add(tableProgressInformationPanel); tableProgressInformationPanel.setProgressMaximum(expectedRows); _progressBarPanel.updateUI(); }); }
@Override public void onDescriptorsUpdated(final DescriptorProvider descriptorProvider) { WidgetUtils.invokeSwingAction(() -> { final TreeNode root = (TreeNode) getModel().getRoot(); final DefaultMutableTreeNode libraryNode = (DefaultMutableTreeNode) root.getChildAt(1); libraryNode.removeAllChildren(); createLibrary(libraryNode); final DefaultTreeModel model = (DefaultTreeModel) getModel(); model.reload(libraryNode); expandStandardPaths(); }); }
final Table table = metrics.getTable(); WidgetUtils.invokeSwingAction(() -> { final ComponentJob[] componentJobs = metrics.getResultProducers();
WidgetUtils.invokeSwingAction(() -> { if (_tabbedPane.getTabCount() > 1) {
WidgetUtils.invokeSwingAction(() -> { final WelcomeDialog welcomeDialog = new WelcomeDialog(analysisJobBuilderWindow, welcomeImage); welcomeDialog.setVisible(true);