use of com.google.gwt.core.client.Scheduler.ScheduledCommand in project rstudio by rstudio.
the class TextEditingTargetWidget method onActivate.
public void onActivate() {
editor_.onActivate();
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
@Override
public void execute() {
manageToolbarSizes();
}
});
}
use of com.google.gwt.core.client.Scheduler.ScheduledCommand in project rstudio by rstudio.
the class AceEditorBackgroundLinkHighlighter method refreshHighlighters.
private void refreshHighlighters(String mode) {
clearAllMarkers();
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
@Override
public void execute() {
TextFileType fileType = editor_.getFileType();
highlighters_.clear();
highlighters_.add(webLinkHighlighter());
if (fileType != null && (fileType.isMarkdown() || fileType.isRmd()))
highlighters_.add(markdownLinkHighlighter());
nextHighlightStart_ = 0;
timer_.schedule(700);
}
});
}
use of com.google.gwt.core.client.Scheduler.ScheduledCommand in project rstudio by rstudio.
the class SVNCommitDialog method onLoad.
@Override
protected void onLoad() {
super.onLoad();
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
@Override
public void execute() {
message_.setFocus(true);
}
});
}
use of com.google.gwt.core.client.Scheduler.ScheduledCommand in project rstudio by rstudio.
the class DesktopExport method export.
public static void export(final ExportPlotSizeEditor sizeEditor, final OperationWithInput<Rectangle> exporter, final Operation onCompleted) {
sizeEditor.prepareForExport(new Command() {
@Override
public void execute() {
// hide gripper
sizeEditor.setGripperVisible(false);
// get zoom level
double zoomLevel = BrowseCap.isMacintoshDesktop() ? getSafariZoomFactor() : Desktop.getFrame().getZoomLevel();
// get the preview iframe rect
ElementEx iframe = sizeEditor.getPreviewIFrame().<ElementEx>cast();
final Rectangle viewerRect = new Rectangle((int) Math.ceil(zoomLevel * iframe.getClientLeft()), (int) Math.ceil(zoomLevel * iframe.getClientTop()), (int) Math.ceil(zoomLevel * iframe.getClientWidth()), (int) Math.ceil(zoomLevel * iframe.getClientHeight())).inflate(-1);
// perform the export
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
@Override
public void execute() {
exporter.execute(viewerRect);
// show gripper
sizeEditor.setGripperVisible(true);
// call onCompleted
if (onCompleted != null)
onCompleted.execute();
}
});
}
});
}
use of com.google.gwt.core.client.Scheduler.ScheduledCommand in project rstudio by rstudio.
the class ChunkOptionsPopupPanel method makeInputBox.
private TextBox makeInputBox(final String option, final boolean enquote) {
final TextBox box = new TextBox();
box.getElement().setAttribute("placeholder", "Default");
box.setWidth("40px");
DomUtils.addKeyHandlers(box, new NativeEventHandler() {
@Override
public void onNativeEvent(NativeEvent event) {
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
@Override
public void execute() {
String text = box.getText().trim();
boolean isEmpty = StringUtil.isNullOrEmpty(text);
if (enquote && !isEmpty) {
text = StringUtil.ensureQuoted(text);
text = text.replaceAll("\\\\", "\\\\\\\\");
}
if (isEmpty)
unset(option);
else
set(option, text);
synchronize();
}
});
}
});
return box;
}
Aggregations