jsinterop.annotations.JsIgnore Java Examples

The following examples show how to use jsinterop.annotations.JsIgnore. 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 File: AnnotationValueBuilder.java    From swellrt with 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 #2
Source File: AnnotationRegistry.java    From swellrt with 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 #3
Source File: SSession.java    From swellrt with 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 #4
Source File: ParticipantId.java    From swellrt with 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 #5
Source File: SPrimitive.java    From swellrt with 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 #6
Source File: ServerlessEntryPoint.java    From swellrt with 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 #7
Source File: DocRevision.java    From swellrt with 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 File: Main.java    From j2cl with 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 #9
Source File: WaveletBasedGroup.java    From swellrt with 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 #10
Source File: SSession.java    From swellrt with 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 #11
Source File: SEvent.java    From swellrt with 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 #12
Source File: SPrimitive.java    From swellrt with 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 #13
Source File: NativeSelectionUtil.java    From swellrt with 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 #14
Source File: SPrimitive.java    From swellrt with 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 File: SVersionManager.java    From swellrt with 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 File: Range.java    From swellrt with 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 File: DefaultFrontend.java    From swellrt with 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 File: CaretInfo.java    From swellrt with 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 File: DocHistory.java    From swellrt with 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 File: NativeSelectionUtil.java    From swellrt with 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 #21
Source File: SPrimitive.java    From swellrt with 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 #22
Source File: SMapProxyHandler.java    From swellrt with Apache License 2.0 4 votes vote down vote up
@JsIgnore
public SMapProxyHandler() {
}
 
Example #23
Source File: DocRevision.java    From swellrt with Apache License 2.0 4 votes vote down vote up
@JsIgnore
public void setDocOp(DocOp op) {
  Preconditions.checkArgument(this.op == null, "Can't overwrite the revision's doc op.");
  this.op = op;
}
 
Example #24
Source File: SWaveObject.java    From swellrt with Apache License 2.0 4 votes vote down vote up
@JsIgnore
public void onStatusEvent(SStatusEvent e) {
  if (statusHandler != null)
    statusHandler.exec(e);
}
 
Example #25
Source File: SWaveObject.java    From swellrt with Apache License 2.0 4 votes vote down vote up
@SuppressWarnings("rawtypes")
@JsIgnore
@Override
public void accept(SVisitor visitor) {
  visitor.visit(this);
}
 
Example #26
Source File: SWaveMap.java    From swellrt with Apache License 2.0 4 votes vote down vote up
@SuppressWarnings("rawtypes")
@JsIgnore
@Override
public void accept(SVisitor visitor) {
  visitor.visit(this);
}
 
Example #27
Source File: MyJsException.java    From j2cl with Apache License 2.0 4 votes vote down vote up
@JsIgnore
public MyJsException(Throwable cause) {
  this();
}
 
Example #28
Source File: DocRevision.java    From swellrt with Apache License 2.0 4 votes vote down vote up
@JsIgnore
public HashedVersion getResultingHashedVersion() {
  return this.resultingVersion;
}
 
Example #29
Source File: DocRevision.java    From swellrt with Apache License 2.0 4 votes vote down vote up
@JsIgnore
public DocOp getDocOp() {
  return this.op;
}
 
Example #30
Source File: NativeSelectionUtil.java    From swellrt with 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());
}