aboutsummaryrefslogtreecommitdiff
path: root/libjava/java/awt/Window.java
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/java/awt/Window.java')
-rw-r--r--libjava/java/awt/Window.java47
1 files changed, 45 insertions, 2 deletions
diff --git a/libjava/java/awt/Window.java b/libjava/java/awt/Window.java
index d8a9954..fcb9c1ae 100644
--- a/libjava/java/awt/Window.java
+++ b/libjava/java/awt/Window.java
@@ -57,10 +57,14 @@ import java.util.ResourceBundle;
public class Window extends Container
{
// Serialized fields, from Sun's serialization spec.
- // private FocusManager focusMgr; // FIXME: what is this?
private String warningString = null;
- private int state = 0;
private int windowSerializedDataVersion = 0; // FIXME
+ /** @since 1.2 */
+ // private FocusManager focusMgr; // FIXME: what is this?
+ /** @since 1.2 */
+ private int state = 0;
+ /** @since 1.4 */
+ private boolean focusableWindowState = true;
private transient WindowListener windowListener;
private transient WindowFocusListener windowFocusListener;
@@ -645,4 +649,43 @@ public class Window extends Container
&& event.getID () == WindowEvent.WINDOW_STATE_CHANGED)
windowStateListener.windowStateChanged (event);
}
+
+ /**
+ * Returns whether this <code>Window</code> can get the focus or not.
+ *
+ * @since 1.4
+ */
+ public boolean isFocusableWindow ()
+ {
+ if (getFocusableWindowState () == false)
+ return false;
+
+ if (this instanceof Dialog
+ || this instanceof Frame)
+ return true;
+
+ // FIXME: Implement more possible cases for returning true.
+
+ return false;
+ }
+
+ /**
+ * Returns the value of the focusableWindowState property.
+ *
+ * @since 1.4
+ */
+ public boolean getFocusableWindowState ()
+ {
+ return focusableWindowState;
+ }
+
+ /**
+ * Sets the value of the focusableWindowState property.
+ *
+ * @since 1.4
+ */
+ public void setFocusableWindowState (boolean focusableWindowState)
+ {
+ this.focusableWindowState = focusableWindowState;
+ }
}