private static AttributeSet createAttribs(Object... keyValuePairs) { assert keyValuePairs.length % 2 == 0 : "There must be even number of prameters. " + "They are key-value pairs of attributes that will be inserted into the set."; List<Object> list = new ArrayList<Object>(); for(int i = keyValuePairs.length / 2 - 1; i >= 0 ; i--) { Object attrKey = keyValuePairs[2 * i]; Object attrValue = keyValuePairs[2 * i + 1]; if (attrKey != null && attrValue != null) { list.add(attrKey); list.add(attrValue); } } return AttributesUtilities.createImmutable(list.toArray()); }
private static AttributeSet adjustAttributes(AttributeSet as) { Collection<Object> attrs = new LinkedList<Object>(); for (Enumeration<?> e = as.getAttributeNames(); e.hasMoreElements(); ) { Object key = e.nextElement(); Object value = as.getAttribute(key); if (value != Boolean.FALSE) { attrs.add(key); attrs.add(value); } } return AttributesUtilities.createImmutable(attrs.toArray()); }
@Override public Object annotate ( String url, int startPosition, int endPosition, String annotationType, Object timeStamp ) { AttributeSet attrs; if (EditorContext.CURRENT_LAST_OPERATION_ANNOTATION_TYPE.equals(annotationType)) { attrs = AttributesUtilities.createImmutable(EditorStyleConstants.WaveUnderlineColor, getColor(annotationType)); } else { attrs = AttributesUtilities.createImmutable(StyleConstants.Background, getColor(annotationType)); } DebuggerAnnotation annotation; try { annotation = new DebuggerAnnotation(annotationType, attrs, startPosition, endPosition, URLMapper.findFileObject(new URL(url))); } catch (MalformedURLException ex) { throw new RuntimeException("Bad URL: "+url, ex); } synchronized (annotationToURLLock) { assert url != null; annotationToURL.put (annotation, url); } return annotation; }
@Override public Object annotate ( String url, int startPosition, int endPosition, String annotationType, Object timeStamp ) { AttributeSet attrs; if (EditorContext.CURRENT_LAST_OPERATION_ANNOTATION_TYPE.equals(annotationType)) { attrs = AttributesUtilities.createImmutable(EditorStyleConstants.WaveUnderlineColor, getColor(annotationType)); } else { attrs = AttributesUtilities.createImmutable(StyleConstants.Background, getColor(annotationType)); } DebuggerAnnotation annotation; try { annotation = new DebuggerAnnotation(annotationType, attrs, startPosition, endPosition, URLMapper.findFileObject(new URL(url))); } catch (MalformedURLException ex) { throw new RuntimeException("Bad URL: "+url, ex); } synchronized (annotationToURLLock) { assert url != null; annotationToURL.put (annotation, url); } return annotation; }
return AttributesUtilities.createImmutable(); attribs.add(AttributesUtilities.createImmutable(EditorStyleConstants.Tooltip, new UnusedTooltipResolver())); attribs.add(AttributesUtilities.createImmutable("unused-browseable", Boolean.TRUE));
EmbeddedSectionsHighlighting(Document document) { this.document = document; // load the background color for the embedding token AttributeSet attribs = null; String mimeType = (String) document.getProperty("mimeType"); //NOI18N FontColorSettings fcs = MimeLookup.getLookup(mimeType).lookup(FontColorSettings.class); if (fcs != null) { Color jsBC = getColoring(fcs, RhtmlTokenId.RUBY.primaryCategory()); if (jsBC != null) { attribs = AttributesUtilities.createImmutable( StyleConstants.Background, jsBC, ATTR_EXTENDS_EOL, Boolean.TRUE); } } rubyBackground = attribs; }
this.document.putProperty(PROP_HIGLIGHT_BLOCKS_LAYER, this); AttributeSet extendsEolEmptyLine = AttributesUtilities.createImmutable( HighlightsContainer.ATTR_EXTENDS_EOL, Boolean.TRUE, HighlightsContainer.ATTR_EXTENDS_EMPTY_LINE, Boolean.TRUE); AttributeSet as = settings.getTokenFontColors("pp-active-block"); //NOI18N if (as != null) { activeBlockHighlight = AttributesUtilities.createImmutable(as, extendsEolEmptyLine); } else { activeBlockHighlight = null; inactiveBlockHighlight = AttributesUtilities.createImmutable(as, extendsEolEmptyLine); } else { inactiveBlockHighlight = null;