Java 类org.eclipse.jface.text.TextViewerUndoManager 实例源码

项目:Black    文件:black.java   
/**
 * �����༭��
 * 
 * @return
 */
public void createTextArea(TextViewerUndoManager undo) {
    if (wv == null || wv.isDisposed()) {

        tv = new TextViewer(this, SWT.WRAP | SWT.V_SCROLL);
        StyledText styledText = tv.getTextWidget();
        if (undo != null) {
            undo.disconnect();
            undo.connect(tv);
        } else
            tvum = new TextViewerUndoManager(100);
        tv.setUndoManager(tvum);
        tv.activatePlugins();
        setCurrentTextArea(styledText);
        blackTextArea = new blackTextArea(styledText, this);
    } else {
        // wv.disposeTextArea();
        wv.createTextArea(null);
    }
}
项目:Black    文件:writingView.java   
public void createTextArea(IDocument iDocument){

    if(b.text != null && !b.text.isDisposed()){
        disposeTextArea();
    }
    b.tv = new TextViewer(b, SWT.V_SCROLL|SWT.WRAP);
    b.text = b.tv.getTextWidget();
    b.text.setVisible(false);
    b.text.setParent(this);
    setStyledTextLayout(x);
    b.blackTextArea = new blackTextArea(b.text,b);
    b.blackTextArea.writingView();
    b.tv.setUndoManager(new TextViewerUndoManager(100));
    b.tv.activatePlugins();
    if(b.ba.isFullScreenWritingView())
        b.ba.changeColor(b.ba.lastForeColor, b.ba.lastBackColor);
    if(iDocument != null) {
        b.tv.setDocument(iDocument);
    }
    addSlider();
    layout();
    b.text.setFocus();
    b.text.setVisible(true);
}
项目:vTM-eclipse    文件:TrafficScriptConf.java   
/**
 * Creates the undo manager (uses the undo level of general text editors)
 */
/* Override */
public IUndoManager getUndoManager( ISourceViewer sourceViewer )
{      
   TextViewerUndoManager undoManager = new TextViewerUndoManager( 
      PreferenceManager.getExternalPreferenceInt( 
         ExternalPreference.EDITOR_UNDO_LEVEL
      )
   );

   editor.setUndoManager( undoManager );
   return undoManager;
}
项目:translationstudio8    文件:SegmentViewer.java   
/**
 * 给TextViewer设置UndoManager
 * @param textViewer
 *            ;
 */
public void initUndoManager(int undoLevel) {
    // remembers edit commands
    final TextViewerUndoManager undoManager = new TextViewerUndoManager(undoLevel);
    // add listeners
    undoManager.connect(this);
    this.setUndoManager(undoManager);
}
项目:tmxeditor8    文件:CellEditorTextViewer.java   
private void initUndoManager(int undoLevel) {
    // remembers edit commands
    final TextViewerUndoManager undoManager = new TextViewerUndoManager(undoLevel);
    // add listeners
    undoManager.connect(this);
    this.setUndoManager(undoManager);
}
项目:tmxeditor8    文件:SegmentViewer.java   
/**
 * 给TextViewer设置UndoManager
 * @param textViewer
 *            ;
 */
public void initUndoManager(int undoLevel) {
    // remembers edit commands
    final TextViewerUndoManager undoManager = new TextViewerUndoManager(undoLevel);
    // add listeners
    undoManager.connect(this);
    this.setUndoManager(undoManager);
}
项目:velocity-edit    文件:Configuration.java   
@Override
public IUndoManager getUndoManager(ISourceViewer sourceViewer) {
    return new TextViewerUndoManager(unDoLimit);
}
项目:vTM-eclipse    文件:TrafficScriptEditor.java   
/**
 * Set the undo manager for this editor.
 * @param undoManager The new undo manager.
 */
public void setUndoManager( TextViewerUndoManager undoManager )
{
   this.undoManager = undoManager;
}
项目:vTM-eclipse    文件:TrafficScriptEditor.java   
/**
 * Get this editors undo manager.
 * @return The undo manager this editor uses.
 */
public TextViewerUndoManager getUndoManager()
{
   return undoManager;
}