author | Jaroslav Tulach <jtulach@netbeans.org> |
Sun, 06 Oct 2013 22:05:14 +0200 | |
changeset 407 | e1439046d96e |
parent 345 | f497cf8621b3 |
permissions | -rw-r--r-- |
jtulach@343 | 1 |
package org.apidesign.singletons.impl; |
jtulach@343 | 2 |
|
jtulach@343 | 3 |
import javax.swing.JOptionPane; |
jtulach@343 | 4 |
import org.apidesign.singletons.api.DialogDisplayer; |
jtulach@343 | 5 |
import org.openide.util.lookup.ServiceProvider; |
jtulach@343 | 6 |
|
jtulach@345 | 7 |
// BEGIN: singletons.injectable.implement |
jtulach@343 | 8 |
@ServiceProvider(service=DialogDisplayer.class) |
jtulach@346 | 9 |
public final class SwingDialogDisplayer extends DialogDisplayer { |
jtulach@343 | 10 |
@Override |
jtulach@343 | 11 |
public boolean yesOrNo(String query) { |
jtulach@343 | 12 |
final int res = JOptionPane.showConfirmDialog(null, query); |
jtulach@343 | 13 |
return res == JOptionPane.OK_OPTION; |
jtulach@343 | 14 |
} |
jtulach@343 | 15 |
} |
jtulach@345 | 16 |
// END: singletons.injectable.implement |