Examples of replace()


Examples of com.google.gwt.regexp.shared.RegExp.replace()

    }


    private String makeLinksOpenInNewWindow(String html) {
        RegExp linkRegExp = RegExp.compile("(<a)([^>]*)(>)", "g");
        return linkRegExp.replace(html, "$1$2 target=\"_blank\"$3");
    }

    private String parseLinks(String html) {
//        RegExp urlRegExp = RegExp.compile("(https?://[^\\s<]*)", "g");
//        return urlRegExp.replace(html, "<a href=\"$1\">$1</a>");
View Full Code Here

Examples of com.google.wave.api.BlipContentRefs.replace()

        LOG.info("stocky finds new symbol: " + symbol);

        // Replace the content with new and delete the "stocky" annotation.
        String price = String.format("$%.2f", util.getStockPrice(symbol));
        String newContent = String.format("%s[%s] ", symbol, price);
        blipContentRefs = blipContentRefs.replace(newContent);

        BlipContentRefs symbolContentRef = blip.range(startIndex, startIndex + symbol.length());
        symbolContentRef.annotate("style/color", "rgb(50,205,50)");
        symbolContentRef.annotate("style/fontWeight", "bold");
View Full Code Here

Examples of com.google.wave.api.FormView.replace()

    FormElement distributePoll = formView.getFormElement(DISTRIBUTE_POLL_BUTTON);
   
    boolean isPressed = "clicked".equals(distributePoll.getValue());
    if (isPressed) {
      distributePoll.setValue(distributePoll.getDefaultValue());
      formView.replace(distributePoll);
    }
   
    return isPressed;
  }
}
View Full Code Here

Examples of com.hazelcast.core.IMap.replace()

            }
        }, 10);
        addOperation(operations, new Runnable() {
            public void run() {
                IMap map = hazelcast.getMap("myMap");
                map.replace(random.nextInt(SIZE), new Customer(random.nextInt(100), String.valueOf(random.nextInt(10000))));
            }
        }, 4);
        addOperation(operations, new Runnable() {
            public void run() {
                IMap map = hazelcast.getMap("myMap");
View Full Code Here

Examples of com.hazelcast.core.TransactionalMap.replace()

            case PUT_WITH_TTL:
                return map.put(key, value, ttl, TimeUnit.MILLISECONDS);
            case PUT_IF_ABSENT:
                return map.putIfAbsent(key, value);
            case REPLACE:
                return map.replace(key, value);
            case REPLACE_IF_SAME:
                return map.replace(key, value, newValue);
            case SET:
                map.set(key, value);
                break;
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.RDFList.replace()

    final RDFList l1 = getListRoot(model);

    // change all the values
    for (int i = 0; i < toSet.length; i++)
    {
      l1.replace(i, toSet[i]);
    }

    // then check them
    for (int i = 0; i < toSet.length; i++)
    {
View Full Code Here

Examples of com.ibm.richtext.styledtext.MText.replace()

    public void test() {

        AttributeMap bold = new AttributeMap(TextAttribute.WEIGHT,
                                             TextAttribute.WEIGHT_BOLD);
        MText text = new StyledText("Hello there!", AttributeMap.EMPTY_ATTRIBUTE_MAP);
        text.replace(2, 2, 'V', bold);

        MTextIterator iter = new MTextIterator(text, FONT_MAPPER, 0, text.length());
        compareIterToText(iter, text);

        text.replace(6, 8, new StyledText("ALL_BOLD", bold), 0, 8);
View Full Code Here

Examples of com.ibm.richtext.styledtext.StyledText.replace()

    public void test() {

        AttributeMap bold = new AttributeMap(TextAttribute.WEIGHT,
                                             TextAttribute.WEIGHT_BOLD);
        MText text = new StyledText("Hello there!", AttributeMap.EMPTY_ATTRIBUTE_MAP);
        text.replace(2, 2, 'V', bold);

        MTextIterator iter = new MTextIterator(text, FONT_MAPPER, 0, text.length());
        compareIterToText(iter, text);

        text.replace(6, 8, new StyledText("ALL_BOLD", bold), 0, 8);
View Full Code Here

Examples of com.intellij.openapi.util.TextRange.replace()

    @Override
    public PsiElement handleElementRename(@NotNull String newElementName) throws IncorrectOperationException {
      TextRange fileNameTextRange = findFileNameTextRagne();
      YAMLKeyValue oldKeyValue = myYamlKeyValueFragment.getElement();
      String newKeyValueText = fileNameTextRange.replace(oldKeyValue.getText(), newElementName);
      YAMLKeyValue newKeyValue = createTempKeyValue(newKeyValueText);
      if (newKeyValue != null) {
        return oldKeyValue.replace(newKeyValue);
      }
      return null;
View Full Code Here

Examples of com.intellij.psi.PsiElement.replace()

    stringBuilder.append(")&");

    final PsiFile file = factory.createFileFromText("dummy.m", MathematicaFileType.INSTANCE, stringBuilder);
    final Function[] func = PsiTreeUtil.getChildrenOfType(file, Function.class);
    assert func != null && func[0] != null;
    e.replace(func[0]);
    return null;
  }
}
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.