container.setActiveProfile( selectedProfile );
listViewer.refresh( true );
+
+ validatePreferencePage();
}
}
protected void validatePreferencePage() {
setValid(true);
+ setMessage( null );
setErrorMessage(null);
- for ( SigningProfile profile : container.getProfiles() ) {
- for ( SigningProfileItem item : profile.getProfileItems() ) {
+ SigningProfile activeProfile = container.getActiveProfile();
+ if ( activeProfile == null ) {
+ setMessage( "Set an active profile", WARNING );
+ } else {
+ for ( SigningProfileItem item : activeProfile.getProfileItems() ) {
+
if ( item == null ) {
continue;
}
- checkFile( item.getKeyLocation(), KeyExtension.p12.name() );
-
- checkFile( item.getCAPath(), "cer" );
- checkFile( item.getRootCAPath(), "cer" );
+ String keyLocation = item.getKeyLocation();
+ checkFile( keyLocation, KeyExtension.p12.name() );
+ if ( ! StringUtil.isEmpty( keyLocation ) ) {
+ checkFile( item.getCAPath(), "cer" );
+ checkFile( item.getRootCAPath(), "cer" );
+ }
}
}
}
createTextWithBrowse( composite, ItemDataKey.keyPath, filterExt_p12, true );
createPasswordText( composite, ItemDataKey.password );
- createTextWithBrowse( composite, ItemDataKey.caPath, filterExt_cer, this.bEnableCA );
+ createTextWithBrowse( composite, ItemDataKey.caPath, filterExt_cer, true );
createTextWithBrowse( composite, ItemDataKey.rootCaPath, filterExt_cer, this.bEnableCA );
return composite;