Java Code Examples for jsinterop.annotations.JsIgnore

The following examples show how to use jsinterop.annotations.JsIgnore. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: swellrt   Source File: SSession.java    License: Apache License 2.0 6 votes vote down vote up
@JsIgnore
public SJsonObject toSJson() {

  SJsonObject jso = SJsonObject.create();
  jso.addString("session", sessionId);
  jso.addString("participant", participantId.getAddress());
  jso.addString("color", color.getHexColor());
  jso.addString("name", name);
  jso.addString("nickname", nickname);

  if (lastAccessTime != null)
    jso.addDouble("lasttime", lastAccessTime);

  if (firstAccessTime != null)
    jso.addDouble("firsttime", firstAccessTime);

  return jso;

}
 
Example 2
Source Project: swellrt   Source File: SPrimitive.java    License: Apache License 2.0 6 votes vote down vote up
@JsIgnore
public SPrimitive(Object value, SNodeAccessControl token) {
  type = TYPE_JSO;
  intValue = Integer.MAX_VALUE;
  doubleValue = Double.NaN;
  stringValue = null;
  boolValue = null;

  if (value instanceof SJsonObject) {
    jsoValue = ((SJsonObject) value).getNative();
  } else {
    jsoValue = value;
  }

  accessControl = token;
}
 
Example 3
Source Project: swellrt   Source File: ParticipantId.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Compare two {@link ParticipantId}s, name first, then domain.
 */
@Override
@JsIgnore
public int compareTo(ParticipantId other) {
  /*
   *  Because it's still possible to create invalid ParticipantId instances
   *  we must deal with the case where an address has other than two (2) parts.
   */
  String[] parts = address.split(DOMAIN_PREFIX);
  String[] otherParts = other.address.split(DOMAIN_PREFIX);
  int minLen = Math.min(parts.length, otherParts.length);
  for (int i = 0; i < minLen; i++) {
    int diff = parts[i].compareTo(otherParts[i]);
    if (diff != 0) {
      return diff;
    }
  }
  return parts.length - otherParts.length;
}
 
Example 4
Source Project: swellrt   Source File: AnnotationRegistry.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Retrieve a {@link Annotation} instance.
 * <p>
 * style/fontWeight
 *
 *
 * @param key,
 *          annotation key or prefix
 * @return
 */
@JsIgnore
public static AnnotationController get(String key) {

  key = normalizeKey(key);

  if (key.contains("/")) {

    if (key.startsWith(PARAGRAPH_PREFIX)) {
      // paragraph annotations have a different controller
      // for each variation paragraph/list, paragraph/textAlign...
      return store.get(key);
    } else {
      // Non paragraph annotations have only one controller
      // for variation, referenced by its prefix
      return store.get(key.substring(0, key.indexOf("/")));
    }

  } else {

    return store.get(key);

  }


}
 
Example 5
Source Project: swellrt   Source File: AnnotationValueBuilder.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Use this method from annotation search. See {@link AnnotationRegistry}
 */
@JsIgnore
public static AnnotationValue buildWithRange(CMutableDocument doc, String key, Object value,
    Range range,
    int searchMatch) {

  Preconditions.checkArgument(range != null, "Range can't be null");

  AnnotationValue av = new AnnotationValue();

  av.key = key;
  av.value = value;
  av.range = Range.copy(range);
  av.searchMatch = searchMatch;

  Point<ContentNode> point = doc.locate(range.getStart());

  av.text = DocHelper.getText(doc, range.getStart(), range.getEnd());
  av.line = getContainerLineElement(point);
  av.node = getMiddleNode(doc, range);

  av.data = point.getContainer();


  return av;
}
 
Example 6
Source Project: j2cl   Source File: Main.java    License: Apache License 2.0 5 votes vote down vote up
@JsIgnore
public static void main(String... args) {
  JsExportTest.testAll();
  JsFunctionTest.testAll();
  JsMethodTest.testAll();
  JsPropertyTest.testAll();
  JsTypeArrayTest.testAll();
  JsTypeBridgeTest.testAll();
  JsTypeTest.testAll();
  NativeJsTypeTest.testAll();
  JsTypeVarargsTest.testAll();
  JsTypeObjectMethodsTest.testAll();
}
 
Example 7
Source Project: swellrt   Source File: DocRevision.java    License: Apache License 2.0 5 votes vote down vote up
@JsIgnore
public DocRevision(DocHistory history,
    HashedVersion resultingVersion, HashedVersion appliedAtVersion,
    double resultingTime, String participant, int nextRevisionIndex) {
  super();
  this.history = history;
  this.resultingVersion = resultingVersion;
  this.appliedAtVersion = appliedAtVersion;
  this.resultingTime = resultingTime;
  this.participant = participant;
  this.revisionIndex = nextRevisionIndex;
}
 
Example 8
Source Project: swellrt   Source File: WaveletBasedGroup.java    License: Apache License 2.0 5 votes vote down vote up
@JsIgnore
public static WaveletBasedGroup create(ObservableWavelet wavelet) {

  //
  // A metadata doc to store info and roles
  //

  ObservableDocument docInfo = wavelet.getDocument(DOC_METADATA);
  DocumentEventRouter<N, E, ? extends N> docRouterInfo = DefaultDocumentEventRouter.create(docInfo);

  //
  // info tag
  //

  Element elementInfo = (Element) DocHelper.getElementWithTagName(docInfo, TAG_INFO);
  if (elementInfo == null) {
    elementInfo = (Element) docInfo.createChildElement(docInfo.getDocumentElement(), TAG_INFO, Collections.emptyMap());
  }

  DocBasedGroupProperties properties = DocBasedGroupProperties.create(docRouterInfo,
      elementInfo);

  //
  // Roles doc
  //

  ObservableDocument rolesDocument = wavelet.getDocument(DOC_ROLES);
  DocumentBasedRoles roles = DocumentBasedRoles.create(rolesDocument);

  return new WaveletBasedGroup(wavelet, properties, roles);
}
 
Example 9
Source Project: swellrt   Source File: SSession.java    License: Apache License 2.0 5 votes vote down vote up
@JsIgnore
public static SSession of(SJsonObject jso) {

  SSession session = new SSession(jso.getString("session"),
      ParticipantId.ofUnsafe(jso.getString("participant")),
      new RgbColor(jso.getString("color")), jso.getString("name"), jso.getString("nickname"));

  session.lastAccessTime = jso.getDouble("lasttime");
  session.firstAccessTime = jso.getDouble("firsttime");

  return session;
}
 
Example 10
Source Project: swellrt   Source File: SEvent.java    License: Apache License 2.0 5 votes vote down vote up
/**
 *
 * @param type
 * @param targetNode
 * @param targetKey
 * @param node
 */
@JsIgnore
public SEvent(int type, SNode targetNode, String targetKey, SNode node) {
  super();
  this.type = type;
  this.target = targetNode;
  this.targetKey = targetKey;
  this.node = node;
}
 
Example 11
Source Project: swellrt   Source File: SPrimitive.java    License: Apache License 2.0 5 votes vote down vote up
@JsIgnore
public static String asString(SNode node) {
  try{
    if (node != null && node instanceof SPrimitive) {
      return (String) ((SPrimitive) node).getValue();
    }
  } catch (ClassCastException e)
  {

  }
  return null;
}
 
Example 12
Source Project: swellrt   Source File: NativeSelectionUtil.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Registers a listener to be notified when transient mutations are about to
 * happen.
 *
 * @param mutationListener
 */
@JsIgnore
public static void setTransientMutationListener(
    NativeSelectionUtil.MutationListener mutationListener) {
  Preconditions.checkNotNull(mutationListener, "null mutationListener");
  transientMutationListener = mutationListener;
}
 
Example 13
Source Project: swellrt   Source File: SPrimitive.java    License: Apache License 2.0 5 votes vote down vote up
@JsIgnore
public SPrimitive(int value, SNodeAccessControl token) {
  type = TYPE_INT;
  intValue = value;
  doubleValue = Double.NaN;
  stringValue = null;
  boolValue = null;
  jsoValue = null;
  accessControl = token;
}
 
Example 14
Source Project: swellrt   Source File: SPrimitive.java    License: Apache License 2.0 5 votes vote down vote up
@JsIgnore
public SPrimitive(double value, SNodeAccessControl token) {
  type = TYPE_DOUBLE;
  intValue = Integer.MAX_VALUE;
  doubleValue = value;
  stringValue = null;
  boolValue = null;
  jsoValue = null;
  accessControl = token;
}
 
Example 15
Source Project: swellrt   Source File: SVersionManager.java    License: Apache License 2.0 5 votes vote down vote up
@JsIgnore
public static Tag fromSJson(SJsonObject sjson) {
  Tag tag = new Tag();
  tag.name = sjson.getString("name");
  tag.description = sjson.getString("description");
  tag.author = ParticipantId.ofUnsafe(sjson.getString("author"));
  tag.timestamp = sjson.getDouble("timestamp");
  try {
    tag.version = HashedVersion.valueOf(sjson.getString("version"));
  } catch (NumberFormatException | Base64DecoderException e) {
    throw new IllegalStateException(e);
  }
  return tag;
}
 
Example 16
Source Project: swellrt   Source File: Range.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 */
@JsIgnore
@Override
public boolean equals(Object obj) {
  if (this == obj) return true;
  if (!(obj instanceof Range)) return false;
  final Range other = (Range) obj;
  if (end != other.end) return false;
  if (start != other.start) return false;
  return true;
}
 
Example 17
Source Project: swellrt   Source File: DefaultFrontend.java    License: Apache License 2.0 5 votes vote down vote up
@JsIgnore
public static DefaultFrontend create(ServiceContext context,
    ServerOperationExecutor serverOpExecutor) {

  Preconditions.checkNotNull(context, "Service context can't be null");
  Preconditions.checkNotNull(serverOpExecutor, "Operation executor can't be null");

  DefaultFrontend sf = new DefaultFrontend(context, serverOpExecutor);
  return sf;
}
 
Example 18
Source Project: swellrt   Source File: CaretInfo.java    License: Apache License 2.0 5 votes vote down vote up
@JsIgnore
public SJsonObject toSJson() {

  SJsonObject jso = SJsonObject.create();
  jso.addObject("session", session.toSJson());
  jso.addDouble("timestamp", timestamp);
  jso.addInt("position", position);
  jso.addString("compositionState", compositionState);
  return jso;

}
 
Example 19
Source Project: swellrt   Source File: DocHistory.java    License: Apache License 2.0 5 votes vote down vote up
@JsIgnore
public void getSnapshot(DocRevision revision, SnapshotResult callback) {
  fetchSnaphost(revision, rawSnapshot -> {
    try {
      if (callback != null)
        callback.result(DocOpUtil.docInitializationFromXml(rawSnapshot));
    } catch (XmlParseException e) {
      throw new IllegalStateException(e);
    }
  });
}
 
Example 20
Source Project: swellrt   Source File: ServerlessEntryPoint.java    License: Apache License 2.0 5 votes vote down vote up
@JsIgnore
@Override
public void onModuleLoad() {

  // Model factory is used in remote Waves
  ModelFactory.instance = null;
  ServiceConfig.configProvider = getConfigProvider();
  getEditorConfigProvider();

  GWT.setUncaughtExceptionHandler(new GWT.UncaughtExceptionHandler() {

    @Override
    public void onUncaughtException(Throwable e) {
      Console.log("Uncaught Exception: " + e.getMessage());
      String string = "";
      for (StackTraceElement element : e.getStackTrace()) {
        string += element + "\n";
      }
      Console.log("Trace: ");
      Console.log(string);

    }
  });

  Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() {
    @Override
    public void execute() {

      service = new ServerlessFrontend();
      notifyOnLoadHandlers(service);

    }
  });

}
 
Example 21
Source Project: swellrt   Source File: NativeSelectionUtil.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * TODO(user): Handle multiple selections in the document.
 *
 * @return The current selection, or null if nothing is
 * currently selected. Note that the Elements in the range
 * are references to the actual elements in the DOM; not
 * clones.
 */
@JsIgnore
public static FocusedPointRange<Node> get() {
  if (caching) {
    if (cache == null) {
      cache = impl.get();
    }
    return cache;
  } else {
    return impl.get();
  }
}
 
Example 22
Source Project: swellrt   Source File: Profile.java    License: Apache License 2.0 4 votes vote down vote up
@JsIgnore
void update(Profile profile);
 
Example 23
@JsIgnore
public MyJsException(String msg) {
  this(msg, null);
}
 
Example 24
Source Project: j2cl   Source File: Enum.java    License: Apache License 2.0 4 votes vote down vote up
@JsIgnore
public static <T extends Enum<T>> T valueOf(Class<T> enumType, String name) {
  throw new AssertionError("not supported");
}
 
Example 25
Source Project: j2cl   Source File: StaticInitializerStaticMethod.java    License: Apache License 2.0 4 votes vote down vote up
@JsIgnore
public static StaticInitializerStaticMethod notExported_1() {
  return STATIC;
}
 
Example 26
Source Project: j2cl   Source File: MyClassExportsConstructor.java    License: Apache License 2.0 4 votes vote down vote up
@JsIgnore
public MyClassExportsConstructor() {
  this(1);
}
 
Example 27
Source Project: j2cl   Source File: MyJsException.java    License: Apache License 2.0 4 votes vote down vote up
@JsIgnore
public MyJsException(Throwable cause) {
  this();
}
 
Example 28
Source Project: swellrt   Source File: NativeSelectionUtil.java    License: Apache License 2.0 4 votes vote down vote up
/**
 * Sets selection to a range
 *
 * @param range
 */
@JsIgnore
public static void set(FocusedPointRange<Node> range) {
  cache = null;
  impl.set(range.getAnchor(), range.getFocus());
}
 
Example 29
Source Project: swellrt   Source File: SStatusEvent.java    License: Apache License 2.0 4 votes vote down vote up
@JsIgnore
public SStatusEvent(String objectId, SException e) {
  this.objectId = objectId;
  this.type = ERROR;
  this.exception = e;
}
 
Example 30
Source Project: swellrt   Source File: SStatusEvent.java    License: Apache License 2.0 4 votes vote down vote up
@JsIgnore
public SStatusEvent(String objectId, boolean allDataCommitted) {
  this.objectId = objectId;
  this.type = CLOSED;
  this.allDataCommitted = allDataCommitted;
}