当前位置: 首页>>代码示例>>Java>>正文


Java Mappable类代码示例

本文整理汇总了Java中elemental.util.Mappable的典型用法代码示例。如果您正苦于以下问题:Java Mappable类的具体用法?Java Mappable怎么用?Java Mappable使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Mappable类属于elemental.util包,在下文中一共展示了Mappable类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: removeAnnotation

import elemental.util.Mappable; //导入依赖的package包/类
@Override
public final void removeAnnotation(final Annotation annotation, int offset) {
  final HTMLCollection children = asElemental().getChildren();
  for (int i = 0; i < children.length(); i++) {
    final Node child = (Node) children.at(i);
    if (child instanceof elemental.dom.Element) {
      final elemental.dom.Element element = (elemental.dom.Element) child;
      final Mappable dataset = element.getDataset();
      if (compareStrings(getMessage(dataset), annotation.getText())
          && getOffset(dataset) == offset
          && getLayer(dataset) == annotation.getLayer()
          && compareStrings(getType(dataset), annotation.getType())) {
        // we may not strictly be on the same annotation instance, but it is not discernible
        asElemental().removeChild(element);
        updateIconVisibility();
        break;
      }
    }
  }
}
 
开发者ID:eclipse,项目名称:che,代码行数:21,代码来源:AnnotationGroupImpl.java

示例2: getMessages

import elemental.util.Mappable; //导入依赖的package包/类
@Override
public List<String> getMessages() {
  final List<String> result = new ArrayList<>();

  final HTMLCollection children = asElemental().getChildren();
  for (int i = 0; i < children.length(); i++) {
    final Node child = (Node) children.at(i);
    if (child instanceof elemental.dom.Element) {
      final elemental.dom.Element element = (elemental.dom.Element) child;
      final Mappable dataset = element.getDataset();
      final String message = getMessage(dataset);
      if (message != null) {
        result.add(message);
      }
    }
  }
  return result;
}
 
开发者ID:eclipse,项目名称:che,代码行数:19,代码来源:AnnotationGroupImpl.java

示例3: getOffset

import elemental.util.Mappable; //导入依赖的package包/类
/**
 * Read the offset value stored in the dataset.
 *
 * @param dataset the dataset
 * @return the offset value or -1 if no valid value is found
 */
private static int getOffset(final Mappable dataset) {
  final String asString = (String) dataset.at(OFFSET_DATASET_NAME);
  if (asString == null) {
    return -1;
  }
  try {
    return Integer.parseInt(asString);
  } catch (final NumberFormatException e) {
    return -1;
  }
}
 
开发者ID:eclipse,项目名称:che,代码行数:18,代码来源:AnnotationGroupImpl.java

示例4: getLayer

import elemental.util.Mappable; //导入依赖的package包/类
/**
 * Read the layer value stored in the dataset.
 *
 * @param dataset the dataset
 * @return the layer value or -1 if no valid value is found
 */
private static int getLayer(final Mappable dataset) {
  final String asString = (String) dataset.at(LAYER_DATASET_NAME);
  if (asString == null) {
    return -1;
  }
  try {
    return Integer.parseInt(asString);
  } catch (final NumberFormatException e) {
    return -1;
  }
}
 
开发者ID:eclipse,项目名称:che,代码行数:18,代码来源:AnnotationGroupImpl.java

示例5: getLine

import elemental.util.Mappable; //导入依赖的package包/类
private static Integer getLine(final EventTarget node) {
    if (node instanceof Element) {
        final Element element = (Element)node;
        final Mappable dataset = element.getDataset();
        final String lineAsString = (String)(dataset.at(DATASET_KEY_LINE));
        try {
            int line = Integer.parseInt(lineAsString);
            return line;
        } catch (final NumberFormatException e) {
            return null;
        }
    } else {
        return null;
    }
}
 
开发者ID:codenvy-legacy,项目名称:plugin-editor-codemirror,代码行数:16,代码来源:MinimapViewImpl.java

示例6: getType

import elemental.util.Mappable; //导入依赖的package包/类
/**
 * Read the type value stored in the dataset.
 *
 * @param dataset the dataset
 * @return the type value
 */
private static String getType(final Mappable dataset) {
  return (String) dataset.at(TYPE_DATASET_NAME);
}
 
开发者ID:eclipse,项目名称:che,代码行数:10,代码来源:AnnotationGroupImpl.java

示例7: getMessage

import elemental.util.Mappable; //导入依赖的package包/类
/**
 * Read the message value stored in the dataset.
 *
 * @param dataset the dataset
 * @return the message value
 */
private static String getMessage(final Mappable dataset) {
  return (String) dataset.at(MESSAGE_DATASET_NAME);
}
 
开发者ID:eclipse,项目名称:che,代码行数:10,代码来源:AnnotationGroupImpl.java


注:本文中的elemental.util.Mappable类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。