Skip to content

Commit

Permalink
hook up F2Console and F2TextViewer with Forge 2 ForgeConsoleImpl
Browse files Browse the repository at this point in the history
  • Loading branch information
koentsje committed Feb 6, 2014
1 parent 98c7050 commit a4dac48
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ private Prompt createPrompt() {
}

public void start() {
if (console == null) {
createConsole();
}
console.start();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,13 @@
import org.jboss.tools.forge.ext.core.FurnaceService;

public class F2Console extends AeshConsole {

private ShellHandle handle;

protected void initialize() {
createStreams();
}

protected void createConsole() {
// super.createConsole();
handle = FurnaceService.INSTANCE.lookup(ShellHandle.class);
Expand All @@ -25,10 +30,6 @@ protected void createConsole() {
handle.initialize(currentDir, getInputStream(), out, err);
}

public void start() {
// super.start();
}

@Override
public void stop() {
handle.destroy();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,22 @@

public class F2TextViewer extends AeshTextViewer {

private boolean constructionFinished = false;

public F2TextViewer(Composite parent) {
super(parent);
constructionFinished = true;
}

protected void initializeConsole() {
aeshConsole = new F2Console();
}

protected void startConsole() {
if (constructionFinished) {
aeshConsole.start();
}
}

}

Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
import org.eclipse.jface.action.IAction;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.jboss.tools.aesh.ui.view.AeshTextViewer;
import org.jboss.tools.forge.core.process.ForgeRuntime;
import org.jboss.tools.forge.ext.core.runtime.FurnaceRuntime;
import org.jboss.tools.forge.ui.console.ForgeConsole;
import org.jboss.tools.forge.ui.ext.actions.StartF2Action;
import org.jboss.tools.forge.ui.ext.actions.StopF2Action;
import org.jboss.tools.forge.ui.ext.cli.F2TextViewer;

public class ForgeConsoleImpl implements ForgeConsole {

Expand All @@ -20,7 +20,7 @@ public ForgeConsoleImpl() {

@Override
public Control createControl(Composite parent) {
return new AeshTextViewer(parent).getControl();
return new F2TextViewer(parent).getControl();
}

@Override
Expand Down

0 comments on commit a4dac48

Please sign in to comment.