Search in sources :

Example 26 with JsIgnore

use of jsinterop.annotations.JsIgnore in project deephaven-core by deephaven.

the class JsFigure method downsampleFailed.

@JsIgnore
public void downsampleFailed(String message, Set<JsSeries> series, double tableSize) {
    CustomEventInit failInit = CustomEventInit.create();
    failInit.setDetail(JsPropertyMap.of("series", series, "message", message, "size", tableSize));
    fireEvent(EVENT_DOWNSAMPLEFAILED, failInit);
}
Also used : CustomEventInit(elemental2.dom.CustomEventInit) JsIgnore(jsinterop.annotations.JsIgnore)

Example 27 with JsIgnore

use of jsinterop.annotations.JsIgnore in project edumips64 by EduMIPS64.

the class Instruction method FromInstruction.

@JsIgnore()
public static Instruction FromInstruction(InstructionInterface i) {
    if (i == null) {
        return null;
    }
    Instruction instruction = new Instruction();
    instruction.Name = i.getName();
    instruction.Code = i.getFullName();
    instruction.SerialNumber = i.getSerialNumber();
    instruction.Comment = i.getComment();
    instruction.BinaryRepresentation = i.getRepr().getBinString();
    instruction.OpCode = instruction.BinaryRepresentation.substring(0, 6);
    ParsedInstructionMetadata meta = i.getParsingMetadata();
    if (meta != null) {
        instruction.Address = meta.address;
        instruction.Line = meta.sourceLine;
    }
    return instruction;
}
Also used : ParsedInstructionMetadata(org.edumips64.core.is.ParsedInstructionMetadata) JsIgnore(jsinterop.annotations.JsIgnore)

Example 28 with JsIgnore

use of jsinterop.annotations.JsIgnore in project console by hal.

the class ResourceDescription method isDefaultValue.

@JsIgnore
public boolean isDefaultValue(String path, String name, Object value) {
    Property property = findAttribute(path, name);
    if (property != null) {
        ModelNode attribute = property.getValue();
        if (attribute.hasDefined(DEFAULT)) {
            if (value == null) {
                return true;
            } else {
                ModelType type = attribute.get(TYPE).asType();
                if (type.equals(ModelType.INT)) {
                    type = ModelType.LONG;
                }
                Object defaultValue = attribute.get(DEFAULT).as(type);
                return value.equals(defaultValue);
            }
        }
    }
    return false;
}
Also used : ModelType(org.jboss.hal.dmr.ModelType) ModelNode(org.jboss.hal.dmr.ModelNode) JsProperty(jsinterop.annotations.JsProperty) Property(org.jboss.hal.dmr.Property) JsIgnore(jsinterop.annotations.JsIgnore)

Example 29 with JsIgnore

use of jsinterop.annotations.JsIgnore in project console by hal.

the class AddressTemplate method of.

/**
 * Turns a resource address into an address template which is the opposite of {@link #resolve(StatementContext, String...)}.
 * Use the {@link Unresolver} function to specify how the segments of the resource address are "unresolved". It is called
 * for each segment of the specified resource address.
 */
@JsIgnore
public static AddressTemplate of(ResourceAddress address, Unresolver unresolver) {
    int index = 0;
    boolean first = true;
    StringBuilder builder = new StringBuilder();
    if (address.isDefined()) {
        int size = address.size();
        for (Iterator<Property> iterator = address.asPropertyList().iterator(); iterator.hasNext(); ) {
            Property property = iterator.next();
            String name = property.getName();
            String value = property.getValue().asString();
            if (value.contains("/")) {
                value = ModelNodeHelper.encodeValue(value);
            }
            String segment = unresolver == null ? name + EQUALS + value : unresolver.unresolve(name, value, first, !iterator.hasNext(), index, size);
            builder.append(segment);
            if (iterator.hasNext()) {
                builder.append("/");
            }
            first = false;
            index++;
        }
    }
    return of(builder.toString());
}
Also used : JsProperty(jsinterop.annotations.JsProperty) Property(org.jboss.hal.dmr.Property) JsIgnore(jsinterop.annotations.JsIgnore)

Example 30 with JsIgnore

use of jsinterop.annotations.JsIgnore in project console by hal.

the class Dispatcher method upload.

@JsIgnore
public Single<ModelNode> upload(File file, Operation operation) {
    Operation uploadOperation = runAs(operation);
    ConstructorBlobPartsArrayUnionType blob = ConstructorBlobPartsArrayUnionType.of(uploadOperation.toBase64String());
    BlobPropertyBag options = BlobPropertyBag.create();
    options.setType("application/dmr-encoded");
    FormData formData = new FormData();
    if (navigator.userAgent.contains("Safari") && !navigator.userAgent.contains("Chrome")) {
        // Safari does not support sending new files
        // https://bugs.webkit.org/show_bug.cgi?id=165081
        ConstructorBlobPartsArrayUnionType fileAsBlob = ConstructorBlobPartsArrayUnionType.of(file);
        formData.append(file.name, new Blob(new ConstructorBlobPartsArrayUnionType[] { fileAsBlob }));
    } else {
        formData.append(file.name, AppendValueUnionType.of(file));
    }
    formData.append(OPERATION, new Blob(new ConstructorBlobPartsArrayUnionType[] { blob }, options));
    return uploadFormData(formData, uploadOperation).map(payload -> payload.get(RESULT));
}
Also used : FormData(elemental2.dom.FormData) Blob(elemental2.dom.Blob) ConstructorBlobPartsArrayUnionType(elemental2.dom.Blob.ConstructorBlobPartsArrayUnionType) Operation(org.jboss.hal.dmr.Operation) BlobPropertyBag(elemental2.dom.BlobPropertyBag) JsIgnore(jsinterop.annotations.JsIgnore)

Aggregations

JsIgnore (jsinterop.annotations.JsIgnore)41 ModelNode (org.jboss.hal.dmr.ModelNode)11 Composite (org.jboss.hal.dmr.Composite)10 Operation (org.jboss.hal.dmr.Operation)10 ResourceAddress (org.jboss.hal.dmr.ResourceAddress)9 Map (java.util.Map)7 SafeHtml (com.google.gwt.safehtml.shared.SafeHtml)6 CustomEventInit (elemental2.dom.CustomEventInit)6 Set (java.util.Set)6 JsProperty (jsinterop.annotations.JsProperty)6 JsType (jsinterop.annotations.JsType)5 AddResourceDialog (org.jboss.hal.core.mbui.dialog.AddResourceDialog)5 ModelNodeForm (org.jboss.hal.core.mbui.form.ModelNodeForm)5 CompositeResult (org.jboss.hal.dmr.CompositeResult)5 Property (org.jboss.hal.dmr.Property)5 Iterables (com.google.common.collect.Iterables)4 EventBus (com.google.web.bindery.event.shared.EventBus)4 Collectors.toSet (java.util.stream.Collectors.toSet)4 StreamSupport.stream (java.util.stream.StreamSupport.stream)4 Nullable (javax.annotation.Nullable)4