use of com.google.gwt.core.client.JavaScriptObject in project che by eclipse.
the class OrionEditorWidget method initBreakpointRuler.
private Gutter initBreakpointRuler(ModuleHolder moduleHolder) {
JavaScriptObject orionEventTargetModule = moduleHolder.getModule("OrionEventTarget");
orionLineNumberRuler = editorOverlay.getTextView().getRulers()[1];
orionLineNumberRuler.overrideOnClickEvent();
OrionEventTargetOverlay.addMixin(orionEventTargetModule, orionLineNumberRuler);
return new OrionBreakpointRuler(orionLineNumberRuler, editorOverlay);
}
use of com.google.gwt.core.client.JavaScriptObject in project che by eclipse.
the class OrionEditorWidget method addKeyBinding.
@Override
public void addKeyBinding(final KeyBinding keyBinding, String actionDescription) {
OrionKeyStrokeOverlay strokeOverlay;
JavaScriptObject keyBindingModule = moduleHolder.getModule("OrionKeyBinding").cast();
String type = keyBinding.getType();
boolean modifier1 = UserAgent.isMac() ? keyBinding.isCmd() : keyBinding.isControl();
boolean modifier2 = keyBinding.isShift();
boolean modifier3 = keyBinding.isAlt();
boolean modifier4 = UserAgent.isMac() ? keyBinding.isControl() : false;
if (keyBinding.isCharacterBinding()) {
strokeOverlay = OrionKeyStrokeOverlay.create(keyBinding.getCharacter(), modifier1, modifier2, modifier3, modifier4, type, keyBindingModule);
} else {
strokeOverlay = OrionKeyStrokeOverlay.create(keyBinding.getKeyCodeNumber(), modifier1, modifier2, modifier3, modifier4, type, keyBindingModule);
}
String actionId = "che-action-" + keyBinding.getAction().toString();
editorOverlay.getTextView().setKeyBinding(strokeOverlay, actionId);
editorOverlay.getTextView().setAction(actionId, new Action() {
@Override
public boolean onAction() {
return keyBinding.getAction().action();
}
}, actionDescription);
}
use of com.google.gwt.core.client.JavaScriptObject in project che by eclipse.
the class BrowserLogger method log.
private static void log(Class<?> clazz, LogConfig.LogLevel logLevel, Object... args) {
String prefix = new StringBuilder(logLevel.toString()).append(" (").append(clazz.getName()).append("): ").toString();
for (Object o : args) {
if (o instanceof String) {
logToBrowser(logLevel, prefix + (String) o);
} else if (o instanceof Throwable) {
Throwable t = (Throwable) o;
logToBrowser(logLevel, prefix + ExceptionUtils.getStackTraceAsString(t));
} else if (o instanceof JavaScriptObject) {
logToBrowser(logLevel, prefix + "(JSO below)");
logToBrowser(logLevel, o);
} else {
logToBrowser(logLevel, prefix + (o != null ? o.toString() : "(null)"));
}
}
}
use of com.google.gwt.core.client.JavaScriptObject in project perun by CESNET.
the class ApplicationFormPage method tryToFindUserByName.
/**
* Try to find user by name
*
* If user found, message box shown
*
* @param jso returned data
*/
private void tryToFindUserByName(JavaScriptObject jso) {
// try to find
JsonPostClient jspc = new JsonPostClient(new JsonCallbackEvents() {
@Override
public void onFinished(JavaScriptObject jso) {
ArrayList<Identity> users = JsonUtils.<Identity>jsoAsList(jso);
if (users != null && !users.isEmpty())
similarUsersFound(users);
}
});
JSONObject query = new JSONObject();
if (jso == null) {
// before app submission
jspc.sendData("registrarManager/checkForSimilarUsers", query);
} else {
// after app submission
query.put("voId", new JSONNumber(vo.getId()));
if (group != null) {
query.put("groupId", new JSONNumber(group.getId()));
} else {
query.put("groupId", new JSONNumber(0));
}
query.put("type", new JSONString(type));
jspc.sendData("registrarManager/checkForSimilarUsers", query);
}
}
use of com.google.gwt.core.client.JavaScriptObject in project perun by CESNET.
the class ApplicationFormPage method sendForm.
/**
* Send form
*/
protected void sendForm(final CustomButton button) {
PerunPrincipal pp = session.getPerunPrincipal();
// fed info
String fedInfo = "";
fedInfo += "{";
fedInfo += " displayName=\"" + pp.getAdditionInformations("displayName") + "\"";
fedInfo += " commonName=\"" + pp.getAdditionInformations("cn") + "\"";
fedInfo += " givenName=\"" + pp.getAdditionInformations("givenName") + "\"";
fedInfo += " sureName=\"" + pp.getAdditionInformations("sn") + "\"";
fedInfo += " loa=\"" + pp.getAdditionInformations("loa") + "\"";
fedInfo += " mail=\"" + pp.getAdditionInformations("mail") + "\"";
fedInfo += " organization=\"" + pp.getAdditionInformations("o") + "\"";
fedInfo += " }";
Application app = Application.construct(vo, group, type, fedInfo, pp.getActor(), pp.getExtSource(), pp.getExtSourceType(), pp.getExtSourceLoa());
if (session.getUser() != null) {
// set user association if known from perun
app.setUser(session.getUser());
}
// loading
final PopupPanel loadingBox = session.getUiElements().perunLoadingBox(ApplicationMessages.INSTANCE.processing());
// Create application request
CreateApplication ca = new CreateApplication(JsonCallbackEvents.disableButtonEvents(button, new JsonCallbackEvents() {
@Override
public void onLoadingStart() {
// show loading box
loadingBox.show();
}
@Override
public void onFinished(JavaScriptObject jso) {
loadingBox.hide();
formOk(jso);
}
@Override
public void onError(PerunError err) {
loadingBox.hide();
formError(err);
}
}));
// Send the request
ca.createApplication(app, data);
}
Aggregations