本文整理匯總了Java中org.openide.DialogDisplayer.getDefault方法的典型用法代碼示例。如果您正苦於以下問題:Java DialogDisplayer.getDefault方法的具體用法?Java DialogDisplayer.getDefault怎麽用?Java DialogDisplayer.getDefault使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.openide.DialogDisplayer
的用法示例。
在下文中一共展示了DialogDisplayer.getDefault方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: displayErrorOpenImage
import org.openide.DialogDisplayer; //導入方法依賴的package包/類
private void displayErrorOpenImage(String messageProperty) {
DialogDisplayer dd = DialogDisplayer.getDefault();
String messageMsg = NbBundle.getMessage(BlobFieldTableCellEditor.class,
messageProperty);
String titleMsg = NbBundle.getMessage(BlobFieldTableCellEditor.class,
"openImageError.title"); //NOI18N
NotifyDescriptor nd = new NotifyDescriptor(
messageMsg,
titleMsg,
NotifyDescriptor.OK_CANCEL_OPTION,
NotifyDescriptor.WARNING_MESSAGE,
new Object[]{NotifyDescriptor.CANCEL_OPTION},
NotifyDescriptor.CANCEL_OPTION);
dd.notifyLater(nd);
}
示例2: returnFromNotify
import org.openide.DialogDisplayer; //導入方法依賴的package包/類
public static void returnFromNotify(Object value) {
Object o = DialogDisplayer.getDefault();
Assert.assertEquals("My class", DialogDisplayerImpl.class, o.getClass());
toReturn = value;
}
示例3: doEncodingTest
import org.openide.DialogDisplayer; //導入方法依賴的package包/類
private void doEncodingTest(String encoding, String metaTag) throws Exception {
//String kun = "Žluťoučký kůň";
String kun = "\u017Dlu\u0165ou\u010Dky k\u016F\u0148";
String utf8 =
"<html><head>" +
metaTag +
"</head>" +
"<body>" +
"<form action='http://anna.nbextras.org/analytics/upload.jsp' method='post'>" +
" <input name='submit' value='" + kun + "' type='hidden'> </input>" +
"</form>" +
"</body></html>";
ByteArrayInputStream is = new ByteArrayInputStream(utf8.getBytes(encoding));
MemoryURL.registerURL("memory://kun.html", is);
DialogDisplayer d = DialogDisplayer.getDefault();
assertTrue(d instanceof DD);
boolean res = Installer.displaySummary("KUN", true, false,true);
assertFalse("Close options was pressed", res);
assertNotNull("DD.d assigned", DD.d);
List<Object> data = Arrays.asList(DD.d.getOptions());
assertEquals("Two objects: " + data, 2, DD.d.getOptions().length);
assertEquals("First is jbutton", JButton.class, DD.d.getOptions()[0].getClass());
JButton b = (JButton)DD.d.getOptions()[0];
assertEquals("It has the right localized text", kun, b.getText());
assertFalse(EventQueue.isDispatchThread());
EventQueue.invokeAndWait(new Runnable() {
@Override
public void run() {
JPanel jp = (JPanel) DD.d.getMessage();
JScrollPane pane = (JScrollPane) jp.getComponent(0); //pane at idx 0
Component c = pane.getViewport().getView();
assertEquals("Dimension is small", new Dimension(350, 50), c.getPreferredSize());
}
});
}
示例4: displayError
import org.openide.DialogDisplayer; //導入方法依賴的package包/類
private void displayError(File f, Exception ex, boolean read) {
DialogDisplayer dd = DialogDisplayer.getDefault();
String errorObjectMsg;
String messageMsg;
String titleMsg;
if (ex instanceof SQLException) {
errorObjectMsg = NbBundle.getMessage(BlobFieldTableCellEditor.class,
"lobErrorObject.database");
} else {
errorObjectMsg = NbBundle.getMessage(BlobFieldTableCellEditor.class,
"lobErrorObject.file");
}
if (!read) {
titleMsg = NbBundle.getMessage(BlobFieldTableCellEditor.class,
"blobSaveToFileError.title");
messageMsg = NbBundle.getMessage(BlobFieldTableCellEditor.class,
"blobSaveToFileError.message",
errorObjectMsg,
f.getAbsolutePath(),
ex.getLocalizedMessage());
} else {
titleMsg = NbBundle.getMessage(BlobFieldTableCellEditor.class,
"blobReadFromFileError.title");
messageMsg = NbBundle.getMessage(BlobFieldTableCellEditor.class,
"blobReadFromFileError.message",
errorObjectMsg,
f.getAbsolutePath(),
ex.getLocalizedMessage());
}
NotifyDescriptor nd = new NotifyDescriptor(
messageMsg,
titleMsg,
NotifyDescriptor.OK_CANCEL_OPTION,
NotifyDescriptor.WARNING_MESSAGE,
new Object[]{NotifyDescriptor.CANCEL_OPTION},
NotifyDescriptor.CANCEL_OPTION);
dd.notifyLater(nd);
}
示例5: displayError
import org.openide.DialogDisplayer; //導入方法依賴的package包/類
private void displayError(File f, Exception ex, boolean read) {
DialogDisplayer dd = DialogDisplayer.getDefault();
String errorObjectMsg;
String messageMsg;
String titleMsg;
if (ex instanceof SQLException) {
errorObjectMsg = NbBundle.getMessage(ClobFieldTableCellEditor.class,
"lobErrorObject.database");
} else {
errorObjectMsg = NbBundle.getMessage(ClobFieldTableCellEditor.class,
"lobErrorObject.file");
}
if (!read) {
titleMsg = NbBundle.getMessage(ClobFieldTableCellEditor.class,
"clobSaveToFileError.title");
messageMsg = NbBundle.getMessage(ClobFieldTableCellEditor.class,
"clobSaveToFileError.message",
errorObjectMsg,
f.getAbsolutePath(),
ex.getLocalizedMessage());
} else {
titleMsg = NbBundle.getMessage(ClobFieldTableCellEditor.class,
"clobReadFromFileError.title");
messageMsg = NbBundle.getMessage(ClobFieldTableCellEditor.class,
"clobReadFromFileError.message",
errorObjectMsg,
f.getAbsolutePath(),
ex.getLocalizedMessage());
}
NotifyDescriptor nd = new NotifyDescriptor(
messageMsg,
titleMsg,
NotifyDescriptor.OK_CANCEL_OPTION,
NotifyDescriptor.WARNING_MESSAGE,
new Object[]{NotifyDescriptor.CANCEL_OPTION},
NotifyDescriptor.CANCEL_OPTION);
dd.notifyLater(nd);
}