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;
}
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);
}
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);
}
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;
}
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;
}
Aggregations