コード例 #1
0
 public boolean isEnabled() {
   JInternalFrame iFrame = desktop.getSelectedFrame();
   if (iFrame != null) {
     return iFrame.isClosable();
   }
   return false;
 }
コード例 #2
0
 @RunsInCurrentThread
 private static void validateCanClose(JInternalFrame internalFrame) {
   validateIsShowing(internalFrame);
   if (!internalFrame.isClosable())
     throw new IllegalStateException(
         concat("The JInternalFrame <", format(internalFrame), "> is not closable"));
 }
コード例 #3
0
 public boolean isEnabled(Object sender) {
   if (sender instanceof JDesktopPane) {
     JDesktopPane dp = (JDesktopPane) sender;
     String action = getName();
     if (action == Actions.NEXT_FRAME || action == Actions.PREVIOUS_FRAME) {
       return true;
     }
     JInternalFrame iFrame = dp.getSelectedFrame();
     if (iFrame == null) {
       return false;
     } else if (action == Actions.CLOSE) {
       return iFrame.isClosable();
     } else if (action == Actions.MINIMIZE) {
       return iFrame.isIconifiable();
     } else if (action == Actions.MAXIMIZE) {
       return iFrame.isMaximizable();
     }
     return true;
   }
   return false;
 }