Search in sources :

Example 1 with Style

use of com.google.gwt.dom.client.Style in project che by eclipse.

the class PartButtonWidget method getBadge.

/**
     * Creates a badge widget with a message
     *
     * @param messages
     *         messages count
     * @return new badge widget
     */
private Widget getBadge(int messages) {
    FlowPanel w = new FlowPanel();
    Style s = w.getElement().getStyle();
    s.setProperty("position", "absolute");
    s.setProperty("width", "12px");
    s.setProperty("height", "12px");
    s.setProperty("boxSizing", "border-box");
    s.setProperty("borderRadius", "8px");
    s.setProperty("textAlign", "center");
    s.setProperty("color", org.eclipse.che.ide.api.theme.Style.getBadgeFontColor());
    s.setProperty("left", "15px");
    s.setProperty("top", "3px");
    s.setProperty("borderWidth", "1.5px");
    s.setProperty("borderStyle", "solid");
    s.setProperty("fontFamily", "'Helvetica Neue', 'Myriad Pro', arial, Verdana, Verdana, sans-serif");
    s.setProperty("fontSize", "9.5px");
    s.setProperty("fontWeight", "bold");
    s.setProperty("textShadow", "none");
    s.setProperty("backgroundColor", org.eclipse.che.ide.api.theme.Style.getBadgeBackgroundColor());
    w.setStyleName("bounceOutUp");
    if (messages > 9) {
        s.setProperty("lineHeight", "5px");
        w.getElement().setInnerHTML("...");
    } else {
        s.setProperty("lineHeight", "10px");
        w.getElement().setInnerHTML("" + messages);
    }
    return w;
}
Also used : FlowPanel(com.google.gwt.user.client.ui.FlowPanel) Style(com.google.gwt.dom.client.Style)

Example 2 with Style

use of com.google.gwt.dom.client.Style in project che by eclipse.

the class TabContainerViewImpl method onAttach.

/** {@inheritDoc} */
@Override
protected void onAttach() {
    super.onAttach();
    Style style = getElement().getParentElement().getParentElement().getStyle();
    style.setHeight(100, PCT);
    style.setWidth(100, PCT);
}
Also used : Style(com.google.gwt.dom.client.Style)

Example 3 with Style

use of com.google.gwt.dom.client.Style in project che by eclipse.

the class Tree method ensureFocusElement.

private void ensureFocusElement() {
    if (focusEl != null) {
        focusEl.removeFromParent();
    }
    focusEl = getElement().appendChild(focusImpl.createFocusable());
    focusEl.addClassName(treeStyles.styles().noFocusOutline());
    if (focusEl.hasChildNodes()) {
        focusEl.getFirstChildElement().addClassName(treeStyles.styles().noFocusOutline());
        Style focusElStyle = focusEl.getFirstChildElement().getStyle();
        focusElStyle.setBorderWidth(0, Style.Unit.PX);
        focusElStyle.setFontSize(1, Style.Unit.PX);
        focusElStyle.setPropertyPx("lineHeight", 1);
    }
    focusEl.getStyle().setLeft(0, Style.Unit.PX);
    focusEl.getStyle().setTop(0, Style.Unit.PX);
    focusEl.getStyle().setPosition(Style.Position.ABSOLUTE);
    //subscribe for Event.FOCUSEVENTS
    //do not remove redundant cast, GWT tests will fail
    int bits = DOM.getEventsSunk((Element) focusEl.cast());
    DOM.sinkEvents((Element) focusEl.cast(), bits | Event.FOCUSEVENTS);
}
Also used : Style(com.google.gwt.dom.client.Style)

Example 4 with Style

use of com.google.gwt.dom.client.Style in project rstudio by rstudio.

the class ClearAllDialog method createMainWidget.

@Override
protected Widget createMainWidget() {
    progress_ = addProgressIndicator();
    VerticalPanel panel = new VerticalPanel();
    HorizontalPanel horizontalPanel = new HorizontalPanel();
    horizontalPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_TOP);
    // add image
    MessageDialogImages images = MessageDialogImages.INSTANCE;
    Image image = new Image(new ImageResource2x(images.dialog_warning2x()));
    horizontalPanel.add(image);
    // add message widget
    String objects;
    if (numObjects_ == 0)
        objects = "all objects";
    else if (numObjects_ == 1)
        objects = "1 object";
    else
        objects = numObjects_ + " objects";
    Label label = new MultiLineLabel("Are you sure you want to remove " + objects + " from the " + "environment? This operation cannot be undone.");
    label.setStylePrimaryName(ThemeResources.INSTANCE.themeStyles().dialogMessage());
    horizontalPanel.add(label);
    panel.add(horizontalPanel);
    // add include hidden option
    HorizontalPanel optionPanel = new HorizontalPanel();
    Style optionStyle = optionPanel.getElement().getStyle();
    optionStyle.setMarginLeft(image.getWidth(), Unit.PX);
    optionStyle.setMarginBottom(10, Unit.PX);
    chkIncludeHidden_ = new CheckBox("Include hidden objects");
    chkIncludeHidden_.setValue(prefs_.clearHidden().getValue());
    if (numObjects_ == 0) {
        chkIncludeHidden_.addValueChangeHandler(new ValueChangeHandler<Boolean>() {

            @Override
            public void onValueChange(ValueChangeEvent<Boolean> event) {
                prefs_.clearHidden().setGlobalValue(event.getValue());
                prefs_.writeUIPrefs();
            }
        });
        optionPanel.add(chkIncludeHidden_);
    }
    panel.add(optionPanel);
    return panel;
}
Also used : MessageDialogImages(org.rstudio.core.client.widget.images.MessageDialogImages) MultiLineLabel(org.rstudio.core.client.widget.MultiLineLabel) ImageResource2x(org.rstudio.core.client.resources.ImageResource2x) Style(com.google.gwt.dom.client.Style) MultiLineLabel(org.rstudio.core.client.widget.MultiLineLabel)

Example 5 with Style

use of com.google.gwt.dom.client.Style in project rstudio by rstudio.

the class HelpButton method createHelpButton.

public static HelpButton createHelpButton(String rstudioLinkName) {
    HelpButton helpButton = new HelpButton(rstudioLinkName);
    Style style = helpButton.getElement().getStyle();
    style.setMarginTop(3, Unit.PX);
    style.setMarginLeft(4, Unit.PX);
    return helpButton;
}
Also used : Style(com.google.gwt.dom.client.Style)

Aggregations

Style (com.google.gwt.dom.client.Style)43 Element (com.google.gwt.dom.client.Element)5 Button (com.google.gwt.user.client.ui.Button)4 Image (com.google.gwt.user.client.ui.Image)4 GwtTestTest (com.googlecode.gwt.test.GwtTestTest)4 Test (org.junit.Test)4 ImageElementEx (org.rstudio.core.client.dom.ImageElementEx)3 ImageResource2x (org.rstudio.core.client.resources.ImageResource2x)3 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)2 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)2 Command (com.google.gwt.user.client.Command)2 Timer (com.google.gwt.user.client.Timer)2 FlexTable (com.google.gwt.user.client.ui.FlexTable)2 HTMLPanel (com.google.gwt.user.client.ui.HTMLPanel)2 SimplePanel (com.google.gwt.user.client.ui.SimplePanel)2 VerticalPanel (com.google.gwt.user.client.ui.VerticalPanel)2 MultiLineLabel (org.rstudio.core.client.widget.MultiLineLabel)2 MessageDialogImages (org.rstudio.core.client.widget.images.MessageDialogImages)2 PreloaderCallback (com.badlogic.gdx.backends.gwt.preloader.Preloader.PreloaderCallback)1 PreloaderState (com.badlogic.gdx.backends.gwt.preloader.Preloader.PreloaderState)1