當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。