--- a/api.progress/apichanges.xml +++ a/api.progress/apichanges.xml @@ -105,6 +105,22 @@ + + + SPI added + + + + + +

+ An internal SPI package was exposed. Normal modules should not + need to access this package. +

+
+ + +
ProgressUtils class with runOffEventDispatchThread methods was added. --- a/api.progress/manifest.mf +++ a/api.progress/manifest.mf @@ -1,8 +1,7 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.api.progress/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/progress/module/resources/Bundle.properties -OpenIDE-Module-Layer: org/netbeans/progress/module/resources/layer.xml -OpenIDE-Module-Implementation-Version: 1 -OpenIDE-Module-Recommends: org.netbeans.progress.spi.ProgressUIWorkerProvider, org.netbeans.progress.spi.RunOffAWTProvider +OpenIDE-Module-Recommends: org.netbeans.modules.progress.spi.ProgressUIWorkerProvider, org.netbeans.modules.progress.spi.RunOffEDTProvider AutoUpdate-Essential-Module: true +OpenIDE-Module-Specification-Version: 1.18 --- a/api.progress/nbproject/project.properties +++ a/api.progress/nbproject/project.properties @@ -40,7 +40,6 @@ is.autoload=true javac.compilerargs=-Xlint:unchecked javac.source=1.5 -spec.version.base=1.17.0 javadoc.arch=${basedir}/arch.xml javadoc.apichanges=${basedir}/apichanges.xml --- a/api.progress/nbproject/project.xml +++ a/api.progress/nbproject/project.xml @@ -93,6 +93,7 @@ org.netbeans.api.progress org.netbeans.api.progress.aggregate + org.netbeans.modules.progress.spi --- a/api.progress/src/org/netbeans/api/progress/ProgressHandle.java +++ a/api.progress/src/org/netbeans/api/progress/ProgressHandle.java @@ -45,7 +45,7 @@ import java.util.logging.Logger; import javax.swing.JComponent; import javax.swing.JLabel; -import org.netbeans.progress.spi.InternalHandle; +import org.netbeans.modules.progress.spi.InternalHandle; /** * Instances provided by the ProgressHandleFactory allow the users of the API to --- a/api.progress/src/org/netbeans/api/progress/ProgressHandleFactory.java +++ a/api.progress/src/org/netbeans/api/progress/ProgressHandleFactory.java @@ -44,7 +44,7 @@ import javax.swing.Action; import javax.swing.JComponent; import javax.swing.JLabel; -import org.netbeans.progress.spi.InternalHandle; +import org.netbeans.modules.progress.spi.InternalHandle; import org.openide.util.Cancellable; /** --- a/api.progress/src/org/netbeans/api/progress/ProgressUtils.java +++ a/api.progress/src/org/netbeans/api/progress/ProgressUtils.java @@ -41,7 +41,7 @@ import java.util.concurrent.atomic.AtomicBoolean; import javax.swing.SwingUtilities; -import org.netbeans.progress.spi.RunOffEDTProvider; +import org.netbeans.modules.progress.spi.RunOffEDTProvider; import org.openide.util.Lookup; import org.openide.util.RequestProcessor; import org.openide.util.RequestProcessor.Task; --- a/api.progress/src/org/netbeans/progress/module/Controller.java +++ a/api.progress/src/org/netbeans/progress/module/Controller.java @@ -40,9 +40,10 @@ */ -package org.netbeans.progress.module; +package org.netbeans.modules.progress.spi; import java.awt.Component; +import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.ArrayList; import java.util.Collection; @@ -54,19 +55,14 @@ import java.util.logging.Logger; import javax.swing.SwingUtilities; import javax.swing.Timer; -import org.netbeans.progress.spi.InternalHandle; -import org.netbeans.progress.spi.ProgressEvent; -import org.netbeans.progress.spi.ProgressUIWorker; -import org.netbeans.progress.spi.ProgressUIWorkerProvider; -import org.netbeans.progress.spi.ProgressUIWorkerWithModel; -import org.netbeans.progress.spi.TaskModel; +import org.netbeans.progress.module.TrivialProgressUIWorkerProvider; import org.openide.util.Lookup; /** * * @author Milos Kleint (mkleint@netbeans.org) */ -public /* final - because of tests */ class Controller implements Runnable, ActionListener { +public /* final - because of tests */ class Controller { // non-private so that it can be accessed from the tests public static Controller defaultInstance; @@ -87,26 +83,27 @@ /** Creates a new instance of Controller */ public Controller(ProgressUIWorker comp) { - this(); component = comp; - } - protected Controller() { model = new TaskModel(); eventQueue = new ArrayList(); dispatchRunning = false; - timer = new Timer(TIMER_QUANTUM, this); + timer = new Timer(TIMER_QUANTUM, new ActionListener() { + public void actionPerformed(ActionEvent e) { + runNow(); + } + }); timer.setRepeats(false); } public static synchronized Controller getDefault() { if (defaultInstance == null) { - defaultInstance = new Controller(); + defaultInstance = new Controller(null); } return defaultInstance; } // to be called on the default instance only.. - Component getVisualComponent() { + public Component getVisualComponent() { if (component == null) { getProgressUIWorker(); } @@ -136,7 +133,7 @@ return model; } - public void start(InternalHandle handle) { + void start(InternalHandle handle) { ProgressEvent event = new ProgressEvent(handle, ProgressEvent.TYPE_START, isWatched(handle)); if (this == getDefault() && handle.getInitialDelay() > 100) { // default controller @@ -146,34 +143,34 @@ } } - public void finish(InternalHandle handle) { + void finish(InternalHandle handle) { ProgressEvent event = new ProgressEvent(handle, ProgressEvent.TYPE_FINISH, isWatched(handle)); postEvent(event); } - public void toIndeterminate(InternalHandle handle) { + void toIndeterminate(InternalHandle handle) { ProgressEvent event = new ProgressEvent(handle, ProgressEvent.TYPE_SWITCH, isWatched(handle)); postEvent(event); } - public void toSilent(InternalHandle handle, String message) { + void toSilent(InternalHandle handle, String message) { ProgressEvent event = new ProgressEvent(handle, ProgressEvent.TYPE_SILENT, isWatched(handle), message); postEvent(event); } - public void toDeterminate(InternalHandle handle) { + void toDeterminate(InternalHandle handle) { ProgressEvent event = new ProgressEvent(handle, ProgressEvent.TYPE_SWITCH, isWatched(handle)); postEvent(event); } - public void progress(InternalHandle handle, String msg, + void progress(InternalHandle handle, String msg, int units, double percentage, long estimate) { ProgressEvent event = new ProgressEvent(handle, msg, units, percentage, estimate, isWatched(handle)); postEvent(event); } - public ProgressEvent snapshot(InternalHandle handle, String msg, + ProgressEvent snapshot(InternalHandle handle, String msg, int units, double percentage, long estimate) { if (handle.isInSleepMode()) { return new ProgressEvent(handle, ProgressEvent.TYPE_SILENT, isWatched(handle), msg); @@ -182,7 +179,7 @@ } - public void explicitSelection(InternalHandle handle) { + void explicitSelection(InternalHandle handle) { InternalHandle old = model.getExplicitSelection(); model.explicitlySelect(handle); Collection evnts = new ArrayList(); @@ -194,7 +191,7 @@ runImmediately(evnts); } - public void displayNameChange(InternalHandle handle, int units, double percentage, long estimate, String display) { + void displayNameChange(InternalHandle handle, int units, double percentage, long estimate, String display) { Collection evnts = new ArrayList(); evnts.add(new ProgressEvent(handle, null, units, percentage, estimate, isWatched(handle), display)); runImmediately(evnts); @@ -204,9 +201,6 @@ return model.getExplicitSelection() == hndl; } - /** - * - */ void runImmediately(Collection events) { synchronized (this) { // need to add to queue immediately in the current thread @@ -215,9 +209,13 @@ } // trigger ui update as fast as possible. if (SwingUtilities.isEventDispatchThread()) { - run(); + runNow(); } else { - SwingUtilities.invokeLater(this); + SwingUtilities.invokeLater(new Runnable() { + public void run() { + runNow(); + } + }); } } @@ -256,10 +254,8 @@ } - /** - * can be run from awt only. - */ - public void run() { + public void runNow() { + // not true in tests: assert EventQueue.isDispatchThread(); HashMap map = new HashMap(); boolean hasShortOne = false; long minDiff = TIMER_QUANTUM; @@ -284,7 +280,7 @@ { model.removeHandle(event.getSource()); } - ProgressEvent lastEvent = (ProgressEvent)map.get(event.getSource()); + ProgressEvent lastEvent = map.get(event.getSource()); if (lastEvent != null && event.getType() == ProgressEvent.TYPE_FINISH && justStarted.contains(event.getSource()) && isShort) { @@ -316,7 +312,7 @@ model.addHandle(hndl); } else { eventQueue.add(new ProgressEvent(hndl, ProgressEvent.TYPE_START, isWatched(hndl))); - ProgressEvent evnt = (ProgressEvent)map.remove(hndl); + ProgressEvent evnt = map.remove(hndl); if (evnt.getType() != ProgressEvent.TYPE_START) { eventQueue.add(evnt); } @@ -350,13 +346,4 @@ } } - /** - * used by Timer - */ - public void actionPerformed(java.awt.event.ActionEvent actionEvent) { - run(); - } - - - } --- a/api.progress/src/org/netbeans/progress/spi/ExtractedProgressUIWorker.java +++ a/api.progress/src/org/netbeans/progress/spi/ExtractedProgressUIWorker.java @@ -39,7 +39,7 @@ * made subject to such option by the copyright holder. */ -package org.netbeans.progress.spi; +package org.netbeans.modules.progress.spi; import javax.swing.JComponent; import javax.swing.JLabel; --- a/api.progress/src/org/netbeans/progress/spi/InternalHandle.java +++ a/api.progress/src/org/netbeans/progress/spi/InternalHandle.java @@ -40,7 +40,7 @@ */ -package org.netbeans.progress.spi; +package org.netbeans.modules.progress.spi; import java.awt.event.ActionEvent; import java.util.logging.Level; --- a/api.progress/src/org/netbeans/progress/spi/ProgressEvent.java +++ a/api.progress/src/org/netbeans/progress/spi/ProgressEvent.java @@ -40,7 +40,7 @@ */ -package org.netbeans.progress.spi; +package org.netbeans.modules.progress.spi; /** * --- a/api.progress/src/org/netbeans/progress/spi/ProgressUIWorker.java +++ a/api.progress/src/org/netbeans/progress/spi/ProgressUIWorker.java @@ -39,7 +39,7 @@ * made subject to such option by the copyright holder. */ -package org.netbeans.progress.spi; +package org.netbeans.modules.progress.spi; import org.netbeans.progress.module.*; --- a/api.progress/src/org/netbeans/progress/spi/ProgressUIWorkerProvider.java +++ a/api.progress/src/org/netbeans/progress/spi/ProgressUIWorkerProvider.java @@ -39,7 +39,7 @@ * made subject to such option by the copyright holder. */ -package org.netbeans.progress.spi; +package org.netbeans.modules.progress.spi; /** * --- a/api.progress/src/org/netbeans/progress/spi/ProgressUIWorkerWithModel.java +++ a/api.progress/src/org/netbeans/progress/spi/ProgressUIWorkerWithModel.java @@ -39,7 +39,7 @@ * made subject to such option by the copyright holder. */ -package org.netbeans.progress.spi; +package org.netbeans.modules.progress.spi; import org.netbeans.progress.module.*; --- a/api.progress/src/org/netbeans/progress/spi/RunOffEDTProvider.java +++ a/api.progress/src/org/netbeans/progress/spi/RunOffEDTProvider.java @@ -37,7 +37,7 @@ * Portions Copyrighted 2009 Sun Microsystems, Inc. */ -package org.netbeans.progress.spi; +package org.netbeans.modules.progress.spi; import java.util.concurrent.atomic.AtomicBoolean; --- a/api.progress/src/org/netbeans/progress/spi/TaskModel.java +++ a/api.progress/src/org/netbeans/progress/spi/TaskModel.java @@ -40,7 +40,7 @@ */ -package org.netbeans.progress.spi; +package org.netbeans.modules.progress.spi; import javax.swing.DefaultListModel; import javax.swing.DefaultListSelectionModel; --- a/api.progress/src/org/netbeans/modules/progress/spi/package-info.java +++ a/api.progress/src/org/netbeans/modules/progress/spi/package-info.java @@ -0,0 +1,44 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright 2010 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 2010 Sun Microsystems, Inc. + */ + +/** + * Interfaces permitting a UI for the progress system to be supplied. + * Not intended for use from modules outside the NetBeans Platform. + */ +package org.netbeans.modules.progress.spi; --- a/api.progress/src/org/netbeans/progress/module/Bundle.properties +++ a/api.progress/src/org/netbeans/progress/module/Bundle.properties @@ -1,42 +0,0 @@ -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. -# -# Copyright 1997-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]" -# -# Contributor(s): -# -# The Original Software is NetBeans. The Initial Developer of the Original -# Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun -# Microsystems, Inc. All Rights Reserved. -# -# 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. - -CTL_CancelAction=Cancel Process -CTL_ProcessListAction=&Processes -ProcessListAction.mnemonic=P --- a/api.progress/src/org/netbeans/progress/module/ProgressVisualizerProvider.java +++ a/api.progress/src/org/netbeans/progress/module/ProgressVisualizerProvider.java @@ -41,6 +41,7 @@ package org.netbeans.progress.module; +import org.netbeans.modules.progress.spi.Controller; import java.awt.Component; import org.openide.awt.StatusLineElementProvider; --- a/api.progress/src/org/netbeans/progress/module/TrivialProgressUIWorkerProvider.java +++ a/api.progress/src/org/netbeans/progress/module/TrivialProgressUIWorkerProvider.java @@ -44,11 +44,11 @@ import javax.swing.JComponent; import javax.swing.JLabel; import javax.swing.JPanel; -import org.netbeans.progress.spi.ExtractedProgressUIWorker; -import org.netbeans.progress.spi.ProgressEvent; -import org.netbeans.progress.spi.ProgressUIWorkerProvider; -import org.netbeans.progress.spi.ProgressUIWorkerWithModel; -import org.netbeans.progress.spi.TaskModel; +import org.netbeans.modules.progress.spi.ExtractedProgressUIWorker; +import org.netbeans.modules.progress.spi.ProgressEvent; +import org.netbeans.modules.progress.spi.ProgressUIWorkerProvider; +import org.netbeans.modules.progress.spi.ProgressUIWorkerWithModel; +import org.netbeans.modules.progress.spi.TaskModel; /** * Fallback provider in case no GUI is registered. --- a/api.progress/src/org/netbeans/progress/module/resources/layer.xml +++ a/api.progress/src/org/netbeans/progress/module/resources/layer.xml @@ -1,53 +0,0 @@ - - - - - - - - - - - - - --- a/api.progress/test/unit/src/org/netbeans/api/progress/ProgressHandleFactoryTest.java +++ a/api.progress/test/unit/src/org/netbeans/api/progress/ProgressHandleFactoryTest.java @@ -49,10 +49,10 @@ import javax.swing.UIManager; import org.netbeans.junit.NbTestCase; import org.netbeans.junit.RandomlyFails; -import org.netbeans.progress.module.Controller; -import org.netbeans.progress.spi.InternalHandle; -import org.netbeans.progress.spi.ProgressEvent; -import org.netbeans.progress.spi.ProgressUIWorker; +import org.netbeans.modules.progress.spi.Controller; +import org.netbeans.modules.progress.spi.InternalHandle; +import org.netbeans.modules.progress.spi.ProgressEvent; +import org.netbeans.modules.progress.spi.ProgressUIWorker; import org.openide.util.Cancellable; /** --- a/api.progress/test/unit/src/org/netbeans/api/progress/ProgressHandleTest.java +++ a/api.progress/test/unit/src/org/netbeans/api/progress/ProgressHandleTest.java @@ -49,10 +49,10 @@ import javax.swing.Timer; import org.netbeans.junit.NbTestCase; import org.netbeans.junit.RandomlyFails; -import org.netbeans.progress.module.Controller; -import org.netbeans.progress.spi.InternalHandle; -import org.netbeans.progress.spi.ProgressUIWorker; -import org.netbeans.progress.spi.ProgressEvent; +import org.netbeans.modules.progress.spi.Controller; +import org.netbeans.modules.progress.spi.InternalHandle; +import org.netbeans.modules.progress.spi.ProgressUIWorker; +import org.netbeans.modules.progress.spi.ProgressEvent; import org.openide.util.Cancellable; /** @@ -217,7 +217,7 @@ proghandle.finish(); //simulate timer run - control.run(); + control.runNow(); //after running the timer sould be stopped assertTrue(control.tobeRestartedDelay == -1); @@ -233,7 +233,7 @@ } //simulate timer run - control.run(); + control.runNow(); // timer should continue assertFalse(control.tobeRestartedDelay == -1); @@ -242,7 +242,7 @@ proghandle.finish(); //simulate timer run - control.run(); + control.runNow(); // timer should be continuing assertFalse(control.tobeRestartedDelay == -1); @@ -253,7 +253,7 @@ } h2.finish(); //simulate timer run - control.run(); + control.runNow(); // timer should be stopped assertTrue(control.tobeRestartedDelay == -1); @@ -272,7 +272,7 @@ proghandle.finish(); //simulate timer run - control.run(); + control.runNow(); //after running the timer sould be stopped assertTrue(control.tobeRestartedDelay == -1); @@ -287,7 +287,7 @@ System.out.println("interrupted"); } //simulate timer run - control.run(); + control.runNow(); // timer should continue assertFalse(control.tobeRestartedDelay == -1); @@ -297,7 +297,7 @@ proghandle.finish(); //simulate timer run - control.run(); + control.runNow(); // timer should be continuing assertFalse(control.tobeRestartedDelay == -1); @@ -307,7 +307,7 @@ System.out.println("interrupted"); } h2.finish(); - control.run(); + control.runNow(); // timer should NOT continue assertTrue(control.tobeRestartedDelay == -1); } --- a/api.progress/test/unit/src/org/netbeans/api/progress/aggregate/AggregateProgressHandleTest.java +++ a/api.progress/test/unit/src/org/netbeans/api/progress/aggregate/AggregateProgressHandleTest.java @@ -42,9 +42,9 @@ package org.netbeans.api.progress.aggregate; import junit.framework.TestCase; -import org.netbeans.progress.module.Controller; -import org.netbeans.progress.spi.ProgressUIWorker; -import org.netbeans.progress.spi.ProgressEvent; +import org.netbeans.modules.progress.spi.Controller; +import org.netbeans.modules.progress.spi.ProgressUIWorker; +import org.netbeans.modules.progress.spi.ProgressEvent; /** * --- a/core.execution/manifest.mf +++ a/core.execution/manifest.mf @@ -4,3 +4,4 @@ OpenIDE-Module-Install: org/netbeans/core/execution/Install.class OpenIDE-Module-Provides: org.openide.execution.ExecutionEngine AutoUpdate-Essential-Module: true +OpenIDE-Module-Specification-Version: 1.19 --- a/core.execution/nbproject/project.properties +++ a/core.execution/nbproject/project.properties @@ -40,5 +40,4 @@ is.autoload=true javac.compilerargs=-Xlint:unchecked javac.source=1.5 -spec.version.base=1.18.0 --- a/core.execution/nbproject/project.xml +++ a/core.execution/nbproject/project.xml @@ -52,7 +52,7 @@ 1 - + 1.18 --- a/core.execution/src/org/netbeans/core/execution/Install.java +++ a/core.execution/src/org/netbeans/core/execution/Install.java @@ -71,8 +71,8 @@ import javax.swing.text.DefaultEditorKit; import org.netbeans.TopSecurityManager; import org.netbeans.core.ModuleActions; -import org.netbeans.progress.module.Controller; -import org.netbeans.progress.spi.InternalHandle; +import org.netbeans.modules.progress.spi.Controller; +import org.netbeans.modules.progress.spi.InternalHandle; import org.openide.DialogDescriptor; import org.openide.DialogDisplayer; import org.openide.awt.Mnemonics; --- a/core.execution/test/unit/src/org/netbeans/core/execution/PendingTaskTest.java +++ a/core.execution/test/unit/src/org/netbeans/core/execution/PendingTaskTest.java @@ -47,9 +47,9 @@ import org.netbeans.api.progress.ProgressHandle; import org.netbeans.api.progress.ProgressHandleFactory; import org.netbeans.junit.NbTestCase; -import org.netbeans.progress.module.Controller; -import org.netbeans.progress.spi.ProgressEvent; -import org.netbeans.progress.spi.ProgressUIWorker; +import org.netbeans.modules.progress.spi.Controller; +import org.netbeans.modules.progress.spi.ProgressEvent; +import org.netbeans.modules.progress.spi.ProgressUIWorker; import org.openide.actions.ActionManager; import org.openide.util.RequestProcessor; --- a/core.output2/manifest.mf +++ a/core.output2/manifest.mf @@ -1,7 +1,7 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.core.output2/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/core/output2/Bundle.properties -OpenIDE-Module-Implementation-Version: 1 OpenIDE-Module-Provides: org.openide.windows.IOProvider AutoUpdate-Essential-Module: true +OpenIDE-Module-Specification-Version: 1.16 --- a/core.output2/nbproject/project.properties +++ a/core.output2/nbproject/project.properties @@ -40,5 +40,4 @@ is.autoload=true javac.compilerargs=-Xlint -Xlint:-serial javac.source=1.5 -spec.version.base=1.15.0 javadoc.arch=${basedir}/arch.xml --- a/core.output2/src/org/netbeans/core/output2/ui/AbstractOutputPane.java +++ a/core.output2/src/org/netbeans/core/output2/ui/AbstractOutputPane.java @@ -258,6 +258,9 @@ } } + /** + * Accessed reflectively from org.netbeans.jellytools.OutputTabOperator. + */ public final Document getDocument() { return textView.getDocument(); } --- a/core.output2/src/org/netbeans/core/output2/ui/AbstractOutputTab.java +++ a/core.output2/src/org/netbeans/core/output2/ui/AbstractOutputTab.java @@ -145,7 +145,10 @@ protected abstract AbstractOutputPane createOutputPane(); protected abstract void inputSent (String txt); - + + /** + * Accessed reflectively from org.netbeans.jellytools.OutputTabOperator. + */ public final AbstractOutputPane getOutputPane() { return outputPane; } --- a/core.startup/manifest.mf +++ a/core.startup/manifest.mf @@ -3,4 +3,5 @@ OpenIDE-Module-Localizing-Bundle: org/netbeans/core/startup/Bundle.properties OpenIDE-Module-Layer: org/netbeans/core/startup/layer.xml OpenIDE-Module-Provides: org.openide.modules.InstalledFileLocator +OpenIDE-Module-Specification-Version: 1.23 --- a/core.startup/nbproject/project.properties +++ a/core.startup/nbproject/project.properties @@ -37,7 +37,6 @@ # Version 2 license, then the option applies only if the new code is # made subject to such option by the copyright holder. -spec.version.base=1.22.0 javadoc.arch=${basedir}/arch.xml javac.compilerargs=-Xlint -Xlint:-serial javac.source=1.5 --- a/core.startup/nbproject/project.xml +++ a/core.startup/nbproject/project.xml @@ -76,7 +76,7 @@ - + 8.1 @@ -84,7 +84,7 @@ - + 8.2 --- a/core.startup/src/org/netbeans/core/startup/preferences/PreferencesProviderImpl.java +++ a/core.startup/src/org/netbeans/core/startup/preferences/PreferencesProviderImpl.java @@ -43,12 +43,13 @@ import java.util.prefs.Preferences; import org.netbeans.Util; -import org.netbeans.modules.openide.util.PreferencesProvider; +import org.openide.util.lookup.ServiceProvider; +import org.openide.util.spi.PreferencesProvider; /** * @author Radek Matous */ -@org.openide.util.lookup.ServiceProvider(service=org.netbeans.modules.openide.util.PreferencesProvider.class) +@ServiceProvider(service=PreferencesProvider.class) public class PreferencesProviderImpl implements PreferencesProvider { /** Creates a new instance of PreferencesProviderImpl */ public PreferencesProviderImpl() { --- a/core.ui/manifest.mf +++ a/core.ui/manifest.mf @@ -4,4 +4,5 @@ OpenIDE-Module-Layer: org/netbeans/core/ui/resources/layer.xml AutoUpdate-Show-In-Client: false AutoUpdate-Essential-Module: true +OpenIDE-Module-Specification-Version: 1.21 --- a/core.ui/nbproject/project.properties +++ a/core.ui/nbproject/project.properties @@ -40,4 +40,3 @@ javac.compilerargs=-Xlint:unchecked javac.source=1.5 javadoc.arch=${basedir}/arch.xml -spec.version.base=1.20.0 --- a/core.ui/nbproject/project.xml +++ a/core.ui/nbproject/project.xml @@ -118,7 +118,7 @@ - + 7.34 --- a/core.ui/src/org/netbeans/core/ui/options/filetypes/FileAssociationsModel.java +++ a/core.ui/src/org/netbeans/core/ui/options/filetypes/FileAssociationsModel.java @@ -47,7 +47,6 @@ import java.util.Set; import java.util.TreeSet; import java.util.logging.Logger; -import org.netbeans.modules.openide.filesystems.declmime.MIMEResolverImpl; import org.openide.filesystems.FileChangeAdapter; import org.openide.filesystems.FileChangeListener; import org.openide.filesystems.FileEvent; @@ -56,13 +55,14 @@ import org.openide.filesystems.FileStateInvalidException; import org.openide.filesystems.FileSystem; import org.openide.filesystems.FileUtil; +import org.openide.filesystems.MIMEResolver; import org.openide.util.Exceptions; /** Model holds mapping between extension and MIME type. * * @author Jiri Skrivanek */ -final class FileAssociationsModel { +final class FileAssociationsModel extends MIMEResolver.UIHelpers { private static final String MIME_RESOLVERS_PATH = "Services/MIMEResolver"; //NOI18N private static final Logger LOGGER = Logger.getLogger(FileAssociationsModel.class.getName()); @@ -94,6 +94,20 @@ /** Creates new model. */ FileAssociationsModel() { + // the following code is a dirty trick to allow the UIHelpers class + // to be a nested class (and thus not be visible in the general javadoc) + // in the openide.filesystems API + // It does not matter that you suffer reading this code. The important + // thing is that millions of users of openide.filesystems are not + // disturbed by presence of UIHelpers class or its methods + // in javadoc overview. + new MIMEResolver() { + @Override + public String findMIMEType(FileObject fo) { + return null; + } + }.super(); + FileObject resolvers = FileUtil.getConfigFile(MIME_RESOLVERS_PATH); if (resolvers != null) { resolvers.addFileChangeListener(FileUtil.weakFileChangeListener(mimeResolversListener, resolvers)); @@ -252,7 +266,7 @@ } extensions.add(extension); } - MIMEResolverImpl.storeUserDefinedResolver(mimeToExtensions); + storeUserDefinedResolver(mimeToExtensions); } private void init() { @@ -261,9 +275,9 @@ } LOGGER.fine("FileAssociationsModel.init"); //NOI18N initialized = true; - for (FileObject mimeResolverFO : MIMEResolverImpl.getOrderedResolvers().values()) { - boolean userDefined = MIMEResolverImpl.isUserDefined(mimeResolverFO); - Map> mimeToExtensions = MIMEResolverImpl.getMIMEToExtensions(mimeResolverFO); + for (FileObject mimeResolverFO : getOrderedResolvers()) { + boolean userDefined = isUserDefined(mimeResolverFO); + Map> mimeToExtensions = getMIMEToExtensions(mimeResolverFO); for (Map.Entry> entry : mimeToExtensions.entrySet()) { String mimeType = entry.getKey(); Set extensions = entry.getValue(); --- a/core.windows/manifest.mf +++ a/core.windows/manifest.mf @@ -6,4 +6,5 @@ OpenIDE-Module-Recommends: org.netbeans.core.windows.nativeaccess.NativeWindowSystem AutoUpdate-Show-In-Client: false AutoUpdate-Essential-Module: true +OpenIDE-Module-Specification-Version: 2.20 --- a/core.windows/nbproject/project.properties +++ a/core.windows/nbproject/project.properties @@ -39,7 +39,6 @@ javac.compilerargs=-Xlint:unchecked javac.source=1.5 -spec.version.base=2.19.0 test.config.commit.includes=**/Validate*Test.class --- a/core.windows/nbproject/project.xml +++ a/core.windows/nbproject/project.xml @@ -123,7 +123,7 @@ - + 6.25 --- a/jellytools.platform/manifest.mf +++ a/jellytools.platform/manifest.mf @@ -1,4 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.jellytools.platform/3 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/jellytools/platform/Bundle.properties +OpenIDE-Module-Specification-Version: 3.4 --- a/jellytools.platform/nbproject/project.properties +++ a/jellytools.platform/nbproject/project.properties @@ -1,7 +1,6 @@ is.autoload=true javac.source=1.5 javac.compilerargs=-Xlint -Xlint:-serial -spec.version.base=3.3.0 test.config.stable.includes=**/*Test.class test.config.bundle.includes=**/PlatformBundleKeysTest.class --- a/jellytools.platform/nbproject/project.xml +++ a/jellytools.platform/nbproject/project.xml @@ -42,11 +42,9 @@ org.netbeans.core.output2 - - 1 - + 1.16 --- a/jellytools.platform/src/org/netbeans/jellytools/OutputTabOperator.java +++ a/jellytools.platform/src/org/netbeans/jellytools/OutputTabOperator.java @@ -49,7 +49,6 @@ import javax.swing.JTabbedPane; import javax.swing.KeyStroke; import javax.swing.text.Document; -import org.netbeans.core.output2.ui.AbstractOutputTab; import org.netbeans.jellytools.actions.Action; import org.netbeans.jellytools.actions.CopyAction; import org.netbeans.jellytools.actions.FindAction; @@ -255,7 +254,7 @@ // ((OutputTab)getSource()).getDocument().getLength(); return runMapping(new MapIntegerAction("getLength") { public int map() { - Document document = ((AbstractOutputTab)getSource()).getOutputPane().getDocument(); + Document document = documentForTab(getSource()); try { Class clazz = Class.forName("org.netbeans.core.output2.OutputDocument"); Method getLengthMethod = clazz.getDeclaredMethod("getLength", (Class[])null); @@ -292,7 +291,7 @@ final int length = getLength(); return (String)runMapping(new MapAction("getText") { public Object map() { - Document document = ((AbstractOutputTab)getSource()).getOutputPane().getDocument(); + Document document = documentForTab(getSource()); try { Class clazz = Class.forName("org.netbeans.core.output2.OutputDocument"); Method getTextMethod = clazz.getDeclaredMethod("getText", new Class[] {int.class, int.class}); @@ -341,7 +340,7 @@ public int getLineCount() { return ((Integer)runMapping(new MapAction("getLineCount") { public Object map() { - Document document = ((AbstractOutputTab)getSource()).getOutputPane().getDocument(); + Document document = documentForTab(getSource()); try { Class clazz = Class.forName("org.netbeans.core.output2.OutputDocument"); Method getElementCountMethod = clazz.getDeclaredMethod("getElementCount", (Class[])null); @@ -361,7 +360,7 @@ // first make component visible because tab must be visible to dispatch events makeComponentVisible(); if(outputPaneOperator == null) { - outputPaneOperator = ComponentOperator.createOperator(((AbstractOutputTab)getSource()).getOutputPane()); + outputPaneOperator = ComponentOperator.createOperator(outputPaneForTab(getSource())); outputPaneOperator.copyEnvironment(this); } return outputPaneOperator; @@ -374,7 +373,7 @@ public String getLine(final int line) { return (String)runMapping(new MapAction("getText") { public Object map() { - Document document = ((AbstractOutputTab)getSource()).getOutputPane().getDocument(); + Document document = documentForTab(getSource()); try { Class clazz = Class.forName("org.netbeans.core.output2.OutputDocument"); Method getLineStartMethod = clazz.getDeclaredMethod("getLineStart", new Class[] {int.class}); @@ -396,6 +395,23 @@ }}); } + private static Component outputPaneForTab(Component tab) { + try { + return (Component) tab.getClass().getMethod("getOutputPane").invoke(tab); + } catch (Exception x) { + throw new JemmyException("Reflection failed: " + x, x); + } + } + + private static Document documentForTab(Component tab) { + Component pane = outputPaneForTab(tab); + try { + return (Document) pane.getClass().getMethod("getDocument").invoke(pane); + } catch (Exception x) { + throw new JemmyException("Reflection failed: " + x, x); + } + } + /** SubChooser to determine OutputTab component * Used in findTopComponent method. */ --- a/openide.actions/manifest.mf +++ a/openide.actions/manifest.mf @@ -2,4 +2,5 @@ OpenIDE-Module: org.openide.actions OpenIDE-Module-Localizing-Bundle: org/openide/actions/Bundle.properties AutoUpdate-Essential-Module: true +OpenIDE-Module-Specification-Version: 6.14 --- a/openide.actions/nbproject/project.properties +++ a/openide.actions/nbproject/project.properties @@ -44,4 +44,3 @@ javadoc.arch=${basedir}/arch.xml javadoc.apichanges=${basedir}/apichanges.xml -spec.version.base=6.13.0 --- a/openide.actions/nbproject/project.xml +++ a/openide.actions/nbproject/project.xml @@ -47,19 +47,27 @@ org.openide.actions - org.openide.util + org.openide.awt - + 6.5 - org.openide.util.lookup + org.openide.dialogs - + 6.2 + + + + org.openide.explorer + + + + 6.8 @@ -71,14 +79,6 @@ - org.openide.awt - - - - 6.5 - - - org.openide.text @@ -87,19 +87,19 @@ - org.openide.explorer + org.openide.util - 6.8 + 8.1 - org.openide.dialogs + org.openide.util.lookup - 6.2 + 8.2 --- a/openide.actions/src/org/netbeans/modules/openide/actions/ActionsBridgeImpl.java +++ a/openide.actions/src/org/netbeans/modules/openide/actions/ActionsBridgeImpl.java @@ -41,14 +41,18 @@ package org.netbeans.modules.openide.actions; +import org.openide.util.lookup.ServiceProvider; +import org.openide.util.spi.ActionsBridge; + /** Implements the delegation to ActionManager that is called from * openide/util. */ -@org.openide.util.lookup.ServiceProvider(service=org.netbeans.modules.openide.util.ActionsBridge.class) -public class ActionsBridgeImpl extends org.netbeans.modules.openide.util.ActionsBridge { +@ServiceProvider(service=ActionsBridge.class) +public class ActionsBridgeImpl extends ActionsBridge { /** Invokes an action. */ + @SuppressWarnings("deprecation") protected void invokeAction (javax.swing.Action action, java.awt.event.ActionEvent ev) { org.openide.actions.ActionManager.getDefault().invokeAction(action, ev); } --- a/openide.awt/manifest.mf +++ a/openide.awt/manifest.mf @@ -2,4 +2,5 @@ OpenIDE-Module: org.openide.awt OpenIDE-Module-Localizing-Bundle: org/openide/awt/Bundle.properties AutoUpdate-Essential-Module: true +OpenIDE-Module-Specification-Version: 7.21 --- a/openide.awt/nbproject/project.properties +++ a/openide.awt/nbproject/project.properties @@ -43,4 +43,3 @@ javadoc.arch=${basedir}/arch.xml javadoc.apichanges=${basedir}/apichanges.xml -spec.version.base=7.20.0 --- a/openide.awt/nbproject/project.xml +++ a/openide.awt/nbproject/project.xml @@ -51,7 +51,7 @@ - + 8.1 --- a/openide.awt/src/org/netbeans/modules/openide/awt/DefaultAWTBridge.java +++ a/openide.awt/src/org/netbeans/modules/openide/awt/DefaultAWTBridge.java @@ -56,11 +56,13 @@ import org.openide.awt.DynamicMenuContent; import org.openide.util.actions.BooleanStateAction; import org.openide.util.actions.SystemAction; +import org.openide.util.lookup.ServiceProvider; +import org.openide.util.spi.ActionPresenterProvider; /** Default implementaiton of presenters for various action types. */ -@org.openide.util.lookup.ServiceProvider(service=org.netbeans.modules.openide.util.AWTBridge.class) -public final class DefaultAWTBridge extends org.netbeans.modules.openide.util.AWTBridge { +@ServiceProvider(service=ActionPresenterProvider.class) +public final class DefaultAWTBridge extends ActionPresenterProvider { public JMenuItem createMenuPresenter (Action action) { if (action instanceof BooleanStateAction) { BooleanStateAction b = (BooleanStateAction)action; --- a/openide.awt/src/org/openide/awt/AlwaysEnabledAction.java +++ a/openide.awt/src/org/openide/awt/AlwaysEnabledAction.java @@ -21,8 +21,6 @@ import javax.swing.Icon; import javax.swing.JCheckBoxMenuItem; import javax.swing.JMenuItem; -import org.netbeans.modules.openide.util.ActionsBridge; -import org.netbeans.modules.openide.util.ActionsBridge.ActionRunnable; import org.openide.util.ContextAwareAction; import org.openide.util.ImageUtilities; import org.openide.util.Lookup; @@ -30,6 +28,8 @@ import org.openide.util.LookupListener; import org.openide.util.NbPreferences; import org.openide.util.actions.Presenter; +import org.openide.util.spi.ActionsBridge; +import org.openide.util.spi.ActionsBridge.ActionRunnable; /** Lazily initialized always enabled action * --- a/openide.awt/src/org/openide/awt/GeneralAction.java +++ a/openide.awt/src/org/openide/awt/GeneralAction.java @@ -50,14 +50,14 @@ import java.util.logging.Logger; import javax.swing.Action; import javax.swing.ActionMap; -import org.netbeans.modules.openide.util.ActionsBridge; -import org.netbeans.modules.openide.util.ActionsBridge.ActionRunnable; import org.openide.awt.ContextAction.Performer; import org.openide.util.ContextAwareAction; import org.openide.util.Lookup; import org.openide.util.Parameters; import org.openide.util.Utilities; import org.openide.util.WeakListeners; +import org.openide.util.spi.ActionsBridge; +import org.openide.util.spi.ActionsBridge.ActionRunnable; /** * --- a/openide.explorer/manifest.mf +++ a/openide.explorer/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.openide.explorer -OpenIDE-Module-Implementation-Version: 1 OpenIDE-Module-Localizing-Bundle: org/openide/explorer/Bundle.properties AutoUpdate-Essential-Module: true +OpenIDE-Module-Specification-Version: 6.25 --- a/openide.explorer/nbproject/project.properties +++ a/openide.explorer/nbproject/project.properties @@ -44,4 +44,3 @@ javadoc.arch=${basedir}/arch.xml javadoc.apichanges=${basedir}/apichanges.xml -spec.version.base=6.24.0 --- a/openide.explorer/nbproject/project.xml +++ a/openide.explorer/nbproject/project.xml @@ -55,6 +55,14 @@ + org.netbeans.swing.tabcontrol + + + + 1.20 + + + org.openide.awt --- a/openide.explorer/src/org/netbeans/modules/openide/explorer/TabbedContainerBridge.java +++ a/openide.explorer/src/org/netbeans/modules/openide/explorer/TabbedContainerBridge.java @@ -43,30 +43,16 @@ import javax.swing.JComponent; import javax.swing.event.ChangeListener; -import org.openide.util.Lookup; /** - * An architectural hack - until PropertySheet is separated and openide - * split up, openide cannot depend on module code due to classloader - * restrictions. So we have an interface which will supply a bridge to - * the tabcontrol code; an implementation of this interface is provided - * over org.netbeans.swing.tabcontrol.TabbedContainer (in core/swing/tabcontrol) - * by the window system which depends on it. - * - * @see org.netbeans.core.windows.view.ui.tabcontrol.TabbedContainerBridgeImpl - * @author Tim Boudreau + * A separate class only for historical reasons. Could be inlined into PSheet if desired. */ public abstract class TabbedContainerBridge { protected TabbedContainerBridge(){}; public static TabbedContainerBridge getDefault() { - TabbedContainerBridge result = Lookup.getDefault().lookup (TabbedContainerBridge.class); - if (result == null) { - //unit test or standalone library operation - return new TrivialTabbedContainerBridgeImpl(); - } - return result; + return new TabbedContainerBridgeImpl(); } public abstract JComponent createTabbedContainer(); --- a/core.windows/src/org/netbeans/core/windows/view/ui/tabcontrol/TabbedContainerBridgeImpl.java +++ a/core.windows/src/org/netbeans/core/windows/view/ui/tabcontrol/TabbedContainerBridgeImpl.java @@ -38,34 +38,18 @@ * Version 2 license, then the option applies only if the new code is * made subject to such option by the copyright holder. */ -/* - * TabbedContainerBridgeImpl.java - * - * Created on June 1, 2004, 6:42 PM - */ -package org.netbeans.core.windows.view.ui.tabcontrol; +package org.netbeans.modules.openide.explorer; import java.util.List; -import java.util.Arrays; import javax.swing.JComponent; import javax.swing.event.ChangeListener; import org.netbeans.swing.tabcontrol.ComponentConverter; import org.netbeans.swing.tabcontrol.TabData; import org.netbeans.swing.tabcontrol.TabbedContainer; import org.netbeans.swing.tabcontrol.TabDataModel; -import org.netbeans.modules.openide.explorer.TabbedContainerBridge; -/** - * Implementation of org.netbeans.modules.explorer.TabbedContainerBridge, as - * used by the property sheet. This class allows the property sheet to use - * TabbedContainer without openide explicitly depending on the TabControl - * library (currently impossible). - * - * @author Tim Boudreau - */ -@org.openide.util.lookup.ServiceProvider(service=org.netbeans.modules.openide.explorer.TabbedContainerBridge.class) -public class TabbedContainerBridgeImpl extends TabbedContainerBridge { +class TabbedContainerBridgeImpl extends TabbedContainerBridge { /** Creates a new instance of TabbedContainerBridgeImpl */ public TabbedContainerBridgeImpl() { --- a/openide.explorer/src/org/netbeans/modules/openide/explorer/TrivialTabbedContainerBridgeImpl.java +++ a/openide.explorer/src/org/netbeans/modules/openide/explorer/TrivialTabbedContainerBridgeImpl.java @@ -1,127 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 1997-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]" - * - * Contributor(s): - * - * The Original Software is NetBeans. The Initial Developer of the Original - * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun - * Microsystems, Inc. All Rights Reserved. - * - * 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. - */ -package org.netbeans.modules.openide.explorer; - -import javax.swing.*; -import javax.swing.event.ChangeListener; - -import java.awt.*; - -/** - * Trivial implementation of TabbedContainerBridge for use with unit tests, etc. - * Does not actually support changing tabs, this is just so things link and do not - * throw NPEs. - *

- * Given sufficient interest, a JTabbedPane implementation could be provided, - * though there are some non-trivial difficulties getting a JTabbedPane to show - * the same component for all tabs, and the technique that worked on 1.4 does not - * work on 1.5. - * - */ -public class TrivialTabbedContainerBridgeImpl extends TabbedContainerBridge { - public TrivialTabbedContainerBridgeImpl() { - - } - - public JComponent createTabbedContainer() { - JPanel result = new JPanel(); - result.setLayout (new BorderLayout()); - result.putClientProperty ("titles", new String[0]); - result.putClientProperty ("items", new Object[0]); - return result; - } - - public void setInnerComponent(JComponent container, JComponent inner) { - if (container.getComponentCount() > 0) { - container.removeAll(); - } - container.add (inner, BorderLayout.CENTER); - } - - public JComponent getInnerComponent(JComponent jc) { - JComponent result = null; - if (jc.getComponentCount() > 0 && jc.getComponent(0) instanceof JComponent) { - result = (JComponent) jc.getComponent(0); - } - return result; - } - - public Object[] getItems(JComponent jc) { - return new Object[0]; - } - - public void setItems(JComponent jc, Object[] objects, String[] titles) { - jc.putClientProperty ("items", objects); - jc.putClientProperty ("titles", titles); - } - - public void attachSelectionListener(JComponent jc, ChangeListener listener) { - //do nothing - } - - public void detachSelectionListener(JComponent jc, ChangeListener listener) { - //do nothing - } - - public Object getSelectedItem(JComponent jc) { - Object[] items = (Object[]) jc.getClientProperty ("items"); - if (items != null && items.length > 0) { - return items[0]; - } - return null; - } - - public void setSelectedItem(JComponent jc, Object selection) { - //do nothing - } - - public boolean setSelectionByName(JComponent jc, String tabname) { - return false; - } - - public String getCurrentSelectedTabName(JComponent jc) { - String[] titles = (String[]) jc.getClientProperty("titles"); - if (titles != null && titles.length > 0) { - return titles[0]; - } - return ""; //NOI18N - } -} --- a/openide.filesystems/apichanges.xml +++ a/openide.filesystems/apichanges.xml @@ -46,6 +46,24 @@ Filesystems API + + +

Access methods added to MIMEResolver.UIHelpers + + + + + +

+ Several internal methods were added to nested class + of MIMEResolver - UIHelpers + for use from other parts of the NetBeans Platform. Use from + other modules is not supported. +

+
+ + +
Support for recursive listeners --- a/openide.filesystems/manifest.mf +++ a/openide.filesystems/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.openide.filesystems -OpenIDE-Module-Implementation-Version: 1 OpenIDE-Module-Localizing-Bundle: org/openide/filesystems/Bundle.properties OpenIDE-Module-Layer: org/openide/filesystems/resources/layer.xml +OpenIDE-Module-Specification-Version: 7.34 --- a/openide.filesystems/nbproject/project.properties +++ a/openide.filesystems/nbproject/project.properties @@ -44,4 +44,3 @@ javadoc.main.page=org/openide/filesystems/doc-files/api.html javadoc.arch=${basedir}/arch.xml javadoc.apichanges=${basedir}/apichanges.xml -spec.version.base=7.33.0 --- a/openide.filesystems/nbproject/project.xml +++ a/openide.filesystems/nbproject/project.xml @@ -51,7 +51,7 @@ - + 8.0 @@ -59,7 +59,7 @@ - + 8.1 --- a/openide.filesystems/src/org/netbeans/modules/openide/filesystems/RecognizeInstanceFiles.java +++ a/openide.filesystems/src/org/netbeans/modules/openide/filesystems/RecognizeInstanceFiles.java @@ -41,7 +41,6 @@ import java.util.Map; import java.util.logging.Level; import java.util.logging.Logger; -import org.netbeans.modules.openide.util.NamedServicesProvider; import org.openide.filesystems.FileAttributeEvent; import org.openide.filesystems.FileChangeListener; import org.openide.filesystems.FileEvent; @@ -58,8 +57,9 @@ import org.openide.util.lookup.Lookups; import org.openide.util.lookup.ProxyLookup; import org.openide.util.lookup.ServiceProvider; +import org.openide.util.lookup.implspi.NamedServicesProvider; -/** Interface for core/startup to provide lookup overt system filesystem. +/** Interface for core/startup to provide lookup over system filesystem. * * @author Jaroslav Tulach */ --- a/openide.filesystems/src/org/netbeans/modules/openide/filesystems/declmime/MIMEResolverImpl.java +++ a/openide.filesystems/src/org/netbeans/modules/openide/filesystems/declmime/MIMEResolverImpl.java @@ -46,6 +46,7 @@ import java.io.InputStream; import java.io.OutputStream; import java.util.ArrayList; +import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; @@ -244,13 +245,12 @@ }); } - /** Returns map of all registered MIMEResolver instances in revers order, + /** Lists registered MIMEResolver instances in reverse order, * i.e. first are ones with lower priority (position attribute higher) * and last are ones with highest prority (position attribute lower). - * @return map of all registered MIMEResolver instances in revers order - * (highest priority last) + * @return list of all registered MIMEResolver instances in reverse order */ - public static Map getOrderedResolvers() { + public static Collection getOrderedResolvers() { // scan resolvers and order them to be able to assign extension to mime type from resolver with the lowest position FileObject[] resolvers = FileUtil.getConfigFile(MIME_RESOLVERS_PATH).getChildren(); TreeMap orderedResolvers = new TreeMap(Collections.reverseOrder()); @@ -264,7 +264,7 @@ } orderedResolvers.put(position, mimeResolverFO); } - return orderedResolvers; + return orderedResolvers.values(); } // MIMEResolver ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- a/openide.filesystems/src/org/openide/filesystems/FileUtil.java +++ a/openide.filesystems/src/org/openide/filesystems/FileUtil.java @@ -1470,7 +1470,7 @@ public static List getMIMETypeExtensions(String mimeType) { Parameters.notEmpty("mimeType", mimeType); //NOI18N HashMap extensionToMime = new HashMap(); - for (FileObject mimeResolverFO : MIMEResolverImpl.getOrderedResolvers().values()) { + for (FileObject mimeResolverFO : MIMEResolverImpl.getOrderedResolvers()) { Map> mimeToExtensions = MIMEResolverImpl.getMIMEToExtensions(mimeResolverFO); for (Map.Entry> entry : mimeToExtensions.entrySet()) { String mimeKey = entry.getKey(); --- a/openide.filesystems/src/org/openide/filesystems/MIMEResolver.java +++ a/openide.filesystems/src/org/openide/filesystems/MIMEResolver.java @@ -40,6 +40,10 @@ */ package org.openide.filesystems; +import java.util.Collection; +import java.util.Map; +import java.util.Set; +import org.netbeans.modules.openide.filesystems.declmime.MIMEResolverImpl; import org.openide.util.Parameters; /** @@ -104,4 +108,71 @@ String[] getMIMETypes() { return resolvableMIMETypes; } + + /** Internal support for implementors of MIME resolver UIs. + * + * @since 7.34 + */ + public abstract class UIHelpers { + + /** Throws an exception. Allows instantiation only by known subclasses. + * @throws IllegalStateException + */ + protected UIHelpers() { + if (getClass().getName().equals("org.netbeans.core.ui.options.filetypes.FileAssociationsModel")) { // NOI18N + // only core.ui is allowed to use methods of this class. + return; + } + throw new IllegalStateException(); + } + + /** + * Stores declarative resolver corresponding to specified mapping of MIME type + * and set of extensions. This resolver has the highest priority. Usually + * it resides in userdir/config/Servicer/MIMEResolver. + *

Not intended for use by modules outside the NetBeans Platform. + * @param mimeToExtensions mapping of MIME type to set of extensions like + * {@code {image/jpeg=[jpg, jpeg], image/gif=[]}} + * @since org.openide.filesystems 7.34 + */ + protected final void storeUserDefinedResolver(final Map> mimeToExtensions) { + MIMEResolverImpl.storeUserDefinedResolver(mimeToExtensions); + } + + /** + * Lists registered MIMEResolver instances in reverse order, + * i.e. first are ones with lower priority (position attribute higher) + * and last are ones with highest prority (position attribute lower). + *

Not intended for use by modules outside the NetBeans Platform. + * @return list of all registered MIME resolver definitions in reverse order + * @since org.openide.filesystems 7.34 + */ + protected final Collection getOrderedResolvers() { + return MIMEResolverImpl.getOrderedResolvers(); + } + + /** + * Checks whether a given resolver is user-defined. + *

Not intended for use by modules outside the NetBeans Platform. + * @param mimeResolverFO resolver definition + * @return true if the specified file is a user-defined MIME resolver, false otherwise + * @since org.openide.filesystems 7.34 + */ + protected final boolean isUserDefined(FileObject mimeResolverFO) { + return MIMEResolverImpl.isUserDefined(mimeResolverFO); + } + + /** + * Returns mapping of MIME type to set of extensions. + *

Not intended for use by modules outside the NetBeans Platform. + * @param fo MIMEResolver definition + * @return mapping of MIME type to set of extensions like + * {@code {image/jpeg=[jpg, jpeg], image/gif=[]}} (never null but may be empty) + * @since org.openide.filesystems 7.34 + */ + protected final Map> getMIMEToExtensions(FileObject fo) { + return MIMEResolverImpl.getMIMEToExtensions(fo); + } + } + } --- a/openide.nodes/manifest.mf +++ a/openide.nodes/manifest.mf @@ -2,4 +2,5 @@ OpenIDE-Module: org.openide.nodes OpenIDE-Module-Localizing-Bundle: org/openide/nodes/Bundle.properties AutoUpdate-Essential-Module: true +OpenIDE-Module-Specification-Version: 7.14 --- a/openide.nodes/nbproject/project.properties +++ a/openide.nodes/nbproject/project.properties @@ -44,4 +44,3 @@ javadoc.arch=${basedir}/arch.xml javadoc.apichanges=${basedir}/apichanges.xml -spec.version.base=7.13.0 --- a/openide.nodes/nbproject/project.xml +++ a/openide.nodes/nbproject/project.xml @@ -67,7 +67,7 @@ - + 8.0 --- a/openide.nodes/src/org/openide/util/actions/NodeAction.java +++ a/openide.nodes/src/org/openide/util/actions/NodeAction.java @@ -168,6 +168,11 @@ */ @Override public boolean isEnabled() { + if ( + (SOURCE.get() instanceof Node) || (SOURCE.get() instanceof Node[]) + ) { + return true; + } Node[] ns = null; Boolean b = null; @@ -242,6 +247,7 @@ } } + private final ThreadLocal SOURCE = new ThreadLocal(); /** Perform the action with a specific action event. * Normally this simply calls {@link #performAction()}, that is using * the global node selection. @@ -261,28 +267,17 @@ @Override public void actionPerformed(final ActionEvent ev) { final Object s = (ev == null) ? null : ev.getSource(); + Object prev = SOURCE.get(); + try { + SOURCE.set(s); + superActionPerformed(ev); + } finally { + SOURCE.set(prev); + } + } - if (s instanceof Node) { - org.netbeans.modules.openide.util.ActionsBridge.doPerformAction( - this, - new org.netbeans.modules.openide.util.ActionsBridge.ActionRunnable(ev, this, amIasynchronous()) { - public void run() { - performAction(new Node[] { (Node) s }); - } - } - ); - } else if (s instanceof Node[]) { - org.netbeans.modules.openide.util.ActionsBridge.doPerformAction( - this, - new org.netbeans.modules.openide.util.ActionsBridge.ActionRunnable(ev, this, amIasynchronous()) { - public void run() { - performAction((Node[]) s); - } - } - ); - } else { - super.actionPerformed(ev); - } + final void superActionPerformed(ActionEvent ev) { + super.actionPerformed(ev); } /** Performs the action. @@ -293,7 +288,14 @@ */ @Deprecated public void performAction() { - performAction(getActivatedNodes()); + Object s = SOURCE.get(); + if (s instanceof Node) { + performAction(new Node[]{(Node) s}); + } else if (s instanceof Node[]) { + performAction((Node[]) s); + } else { + performAction(getActivatedNodes()); + } } /** Get the currently activated nodes. @@ -384,12 +386,6 @@ } } - /** Package private accessor. - */ - final boolean amIasynchronous() { - return asynchronous(); - } - /** Node listener to check whether the action is enabled or not */ private static final class NodesL implements LookupListener { @@ -582,14 +578,13 @@ /** Invoked when an action occurs. */ public void actionPerformed(ActionEvent e) { - org.netbeans.modules.openide.util.ActionsBridge.doPerformAction ( - delegate, - new org.netbeans.modules.openide.util.ActionsBridge.ActionRunnable(e, delegate, delegate.amIasynchronous()) { - public void run() { - delegate.performAction(nodes()); - } - } - ); + Object prev = delegate.SOURCE.get(); + try { + delegate.SOURCE.set(nodes()); + delegate.superActionPerformed(e); + } finally { + delegate.SOURCE.set(prev); + } } public void addPropertyChangeListener(PropertyChangeListener listener) { --- a/openide.util.lookup/apichanges.xml +++ a/openide.util.lookup/apichanges.xml @@ -46,6 +46,26 @@ Lookup API + + + Introducing semihidden SPI + + + + + +

+ Adding SPI interface package for those who implement + the NetBeans platform. This packages is not shown in javadoc + as it does not form generally available public API. +

+
+ +
Separate module for Lookup API --- a/openide.util.lookup/manifest.mf +++ a/openide.util.lookup/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.openide.util.lookup -OpenIDE-Module-Implementation-Version: 1 OpenIDE-Module-Localizing-Bundle: org/openide/util/lookup/Bundle.properties +OpenIDE-Module-Specification-Version: 8.2 --- a/openide.util.lookup/nbproject/project.properties +++ a/openide.util.lookup/nbproject/project.properties @@ -40,9 +40,9 @@ module.jar.dir=lib javac.source=1.5 javac.compilerargs=-Xlint -Xlint:-serial -spec.version.base=8.0.0 cp.extra=${nb_all}/apisupport.harness/external/openjdk-javac-6-b12.jar javadoc.arch=${basedir}/arch.xml javadoc.apichanges=${basedir}/apichanges.xml +module.javadoc.packages=org.openide.util,org.openide.util.lookup --- a/openide.util.lookup/nbproject/project.xml +++ a/openide.util.lookup/nbproject/project.xml @@ -22,6 +22,7 @@ org.openide.util org.openide.util.lookup + org.openide.util.lookup.implspi --- a/openide.util.lookup/src/org/netbeans/modules/openide/util/ServiceProviderProcessor.java +++ a/openide.util.lookup/src/org/netbeans/modules/openide/util/ServiceProviderProcessor.java @@ -60,6 +60,7 @@ import javax.lang.model.type.TypeMirror; import org.openide.util.lookup.ServiceProvider; import org.openide.util.lookup.ServiceProviders; +import org.openide.util.lookup.implspi.AbstractServiceProviderProcessor; @SupportedSourceVersion(SourceVersion.RELEASE_6) public class ServiceProviderProcessor extends AbstractServiceProviderProcessor { --- a/openide.util.lookup/src/org/openide/util/lookup/AbstractLookup.java +++ a/openide.util.lookup/src/org/openide/util/lookup/AbstractLookup.java @@ -40,15 +40,9 @@ */ package org.openide.util.lookup; -import java.io.PrintStream; -import org.openide.util.Lookup; -import org.openide.util.LookupEvent; -import org.openide.util.LookupListener; - import java.io.IOException; import java.io.ObjectOutputStream; import java.io.Serializable; - import java.lang.ref.ReferenceQueue; import java.lang.ref.WeakReference; import java.util.ArrayList; @@ -63,9 +57,11 @@ import java.util.Map; import java.util.Set; import java.util.TreeSet; - import java.util.concurrent.Executor; -import org.netbeans.modules.openide.util.ActiveQueue; +import org.openide.util.Lookup; +import org.openide.util.LookupEvent; +import org.openide.util.LookupListener; +import org.openide.util.lookup.implspi.ActiveQueue; /** Implementation of the lookup from OpenAPIs that is based on the --- a/openide.util.lookup/src/org/openide/util/lookup/Lookups.java +++ a/openide.util.lookup/src/org/openide/util/lookup/Lookups.java @@ -41,9 +41,14 @@ package org.openide.util.lookup; +import java.lang.ref.Reference; +import java.lang.ref.WeakReference; import java.util.Arrays; -import org.netbeans.modules.openide.util.NamedServicesProvider; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; import org.openide.util.Lookup; +import org.openide.util.lookup.implspi.NamedServicesProvider; /** * Static factory methods for creating common lookup implementations. @@ -214,7 +219,10 @@ * @since 7.9 */ public static Lookup forPath(String path) { - return NamedServicesProvider.find(path); + if (!path.endsWith("/")) { + path = path + "/"; + } + return NamedServicesProvider.forPath(path); } /** Creates a lookup that wraps another one and filters out instances --- a/openide.util.lookup/src/org/netbeans/modules/openide/util/AbstractServiceProviderProcessor.java +++ a/openide.util.lookup/src/org/netbeans/modules/openide/util/AbstractServiceProviderProcessor.java @@ -37,7 +37,7 @@ * Portions Copyrighted 2009 Sun Microsystems, Inc. */ -package org.netbeans.modules.openide.util; +package org.openide.util.lookup.implspi; import java.io.BufferedReader; import java.io.FileNotFoundException; @@ -79,8 +79,18 @@ private final Map>> originatingElementsByProcessor = new WeakHashMap>>(); private final Map verifiedClasses = new WeakHashMap(); - /** For access by subclasses. */ - protected AbstractServiceProviderProcessor() {} + /** Throws IllegalStateException. For access by selected subclasses. */ + protected AbstractServiceProviderProcessor() { + if (getClass().getName().equals("org.netbeans.modules.openide.util.ServiceProviderProcessor")) { // NOI18N + // OK subclass + return; + } + if (getClass().getName().equals("org.netbeans.modules.openide.util.URLStreamHandlerRegistrationProcessor")) { // NOI18N + // OK subclass + return; + } + throw new IllegalStateException(); + } public @Override final boolean process(Set annotations, RoundEnvironment roundEnv) { if (roundEnv.errorRaised()) { --- a/openide.util.lookup/src/org/netbeans/modules/openide/util/ActiveQueue.java +++ a/openide.util.lookup/src/org/netbeans/modules/openide/util/ActiveQueue.java @@ -1,4 +1,4 @@ -package org.netbeans.modules.openide.util; +package org.openide.util.lookup.implspi; import java.lang.ref.Reference; import java.lang.ref.ReferenceQueue; @@ -7,24 +7,22 @@ /** * Implementation of the active reference queue. + * @since 8.1 */ -public final class ActiveQueue extends ReferenceQueue implements Runnable { +public final class ActiveQueue { + + private ActiveQueue() {} private static final Logger LOGGER = Logger.getLogger(ActiveQueue.class.getName().replace('$', '.')); - private static ActiveQueue activeReferenceQueue; - - /** number of known outstanding references */ - private int count; - private boolean deprecated; + private static Impl activeReferenceQueue; - ActiveQueue(boolean deprecated) { - super(); - this.deprecated = deprecated; - } - + /** + * Gets the active reference queue. + * @return the singleton queue + */ public static synchronized ReferenceQueue queue() { if (activeReferenceQueue == null) { - activeReferenceQueue = new ActiveQueue(false); + activeReferenceQueue = new Impl(false); } activeReferenceQueue.ping(); @@ -32,6 +30,17 @@ return activeReferenceQueue; } + private static final class Impl extends ReferenceQueue implements Runnable { + + /** number of known outstanding references */ + private int count; + private boolean deprecated; + + Impl(boolean deprecated) { + super(); + this.deprecated = deprecated; + } + @Override public Reference poll() { throw new UnsupportedOperationException(); @@ -105,4 +114,7 @@ } count++; } + + } + } --- a/openide.util.lookup/src/org/netbeans/modules/openide/util/NamedServicesProvider.java +++ a/openide.util.lookup/src/org/netbeans/modules/openide/util/NamedServicesProvider.java @@ -29,7 +29,7 @@ * Portions Copyrighted 2006 Sun Microsystems, Inc. */ -package org.netbeans.modules.openide.util; +package org.openide.util.lookup.implspi; import java.lang.ref.Reference; import java.lang.ref.WeakReference; @@ -39,29 +39,48 @@ import org.openide.util.Lookup; import org.openide.util.lookup.Lookups; -/** Interface for core/startup and core/settings - * to provide lookup over system filesystem. +/** Infrastructure provider interface for those who control the overall + * registration of services in the system. The first instance of this interface + * found in {@link Lookup#getDefault()} is consulted when providing answers + * to {@link Lookups#forPath(java.lang.String)} queries. Current implementation + * is not ready for multiple instances of this interface (the first one wins) + * and also changing the instances during runtime. + * + *
+ * The basic implementation of this interface is provided in + * Filesystem API + * and recognizes the + * .instance files + * registered in XML layers. As such one can rely on + * .instance files + * being recognized in unit tests, if the + * Filesystem API + * is included. + * The implementation + * is then refined in + * Settings API + * to handle also .settings files. + * Again, including this module in unit tests + * ensures + * .settings files + * files are recognized. + *
* * @author Jaroslav Tulach + * @since 8.1 */ public abstract class NamedServicesProvider { + private static final Map> namedServicesProviders = Collections.synchronizedMap(new HashMap>()); - private static final Map> map = Collections.synchronizedMap(new HashMap>()); - - public abstract Lookup create(String path); - - public static Lookup find(String path) { - if (!path.endsWith("/")) { - path = path + "/"; - } - - Reference ref = map.get(path); + public static Lookup forPath(String path) { + + Reference ref = namedServicesProviders.get(path); Lookup lkp = ref == null ? null : ref.get(); if (lkp != null) { return lkp; } NamedServicesProvider prov = Lookup.getDefault().lookup(NamedServicesProvider.class); - if (prov != null && + if (prov != null && /* avoid stack overflow during initialization */ !path.startsWith( "URLStreamHandler/" @@ -79,9 +98,40 @@ } lkp = Lookups.metaInfServices(l, "META-INF/namedservices/" + path); } - - map.put(path, new WeakReference(lkp)); + + namedServicesProviders.put(path, new WeakReference(lkp)); return lkp; } + + /** Throws an exception. Prevents unwanted instantiation of this class + * by unknown subclasses. + */ + protected NamedServicesProvider() { + if (getClass().getName().equals("org.openide.util.lookup.PathInLookupTest$P")) { // NOI18N + // OK for tests + return; + } + if (getClass().getName().equals("org.openide.util.UtilitiesTest$NamedServicesProviderImpl")) { // NOI18N + // OK for tests + return; + } + if (getClass().getName().equals("org.netbeans.modules.openide.filesystems.RecognizeInstanceFiles")) { // NOI18N + // OK for openide.filesystems + return; + } + if (getClass().getName().equals("org.netbeans.modules.settings.RecognizeInstanceObjects")) { // NOI18N + // OK for settings + return; + } + throw new IllegalStateException(); + } + + /** Create the lookup for given path. Called as a result of query to + * {@link Lookups#forPath(java.lang.String)}. + * + * @param path the identification of the path + * @return the lookup representing objects in this path. + */ + protected abstract Lookup create(String path); } --- a/openide.util.lookup/src/org/openide/util/lookup/implspi/package-info.java +++ a/openide.util.lookup/src/org/openide/util/lookup/implspi/package-info.java @@ -0,0 +1,43 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright 2010 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 2010 Sun Microsystems, Inc. + */ + +/** + * Interfaces intended to be used within the NetBeans Platform. + */ +package org.openide.util.lookup.implspi; --- a/openide.util.lookup/test/unit/src/org/netbeans/modules/openide/util/ActiveQueueTest.java +++ a/openide.util.lookup/test/unit/src/org/netbeans/modules/openide/util/ActiveQueueTest.java @@ -45,6 +45,7 @@ import java.net.URL; import java.net.URLClassLoader; import org.netbeans.junit.NbTestCase; +import org.openide.util.lookup.implspi.ActiveQueue; /** * --- a/openide.util.lookup/test/unit/src/org/openide/util/lookup/AbstractLookupMemoryTest.java +++ a/openide.util.lookup/test/unit/src/org/openide/util/lookup/AbstractLookupMemoryTest.java @@ -41,10 +41,12 @@ package org.openide.util.lookup; -import java.util.*; -import org.netbeans.junit.*; -import org.netbeans.modules.openide.util.ActiveQueue; +import java.util.Arrays; +import java.util.Collections; +import org.netbeans.junit.NbTestCase; +import org.netbeans.junit.NbTestSuite; import org.openide.util.Lookup; +import org.openide.util.lookup.implspi.ActiveQueue; /** Testing memory consumption of various AbstractLookup aspects. */ --- a/openide.util.lookup/test/unit/src/org/openide/util/lookup/PathInLookupTest.java +++ a/openide.util.lookup/test/unit/src/org/openide/util/lookup/PathInLookupTest.java @@ -45,8 +45,8 @@ import java.util.logging.Level; import org.netbeans.junit.MockServices; import org.netbeans.junit.NbTestCase; -import org.netbeans.modules.openide.util.NamedServicesProvider; import org.openide.util.Lookup; +import org.openide.util.lookup.implspi.NamedServicesProvider; /** * @author Jaroslav Tulach @@ -98,8 +98,6 @@ new AbstractLookup(ic1), new AbstractLookup(ic2) }; - - @Override public Lookup create(String path) { int indx = -1; if (path.equals("MyServices/")) { --- a/openide.util.lookup/test/unit/src/org/openide/util/lookup/ProxyLookupTest.java +++ a/openide.util.lookup/test/unit/src/org/openide/util/lookup/ProxyLookupTest.java @@ -45,15 +45,17 @@ import java.lang.ref.Reference; import java.lang.ref.WeakReference; -import java.util.*; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; import java.util.concurrent.Executor; -import junit.framework.*; -import org.netbeans.junit.*; -import org.netbeans.modules.openide.util.ActiveQueue; +import junit.framework.Test; +import org.netbeans.junit.NbTestSuite; import org.openide.util.Lookup; import org.openide.util.Lookup.Result; import org.openide.util.LookupEvent; import org.openide.util.LookupListener; +import org.openide.util.lookup.implspi.ActiveQueue; /** Runs all NbLookupTest tests on ProxyLookup and adds few additional. */ --- a/openide.util/manifest.mf +++ a/openide.util/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.openide.util -OpenIDE-Module-Implementation-Version: 1 OpenIDE-Module-Localizing-Bundle: org/openide/util/Bundle.properties +OpenIDE-Module-Specification-Version: 8.1 --- a/openide.util/nbproject/project.properties +++ a/openide.util/nbproject/project.properties @@ -42,7 +42,6 @@ module.jar.dir=lib cp.extra=${nb_all}/apisupport.harness/external/openjdk-javac-6-b12.jar -spec.version.base=8.0.0 # For XMLSerializer, needed for XMLUtil.write to work w/ namespaces under JDK 1.4: --- a/openide.util/nbproject/project.xml +++ a/openide.util/nbproject/project.xml @@ -51,7 +51,7 @@ - + 8.2 @@ -77,10 +77,10 @@ org.openide org.openide.util + org.openide.util.actions org.openide.util.datatransfer - org.openide.util.actions - org.openide.util.lookup org.openide.util.io + org.openide.util.spi org.openide.xml --- a/openide.util/src/org/netbeans/modules/openide/util/URLStreamHandlerRegistrationProcessor.java +++ a/openide.util/src/org/netbeans/modules/openide/util/URLStreamHandlerRegistrationProcessor.java @@ -49,6 +49,7 @@ import javax.lang.model.element.TypeElement; import javax.lang.model.type.TypeMirror; import org.openide.util.URLStreamHandlerRegistration; +import org.openide.util.lookup.implspi.AbstractServiceProviderProcessor; @SupportedSourceVersion(SourceVersion.RELEASE_6) public class URLStreamHandlerRegistrationProcessor extends AbstractServiceProviderProcessor { --- a/openide.util/src/org/openide/util/NbPreferences.java +++ a/openide.util/src/org/openide/util/NbPreferences.java @@ -47,7 +47,7 @@ import java.util.logging.Level; import java.util.logging.Logger; import java.util.prefs.Preferences; -import org.netbeans.modules.openide.util.PreferencesProvider; +import org.openide.util.spi.PreferencesProvider; /** * Provides an implementation of the Preferences API which may be backed by --- a/openide.util/src/org/openide/util/Utilities.java +++ a/openide.util/src/org/openide/util/Utilities.java @@ -41,7 +41,6 @@ package org.openide.util; -import org.netbeans.modules.openide.util.ActiveQueue; import java.awt.BorderLayout; import java.awt.Component; import java.awt.Container; @@ -105,9 +104,10 @@ import javax.swing.KeyStroke; import javax.swing.SwingUtilities; import javax.swing.Timer; -import org.netbeans.modules.openide.util.AWTBridge; import org.openide.util.actions.Presenter; import org.openide.util.lookup.Lookups; +import org.openide.util.lookup.implspi.ActiveQueue; +import org.openide.util.spi.ActionPresenterProvider; /** Otherwise uncategorized useful static methods. * @@ -2737,10 +2737,10 @@ } } else { // We need to correctly handle mnemonics with '&' etc. - item = AWTBridge.getDefault().createPopupPresenter(action); + item = ActionPresenterProvider.getDefault().createPopupPresenter(action); } - for (Component c : AWTBridge.getDefault().convertComponents(item)) { + for (Component c : ActionPresenterProvider.getDefault().convertComponents(item)) { if (c instanceof JSeparator) { components.add(null); } else { @@ -2753,7 +2753,7 @@ } // Now create actual menu. Strip adjacent, leading, and trailing separators. - JPopupMenu menu = AWTBridge.getDefault().createEmptyPopup(); + JPopupMenu menu = ActionPresenterProvider.getDefault().createEmptyPopup(); boolean nonempty = false; // has anything been added yet? boolean pendingSep = false; // should there be a separator before any following item? for (Component c : components) { --- a/openide.util/src/org/openide/util/actions/BooleanStateAction.java +++ a/openide.util/src/org/openide/util/actions/BooleanStateAction.java @@ -62,7 +62,7 @@ * @return the JMenuItem representation for the Action */ public javax.swing.JMenuItem getMenuPresenter() { - return org.netbeans.modules.openide.util.AWTBridge.getDefault().createMenuPresenter(this); + return org.openide.util.spi.ActionPresenterProvider.getDefault().createMenuPresenter(this); } /* Returns a JMenuItem that presents the Action, that implements this @@ -71,7 +71,7 @@ * @return the JMenuItem representation for the Action */ public javax.swing.JMenuItem getPopupPresenter() { - return org.netbeans.modules.openide.util.AWTBridge.getDefault().createPopupPresenter(this); + return org.openide.util.spi.ActionPresenterProvider.getDefault().createPopupPresenter(this); } /* Returns a Component that presents the Action, that implements this @@ -79,7 +79,7 @@ * @return the Component representation for the Action */ public java.awt.Component getToolbarPresenter() { - return org.netbeans.modules.openide.util.AWTBridge.getDefault().createToolbarPresenter(this); + return org.openide.util.spi.ActionPresenterProvider.getDefault().createToolbarPresenter(this); } /** Get the current state. --- a/openide.util/src/org/openide/util/actions/CallableSystemAction.java +++ a/openide.util/src/org/openide/util/actions/CallableSystemAction.java @@ -85,7 +85,7 @@ * @return the JMenuItem representation for the Action */ public javax.swing.JMenuItem getMenuPresenter() { - return org.netbeans.modules.openide.util.AWTBridge.getDefault().createMenuPresenter(this); + return org.openide.util.spi.ActionPresenterProvider.getDefault().createMenuPresenter(this); } /* Returns a JMenuItem that presents the Action, that implements this @@ -93,7 +93,7 @@ * @return the JMenuItem representation for the Action */ public javax.swing.JMenuItem getPopupPresenter() { - return org.netbeans.modules.openide.util.AWTBridge.getDefault().createPopupPresenter(this); + return org.openide.util.spi.ActionPresenterProvider.getDefault().createPopupPresenter(this); } /* Returns a Component that presents the Action, that implements this @@ -101,7 +101,7 @@ * @return the Component representation for the Action */ public java.awt.Component getToolbarPresenter() { - return org.netbeans.modules.openide.util.AWTBridge.getDefault().createToolbarPresenter(this); + return org.openide.util.spi.ActionPresenterProvider.getDefault().createToolbarPresenter(this); } /** Actually perform the action. @@ -120,9 +120,9 @@ */ public void actionPerformed(ActionEvent ev) { if (isEnabled()) { - org.netbeans.modules.openide.util.ActionsBridge.doPerformAction( + org.openide.util.spi.ActionsBridge.doPerformAction( this, - new org.netbeans.modules.openide.util.ActionsBridge.ActionRunnable(ev, this, asynchronous()) { + new org.openide.util.spi.ActionsBridge.ActionRunnable(ev, this, asynchronous()) { public void run() { performAction(); } --- a/openide.util/src/org/openide/util/actions/CallbackSystemAction.java +++ a/openide.util/src/org/openide/util/actions/CallbackSystemAction.java @@ -225,9 +225,9 @@ final Object ap = getActionPerformer(); if (ap != null) { - org.netbeans.modules.openide.util.ActionsBridge.doPerformAction( + org.openide.util.spi.ActionsBridge.doPerformAction( this, - new org.netbeans.modules.openide.util.ActionsBridge.ActionRunnable(ev, this, asynchronous ()) { + new org.openide.util.spi.ActionsBridge.ActionRunnable(ev, this, asynchronous ()) { public void run() { if (ap == getActionPerformer()) { getActionPerformer().performAction(CallbackSystemAction.this); @@ -600,14 +600,14 @@ final Action a = findAction(); if (a != null) { - org.netbeans.modules.openide.util.ActionsBridge.ActionRunnable run; - run = new org.netbeans.modules.openide.util.ActionsBridge.ActionRunnable(e, delegate, delegate.asynchronous()) { + org.openide.util.spi.ActionsBridge.ActionRunnable run; + run = new org.openide.util.spi.ActionsBridge.ActionRunnable(e, delegate, delegate.asynchronous()) { public void run() { a.actionPerformed(e); } }; - org.netbeans.modules.openide.util.ActionsBridge.doPerformAction(delegate, run); + org.openide.util.spi.ActionsBridge.doPerformAction(delegate, run); } else { // XXX #30303 if the action falls back to the old behaviour // it may not be performed in case it is in dialog and @@ -707,7 +707,7 @@ return delegate.getMenuPresenter(); } else { - return org.netbeans.modules.openide.util.AWTBridge.getDefault().createMenuPresenter(this); + return org.openide.util.spi.ActionPresenterProvider.getDefault().createMenuPresenter(this); } } @@ -716,7 +716,7 @@ return delegate.getPopupPresenter(); } else { - return org.netbeans.modules.openide.util.AWTBridge.getDefault().createPopupPresenter(this); + return org.openide.util.spi.ActionPresenterProvider.getDefault().createPopupPresenter(this); } } @@ -725,7 +725,7 @@ return delegate.getToolbarPresenter(); } else { - return org.netbeans.modules.openide.util.AWTBridge.getDefault().createToolbarPresenter(this); + return org.openide.util.spi.ActionPresenterProvider.getDefault().createToolbarPresenter(this); } } --- a/openide.util/src/org/netbeans/modules/openide/util/AWTBridge.java +++ a/openide.util/src/org/netbeans/modules/openide/util/AWTBridge.java @@ -39,7 +39,7 @@ * made subject to such option by the copyright holder. */ -package org.netbeans.modules.openide.util; +package org.openide.util.spi; import java.awt.Component; import javax.swing.Action; @@ -56,12 +56,12 @@ * to allow more enhanced parts of the system to provide more enhanced * visualitions. */ -public abstract class AWTBridge extends Object { +public abstract class ActionPresenterProvider extends Object { /** Finds out the global implementtion of the object * @return the presenter */ - public static AWTBridge getDefault () { - AWTBridge ap = Lookup.getDefault().lookup(AWTBridge.class); + public static ActionPresenterProvider getDefault () { + ActionPresenterProvider ap = Lookup.getDefault().lookup(ActionPresenterProvider.class); return ap == null ? new Default () : ap; } @@ -95,7 +95,7 @@ // Default implementation of the the presenter // - private static final class Default extends AWTBridge { + private static final class Default extends ActionPresenterProvider { public JMenuItem createMenuPresenter(Action action) { return new JMenuItem(action); --- a/openide.util/src/org/netbeans/modules/openide/util/ActionsBridge.java +++ a/openide.util/src/org/netbeans/modules/openide/util/ActionsBridge.java @@ -39,18 +39,15 @@ * made subject to such option by the copyright holder. */ -package org.netbeans.modules.openide.util; +package org.openide.util.spi; import java.awt.event.ActionEvent; import java.beans.PropertyChangeListener; import javax.swing.Action; import org.openide.util.Lookup; import org.openide.util.RequestProcessor; -import org.openide.util.actions.CallableSystemAction; import org.openide.util.actions.SystemAction; -/** Allows Node action to get access to special tricks in CallableSystemAction. - */ public abstract class ActionsBridge extends Object { /** thread to run actions in */ private static RequestProcessor RP = new RequestProcessor("Module-Actions", Integer.MAX_VALUE); // NOI18N @@ -60,13 +57,7 @@ */ protected abstract void invokeAction(Action action, ActionEvent ev); - public static void doPerformAction(CallableSystemAction action, final ActionsBridge.ActionRunnable r) { - implPerformAction(action, r); - } public static void doPerformAction(Action action, final ActionsBridge.ActionRunnable r) { - implPerformAction(action, r); - } - private static void implPerformAction(Action action, final ActionsBridge.ActionRunnable r) { assert java.awt.EventQueue.isDispatchThread() : "Action " + action.getClass().getName() + " may not be invoked from the thread " + Thread.currentThread().getName() + ", only the event queue: http://www.netbeans.org/download/4_1/javadoc/OpenAPIs/apichanges.html#actions-event-thread"; --- a/openide.util/src/org/netbeans/modules/openide/util/PreferencesProvider.java +++ a/openide.util/src/org/netbeans/modules/openide/util/PreferencesProvider.java @@ -39,7 +39,7 @@ * made subject to such option by the copyright holder. */ -package org.netbeans.modules.openide.util; +package org.openide.util.spi; import java.util.prefs.Preferences; --- a/openide.util/src/org/openide/util/spi/package-info.java +++ a/openide.util/src/org/openide/util/spi/package-info.java @@ -0,0 +1,43 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright 2010 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 2010 Sun Microsystems, Inc. + */ + +/** + * Interfaces intended to be used within the NetBeans Platform. + */ +package org.openide.util.spi; --- a/openide.util/test/unit/src/org/openide/util/UtilitiesTest.java +++ a/openide.util/test/unit/src/org/openide/util/UtilitiesTest.java @@ -63,12 +63,12 @@ import junit.framework.Assert; import org.netbeans.junit.MockServices; import org.netbeans.junit.NbTestCase; -import org.netbeans.modules.openide.util.AWTBridge; -import org.netbeans.modules.openide.util.NamedServicesProvider; import org.openide.util.actions.Presenter; import org.openide.util.lookup.AbstractLookup; import org.openide.util.lookup.InstanceContent; import org.openide.util.lookup.Lookups; +import org.openide.util.lookup.implspi.NamedServicesProvider; +import org.openide.util.spi.ActionPresenterProvider; import org.openide.util.test.MockLookup; /** @@ -283,53 +283,7 @@ } public void testActionsForPath() throws Exception { - MockLookup.setInstances(new NamedServicesProvider() { - public Lookup create(String path) { - if (!path.equals("stuff/")) { - return Lookup.EMPTY; - } - InstanceContent content = new InstanceContent(); - InstanceContent.Convertor actionConvertor = new InstanceContent.Convertor() { - public Action convert(final String obj) { - return new AbstractAction() { - public void actionPerformed(ActionEvent e) {} - public @Override String toString() { - return obj; - } - - }; - } - public Class type(String obj) { - return AbstractAction.class; - } - public String id(String obj) { - return obj; - } - public String displayName(String obj) { - return id(obj); - } - }; - InstanceContent.Convertor separatorConvertor = new InstanceContent.Convertor() { - public JSeparator convert(Boolean obj) { - Assert.fail("should not be creating the JSeparator yet"); - return new JSeparator(); - } - public Class type(Boolean obj) { - return JSeparator.class; - } - public String id(Boolean obj) { - return "sep"; - } - public String displayName(Boolean obj) { - return id(obj); - } - }; - content.add("hello", actionConvertor); - content.add(true, separatorConvertor); - content.add("there", actionConvertor); - return new AbstractLookup(content); - } - }); + MockLookup.setInstances(new NamedServicesProviderImpl()); // #156829: ensure that no tree lock is acquired. final Semaphore ready = new Semaphore(0); final Semaphore done = new Semaphore(0); @@ -546,7 +500,7 @@ } */ - public static final class AwtBridgeImpl extends AWTBridge { + public static final class AwtBridgeImpl extends ActionPresenterProvider { public JPopupMenu createEmptyPopup() { return new JPopupMenu(); } @@ -567,5 +521,68 @@ } } } + + private class NamedServicesProviderImpl extends NamedServicesProvider { + + public NamedServicesProviderImpl() { + } + + public Lookup create(String path) { + if (!path.equals("stuff/")) { + return Lookup.EMPTY; + } + InstanceContent content = new InstanceContent(); + InstanceContent.Convertor actionConvertor = new InstanceContent.Convertor() { + + public Action convert(final String obj) { + return new AbstractAction() { + + public void actionPerformed(ActionEvent e) { + } + + @Override + public String toString() { + return obj; + } + }; + } + + public Class type(String obj) { + return AbstractAction.class; + } + + public String id(String obj) { + return obj; + } + + public String displayName(String obj) { + return id(obj); + } + }; + InstanceContent.Convertor separatorConvertor = new InstanceContent.Convertor() { + + public JSeparator convert(Boolean obj) { + Assert.fail("should not be creating the JSeparator yet"); + return new JSeparator(); + } + + public Class type(Boolean obj) { + return JSeparator.class; + } + + public String id(Boolean obj) { + return "sep"; + } + + public String displayName(Boolean obj) { + return id(obj); + } + }; + content.add("hello", actionConvertor); + content.add(true, separatorConvertor); + content.add("there", actionConvertor); + return new AbstractLookup(content); + } + } } --- a/progress.ui/manifest.mf +++ a/progress.ui/manifest.mf @@ -2,6 +2,7 @@ OpenIDE-Module: org.netbeans.modules.progress.ui OpenIDE-Module-Layer: org/netbeans/modules/progress/ui/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/progress/ui/Bundle.properties -OpenIDE-Module-Provides: org.netbeans.progress.spi.ProgressUIWorkerProvider, org.netbeans.progress.spi.RunOffAWTProvider +OpenIDE-Module-Provides: org.netbeans.modules.progress.spi.ProgressUIWorkerProvider, org.netbeans.modules.progress.spi.RunOffEDTProvider AutoUpdate-Essential-Module: true +OpenIDE-Module-Specification-Version: 1.8 --- a/progress.ui/nbproject/project.properties +++ a/progress.ui/nbproject/project.properties @@ -2,4 +2,3 @@ is.autoload=true javac.compilerargs=-Xlint:unchecked javac.source=1.5 -spec.version.base=1.7.0 --- a/progress.ui/nbproject/project.xml +++ a/progress.ui/nbproject/project.xml @@ -11,7 +11,7 @@ 1 - + 1.18 --- a/progress.ui/src/org/netbeans/modules/progress/ui/Bundle.properties +++ a/progress.ui/src/org/netbeans/modules/progress/ui/Bundle.properties @@ -57,3 +57,8 @@ RunOffAWT.TITLE_Operation=Lengthy operation in progress RunOffAWT.BTN_Cancel=Cancel +# ProgressListAction +CTL_ProcessListAction=&Processes + +# CancelAction +CTL_CancelAction=Cancel Process --- a/api.progress/src/org/netbeans/progress/module/CancelAction.java +++ a/api.progress/src/org/netbeans/progress/module/CancelAction.java @@ -38,9 +38,10 @@ * Version 2 license, then the option applies only if the new code is * made subject to such option by the copyright holder. */ -package org.netbeans.progress.module; +package org.netbeans.modules.progress.ui; -import org.netbeans.progress.spi.InternalHandle; +import org.netbeans.modules.progress.spi.Controller; +import org.netbeans.modules.progress.spi.InternalHandle; import org.openide.util.HelpCtx; import org.openide.util.NbBundle; import org.openide.util.actions.CallableSystemAction; --- a/progress.ui/src/org/netbeans/modules/progress/ui/ListComponent.java +++ a/progress.ui/src/org/netbeans/modules/progress/ui/ListComponent.java @@ -63,8 +63,8 @@ import javax.swing.JPopupMenu; import javax.swing.KeyStroke; import javax.swing.UIManager; -import org.netbeans.progress.spi.InternalHandle; -import org.netbeans.progress.spi.ProgressEvent; +import org.netbeans.modules.progress.spi.InternalHandle; +import org.netbeans.modules.progress.spi.ProgressEvent; import org.openide.DialogDisplayer; import org.openide.NotifyDescriptor; import org.openide.util.ImageUtilities; --- a/progress.ui/src/org/netbeans/modules/progress/ui/NbProgressBar.java +++ a/progress.ui/src/org/netbeans/modules/progress/ui/NbProgressBar.java @@ -47,9 +47,9 @@ import javax.swing.JLabel; import javax.swing.JProgressBar; import javax.swing.UIManager; -import org.netbeans.progress.spi.ExtractedProgressUIWorker; -import org.netbeans.progress.spi.InternalHandle; -import org.netbeans.progress.spi.ProgressEvent; +import org.netbeans.modules.progress.spi.ExtractedProgressUIWorker; +import org.netbeans.modules.progress.spi.InternalHandle; +import org.netbeans.modules.progress.spi.ProgressEvent; /** --- a/progress.ui/src/org/netbeans/modules/progress/ui/PopupPane.java +++ a/progress.ui/src/org/netbeans/modules/progress/ui/PopupPane.java @@ -61,7 +61,7 @@ import javax.swing.JScrollPane; import javax.swing.KeyStroke; import javax.swing.border.Border; -import org.netbeans.progress.spi.InternalHandle; +import org.netbeans.modules.progress.spi.InternalHandle; /** * --- a/api.progress/src/org/netbeans/progress/module/ProgressListAction.java +++ a/api.progress/src/org/netbeans/progress/module/ProgressListAction.java @@ -39,12 +39,13 @@ * made subject to such option by the copyright holder. */ -package org.netbeans.progress.module; +package org.netbeans.modules.progress.ui; +import org.netbeans.modules.progress.spi.Controller; import javax.swing.AbstractAction; import javax.swing.SwingUtilities; import javax.swing.event.ListDataListener; -import org.netbeans.progress.spi.ProgressUIWorkerWithModel; +import org.netbeans.modules.progress.spi.ProgressUIWorkerWithModel; import org.openide.util.NbBundle; /** --- a/progress.ui/src/org/netbeans/modules/progress/ui/ProviderImpl.java +++ a/progress.ui/src/org/netbeans/modules/progress/ui/ProviderImpl.java @@ -41,15 +41,15 @@ package org.netbeans.modules.progress.ui; -import org.netbeans.progress.spi.ExtractedProgressUIWorker; -import org.netbeans.progress.spi.ProgressUIWorkerProvider; -import org.netbeans.progress.spi.ProgressUIWorkerWithModel; +import org.netbeans.modules.progress.spi.ExtractedProgressUIWorker; +import org.netbeans.modules.progress.spi.ProgressUIWorkerProvider; +import org.netbeans.modules.progress.spi.ProgressUIWorkerWithModel; /** * * @author mkleint */ -@org.openide.util.lookup.ServiceProvider(service=org.netbeans.progress.spi.ProgressUIWorkerProvider.class) +@org.openide.util.lookup.ServiceProvider(service=org.netbeans.modules.progress.spi.ProgressUIWorkerProvider.class) public class ProviderImpl implements ProgressUIWorkerProvider { /** Creates a new instance of ProviderImpl */ --- a/progress.ui/src/org/netbeans/modules/progress/ui/RunOffEDTImpl.java +++ a/progress.ui/src/org/netbeans/modules/progress/ui/RunOffEDTImpl.java @@ -54,7 +54,7 @@ import javax.swing.JFrame; import javax.swing.SwingUtilities; import org.netbeans.api.progress.ProgressUtils; -import org.netbeans.progress.spi.RunOffEDTProvider; +import org.netbeans.modules.progress.spi.RunOffEDTProvider; import org.openide.DialogDescriptor; import org.openide.DialogDisplayer; import org.openide.NotifyDescriptor; @@ -67,7 +67,7 @@ * Default RunOffEDTProvider implementation for ProgressUtils.runOffEventDispatchThread() methods * @author Jan Lahoda, Tomas Holy */ -@org.openide.util.lookup.ServiceProvider(service = org.netbeans.progress.spi.RunOffEDTProvider.class, position = 100) +@org.openide.util.lookup.ServiceProvider(service = org.netbeans.modules.progress.spi.RunOffEDTProvider.class, position = 100) public class RunOffEDTImpl implements RunOffEDTProvider { private static final RequestProcessor WORKER = new RequestProcessor(ProgressUtils.class.getName()); --- a/progress.ui/src/org/netbeans/modules/progress/ui/StatusLineComponent.java +++ a/progress.ui/src/org/netbeans/modules/progress/ui/StatusLineComponent.java @@ -85,11 +85,10 @@ import javax.swing.event.ListDataListener; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; -import org.netbeans.progress.spi.InternalHandle; -import org.netbeans.progress.spi.ProgressEvent; -import org.netbeans.progress.module.ProgressListAction; -import org.netbeans.progress.spi.ProgressUIWorkerWithModel; -import org.netbeans.progress.spi.TaskModel; +import org.netbeans.modules.progress.spi.InternalHandle; +import org.netbeans.modules.progress.spi.ProgressEvent; +import org.netbeans.modules.progress.spi.ProgressUIWorkerWithModel; +import org.netbeans.modules.progress.spi.TaskModel; import org.openide.DialogDisplayer; import org.openide.NotifyDescriptor; import org.openide.util.ImageUtilities; --- a/progress.ui/src/org/netbeans/modules/progress/ui/layer.xml +++ a/progress.ui/src/org/netbeans/modules/progress/ui/layer.xml @@ -42,17 +42,25 @@ --> + + + + + + + + - + - + --- a/settings/manifest.mf +++ a/settings/manifest.mf @@ -3,4 +3,5 @@ OpenIDE-Module-Layer: org/netbeans/modules/settings/resources/mf-layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/settings/resources/Bundle.properties AutoUpdate-Essential-Module: true +OpenIDE-Module-Specification-Version: 1.25 --- a/settings/nbproject/project.properties +++ a/settings/nbproject/project.properties @@ -44,4 +44,3 @@ javadoc.apichanges=${basedir}/apichanges.xml javadoc.arch=${basedir}/arch.xml javadoc.main.page=org/netbeans/spi/settings/doc-files/api.html -spec.version.base=1.24.0 --- a/settings/nbproject/project.xml +++ a/settings/nbproject/project.xml @@ -115,7 +115,7 @@ - + 8.1 --- a/settings/src/org/netbeans/modules/settings/RecognizeInstanceObjects.java +++ a/settings/src/org/netbeans/modules/settings/RecognizeInstanceObjects.java @@ -34,7 +34,6 @@ import java.util.Collection; import java.util.Collections; import java.util.logging.Logger; -import org.netbeans.modules.openide.util.NamedServicesProvider; import org.openide.filesystems.FileAttributeEvent; import org.openide.filesystems.FileChangeListener; import org.openide.filesystems.FileEvent; @@ -50,12 +49,18 @@ import org.openide.util.WeakListeners; import org.openide.util.lookup.Lookups; import org.openide.util.lookup.ProxyLookup; +import org.openide.util.lookup.ServiceProvider; +import org.openide.util.lookup.implspi.NamedServicesProvider; /** Use FolderLookup to find out intances of named services. * * @author Jaroslav Tulach */ -@org.openide.util.lookup.ServiceProvider(service=org.netbeans.modules.openide.util.NamedServicesProvider.class, position=200, supersedes="org.netbeans.modules.openide.filesystems.RecognizeInstanceFiles") +@ServiceProvider( + service=NamedServicesProvider.class, + position=200, + supersedes="org.netbeans.modules.openide.filesystems.RecognizeInstanceFiles" +) public final class RecognizeInstanceObjects extends NamedServicesProvider { private static final Logger LOG = Logger.getLogger(RecognizeInstanceObjects.class.getName());