当前位置: 首页>>代码示例>>Java>>正文


Java DialogDisplayer.getDefault方法代码示例

本文整理汇总了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);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:19,代码来源:BlobFieldTableCellEditor.java

示例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;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:6,代码来源:DialogDisplayerImpl.java

示例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());
        }
    });
    
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:42,代码来源:InstallerReadPageTest.java

示例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);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:44,代码来源:BlobFieldTableCellEditor.java

示例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);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:44,代码来源:ClobFieldTableCellEditor.java


注:本文中的org.openide.DialogDisplayer.getDefault方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。