1 19 20 package org.netbeans.modules.websvc.wsitconf.ui.service.profiles; 21 22 import java.awt.Dialog ; 23 import javax.swing.JPanel ; 24 import javax.swing.undo.UndoManager ; 25 import org.netbeans.modules.websvc.wsitconf.spi.SecurityProfile; 26 import org.netbeans.modules.websvc.wsitconf.ui.ComboConstants; 27 import org.netbeans.modules.websvc.wsitconf.util.UndoCounter; 28 import org.netbeans.modules.websvc.wsitconf.wsdlmodelext.ProfilesModelHelper; 29 import org.netbeans.modules.websvc.wsitconf.wsdlmodelext.SecurityPolicyModelHelper; 30 import org.netbeans.modules.xml.wsdl.model.WSDLComponent; 31 import org.netbeans.modules.xml.wsdl.model.WSDLModel; 32 import org.openide.DialogDescriptor; 33 import org.openide.DialogDisplayer; 34 35 40 public class SAMLAuthorizationOverSSLProfile extends SecurityProfile { 41 42 public int getId() { 43 return 50; 44 } 45 46 public String getDisplayName() { 47 return ComboConstants.PROF_SAMLSSL; 48 } 49 50 public String getDescription() { 51 return ComboConstants.PROF_SAMLSSL_INFO; 52 } 53 54 57 public void profileSelected(WSDLComponent component) { 58 ProfilesModelHelper.setSecurityProfile(component, getDisplayName()); 59 } 60 61 64 public void profileDeselected(WSDLComponent component) { 65 SecurityPolicyModelHelper.disableSecurity(component, false); 66 } 67 68 71 public boolean isCurrentProfile(WSDLComponent component) { 72 return getDisplayName().equals(ProfilesModelHelper.getWSITSecurityProfile(component)); 73 } 74 75 @Override () 76 public void displayConfig(WSDLComponent component, UndoManager undoManager) { 77 UndoCounter undoCounter = new UndoCounter(); 78 WSDLModel model = component.getModel(); 79 80 model.addUndoableEditListener(undoCounter); 81 82 JPanel profConfigPanel = new SAMLAuthorizationOverSSL(component); 83 DialogDescriptor dlgDesc = new DialogDescriptor(profConfigPanel, getDisplayName()); 84 Dialog dlg = DialogDisplayer.getDefault().createDialog(dlgDesc); 85 86 dlg.setVisible(true); 87 if (dlgDesc.getValue() == dlgDesc.CANCEL_OPTION) { 88 for (int i=0; i<undoCounter.getCounter();i++) { 89 if (undoManager.canUndo()) { 90 undoManager.undo(); 91 } 92 } 93 } 94 95 model.removeUndoableEditListener(undoCounter); 96 } 97 } 98 | Popular Tags |