Skip to content

Commit

Permalink
add connect(Document) and disconnect() to the AeshConsole interface a…
Browse files Browse the repository at this point in the history
…nd use these methods in AeshTextViewer
  • Loading branch information
koentsje committed Mar 8, 2014
1 parent 477e637 commit 7b03681
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.jboss.tools.aesh.core.console;

import org.jboss.tools.aesh.core.ansi.Document;
import org.jboss.tools.aesh.core.io.StreamListener;

public interface AeshConsole {
Expand All @@ -8,6 +9,9 @@ public interface AeshConsole {
void sendInput(String input);
void stop();

void connect(Document document);
void disconnect();

void addStdOutListener(StreamListener listener);
void removeStdOutListener(StreamListener listener);
void addStdErrListener(StreamListener listener);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ public AeshTextViewer(Composite parent) {

protected void initializeDocument() {
aeshDocument = new DelegateDocument();
aeshDocument.connect(aeshConsole);
aeshDocument.addCursorListener(cursorListener);
aeshDocument.addDocumentListener(documentListener);
aeshConsole.connect(aeshDocument.getProxy());
}

protected void initializeTextWidget() {
Expand Down Expand Up @@ -141,7 +141,7 @@ public void cleanup() {
aeshConsole.stop();
aeshDocument.removeDocumentListener(documentListener);
aeshDocument.removeCursorListener(cursorListener);
aeshDocument.disconnect();
aeshConsole.disconnect();
}

protected void handleVerifyEvent(VerifyEvent e) {
Expand Down

0 comments on commit 7b03681

Please sign in to comment.