ide/src/wombat/util/files/DocumentManager.java
public static boolean Close(boolean force) {
    	if (me == null) throw new RuntimeException("Document manager not initialized.");
    	if (verifyActiveDocument()) return false;
    	
        if (!me.activeDocument.isEmpty()) {
            String name = me.activeDocument.myView.getViewProperties().getTitle();
            if (me.activeDocument.isDirty()) {
            	if (Options.ConfirmOnClose) {
            		int result = JOptionPane.showConfirmDialog(
            				me.activeDocument,
            				"Save " + name + " before closing?\n\n(If you select no, any unsaved work will be lost.)",
            				"Close...",
            				(force ? JOptionPane.YES_NO_OPTION : JOptionPane.YES_NO_CANCEL_OPTION));
            		
            		if (result == JOptionPane.YES_OPTION){
            			if (!Save())
            				return false;
            		} else if (result == JOptionPane.CANCEL_OPTION) {
            			return false;
            		}
            	} else {
            		Save();
            	}
            }
        }
        
        // Close it.
        int i = me.allDocuments.indexOf(me.activeDocument);
        me.allDocuments.remove(me.activeDocument);
        me.activeDocument.close();
        me.activeDocument.myView.close();
        
        // Get a new active document.
        try {
        	me.activeDocument = me.allDocuments.get(Math.max(0, i - 1));
        	me.activeDocument.requestFocusInWindow();
        } catch(Exception e) {
        }
        
        return true;
    }
/**
     * Close the active document.
     * @return If it worked.
     */
Close the active document.
@return If it worked.
Close the active document . @return If it worked .
public static boolean Close(boolean force) {
    	if (me == null) throw new RuntimeException("Document manager not initialized.");
    	if (verifyActiveDocument()) return false;
        if (!me.activeDocument.isEmpty()) {
            String name = me.activeDocument.myView.getViewProperties().getTitle();
            if (me.activeDocument.isDirty()) {
            	if (Options.ConfirmOnClose) {
            		int result = JOptionPane.showConfirmDialog(
            				me.activeDocument,
            				"Save " + name + " before closing?\n\n(If you select no, any unsaved work will be lost.)",
            				"Close...",
            				(force ? JOptionPane.YES_NO_OPTION : JOptionPane.YES_NO_CANCEL_OPTION));
            		if (result == JOptionPane.YES_OPTION){
            			if (!Save())
            				return false;
            		} else if (result == JOptionPane.CANCEL_OPTION) {
            			return false;
            		}
            	} else {
            		Save();
            	}
            }
        }
        int i = me.allDocuments.indexOf(me.activeDocument);
        me.allDocuments.remove(me.activeDocument);
        me.activeDocument.close();
        me.activeDocument.myView.close();
        try {
        	me.activeDocument = me.allDocuments.get(Math.max(0, i - 1));
        	me.activeDocument.requestFocusInWindow();
        } catch(Exception e) {
        }
        return true;
    }
public static boolean Close ( boolean force ) { if ( me == null ) throw new RuntimeException ( "Document manager not initialized." ) ; if ( verifyActiveDocument ( ) ) return false ; if ( ! me . activeDocument . isEmpty ( ) ) { String name = me . activeDocument . myView . getViewProperties ( ) . getTitle ( ) ; if ( me . activeDocument . isDirty ( ) ) { if ( Options . ConfirmOnClose ) { int result = JOptionPane . showConfirmDialog ( me . activeDocument , "Save " + name + " before closing?\n\n(If you select no, any unsaved work will be lost.)" , "Close..." , ( force ? JOptionPane . YES_NO_OPTION : JOptionPane . YES_NO_CANCEL_OPTION ) ) ; if ( result == JOptionPane . YES_OPTION ) { if ( ! Save ( ) ) return false ; } else if ( result == JOptionPane . CANCEL_OPTION ) { return false ; } } else { Save ( ) ; } } } int i = me . allDocuments . indexOf ( me . activeDocument ) ; me . allDocuments . remove ( me . activeDocument ) ; me . activeDocument . close ( ) ; me . activeDocument . myView . close ( ) ; try { me . activeDocument = me . allDocuments . get ( Math . max ( 0 , i - 1 ) ) ; me . activeDocument . requestFocusInWindow ( ) ; } catch ( Exception e ) { } return true ; }
Close the active document.
Close the active document .
// Close it. // Get a new active document.