Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1)

E13403-03

oracle.javatools.buffer
Class Utilities

java.lang.Object
  extended by oracle.javatools.buffer.Utilities

public final class Utilities
extends java.lang.Object

The Utilities is a static utility class for TextBuffer instances.


Constructor Summary
Utilities()
           
 
Method Summary
static boolean attachUndoState(AbstractTextBuffer textBuffer, AbstractTextBuffer.UndoState state)
          Utility routine which will reattach the UndoableEdit's linked through the given state object to the specified TextBuffer.
static AbstractTextBuffer.UndoState copyUndoState(AbstractTextBuffer textBuffer)
          Utility routine which will copy all UndoableEdit's that have been generated for the given TextBuffer instance into an opaque state object.
static AbstractTextBuffer.UndoState detachUndoState(AbstractTextBuffer textBuffer)
          Utility routine which will detach all UndoableEdit's that have been generated for the given TextBuffer instance into an opaque state object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Utilities

public Utilities()
Method Detail

detachUndoState

public static AbstractTextBuffer.UndoState detachUndoState(AbstractTextBuffer textBuffer)
Utility routine which will detach all UndoableEdit's that have been generated for the given TextBuffer instance into an opaque state object. This state object can be later reattached to a separate TextBuffer instance that has the same exact buffer contents.

This allows clients to support keeping Undo support for TextBuffer instances without requiring that the TextBuffer be kept pinned in memory.

Parameters:
textBuffer - the text buffer to detach the undo state of
Returns:
an opaque object representing the undo state, or null if the state cannot be detached

copyUndoState

public static AbstractTextBuffer.UndoState copyUndoState(AbstractTextBuffer textBuffer)
Utility routine which will copy all UndoableEdit's that have been generated for the given TextBuffer instance into an opaque state object. This state object can be later reattached to the current or another TextBuffer instance that has the same exact buffer contents.

This allows clients to support keeping Undo support for TextBuffer instances without requiring that the TextBuffer be kept pinned in memory.

Parameters:
textBuffer - the text buffer to copy the undo state of
Returns:
an opaque object representing the undo state, or null if the state cannot be detached

attachUndoState

public static boolean attachUndoState(AbstractTextBuffer textBuffer,
                                      AbstractTextBuffer.UndoState state)
Utility routine which will reattach the UndoableEdit's linked through the given state object to the specified TextBuffer. This operation requires that the buffer's contents exactly match the previous buffer's contents at the time the state was detached and stored. This verification is performed through an MD5-like hash calculation and comparison.

Parameters:
textBuffer - the text buffer to attach the undo state of
state - the opaque state object from a prior successful detach
Returns:
true if the attach succeeded, false otherwise

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1)

E13403-03

Copyright © 1997, 2009, Oracle. All rights reserved.