Java Code Examples for com.google.gwt.user.client.ui.SimplePanel#addStyleName()

The following examples show how to use com.google.gwt.user.client.ui.SimplePanel#addStyleName() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TractionDialogBox.java    From gwt-traction with Apache License 2.0 6 votes vote down vote up
public TractionDialogBox(boolean autoHide, boolean modal, boolean showCloseIcon) {
super(autoHide, modal, new TractionCaption());

container = new SimplePanel();
container.addStyleName("dialogContainer");

close = new Anchor();
close.setStyleName("x");
close.addClickHandler(new ClickHandler() {
           @Override
           public void onClick(ClickEvent event) {
               onCloseClick(event);
           }
});
setCloseIconVisible(showCloseIcon);

controls = new FlowPanel();
controls.setStyleName("dialogControls");
controls.add(close);

// add the controls to the end of the caption
TractionCaption caption = (TractionCaption) getCaption();
caption.add(controls);
   }
 
Example 2
Source File: WidgetComboBox.java    From consulo with Apache License 2.0 6 votes vote down vote up
@Override
public void onFocus(FocusEvent event) {
  Object sender = event.getSource();
  getFocuses().add(sender);

  if (keyboardManagerRegistration == null) keyboardManagerRegistration = Event.addNativePreviewHandler(getKeyboardManager());

  SimplePanel value = getSelectedValue();
  if (sender == value) {
    value.addStyleName("selected-row");
    if (isChoiceButtonVisible()) getChoiceButton().setFocus(true);
  }
  else if (sender == null || sender == getListPanel()) { //on drop down list show
    Widget widget = getSelectedWidget();
    if (widget != null) getListPanel().ensureVisible(widget);
  }

  if (focuses.size() == 1) fireEvent(event);
}
 
Example 3
Source File: WordCloudDetailApp.java    From swcv with MIT License 5 votes vote down vote up
private SimplePanel createPanel(String svg, int width, int height)
{
    SimplePanel panel = new SimplePanel();
    panel.setPixelSize(width, height);
    panel.addStyleName("center");
    HTML html = new HTML(svg);
    html.setWidth("100%");
    html.setHeight("100%");
    panel.add(html);
    return panel;
}