diff -r 03fd5905bd9c spi.debugger.ui/apichanges.xml
--- a/spi.debugger.ui/apichanges.xml Wed Sep 17 10:57:34 2008 +0200
+++ b/spi.debugger.ui/apichanges.xml Wed Sep 17 11:57:53 2008 +0200
@@ -111,6 +111,26 @@
+ AttachType.getController()
and
+ BreakpointType.getController()
methods added.AttachType.getController()
and BreakpointType.getController()
+ methods added, because of the clash of Controller.isValid() and
+ javax.swing.JComponent.isValid() methods.
+ This cause problems when using false validity in some cases,
+ therefore a separate implementation of Controller
interface is necessary.
+
+ * In cases when it's not desired to implement {@link Controller} interface
+ * by the JComponent returned from {@link #getCustomizer()} method, because
+ * of the clash of {@link Controller#isValid()} method with
+ * {@link javax.swing.JComponent#isValid()}, an explicit implementation
+ * can be returned by overriding this method.
+ * The default implementation returns the result of {@link #getCustomizer()}
+ * if that implements the {@link Controller} interface, or null
+ * otherwise.
+ *
+ * @return Controller implementation or null
.
+ * @since 2.14
+ */
+ public Controller getController() {
+ JComponent c = getCustomizer();
+ if (c instanceof Controller) {
+ return ((Controller) c);
+ } else {
+ return null;
+ }
+ }
+
}
\ No newline at end of file
diff -r 03fd5905bd9c spi.debugger.ui/src/org/netbeans/spi/debugger/ui/BreakpointType.java
--- a/spi.debugger.ui/src/org/netbeans/spi/debugger/ui/BreakpointType.java Wed Sep 17 10:57:34 2008 +0200
+++ b/spi.debugger.ui/src/org/netbeans/spi/debugger/ui/BreakpointType.java Wed Sep 17 11:57:53 2008 +0200
@@ -68,11 +68,38 @@
/**
* Returns visual customizer for this breakpoint type. Customizer can
- * optionally implement {@link Controller} intarface.
+ * optionally implement {@link Controller} intarface. In that case please
+ * notice the clash of {@link Controller#isValid()} method with
+ * {@link javax.swing.JComponent#isValid()} and consider extending
+ * {@link #getController()} method in case you need to provide
+ * false validity in some cases.
*
* @return visual customizer for this breakpoint type
*/
public abstract JComponent getCustomizer ();
+
+ /**
+ * Return the implementation of {@link Controller} interface.
+ * In cases when it's not desired to implement {@link Controller} interface
+ * by the JComponent returned from {@link #getCustomizer()} method, because
+ * of the clash of {@link Controller#isValid()} method with
+ * {@link javax.swing.JComponent#isValid()}, an explicit implementation
+ * can be returned by overriding this method.
+ * The default implementation returns the result of {@link #getCustomizer()}
+ * if that implements the {@link Controller} interface, or null
+ * otherwise.
+ *
+ * @return Controller implementation or null
.
+ * @since 2.14
+ */
+ public Controller getController() {
+ JComponent c = getCustomizer();
+ if (c instanceof Controller) {
+ return ((Controller) c);
+ } else {
+ return null;
+ }
+ }
/**
* Should return true of this breakpoint type should be default one in
diff -r 03fd5905bd9c spi.debugger.ui/src/org/netbeans/spi/debugger/ui/Controller.java
--- a/spi.debugger.ui/src/org/netbeans/spi/debugger/ui/Controller.java Wed Sep 17 10:57:34 2008 +0200
+++ b/spi.debugger.ui/src/org/netbeans/spi/debugger/ui/Controller.java Wed Sep 17 11:57:53 2008 +0200
@@ -75,6 +75,13 @@
/**
* Return true
whether value of this customizer
* is valid (and OK button can be enabled).
+ *
+ * Please note that if this interface is implemented by a class that extends
+ * {@link javax.swing.JComponent}, this method clashes with
+ * {@link javax.swing.JComponent#isValid()} method. Thus in case you need
+ * to provide false validity in some cases, please implement
+ * this by a different class and override {@link AttachType#getController()},
+ * resp. {@link BreakpointType#getController()}.
*
* @return true
whether value of this customizer
* is valid