< prev index next >
src/java.desktop/share/classes/sun/awt/im/InputMethodPopupMenu.java
Print this page
*** 42,51 ****
--- 42,53 ----
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JPopupMenu;
import javax.swing.JMenu;
import javax.swing.JMenuItem;
+ import javax.swing.JWindow;
+ import javax.swing.SwingUtilities;
/**
* {@code InputMethodPopupMenu} provides the popup selection menu
*/
*** 54,70 ****
// Factory method to provide the menu, depending on the client, i.e.,
// provide Swing popup menu if client is a swing app, otherwise AWT popup
// is created.
static InputMethodPopupMenu getInstance(Component client, String title) {
if ((client instanceof JFrame) ||
! (client instanceof JDialog)) {
return new JInputMethodPopupMenu(title);
} else {
return new AWTInputMethodPopupMenu(title);
}
}
abstract void show(Component c, int x, int y);
abstract void removeAll();
abstract void addSeparator();
--- 56,79 ----
// Factory method to provide the menu, depending on the client, i.e.,
// provide Swing popup menu if client is a swing app, otherwise AWT popup
// is created.
static InputMethodPopupMenu getInstance(Component client, String title) {
if ((client instanceof JFrame) ||
! (client instanceof JDialog) ||
! (client instanceof JWindow)) {
return new JInputMethodPopupMenu(title);
} else {
return new AWTInputMethodPopupMenu(title);
}
}
+ static InputMethodPopupMenu getAWTInstance(Component client, String title) {
+ return new AWTInputMethodPopupMenu(title);
+ }
+
+ abstract boolean isVisible();
+
abstract void show(Component c, int x, int y);
abstract void removeAll();
abstract void addSeparator();
*** 173,183 ****
--- 182,197 ----
delegate = new JPopupMenu(title);
}
}
}
+ boolean isVisible() {
+ return delegate.isVisible();
+ }
+
void show(Component c, int x, int y) {
+ SwingUtilities.updateComponentTreeUI(delegate);
delegate.show(c, x, y);
}
void removeAll() {
delegate.removeAll();
*** 230,239 ****
--- 244,257 ----
delegate = new PopupMenu(title);
}
}
}
+ boolean isVisible() {
+ return false;
+ }
+
void show(Component c, int x, int y) {
delegate.show(c, x, y);
}
void removeAll() {
< prev index next >