1 16 17 package de.schlichtherle.key.passwd.swing; 18 19 import de.schlichtherle.key.*; 20 21 import java.awt.*; 22 import java.lang.ref.*; 23 24 import javax.swing.*; 25 26 49 public class PromptingKeyManager 50 extends de.schlichtherle.key.PromptingKeyManager { 51 52 71 public PromptingKeyManager() { 72 mapPromptingKeyProviderUIType( 73 "PromptingKeyProvider", 74 PromptingKeyProviderUI.class); 75 mapPromptingKeyProviderUIType( 76 "PromptingAesKeyProvider", 77 PromptingAesKeyProviderUI.class); 78 } 79 80 96 public static Window getParentWindow() { 97 return WindowUtils.getParentWindow(); 98 } 99 100 113 public static void setParentWindow(final Window w) { 114 WindowUtils.setParentWindow(w); 115 } 116 117 121 protected boolean isPromptingImpl() { 122 return super.isPromptingImpl() && !GraphicsEnvironment.isHeadless(); 123 } 124 125 130 protected void ensurePromptingImpl() 131 throws KeyPromptingDisabledException { 132 if (GraphicsEnvironment.isHeadless()) 133 throw new KeyPromptingDisabledException(new HeadlessException()); 134 super.ensurePromptingImpl(); 135 } 136 } 137 | Popular Tags |