diff -r cba4b1a0a484 core.ui/nbproject/project.xml --- a/core.ui/nbproject/project.xml Thu Oct 08 17:11:11 2009 +0200 +++ b/core.ui/nbproject/project.xml Fri Oct 09 09:20:51 2009 +0200 @@ -43,7 +43,7 @@ org.netbeans.modules.apisupport.project - + org.netbeans.core.ui @@ -94,7 +94,7 @@ - 7.12 + 7.17 @@ -154,6 +154,15 @@ + + + unit + + org.netbeans.libs.junit4 + + + + diff -r cba4b1a0a484 core.ui/src/org/netbeans/core/ui/notifications/FlashingIcon.java --- a/core.ui/src/org/netbeans/core/ui/notifications/FlashingIcon.java Thu Oct 08 17:11:11 2009 +0200 +++ b/core.ui/src/org/netbeans/core/ui/notifications/FlashingIcon.java Fri Oct 09 09:20:51 2009 +0200 @@ -57,6 +57,7 @@ import javax.swing.JLabel; import javax.swing.JToolTip; import javax.swing.SwingUtilities; +import org.openide.awt.NotificationDisplayer.Priority; import org.openide.util.RequestProcessor; import org.openide.util.RequestProcessor.Task; @@ -250,7 +251,8 @@ public void propertyChange(PropertyChangeEvent evt) { if( NotificationDisplayerImpl.PROP_NOTIFICATION_ADDED.equals(evt.getPropertyName()) ) { - setNotification( (NotificationImpl)evt.getNewValue(), true ); + final NotificationImpl ni = (NotificationImpl) evt.getNewValue(); + setNotification( ni, ni.showBallon() ); PopupList.dismiss(); } else if( NotificationDisplayerImpl.PROP_NOTIFICATION_REMOVED.equals(evt.getPropertyName()) ) { NotificationImpl removed = (NotificationImpl)evt.getNewValue(); diff -r cba4b1a0a484 core.ui/src/org/netbeans/core/ui/notifications/NotificationImpl.java --- a/core.ui/src/org/netbeans/core/ui/notifications/NotificationImpl.java Thu Oct 08 17:11:11 2009 +0200 +++ b/core.ui/src/org/netbeans/core/ui/notifications/NotificationImpl.java Fri Oct 09 09:20:51 2009 +0200 @@ -92,4 +92,8 @@ public String getTitle() { return title; } + + boolean showBallon() { + return priority != Priority.SILENT; + } } diff -r cba4b1a0a484 core.ui/test/unit/src/org/netbeans/core/ui/notifications/NotificationImplTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core.ui/test/unit/src/org/netbeans/core/ui/notifications/NotificationImplTest.java Fri Oct 09 09:20:51 2009 +0200 @@ -0,0 +1,61 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common + * Development and Distribution License("CDDL") (collectively, the + * "License"). You may not use this file except in compliance with the + * License. You can obtain a copy of the License at + * http://www.netbeans.org/cddl-gplv2.html + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the + * specific language governing permissions and limitations under the + * License. When distributing the software, include this License Header + * Notice in each file and include the License file at + * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the GPL Version 2 section of the License file that + * accompanied this code. If applicable, add the following below the + * License Header, with the fields enclosed by brackets [] replaced by + * your own identifying information: + * "Portions Copyrighted [year] [name of copyright owner]" + * + * If you wish your version of this file to be governed by only the CDDL + * or only the GPL Version 2, indicate your decision by adding + * "[Contributor] elects to include this software in this distribution + * under the [CDDL or GPL Version 2] license." If you do not indicate a + * single choice of license, a recipient has the option to distribute + * your version of this file under either the CDDL, the GPL Version 2 or + * to extend the choice of license to its licensees as provided above. + * However, if you add GPL Version 2 code and therefore, elected the GPL + * Version 2 license, then the option applies only if the new code is + * made subject to such option by the copyright holder. + * + * Contributor(s): + * + * Portions Copyrighted 2009 Sun Microsystems, Inc. + */ + +package org.netbeans.core.ui.notifications; + +import junit.framework.TestCase; +import org.openide.awt.NotificationDisplayer.Priority; + +/** + * + * @author Jaroslav Tulach + */ +public class NotificationImplTest extends TestCase { + + public NotificationImplTest(String testName) { + super(testName); + } + + public void testSilentMeansNoBalloon() { + NotificationImpl instance = new NotificationImpl(); + instance.init("Title", null, Priority.SILENT, null, null); + assertFalse("No balloon", instance.showBallon()); + } + +} diff -r cba4b1a0a484 nbbuild/hudson/core-main --- a/nbbuild/hudson/core-main Thu Oct 08 17:11:11 2009 +0200 +++ b/nbbuild/hudson/core-main Fri Oct 09 09:20:51 2009 +0200 @@ -26,6 +26,7 @@ testmodule core.multiview testmodule core.output2 testmodule core.startup + testmodule core.ui testmodule core.windows testmodule editor.mimelookup testmodule editor.mimelookup.impl diff -r cba4b1a0a484 openide.awt/apichanges.xml --- a/openide.awt/apichanges.xml Thu Oct 08 17:11:11 2009 +0200 +++ b/openide.awt/apichanges.xml Fri Oct 09 09:20:51 2009 +0200 @@ -47,6 +47,20 @@ AWT API + + + Support for silent notifications + + + + + + New priority to show a notification but without its details initially. + The user can display the details baloon manually later. + + + + AwlaysEnabledAction can represent a boolean key in Preferences. diff -r cba4b1a0a484 openide.awt/nbproject/project.properties --- a/openide.awt/nbproject/project.properties Thu Oct 08 17:11:11 2009 +0200 +++ b/openide.awt/nbproject/project.properties Fri Oct 09 09:20:51 2009 +0200 @@ -44,4 +44,4 @@ javadoc.arch=${basedir}/arch.xml javadoc.apichanges=${basedir}/apichanges.xml -spec.version.base=7.16.0 +spec.version.base=7.17.0 diff -r cba4b1a0a484 openide.awt/src/org/openide/awt/NotificationDisplayer.java --- a/openide.awt/src/org/openide/awt/NotificationDisplayer.java Thu Oct 08 17:11:11 2009 +0200 +++ b/openide.awt/src/org/openide/awt/NotificationDisplayer.java Fri Oct 09 09:20:51 2009 +0200 @@ -61,6 +61,11 @@ HIGH, NORMAL, LOW, + /** Priority that shows the notification without details. + * Details shall be shown only later, per user request. + * @since 7.17 + */ + SILENT } /** @@ -149,6 +154,7 @@ importance = 50; break; case LOW: + case SILENT: importance = 1; break; } diff -r cba4b1a0a484 uihandler/nbproject/project.xml --- a/uihandler/nbproject/project.xml Thu Oct 08 17:11:11 2009 +0200 +++ b/uihandler/nbproject/project.xml Fri Oct 09 09:20:51 2009 +0200 @@ -86,7 +86,7 @@ - 6.7 + 7.17 diff -r cba4b1a0a484 uihandler/src/org/netbeans/modules/uihandler/SlownessReporter.java --- a/uihandler/src/org/netbeans/modules/uihandler/SlownessReporter.java Thu Oct 08 17:11:11 2009 +0200 +++ b/uihandler/src/org/netbeans/modules/uihandler/SlownessReporter.java Fri Oct 09 09:20:51 2009 +0200 @@ -58,6 +58,7 @@ import javax.swing.JPanel; import org.openide.awt.Notification; import org.openide.awt.NotificationDisplayer; +import org.openide.awt.NotificationDisplayer.Priority; import org.openide.util.ImageUtilities; import org.openide.util.NbBundle; @@ -148,11 +149,14 @@ NotifySnapshot(SlownessData data) { this.data = data; + NotificationDisplayer.Priority priority = Priority.SILENT; + // in dev builds use higher priority + assert (priority = Priority.LOW) != null; note = NotificationDisplayer.getDefault().notify( NbBundle.getMessage(NotifySnapshot.class, "TEQ_LowPerformance"), ImageUtilities.loadImageIcon("org/netbeans/modules/uihandler/vilik.png", true), createPanel(), createPanel(), - NotificationDisplayer.Priority.LOW); + priority); if (CLEAR > 0) { Installer.RP.post(new Runnable() {