Package org.fest.swing.hierarchy

Source Code of org.fest.swing.hierarchy.JInternalFrameDesktopPaneQuery

package org.fest.swing.hierarchy;

import javax.swing.JDesktopPane;
import javax.swing.JInternalFrame;
import javax.swing.JInternalFrame.JDesktopIcon;

import org.fest.swing.annotation.RunsInCurrentThread;

/**
* Understands an action, executed in the event dispatch thread, that returns the desktop the given
* <code>{@link JInternalFrame}</code> belongs to when iconified.
* <p>
* <b>Note:</b> Methods in this class are <b>not</b> executed in the event dispatch thread (EDT.) Clients are
* responsible for invoking them in the EDT.
* </p>
* @see JInternalFrame#getDesktopIcon()
* @see JDesktopIcon#getDesktopPane()
*
* @author Alex Ruiz
* @author Yvonne Wang
*/
final class JInternalFrameDesktopPaneQuery {

  @RunsInCurrentThread
  static JDesktopPane desktopPaneOf(final JInternalFrame internalFrame) {
    JDesktopIcon icon = internalFrame.getDesktopIcon();
    if (icon != null) return icon.getDesktopPane();
    return null;
  }

  private JInternalFrameDesktopPaneQuery() {}
}
TOP

Related Classes of org.fest.swing.hierarchy.JInternalFrameDesktopPaneQuery

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.