Skip to content

Commit

Permalink
misc code-style cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
gtritchie committed Oct 6, 2019
1 parent 3680e8c commit 1104c98
Show file tree
Hide file tree
Showing 3 changed files with 223 additions and 478 deletions.
Expand Up @@ -47,15 +47,12 @@

import com.google.gwt.core.client.Scheduler;
import com.google.gwt.core.client.Scheduler.RepeatingCommand;
import com.google.gwt.core.client.Scheduler.ScheduledCommand;
import com.google.gwt.dom.client.Document;
import com.google.gwt.dom.client.Element;
import com.google.gwt.dom.client.SpanElement;
import com.google.gwt.dom.client.Style.Unit;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.dom.client.FocusEvent;
import com.google.gwt.event.dom.client.FocusHandler;
import com.google.gwt.event.dom.client.KeyCodes;
import com.google.gwt.event.dom.client.KeyDownEvent;
import com.google.gwt.event.dom.client.KeyDownHandler;
Expand Down Expand Up @@ -114,14 +111,7 @@ public ShellWidget(AceEditor editor, UserPrefs prefs, EventBus events)
{
public void onCursorChanged(CursorChangedEvent event)
{
Scheduler.get().scheduleDeferred(new ScheduledCommand()
{
@Override
public void execute()
{
input_.scrollToCursor(scrollPanel_, 8, 60);
}
});
Scheduler.get().scheduleDeferred(() -> input_.scrollToCursor(scrollPanel_, 8, 60));
}
});
input_.addCapturingKeyDownHandler(new KeyDownHandler()
Expand Down Expand Up @@ -180,14 +170,7 @@ public void onKeyDown(KeyDownEvent event)
}
}
});
input_.addFocusHandler(new FocusHandler()
{
@Override
public void onFocus(FocusEvent event)
{
scrollToBottom();
}
});
input_.addFocusHandler(event -> scrollToBottom());

inputLine_ = new DockPanel();
inputLine_.setHorizontalAlignment(DockPanel.ALIGN_LEFT);
Expand Down Expand Up @@ -257,13 +240,9 @@ protected void onLoad()
if (!initialized_)
{
initialized_ = true;
Scheduler.get().scheduleDeferred(new ScheduledCommand()
{
public void execute()
{
doOnLoad();
scrollPanel_.scrollToBottom();
}
Scheduler.get().scheduleDeferred(() -> {
doOnLoad();
scrollPanel_.scrollToBottom();
});
}

Expand Down Expand Up @@ -808,7 +787,7 @@ public void onErrorBoxResize()
private final UserPrefs prefs_;

// A list of errors that have occurred between console prompts.
private Map<String, List<Element>> errorNodes_ = new TreeMap<String, List<Element>>();
private Map<String, List<Element>> errorNodes_ = new TreeMap<>();
private boolean clearErrors_ = false;

private static final String KEYWORD_CLASS_NAME = ConsoleResources.KEYWORD_CLASS_NAME;
Expand Down

0 comments on commit 1104c98

Please sign in to comment.