use of com.att.aro.ui.view.menu.datacollector.IOSStepsDialog in project VideoOptimzer by attdevsupport.
the class DataCollectorSelectNStartDialog method startButtonActionListener.
private ActionListener startButtonActionListener() {
return new ActionListener() {
@Override
public void actionPerformed(ActionEvent arg0) {
LOG.debug("Button.start");
String traceFolderName = traceFolderNameField.getText();
AttnrRadioGroupPanel radioGP = getDeviceOptionPanel().getAttnrGroup().getAttnrRadioGP();
if (radioGP.getSliderBtn().isSelected()) {
boolean isAttenuateSelected = radioGP.getThroughputPanel().getDownloadCheckBox().isSelected() || radioGP.getThroughputPanel().getUploadCheckBox().isSelected();
if (!isAttenuateSelected) {
LOG.info("need to set at least one DL or UL for the throttle");
proceed = false;
showAttenuationError();
return;
}
}
boolean secureOrAttnEnabled = deviceOptionPanel.getAttnrGroup().getAttnrRadioGP().getSliderBtn().isSelected();
if (deviceTablePanel.getSelection().isPlatform(Platform.iOS)) {
if (deviceTablePanel.getSelection().getProductName() == null || deviceTablePanel.getSelection().getModel() == null) {
JOptionPane.showMessageDialog(DataCollectorSelectNStartDialog.this, ResourceBundleHelper.getMessageString("Error.app.nolibimobiledevice"), MessageFormat.format(ResourceBundleHelper.getMessageString("Error.app.noprerequisitelib"), ApplicationConfig.getInstance().getAppShortName()), JOptionPane.ERROR_MESSAGE);
return;
}
if (secureOrAttnEnabled && (!deviceOptionPanel.isSharedNetworkActive())) {
new IOSStepsDialog(DataCollectorSelectNStartDialog.this);
return;
}
}
// don't allow whitespace
traceFolderName = traceFolderName.replaceAll("\\s", "");
if (!traceFolderName.isEmpty()) {
proceed = true;
if (traceFolderNameField.getText() != null) {
if (isContainsSpecialCharacterorSpace(traceFolderNameField.getText())) {
JOptionPane.showMessageDialog(getCollectorDialogComponent(), ResourceBundleHelper.getMessageString("Error.specialchar"), MessageFormat.format(ResourceBundleHelper.getMessageString("aro.title.short"), ApplicationConfig.getInstance().getAppShortName()), JOptionPane.ERROR_MESSAGE);
return;
} else if (traceFolderNameField.getText().toString().length() > TRACE_FOLDER_ALLOWED_LENGTH) {
JOptionPane.showMessageDialog(getCollectorDialogComponent(), ResourceBundleHelper.getMessageString("Error.tracefolderlength"), MessageFormat.format(ResourceBundleHelper.getMessageString("aro.title.short"), ApplicationConfig.getInstance().getAppShortName()), JOptionPane.ERROR_MESSAGE);
return;
} else {
DataCollectorSelectNStartDialog.this.dispose();
}
}
} else {
LOG.info("traceFolderName is blank");
proceed = false;
JOptionPane.showMessageDialog(getCollectorDialogComponent(), ResourceBundleHelper.getMessageString("Error.tracefolderempty"), MessageFormat.format(ResourceBundleHelper.getMessageString("aro.title.short"), ApplicationConfig.getInstance().getAppShortName()), JOptionPane.ERROR_MESSAGE);
traceFolderNameField.requestFocus();
}
if (deviceTablePanel.getSelection().isPlatform(Platform.Android) && !((AROAndroidDevice) deviceTablePanel.getSelection()).isAPKInstalled()) {
if (MessageDialogFactory.showConfirmDialog(getCollectorDialogComponent(), ResourceBundleHelper.getMessageString("Message.permissions.warning"), MessageFormat.format(ResourceBundleHelper.getMessageString("aro.title.short"), ApplicationConfig.getInstance().getAppShortName()), JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {
((MainFrame) getMainframeParent()).setAutoAssignPermissions(true);
} else {
((MainFrame) getMainframeParent()).setAutoAssignPermissions(false);
}
}
}
};
}
Aggregations