pl.edu.agh.cast.backward.editor
Class EditorSaverSupport

java.lang.Object
  extended by pl.edu.agh.cast.backward.editor.EditorSaverSupport

public final class EditorSaverSupport
extends Object

Handles prompts to save an editor when closing. Caches user's response for a certain amount of time.

Author:
AGH CAST Team

Method Summary
static EditorSaverSupport getInstance()
          Returns single, shared instance of EditorSaverSupport.
 int promptToSaveOnClose(AbstractEditor editor)
          Prompts the user for action when editor is unsaved.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static EditorSaverSupport getInstance()
Returns single, shared instance of EditorSaverSupport.

Returns:
single, shared instance of EditorSaverSupport

promptToSaveOnClose

public int promptToSaveOnClose(AbstractEditor editor)
Prompts the user for action when editor is unsaved. Can return a cached response. See ISaveablePart2.promptToSaveOnClose()

Parameters:
editor - editor to prompt for
Returns:
return code, as defined in ISaveablePart2.promptToSaveOnClose() - one of ISaveablePart2.YES, ISaveablePart2.NO or ISaveablePart2.CANCEL.


Copyright © 2007-2009 IISG AGH-UST Krakow, Poland. All Rights Reserved.