Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,12 @@
import java.util.List;
import org.eclipse.e4.ui.css.core.dom.CSSProperty;
import org.eclipse.e4.ui.css.core.dom.CSSPropertyList;
import org.w3c.dom.css.CSSStyleDeclaration;


/**
* CSS computed style which concatenate list of CSSComputedStyleImpl to manage
* styles coming from Condition Selector (ex : Label#MyId) and other selectors
* (ex : Label).
* Computed style merging the declarations of all rules that match an element,
* ordered by specificity and source position.
*/
public class CSSComputedStyleImpl extends CSSStyleDeclarationImpl implements CSSStyleDeclaration {
public class CSSComputedStyleImpl extends CSSStyleDeclarationImpl {

private final List<StyleWrapper> styleRules;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,16 @@
import java.util.List;
import org.eclipse.e4.ui.css.core.dom.CSSProperty;
import org.eclipse.e4.ui.css.core.dom.CSSPropertyList;
import org.eclipse.e4.ui.css.core.exceptions.DOMExceptionImpl;
import org.w3c.dom.DOMException;
import org.w3c.dom.css.CSSRule;
import org.w3c.dom.css.CSSStyleDeclaration;
import org.w3c.dom.css.CSSValue;

/**
* W3C {@link CSSStyleDeclaration} view over the internal property list; part of
* the permanent compatibility facade returned by {@code IStylingEngine.getStyle}
* and {@code IThemeEngine.getStyle}.
*/
public class CSSStyleDeclarationImpl implements CSSStyleDeclaration {

private boolean readOnly;
Expand Down Expand Up @@ -97,8 +101,8 @@ public String item(int index) {
@Override
public String removeProperty(String propertyName) throws DOMException {
if (readOnly) {
throw new DOMExceptionImpl(DOMException.NO_MODIFICATION_ALLOWED_ERR,
DOMExceptionImpl.NO_MODIFICATION_ALLOWED_ERROR);
throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR,
"Attempt to change a readonly object"); //$NON-NLS-1$
}
Comment thread
vogella marked this conversation as resolved.
for (int i = 0; i < properties.size(); i++) {
CSSProperty property = properties.get(i);
Expand All @@ -113,8 +117,8 @@ public String removeProperty(String propertyName) throws DOMException {
@Override
public void setCssText(String cssText) throws DOMException {
if (readOnly) {
throw new DOMExceptionImpl(DOMException.NO_MODIFICATION_ALLOWED_ERR,
DOMExceptionImpl.NO_MODIFICATION_ALLOWED_ERROR);
throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR,
"Attempt to change a readonly object"); //$NON-NLS-1$
}
Comment thread
vogella marked this conversation as resolved.
// TODO Auto-generated method stub
// TODO throws SYNTAX_ERR if cssText is unparsable
Expand All @@ -124,8 +128,8 @@ public void setCssText(String cssText) throws DOMException {
@Override
public void setProperty(String propertyName, String value, String priority) throws DOMException {
if (readOnly) {
throw new DOMExceptionImpl(DOMException.NO_MODIFICATION_ALLOWED_ERR,
DOMExceptionImpl.NO_MODIFICATION_ALLOWED_ERROR);
throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR,
"Attempt to change a readonly object"); //$NON-NLS-1$
}
Comment thread
vogella marked this conversation as resolved.
// TODO Auto-generated method stub
// TODO throws SYNTAX_ERR if value is unparsable
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@
* <p>
* Consumers pattern-match on the record variants ({@link CssNumber},
* {@link CssDimension}, {@link CssText}, {@link CssColor}, {@link CssList})
* and read their components. The variants still implement the W3C DOM-CSS
* interfaces as a transitional bridge; the bridge goes away once the
* computed-style cascade is internal as well.
* and read their components. The variants also implement the W3C DOM-CSS value
* interfaces as a permanent compatibility facade: {@code IStylingEngine.getStyle}
* and {@code IThemeEngine.getStyle} return W3C types, and {@code propertyHandler}
* contributions receive values as W3C {@code CSSValue}, so the facade must stay.
* </p>
*/
public final class CssValues {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import org.eclipse.e4.ui.css.core.dom.properties.converters.ICSSValueConverter;
import org.eclipse.e4.ui.css.core.dom.properties.converters.ICSSValueConverterConfig;
import org.eclipse.e4.ui.css.core.engine.CSSEngine;
import org.eclipse.e4.ui.css.core.exceptions.DOMExceptionImpl;
import org.eclipse.e4.ui.css.swt.helpers.CSSSWTColorHelper;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.widgets.Display;
Expand Down Expand Up @@ -48,8 +47,8 @@ public Color convert(CSSValue value, CSSEngine engine, Object context)
Display display = (Display) context;
Color color = CSSSWTColorHelper.getSWTColor(value, display);
if (color == null) {
throw new DOMExceptionImpl(DOMException.INVALID_ACCESS_ERR,
DOMExceptionImpl.RGBCOLOR_ERROR);
throw new DOMException(DOMException.INVALID_ACCESS_ERR,
"This isn't an RGBColor type");
}

return color;
Expand Down
Loading