/** * �����༭�� * * @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); } }
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); }
/** * 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; }
/** * 给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); }
private void initUndoManager(int undoLevel) { // remembers edit commands final TextViewerUndoManager undoManager = new TextViewerUndoManager(undoLevel); // add listeners undoManager.connect(this); this.setUndoManager(undoManager); }
@Override public IUndoManager getUndoManager(ISourceViewer sourceViewer) { return new TextViewerUndoManager(unDoLimit); }
/** * Set the undo manager for this editor. * @param undoManager The new undo manager. */ public void setUndoManager( TextViewerUndoManager undoManager ) { this.undoManager = undoManager; }
/** * Get this editors undo manager. * @return The undo manager this editor uses. */ public TextViewerUndoManager getUndoManager() { return undoManager; }