Logo Search packages:      
Sourcecode: jedit version File versions  Download package

void org::gjt::sp::jedit::textarea::TextArea::setBuffer ( JEditBuffer  buffer  )  [inline]

Sets the buffer this text area is editing. If you don't run a standalone textarea in jEdit please do not call this method - use org.gjt.sp.jedit.EditPane#setBuffer(org.gjt.sp.jedit.Buffer) instead.

Parameters:
buffer The buffer

Definition at line 379 of file TextArea.java.

References org::gjt::sp::jedit::buffer::JEditBuffer::beginCompoundEdit(), org::gjt::sp::jedit::buffer::JEditBuffer::endCompoundEdit(), org::gjt::sp::jedit::textarea::DisplayManager::getDisplayManager(), org::gjt::sp::jedit::textarea::DisplayManager::init(), org::gjt::sp::jedit::buffer::JEditBuffer::insideCompoundEdit(), org::gjt::sp::jedit::buffer::JEditBuffer::isLoading(), propertiesChanged(), org::gjt::sp::jedit::textarea::DisplayManager::release(), selectNone(), org::gjt::sp::jedit::textarea::Gutter::setBuffer(), org::gjt::sp::jedit::textarea::ChunkCache::setBuffer(), and updateScrollBar().

Referenced by org::gjt::sp::jedit::textarea::JEditEmbeddedTextArea::JEditEmbeddedTextArea(), org::gjt::sp::jedit::EditPane::setBuffer(), and org::gjt::sp::jedit::textarea::StandaloneTextArea::StandaloneTextArea().

      {
            if(this.buffer == buffer)
                  return;

            try
            {
                  bufferChanging = true;

                  if(this.buffer != null)
                  {
                        // dubious?
                        //setFirstLine(0);

                        if(!this.buffer.isLoading())
                              selectNone();
                        caretLine = caret = caretScreenLine = 0;
                        match = null;
                  }
                  boolean inCompoundEdit = false;
                  if (this.buffer != null)
                        inCompoundEdit = this.buffer.insideCompoundEdit();
                  if (inCompoundEdit)
                        this.buffer.endCompoundEdit();
                  this.buffer = buffer;
                  if (inCompoundEdit)
                        this.buffer.beginCompoundEdit();

                  chunkCache.setBuffer(buffer);
                  gutter.setBuffer(buffer);
                  propertiesChanged();

                  if(displayManager != null)
                  {
                        displayManager.release();
                  }

                  displayManager = DisplayManager.getDisplayManager(
                        buffer,this);

                  displayManager.init();

                  if(buffer.isLoading())
                        updateScrollBar();

                  repaint();

                  fireScrollEvent(true);
            }
            finally
            {
                  bufferChanging = false;
            }
      } //}}}


Generated by  Doxygen 1.6.0   Back to index