A convience method that will reset the Style of StyleContext if
necessary.

@return newStyle
346891
public static SynthStyle updateSeaglassStyle(SynthContext context, SeaglassUI ui) {
        SynthStyle newStyle = getStyle(context.getComponent(), context.getRegion());
        // TODO rossi 04.07.2011 this code is now private in the Synth L&F
//        SynthStyle oldStyle = context.getStyle();
//
//        if (newStyle != oldStyle) {
//            if (oldStyle != null) {
//                oldStyle.uninstallDefaults(context);
//            }
//            context.setStyle(newStyle);
//            newStyle.installDefaults(context, ui);
//        }
        return newStyle;
    }
391137
public static Style createDefaultLineStyle() {
        FeatureTypeStyle featureTypeStyle = sf.createFeatureTypeStyle();
        featureTypeStyle.rules().add(createDefaultLineRule());

        Style style = sf.createStyle();
        style.featureTypeStyles().add(featureTypeStyle);

        return style;
    }
1173151
public function reset()
    {
        $this->argumentsAccessor = new ArrayAccessor($this->persistedArguments);
        $this->stateChanged = false;
        return $this;
    }
597610
public java.lang.String getFatalStyle() {
        return (java.lang.String) getStateHelper().eval(PropertyKeys.fatalStyle);

    }
1293263
protected String prepareStyles() {
		StringBuffer styles = new StringBuffer();

		prepareAttribute(styles, "id", getAttribute("styleId"));
		prepareAttribute(styles, "style", getAttribute("style"));
		prepareAttribute(styles, "class", getAttribute("styleClass"));
		prepareAttribute(styles, "title", getAttribute("title"));
		prepareAttribute(styles, "alt", getAttribute("alt"));
		prepareInternationalization(styles);

		return styles.toString();
	}
343457
public function setStyle($property, $style = null)
    {
        $this->template->del('style');
        $this->addStyle($property, $style);

        return $this;
    }
1064432
StageStyle getDefaultStyle() {
        final String style = annotation.stageStyle();
        return StageStyle.valueOf(style.toUpperCase());
    }
449773
public function deleteStyleAction()
    {
        $translator = $this->getServiceLocator()->get('translator');

        $eventDatas = array();
        $this->getEventManager()->trigger('meliscms_style_delete_start', $this, $eventDatas);

        $request = $this->getRequest();
        $templateId = null;
        $status  = 0;
        $message = 'no data';
        $textMessage = 'tr_meliscms_tool_styles_delete_fail';
        $textTitle = 'tr_meliscms_tool_styles';
        // make sure it's a POST call
        if($request->isPost()) {

            // get the service for Templates Model & Table
            $tableStyle = $this->getServiceLocator()->get('MelisEngineTableStyle');
            $styleId = (int) $request->getPost('styleId');

            // make sure our ID is not empty
            if(!empty($styleId))
            {
                $tableStyle->deleteById($styleId);
                $status = 1;
                $textMessage = 'tr_meliscms_tool_styles_delete_success';
            }
        }

        $response = array(
            'success' => $status ,
            'textTitle' => $textTitle,
            'textMessage' => $textMessage
        );

        $this->getEventManager()->trigger('meliscms_style_delete_end', $this, array_merge($response, array('typeCode' => 'CMS_STYLE_DELETE', 'itemId' => $styleId)));

        return new JsonModel($response);
    }
1296501
public function current() : interfaces\Style
    {
        return !empty($this->styles) ? end($this->styles) : $this->default;
    }
147582
public function getDefaultTheme()
    {
        if (!$this->_defaultTheme) {
            $keys = $this->keys(); /// shame to PHP it can't be done in single line :(
            $this->_defaultTheme = reset($keys);
        }

        return $this->_defaultTheme;
    }
423119
public function nextNews()
    {
        $next = $this->newsManager()->next();

        if (!$next) {
            return null;
        }

        return $this->newsFormatNav($next);
    }
900973
public function setPrevNext()
    {
        if ($this->prevEvent && $this->nextEvent) {
            return $this;
        }
        $entries = $this->entries();

        $isPrev = false;
        $isNext = false;
        $firstEvent = false;
        $lastEvent = false;

        foreach ($entries as $event) {
            // Obtain th first event.
            if (!$firstEvent) {
                $firstEvent = $event;
            }
            $lastEvent = $event;
            // Find the current event
            if ($event->id() == $this->currentEvent()['id']) {
                $isNext = true;
                $isPrev = true;

                continue;
            }
            if (!$isPrev) {
                $this->prevEvent = $event;
            }
            // Store the next event
            if ($isNext) {
                $this->nextEvent = $event;

                $isNext = false;
            }
        }

        if ($this->entryCycle()) {
            if (!$this->nextEvent) {
                $this->nextEvent = $firstEvent;
            }

            if (!$this->prevEvent) {
                $this->prevEvent = $lastEvent;
            }
        }

        return $this;
    }
1271333
public function setstyle($style, array $params = [], $prepend = false, $conditional = '')
    {
        return $this->headStyle(array_merge($params, ['type' => 'text/css', 'style' => $style]), $prepend, $conditional);
    }
541794
public function setCurrentTheme($name)
    {
        $name = (string)$name;
        if ($name == '') {
            $name = '__default__';
        }

        $this->current = $name;
        $this->fallbackThemes = null;

        return $this;
    }
1163543
protected function _modeDefault()
    {
        if ($this->getToolbars() === null) {
            $this->setToolbars('undo redo | bold italic underline strikethrough | forecolor backcolor | styleselect | bullist numlist outdent indent | fontselect fontsizeselect | alignleft aligncenter alignright alignjustify | link unlink anchor | image media lioniteimages | preview');
        }
        if ($this->getContextMenu() === null) {
            $this->setContextMenu('link image media inserttable | cell row column deletetable');
        }
    }
687259
public function style($style)
    {
        if (is_string($style)) {
            $this->attributes['style'] = $style;

            return $this;
        }

        if (is_array($style)) {

            $html = [];

            foreach ($style as $name => $value) {
                $html[] = "$name:$value";
            }

            $this->attributes['style'] = implode(';', $html);
        }

        return $this;
    }
409195
public function reset()
    {
        $fields = $this->getFields();
        foreach ($fields as $field) {
            $field->resetValue();
        }
        return $this;
    }