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


Java NotificationDisplayer类代码示例

本文整理汇总了Java中org.openide.awt.NotificationDisplayer的典型用法代码示例。如果您正苦于以下问题:Java NotificationDisplayer类的具体用法?Java NotificationDisplayer怎么用?Java NotificationDisplayer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


NotificationDisplayer类属于org.openide.awt包,在下文中一共展示了NotificationDisplayer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: notifyBackupCreation

import org.openide.awt.NotificationDisplayer; //导入依赖的package包/类
private static void notifyBackupCreation(ModelerFile file, FileObject backupFile) {
    if(backupFile==null){
        return;
    }
    NotificationDisplayer.getDefault().notify("Backup created",
            ImageUtilities.image2Icon(file.getIcon()),// ImageUtilities.loadImageIcon("org/netbeans/jpa/modeler/specification/model/file/JPA_FILE_ICON.png", false),
            "Previous state of file has been saved to " + backupFile.getName() + ". Click here to delete it", (ActionEvent e) -> {
        try {
            if (backupFile.isValid()) {
                backupFile.delete();
            }
        } catch (IOException ex) {
                    file.handleException(ex);
                }
            }, NotificationDisplayer.Priority.NORMAL, NotificationDisplayer.Category.INFO);
}
 
开发者ID:jeddict,项目名称:jeddict,代码行数:17,代码来源:RevEngWizardDescriptor.java

示例2: notifyAboutMultipleInstallations

import org.openide.awt.NotificationDisplayer; //导入依赖的package包/类
@NbBundle.Messages({
    "NotifyMultipleInstallations.title=Multiple MySQL installations found",
    "NotifyMultipleInstallations.text=Select the installation to use"
})
private static void notifyAboutMultipleInstallations() {
    NotificationDisplayer.getDefault().notify(
            Bundle.NotifyMultipleInstallations_title(),
            ImageUtilities.loadImageIcon(ICON_BASE, false),
            Bundle.NotifyMultipleInstallations_text(),
            new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            SelectInstallationPanel.showSelectInstallationDialog();
        }
    }, NotificationDisplayer.Priority.HIGH, NotificationDisplayer.Category.WARNING);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:17,代码来源:InstallationManager.java

示例3: warnNoTestCoS

import org.openide.awt.NotificationDisplayer; //导入依赖的package包/类
@Messages({
    "CosChecker.no_test_cos.title=Not using Compile on Save",
    "CosChecker.no_test_cos.details=Compile on Save mode can speed up single test execution for many projects."
})
static void warnNoTestCoS(RunConfig config) {
    if (warnedNoCoS) {
        return;
    }
    final Project project = config.getProject();
    if (project == null) {
        return;
    }
    final Notification n = NotificationDisplayer.getDefault().notify(CosChecker_no_test_cos_title(), ImageUtilities.loadImageIcon(SUGGESTION, true), CosChecker_no_test_cos_details(), new ActionListener() {
        @Override public void actionPerformed(ActionEvent e) {
            showCompilePanel(project);
        }
    }, NotificationDisplayer.Priority.LOW);
    RequestProcessor.getDefault().post(new Runnable() {
        @Override public void run() {
            n.clear();
        }
    }, 15 * 1000);
    warnedNoCoS = true;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:25,代码来源:CosChecker.java

示例4: notifyAvailable

import org.openide.awt.NotificationDisplayer; //导入依赖的package包/类
public void notifyAvailable () {
    remindLater ();
    String msg = NbBundle.getMessage (ImportManager.class,
            "ImportNotifier_PluginAvailableForImport", // NOI18N
            toImport.size () + toInstall.size ());
    String details = NbBundle.getMessage (ImportManager.class,
            "ImportNotifier_PluginAvailableForImport_Details", // NOI18N
            srcCluster);
    MyAction a = new MyAction();
    synchronized( this ) {
        if( null != currentNotification ) {
            currentNotification.clear();
        }
        Notification notification = NotificationDisplayer.getDefault().notify(msg,
                ImageUtilities.loadImageIcon("org/netbeans/modules/autoupdate/pluginimporter/resources/import.png", false), //NOI18N
                details,
                a);
        a.notification = notification;
        currentNotification = notification;
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:22,代码来源:ImportManager.java

示例5: notifyWarning

import org.openide.awt.NotificationDisplayer; //导入依赖的package包/类
@Messages({"writePermission=You don't have permission to install JUnit Library into the installation directory which is recommended.",
    "showDetails=Show details"})
private static void notifyWarning(final OperationContainer<InstallSupport> oc, final UpdateElement jUnitElement, final UpdateUnit jUnitLib) {
    // lack of privileges for writing
    ActionListener onMouseClickAction = new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            Runnable r = new Runnable() {
                @Override
                public void run() {
                    try {
                        install(oc, jUnitElement, jUnitLib, true);
                    } catch (OperationException ex) {
                        LOG.log(Level.INFO, "While installing " + jUnitLib + " thrown " + ex, ex);
                    }
                }
            };
            showWritePermissionDialog(r);
        }
    };
    String title = writePermission();
    String description = showDetails();
    NotificationDisplayer.getDefault().notify(title,
            ImageUtilities.loadImageIcon("org/netbeans/modules/autoupdate/pluginimporter/resources/warning.gif", false), // NOI18N
            description, onMouseClickAction, NotificationDisplayer.Priority.HIGH, NotificationDisplayer.Category.WARNING);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:27,代码来源:JUnitLibraryInstaller.java

示例6: notify

import org.openide.awt.NotificationDisplayer; //导入依赖的package包/类
private static synchronized ExceptionFlasher notify(String summary, ImageIcon icon) {
    if (flash == null) {
        flash = new ExceptionFlasher();
    } else {
        flash.timer.restart();
        if (flash.note != null) {
            flash.note.clear();
        }
    }
    JComponent detailsPanel = getDetailsPanel(summary);
    JComponent bubblePanel = getDetailsPanel(summary);

    flash.note = NotificationDisplayer.getDefault().notify(
            NbBundle.getMessage(NotifyExcPanel.class, "NTF_ExceptionalExceptionTitle"),
            icon, bubblePanel, detailsPanel,
            NotificationDisplayer.Priority.SILENT, NotificationDisplayer.Category.ERROR);
    return flash;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:19,代码来源:NotifyExcPanel.java

示例7: NotifySnapshot

import org.openide.awt.NotificationDisplayer; //导入依赖的package包/类
NotifySnapshot(SlownessData data) {
    this.data = data;
    NotificationDisplayer.Priority priority = data.getTime() > PRIORITY ?
        Priority.LOW : Priority.SILENT;
    String message = NbBundle.getMessage(NotifySnapshot.class, data.getSlownessType());
    note = NotificationDisplayer.getDefault().notify(
            message,
            ImageUtilities.loadImageIcon("org/netbeans/modules/uihandler/vilik.png", true),
            createPanel(), createPanel(),
            priority,
            NotificationDisplayer.Category.WARNING);
    if (CLEAR > 0) {
        Installer.RP.post(new Runnable() {

            @Override
            public void run() {
                clear();
            }
        }, CLEAR, Thread.MIN_PRIORITY);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:22,代码来源:SlownessReporter.java

示例8: signOn

import org.openide.awt.NotificationDisplayer; //导入依赖的package包/类
public static void signOn () {
    // temprorary to investigate #203326
    NotificationDisplayer.getDefault();
    // end of investigation #203326
    
    AutoupdateSettings.generateIdentity ();
    
    if (timeToCheck ()) {
        // schedule refresh providers
        // install update checker when UI is ready (main window shown)
        WindowManager.getDefault().invokeWhenUIReady(new Runnable () {
            @Override
            public void run () {
                Installer.RP.post (doCheck, 5000);
            }
        });
    } else {
        // install update checker when UI is ready (main window shown)
        WindowManager.getDefault().invokeWhenUIReady(new Runnable () {
            @Override
            public void run () {
                Installer.RP.post (doCheckLazyUpdates, 11000);
            }
        });
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:27,代码来源:AutoupdateCheckScheduler.java

示例9: notifyRestartNeeded

import org.openide.awt.NotificationDisplayer; //导入依赖的package包/类
static void notifyRestartNeeded (final Runnable onMouseClick, final String tooltip) {
    //final NotifyDescriptor nd = new NotifyDescriptor.Confirmation (
    //                                    getBundle ("RestartConfirmation_Message"),
    //                                    getBundle ("RestartConfirmation_Title"),
    //                                    NotifyDescriptor.YES_NO_OPTION);
    ActionListener onClickAction = new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            //DialogDisplayer.getDefault ().notify (nd);
            //if (NotifyDescriptor.OK_OPTION.equals (nd.getValue ())) {
                onMouseClick.run ();
            //}
        }
    };
    synchronized (InstallStep.class) {
        if (restartNotification != null) {
            restartNotification.clear();
            restartNotification = null;
        }

        restartNotification = NotificationDisplayer.getDefault().notify(tooltip,
                ImageUtilities.loadImageIcon("org/netbeans/modules/autoupdate/ui/resources/restart.png", false),
                getBundle("RestartNeeded_Details"), onClickAction, NotificationDisplayer.Priority.HIGH, NotificationDisplayer.Category.WARNING);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:26,代码来源:InstallStep.java

示例10: notifyWritePermissionProblem

import org.openide.awt.NotificationDisplayer; //导入依赖的package包/类
@Messages({
    "# {0} - plugin_name",
    "inBackground_WritePermission=You don''t have permission to install plugin {0} into the installation directory.",
    "inBackground_WritePermission_Details=details", "cancel=Cancel", "install=Install anyway"})
private void notifyWritePermissionProblem(final OperationException ex, final UpdateElement culprit) {
    // lack of privileges for writing
    ActionListener onMouseClickAction = new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            ProblemPanel problem = new ProblemPanel(ex, culprit, false);
            problem.showWriteProblemDialog();
        }
    };
    String title = inBackground_WritePermission(culprit.getDisplayName());
    String description = inBackground_WritePermission_Details();
    NotificationDisplayer.getDefault().notify(title,
            ImageUtilities.loadImageIcon("org/netbeans/modules/autoupdate/ui/resources/error.png", false), // NOI18N
            description, onMouseClickAction, NotificationDisplayer.Priority.HIGH, NotificationDisplayer.Category.ERROR);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:20,代码来源:InstallStep.java

示例11: notifyLowMemory

import org.openide.awt.NotificationDisplayer; //导入依赖的package包/类
@Override
public void notifyLowMemory(String rootName) {
    if (PRIORITY != null) {
        NotificationDisplayer.getDefault().notify(
                NbBundle.getMessage(UIProviderImpl.class, "TITLE_LowMemory"),
                ImageUtilities.loadImageIcon(WARNING_ICON, false),
                NbBundle.getMessage(UIProviderImpl.class, "MSG_LowMemory", rootName),
                new ActionListener() {
                    @Override
                    public void actionPerformed(ActionEvent e) {
                        try {
                            final URL url = new URL(NbBundle.getMessage(UIProviderImpl.class, "URL_LowMemory"));
                            HtmlBrowser.URLDisplayer.getDefault().showURLExternal(url);
                        } catch (MalformedURLException ex) {
                            Exceptions.printStackTrace(ex);
                        }
                    }
                },
                PRIORITY, NotificationDisplayer.Category.ERROR);
    }

}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:23,代码来源:UIProviderImpl.java

示例12: clipboardChanged

import org.openide.awt.NotificationDisplayer; //导入依赖的package包/类
@Override
public void clipboardChanged(ClipboardEvent ev) {
    ExClipboard clipboard = ev.getClipboard();

    Transferable transferable = null;
    String clipboardContent = null;
    try {
        transferable = clipboard.getContents(null);
        if (transferable != null && transferable.isDataFlavorSupported(DataFlavor.stringFlavor)) {
            clipboardContent = (String) transferable.getTransferData(DataFlavor.stringFlavor);
        }
    } catch (OutOfMemoryError oom) {            
        NotificationDisplayer.getDefault().notify( NbBundle.getBundle(ClipboardHistory.class).getString("clipboard-history-oom"),NotificationDisplayer.Priority.NORMAL.getIcon(), NbBundle.getBundle(ClipboardHistory.class).getString("clipboard-history-oom-details"), null);
        return;
    } catch (IOException ioe) {
        //ignored for bug #218255
    } catch (UnsupportedFlavorException ufe) {
    }

    if (clipboardContent != null) {
        addHistory(transferable, clipboardContent);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:24,代码来源:ClipboardHistory.java

示例13: show

import org.openide.awt.NotificationDisplayer; //导入依赖的package包/类
/**
 * Show message with the specified type and action listener
 */
public static Notification show(String title, String message, MessageType type, ActionListener actionListener, final int timeout) {
    if (message == null) {
        message = "null";
    }
    if (title == null) {
        title = "null";
    }
    final Notification n = (Notification) NotificationDisplayer.getDefault().notify(title, type.getIcon(), message, actionListener);
    if (timeout > 0) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                Timer timer = new Timer(timeout, new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        n.clear();
                    }
                });
                timer.setRepeats(false);
                timer.start();
            }
        });
    }
    return n;
}
 
开发者ID:jMonkeyEngine,项目名称:sdk,代码行数:27,代码来源:NotifyUtil.java

示例14: store

import org.openide.awt.NotificationDisplayer; //导入依赖的package包/类
@NbBundle.Messages({
    "LBL_RestartRequest=JSHint plugin asks for restart",
    "DESC_RestartRequest=Your changes to the configuration of the plugin will take effect after a restart.",
    "ICON_RestartRequest="
})
void store() {
    Preferences p = NbPreferences.forModule(JSHintPanel.class);
    String oldJSFiile = p.get("jshint.js", defaultJSFile);
    String newJSFile = jSFileTextField.getText();

    if (!oldJSFiile.equals(newJSFile)) {
        NotificationDisplayer.getDefault().notify(Bundle.LBL_RestartRequest(), new ImageIcon(Bundle.ICON_RestartRequest()), Bundle.DESC_RestartRequest(), new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent ae) {
                LifecycleManager dlm = LifecycleManager.getDefault();
                dlm.markForRestart();
                dlm.exit();
            }
        });
    }

    p.put("jshint.js", newJSFile);
    p.putBoolean("show.annotations", showAnnotationsCheckBox.isSelected());
}
 
开发者ID:luka-zitnik,项目名称:jshint-for-netbeans,代码行数:26,代码来源:JSHintPanel.java

示例15: getConfig

import org.openide.awt.NotificationDisplayer; //导入依赖的package包/类
@NbBundle.Messages({
    "LBL_InvalidRC=Invalid .jshintrc",
    "# {0} - Linted JavaScript file",
    "# {1} - RC file",
    "DESC_InvalidRC=File {0} was linted with default configuration because its related {1} is not valid json",
    "ICON_InvalidRC="
})
private Scriptable getConfig(Context cx, FileObject fo) throws ParseException, IOException {
    JsonParser parser = new JsonParser(cx, scope);
    FileObject config = findConfig(fo);

    if (config == null) {
        return cx.newObject(scope);
    }

    String json = config.asText();

    try {
        return (Scriptable) parser.parseValue(json);
    }
    catch (ParseException ex) {
        JTextArea text = new JTextArea(Bundle.DESC_InvalidRC(fo.getPath(), config.getPath()));
        NotificationDisplayer.getDefault().notify(Bundle.LBL_InvalidRC(), new ImageIcon(Bundle.ICON_InvalidRC()), text, text, NotificationDisplayer.Priority.NORMAL);
        return cx.newObject(scope);
    }
}
 
开发者ID:luka-zitnik,项目名称:jshint-for-netbeans,代码行数:27,代码来源:JSHint.java


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