Example usage for com.google.gwt.eclipse.core GWTPluginLog logError

List of usage examples for com.google.gwt.eclipse.core GWTPluginLog logError

Introduction

In this page you can find the example usage for com.google.gwt.eclipse.core GWTPluginLog logError.

Prototype

public static void logError(Throwable exception, String message) 

Source Link

Document

Log the specified error.

Usage

From source file:com.gwtplugins.gwt.eclipse.gss.model.GssResourceAwareModelRepairer.java

License:Open Source License

private void fixPotentialEmptyMaskedMediaRule(ICSSNode node) {
    CSSMediaRule mediaRule = (CSSMediaRule) node;
    IndexedRegion mediaRuleRegion = (IndexedRegion) mediaRule;

    if (!containsEmptyMaskedMediaRule(mediaRule, mediaRuleRegion)) {
        return;//from  w  w  w  .  ja  v a 2s .c  om
    }

    // Set the range to a valid value (it won't be proper since we don't have
    // any additional words that can be categorized as CSS_MEDIUM.)
    MediaList mediaList = mediaRule.getMedia();
    IStructuredDocumentRegion[] structuredDocumentRegions = structuredDocument
            .getStructuredDocumentRegions(mediaRuleRegion.getStartOffset(), mediaRuleRegion.getLength());

    // The value we set is a 0-length region starting where the next word would
    // have been
    ITextRegion textRegion = new ContextRegion(CSSRegionContexts.CSS_MEDIUM,
            structuredDocumentRegions[0].getEndOffset() - structuredDocumentRegions[0].getStartOffset(), 0, 0);

    try {
        callSetRangeRegion(mediaList, structuredDocumentRegions, textRegion);
    } catch (Throwable e) {
        GWTPluginLog.logError(e, "Could not clean up the @else in the CSS model.");
    }
}