Examples of Styles


Examples of com.citytechinc.cq.component.annotations.widgets.rte.Styles

  }

  private RtePlugin buildStylesRtePlugin(RichTextEditor rteAnnotation) {

    if (rteAnnotation.styles().length > 0) {
      Styles stylesAnnotation = rteAnnotation.styles()[0];

      List<DialogElement> styleList = new ArrayList<DialogElement>();

      for (int i = 0; i < stylesAnnotation.styles().length; i++) {
        String styleFieldName = "style" + i;

        RteStyleParameters styleParameters = new RteStyleParameters();
        styleParameters.setFieldName(styleFieldName);
        styleParameters.setCssName(stylesAnnotation.styles()[i].cssName());
        styleParameters.setText(stylesAnnotation.styles()[i].text());
        styleList.add(new RteStyle(styleParameters));
      }
      WidgetCollectionParameters wcp = new WidgetCollectionParameters();
      wcp.setContainedElements(styleList);
      wcp.setFieldName("styles");
View Full Code Here

Examples of com.gmail.jafelds.ppedits.enums.Styles

   * Ensure that we have a song name and a style.
   */
  private void sanityChecker()
  {
    String sName = getSongName();
    Styles s = getStyle();
    if ((sName != null) && (s != null))
    {
      setMeasures(sqlite.getMeasuresByName(sName));
      setupMeasures(getMeasures(), s.getColumns());
    }
  }
View Full Code Here

Examples of com.vaadin.server.Page.Styles

                // Get the new background color
                Color color = event.getColor();

                // Get the stylesheet of the page
                Styles styles = Page.getCurrent().getStyles();

                // inject the new background color
                styles.add(".v-app .v-textarea.text-label { background-color:"
                        + color.getCSS() + "; }");
            }
        });
        return bgColor;
    }
View Full Code Here

Examples of com.vaadin.server.Page.Styles

                // Get the new text color
                Color color = event.getColor();

                // Get the stylesheet of the page
                Styles styles = Page.getCurrent().getStyles();

                // inject the new color as a style
                styles.add(".v-app .v-textarea.text-label { color:"
                        + color.getCSS() + "; }");
            }
        });

        return textColor;
View Full Code Here

Examples of com.vaadin.server.Page.Styles

            public void valueChange(ValueChangeEvent event) {
                // Get the new font family
                String fontFamily = select.getValue().toString();

                // Get the stylesheet of the page
                Styles styles = Page.getCurrent().getStyles();

                // inject the new font size as a style. We need .v-app to
                // override Vaadin's default styles here
                styles.add(".v-app .v-textarea.text-label { font-family:"
                        + fontFamily + "; }");
            }
        });

        return select;
View Full Code Here

Examples of com.vaadin.server.Page.Styles

            public void valueChange(ValueChangeEvent event) {
                // Get the new font size
                Integer fontSize = (Integer) select.getValue();

                // Get the stylesheet of the page
                Styles styles = Page.getCurrent().getStyles();

                // inject the new font size as a style. We need .v-app to
                // override Vaadin's default styles here
                styles.add(".v-app .v-textarea.text-label { font-size:"
                        + String.valueOf(fontSize) + "px; }");
            }
        });

        return select;
View Full Code Here

Examples of com.vaadin.server.Page.Styles

public class CSSInjectTest extends TestBase {

    @Override
    protected void setup() {

        final Styles stylesheet = Page.getCurrent().getStyles();

        // Inject some resources initially
        final StreamResource initialResource = new StreamResource(
                new StreamResource.StreamSource() {

                    @Override
                    public InputStream getStream() {
                        return new ByteArrayInputStream(
                                ".hello, .world { color:silver; }".getBytes());
                    }
                }, "mystyles-" + System.currentTimeMillis() + ".css");
        stylesheet.add(initialResource);

        Label hello = new Label(
                "<span class='hello'>Hello</span> <span class='world'>world</span>",
                ContentMode.HTML);
        addComponent(hello);

        final TextArea cssToInject = new TextArea();
        cssToInject.setImmediate(true);
        addComponent(cssToInject);

        Button inject = new Button("Inject!", new Button.ClickListener() {

            @Override
            public void buttonClick(ClickEvent event) {
                stylesheet.add(cssToInject.getValue());
                cssToInject.setValue("");
            }
        });
        addComponent(inject);

        Button injectRandom = new Button("Inject as resource!",
                new Button.ClickListener() {

                    @Override
                    public void buttonClick(ClickEvent event) {

                        final String css = cssToInject.getValue();

                        stylesheet.add(new StreamResource(
                                new StreamResource.StreamSource() {

                                    @Override
                                    public InputStream getStream() {
                                        return new ByteArrayInputStream(css
                                                .getBytes());
                                    }
                                }, UUID.randomUUID().toString() + ".css"));

                        cssToInject.setValue("");
                    }
                });
        addComponent(injectRandom);

        addComponent(new Button("Inject initial again!",
                new Button.ClickListener() {
                    @Override
                    public void buttonClick(ClickEvent event) {
                        stylesheet.add(initialResource);
                    }
                }));
    }
View Full Code Here

Examples of com.volantis.styling.Styles

     * @param winner    Styles to merge, may be null.
     * @param luser     Styles to merge, may be null.
     * @return merged Styles. Will be null if both parameters are null.
     */
    public Styles merge(Styles winner, Styles luser) {
        Styles result = winner;

        if (winner != null && luser != null) {

            result = factory.createStyles(null);
            mergePropertyValues(result.getPropertyValues(),
                    winner.getPropertyValues(), luser.getPropertyValues());

        } else if (luser != null) {
            result = luser;
        }
View Full Code Here

Examples of com.volantis.styling.Styles

        // iterate over the dom, extracting all the elements into a list
        final OutputStylesFactory factory = new OutputStylesFactory();
        WalkingDOMVisitor visitor = new WalkingDOMVisitorStub() {
            public void visit(Element element) {
                OutputStyles outputStyles = null;
                Styles styles = element.getStyles();
                if (styles != null) {
                    outputStyles = factory.create(element.getName(), styles);
                }
                OutputStyledElement outputElement =
                        new OutputStyledElement(element, outputStyles);
View Full Code Here

Examples of com.volantis.styling.Styles

    }

    public void testMergeWinnerAndLoser() {

        StylingFactory stylingFactory = StylingFactory.getDefaultInstance();
        Styles expectedResult = stylingFactory.createStyles(null);
        factoryMock.expects.createStyles(null)
                .returns(expectedResult);

        Styles winner = StylesBuilder.getCompleteStyles(
                "background-color: green; font-size: medium");
        Styles loser = StylesBuilder.getCompleteStyles(
                "background-color: red; color: red");

        Styles result = merger.merge(winner, loser);
        assertSame(expectedResult, result);

        MutableStylePropertySet set = new MutableStylePropertySetImpl();
        set.add(StylePropertyDetails.BACKGROUND_COLOR);
        set.add(StylePropertyDetails.COLOR);
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.