Java Code Examples for com.google.gwt.user.client.ui.HorizontalPanel.setCellWidth()

The following are Jave code examples for showing how to use setCellWidth() of the com.google.gwt.user.client.ui.HorizontalPanel class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: appinventor-extensions   File: LabeledTextBox.java   Source Code and License Vote up 6 votes
/**
 * Use this TextBox if you want to have text validation while a user is typing
 *
 * @param caption    caption for leading label
 * @param validator  The validator to use for a specific textBox
 */
public LabeledTextBox(String caption, Validator validator) {
  this.validator = validator;

  HorizontalPanel panel = new HorizontalPanel();
  Label label = new Label(caption);
  panel.add(label);
  textbox = new TextBox();
  defaultTextBoxColor = textbox.getElement().getStyle().getBorderColor();
  textbox.setWidth("100%");
  panel.add(textbox);
  panel.setCellWidth(label, "40%");

  HorizontalPanel errorPanel = new HorizontalPanel();
  errorLabel = new Label("");
  errorPanel.add(errorLabel);

  VerticalPanel vp = new VerticalPanel();
  vp.add(panel);
  vp.add(errorPanel);
  vp.setHeight("85px");

  initWidget(vp);

  setWidth("100%");
}
 
Example 2
Project: appinventor-extensions   File: TopPanel.java   Source Code and License Vote up 6 votes
private void addLogo(HorizontalPanel panel) {
  // Logo should be a link to App Inv homepage. Currently, after the user
  // has logged in, the top level *is* ODE; so for now don't make it a link.
  // Add timestamp to logo url to get around browsers that agressively cache
  // the image! This same trick is used in StorageUtil.getFilePath().
  Image logo = new Image(LOGO_IMAGE_URL + "?t=" + System.currentTimeMillis());
  logo.setSize("40px", "40px");
  logo.setStyleName("ode-Logo");
  String logoUrl = ode.getSystemConfig().getLogoUrl();
  if (!Strings.isNullOrEmpty(logoUrl)) {
    logo.addClickHandler(new WindowOpenClickHandler(logoUrl));
  }
  panel.add(logo);
  panel.setCellWidth(logo, "50px");
  Label title = new Label("MIT App Inventor");
  title.setStyleName("ode-LogoText");
  VerticalPanel titleContainer = new VerticalPanel();
  titleContainer.add(title);
  panel.add(titleContainer);
  panel.setCellWidth(titleContainer, "180px");
  panel.setCellHorizontalAlignment(logo, HorizontalPanel.ALIGN_LEFT);
  panel.setCellVerticalAlignment(logo, HorizontalPanel.ALIGN_MIDDLE);
}
 
Example 3
Project: document-management-system   File: Status.java   Source Code and License Vote up 6 votes
/**
 * The status
 */
public Status() {
	super(false, true);
	hPanel = new HorizontalPanel();
	image = new Image(OKMBundleResources.INSTANCE.indicator());
	msg = new HTML("");
	space = new HTML("");

	hPanel.add(image);
	hPanel.add(msg);
	hPanel.add(space);

	hPanel.setCellVerticalAlignment(image, HasAlignment.ALIGN_MIDDLE);
	hPanel.setCellVerticalAlignment(msg, HasAlignment.ALIGN_MIDDLE);
	hPanel.setCellHorizontalAlignment(image, HasAlignment.ALIGN_CENTER);
	hPanel.setCellWidth(image, "30px");
	hPanel.setCellWidth(space, "7px");

	hPanel.setHeight("25px");

	msg.setStyleName("okm-NoWrap");

	super.hide();
	setWidget(hPanel);
}
 
Example 4
Project: document-management-system   File: Status.java   Source Code and License Vote up 6 votes
/**
 * Status
 */
public Status() {
	super(false, true);
	hPanel = new HorizontalPanel();
	image = new Image(OKMBundleResources.INSTANCE.indicator());
	msg = new HTML("");
	space = new HTML("");

	hPanel.add(image);
	hPanel.add(msg);
	hPanel.add(space);

	hPanel.setCellVerticalAlignment(image, HasAlignment.ALIGN_MIDDLE);
	hPanel.setCellVerticalAlignment(msg, HasAlignment.ALIGN_MIDDLE);
	hPanel.setCellHorizontalAlignment(image, HasAlignment.ALIGN_CENTER);
	hPanel.setCellWidth(image, "30px");
	hPanel.setCellWidth(space, "7px");

	hPanel.setHeight("25px");

	msg.setStyleName("okm-NoWrap");

	super.hide();
	setWidget(hPanel);
}
 
Example 5
Project: optaplanner-wb   File: MultiConstraintHardSoftMatchRuleModellerWidget.java   Source Code and License Vote up 6 votes
private HorizontalPanel getItemPanel(final String labelText,
                                     final IsWidget constraintWidget) {
    HorizontalPanel horizontalPanel = new HorizontalPanel();

    HorizontalPanel labelPanel = new HorizontalPanel();
    Label label = new Label(labelText);
    labelPanel.add(label);
    horizontalPanel.add(labelPanel);

    horizontalPanel.add(constraintWidget);

    horizontalPanel.setWidth("100%");
    horizontalPanel.setCellWidth(labelPanel,
                                 "150px");

    return horizontalPanel;
}
 
Example 6
Project: optaplanner-wb   File: ConstraintMatchRuleModellerWidget.java   Source Code and License Vote up 6 votes
public ConstraintMatchRuleModellerWidget(final RuleModeller mod,
                                         final EventBus eventBus,
                                         final AbstractActionConstraintMatch actionConstraintMatch,
                                         final TranslationService translationService,
                                         final Boolean readOnly,
                                         final String labelTranslationKey) {
    super(mod,
          eventBus,
          translationService);

    HorizontalPanel horizontalPanel = new HorizontalPanel();

    HorizontalPanel labelPanel = createLabelPanel(translationService.getTranslation(labelTranslationKey));
    horizontalPanel.add(labelPanel);

    HorizontalPanel constraintMatchPanel = createConstraintMatchPanel(actionConstraintMatch);
    horizontalPanel.add(constraintMatchPanel);

    horizontalPanel.setCellWidth(labelPanel,
                                 "150px");

    initWidget(horizontalPanel);
}
 
Example 7
Project: optaplanner-wb   File: MultiConstraintHardMediumSoftMatchRuleModellerWidget.java   Source Code and License Vote up 6 votes
private HorizontalPanel getItemPanel(final String labelText,
                                     final IsWidget constraintMatchWidget) {
    HorizontalPanel horizontalPanel = new HorizontalPanel();
    horizontalPanel.setWidth("100%");

    HorizontalPanel labelPanel = new HorizontalPanel();
    Label label = new Label(labelText);
    labelPanel.add(label);
    horizontalPanel.add(labelPanel);

    horizontalPanel.add(constraintMatchWidget);

    horizontalPanel.setCellWidth(labelPanel,
                                 "150px");

    return horizontalPanel;
}
 
Example 8
Project: firefly   File: Form.java   Source Code and License Vote up 6 votes
public ButtonBar() {
    HorizontalPanel hp = new HorizontalPanel();
    hp.setWidth("100%");
    hp.setVerticalAlignment(HorizontalPanel.ALIGN_MIDDLE);
    left = new HorizontalPanel();
    left.setSpacing(3);
    left.setHorizontalAlignment(HorizontalPanel.ALIGN_LEFT);
    left.setWidth("100%");

    right = new HorizontalPanel();
    right.setSpacing(3);
    right.setHorizontalAlignment(HorizontalPanel.ALIGN_RIGHT);
    right.setWidth("100%");
    Label spacerRight = new Label();
    right.add(spacerRight);
    right.setCellWidth(spacerRight, "100%");

    hic.setPixelSize(16,16);
    hp.add(left);
    hp.add(right);
    hp.setCellWidth(right, "100%");
    hp.add(GwtUtil.getFiller(10,1));
    hp.add(hic);

    initWidget(hp);
}
 
Example 9
Project: unitimes   File: AriaTabBar.java   Source Code and License Vote up 5 votes
public void setRestWidget(Widget rest) {
	HorizontalPanel panel = (HorizontalPanel)getWidget();
	rest.addStyleName("gwt-TabBarRest");
	rest.setHeight("100%");
	panel.remove(panel.getWidgetCount() - 1);
	panel.add(rest);
	panel.setCellWidth(rest, "100%");
	setStyleName(rest.getElement().getParentElement(), "gwt-TabBarRest-wrapper");
}
 
Example 10
Project: appinventor-extensions   File: DesignToolbar.java   Source Code and License Vote up 5 votes
/**
 * Initializes and assembles all commands into buttons in the toolbar.
 */
public DesignToolbar() {
  super();

  isReadOnly = Ode.getInstance().isReadOnly();

  projectNameLabel = new Label();
  projectNameLabel.setStyleName("ya-ProjectName");
  HorizontalPanel toolbar = (HorizontalPanel) getWidget();
  toolbar.insert(projectNameLabel, 0);

  // width of palette minus cellspacing/border of buttons
  toolbar.setCellWidth(projectNameLabel, "222px");

  addButton(new ToolbarItem(WIDGET_NAME_TUTORIAL_TOGGLE,
      MESSAGES.toggleTutorialButton(), new ToogleTutorialAction()));
  setButtonVisible(WIDGET_NAME_TUTORIAL_TOGGLE, false); // Don't show unless needed

  List<DropDownItem> screenItems = Lists.newArrayList();
  addDropDownButton(WIDGET_NAME_SCREENS_DROPDOWN, MESSAGES.screensButton(), screenItems);

  if (AppInventorFeatures.allowMultiScreenApplications() && !isReadOnly) {
    addButton(new ToolbarItem(WIDGET_NAME_ADDFORM, MESSAGES.addFormButton(),
        new AddFormAction()));
    addButton(new ToolbarItem(WIDGET_NAME_REMOVEFORM, MESSAGES.removeFormButton(),
        new RemoveFormAction()));
  }

  addButton(new ToolbarItem(WIDGET_NAME_SWITCH_TO_FORM_EDITOR,
      MESSAGES.switchToFormEditorButton(), new SwitchToFormEditorAction()), true);
  addButton(new ToolbarItem(WIDGET_NAME_SWITCH_TO_BLOCKS_EDITOR,
      MESSAGES.switchToBlocksEditorButton(), new SwitchToBlocksEditorAction()), true);

  // Gray out the Designer button and enable the blocks button
  toggleEditor(false);
  Ode.getInstance().getTopToolbar().updateFileMenuButtons(0);
}
 
Example 11
Project: appinventor-extensions   File: LabeledTextBox.java   Source Code and License Vote up 5 votes
/**
 * Creates a new TextBox with the given leading caption.
 *
 * @param caption  caption for leading label
 */
public LabeledTextBox(String caption) {
  HorizontalPanel panel = new HorizontalPanel();
  Label label = new Label(caption);
  panel.add(label);
  textbox = new TextBox();
  textbox.setWidth("100%");
  panel.add(textbox);
  panel.setCellWidth(label, "40%");

  initWidget(panel);

  setWidth("100%");
}
 
Example 12
Project: WebConsole   File: ScreenIndicator.java   Source Code and License Vote up 5 votes
public ScreenIndicator(List<Integer> screenIds) {
	super(new HorizontalPanel(), CLASS_NAME);
	HorizontalPanel container = (HorizontalPanel)getWidget();
	DOM.setIntStyleAttribute(getElement(), "zIndex", 1000 );
	DOM.setStyleAttribute(getElement(), "overflow", "hidden");
	container.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
	this.screenIds = screenIds;
	screenIndicators = new ArrayList<Widget>();
	
	if (screenIds != null) {
		width = INDICATOR_SIZE * ((screenIds.size()*2) - 1);
		setWidth(width + "px");
		setHeight(INDICATOR_SIZE + "px");
		height = INDICATOR_SIZE;
		
		// Add a simple div for each screen
		for (int i=0; i<screenIds.size(); i++) {
			int cellWidth = INDICATOR_SIZE;
			//cellWidth = i != screenIds.size()-1 ? cellWidth + INDICATOR_SPACING : cellWidth;
			Widget screenIndicator = new SimplePanel();
			screenIndicator.setWidth(INDICATOR_SIZE + "px");
			screenIndicator.setHeight(INDICATOR_SIZE + "px");
			screenIndicator.setStylePrimaryName(ITEM_CLASS_NAME);
			screenIndicators.add(screenIndicator);
			container.add(screenIndicator);
			container.setCellWidth(screenIndicator, cellWidth + "px");
			
			if (i<screenIds.size()-1) {
				// Add a spacer
				Widget spacer = new SimplePanel();
				spacer.setWidth(INDICATOR_SIZE + "px");
				spacer.setHeight(INDICATOR_SIZE + "px");
				spacer.setStylePrimaryName(SPACER_CLASS_NAME);
				container.add(spacer);
				container.setCellWidth(spacer, cellWidth + "px");
			}
		}
	}
}
 
Example 13
Project: ontobrowser   File: OntoBrowser.java   Source Code and License Vote up 5 votes
private void layoutViews() {
	TermDetailsView termView = new TermDetailsView(eventBus, service);
	TermSynonymsView synonymsView = new TermSynonymsView(eventBus, service);
	RelatedTermsView relationshipsView = new RelatedTermsView(eventBus, service);
	SearchInputView searchInputView = new SearchInputView(eventBus, service);
	SearchOptionsView searchOptionsView = new SearchOptionsView(eventBus, service);
	SearchResultsView searchResultsView = new SearchResultsView(eventBus, service, searchOptionsView);
	SVGView svgView = new SVGView(eventBus, service);
	//CodeListView codelistView = new CodeListView(eventBus, service);
			
	DockLayoutPanel layoutPanel = new DockLayoutPanel(Unit.PX);
	HorizontalPanel southPanel = new HorizontalPanel();	
	southPanel.add(termView);
	southPanel.add(synonymsView);
	southPanel.add(relationshipsView);
	
	southPanel.setCellWidth(termView, "33.33%");
	southPanel.setCellWidth(synonymsView, "33.33%");
	southPanel.setCellWidth(relationshipsView, "33.33%");
	southPanel.setWidth("100%");
	
	FlowPanel eastPanel = new FlowPanel();										
	eastPanel.add(searchInputView);
	eastPanel.add(searchOptionsView);
	eastPanel.add(searchResultsView);
			
	layoutPanel.addNorth(menuBar, 30);
	layoutPanel.addSouth(southPanel, 197);		
	layoutPanel.addEast(eastPanel, 300);	
	layoutPanel.add(svgView);
			
	RootLayoutPanel.get().add(layoutPanel);
}
 
Example 14
Project: optaplanner-wb   File: BendableConstraintMatchRuleModellerWidget.java   Source Code and License Vote up 5 votes
public BendableConstraintMatchRuleModellerWidget(final RuleModeller mod,
                                                 final EventBus eventBus,
                                                 final AbstractActionBendableConstraintMatch actionConstraintMatch,
                                                 final TranslationService translationService,
                                                 final Boolean readOnly,
                                                 final String labelTranslationKey) {
    super(mod,
          eventBus,
          translationService);

    this.actionConstraintMatch = actionConstraintMatch;
    constraintMatchInputWidget = new ConstraintMatchInputWidget(actionConstraintMatch);
    constraintMatchInputWidget
            .addConstraintMatchValueChangeHandler(new ConstraintMatchValueChangeHandler(actionConstraintMatch));

    HorizontalPanel horizontalPanel = new HorizontalPanel();

    HorizontalPanel labelPanel = createLabelPanel(translationService.getTranslation(labelTranslationKey));
    horizontalPanel.add(labelPanel);

    HorizontalPanel selectPanel = createSelectPanel();
    horizontalPanel.add(selectPanel);

    HorizontalPanel constraintMatchPanel = createConstraintMatchPanel();
    horizontalPanel.add(constraintMatchPanel);

    horizontalPanel.setCellWidth(labelPanel,
                                 "150px");
    horizontalPanel.setCellWidth(selectPanel,
                                 "70px");

    initWidget(horizontalPanel);
}
 
Example 15
Project: onecmdb   File: CIIconDisplayNameWidget.java   Source Code and License Vote up 5 votes
public void load(GWT_CiBean bean) {
	vPanel.clear();
	HorizontalPanel cipanel =  new HorizontalPanel();
	cipanel.add(new Image(OneCMDBUtils.getIconForCI(bean)));
	CIDisplayNameWidget display = new CIDisplayNameWidget(bean, clickListener);
	cipanel.add(display);
	cipanel.setCellWidth(display, "100%");
	cipanel.setCellHorizontalAlignment(display, HorizontalPanel.ALIGN_LEFT);
	vPanel.add(cipanel);
}
 
Example 16
Project: firefly   File: TitlePanel.java   Source Code and License Vote up 5 votes
public TitlePanel(String title, Widget body, boolean showTitle) {
        titleWrapper = new HorizontalPanel();
        makeTitleLabel(titleWrapper);
        titleWrapper.add(titleLabel);
        titleWrapper.add(titleBar);
        titleWrapper.add(GwtUtil.getFiller(10, 1));
        titleWrapper.setCellWidth(titleBar, "100%");
        titleWrapper.setCellHorizontalAlignment(titleBar, HorizontalPanel.ALIGN_RIGHT);

        dlp = new DockLayoutPanel(Style.Unit.PX);
        if (showTitle) {
            dlp.addNorth(titleWrapper, 23);
            dlp.addNorth(GwtUtil.getFiller(1,2), 2);
        }
        dlp.add(body);
        dlp.setSize("100%", "100%");
//
//
//        FlowPanel vp = new FlowPanel();
//        vp.add(titleWrapper);
//        vp.add(body);
//        vp.setSize("100%", "100%");
        initWidget(dlp);
        this.body = body;

//        dlp.setStyleName("standard-border");
        setTitle(title);
        if (BrowserUtil.isIE()) {
            DOM.setStyleAttribute(titleLabel.getElement(), "whiteSpace", "nowrap");
        }
    }
 
Example 17
Project: firefly   File: FormBuilder.java   Source Code and License Vote up 5 votes
public static Widget createWidget(int labelWidth, int padding, Widget label, Widget field) {
    HorizontalPanel hp = new HorizontalPanel();
    hp.add(label);
    hp.add(field);
    hp.setCellWidth(label, labelWidth + "px");
    GwtUtil.setStyle(hp, "paddingLeft", padding+"px");
    return hp;
}
 
Example 18
Project: unitime   File: AriaTabBar.java   Source Code and License Vote up 5 votes
public void setRestWidget(Widget rest) {
	HorizontalPanel panel = (HorizontalPanel)getWidget();
	rest.addStyleName("gwt-TabBarRest");
	rest.setHeight("100%");
	panel.remove(panel.getWidgetCount() - 1);
	panel.add(rest);
	panel.setCellWidth(rest, "100%");
	setStyleName(rest.getElement().getParentElement(), "gwt-TabBarRest-wrapper");
}
 
Example 19
Project: appinventor-extensions   File: SimplePaletteItem.java   Source Code and License Vote up 4 votes
/**
 * Creates a new palette item.
 *
 * @param scd component descriptor for palette item
 * @param dropTargetProvider provider of targets that palette items can be dropped on
 */
public SimplePaletteItem(SimpleComponentDescriptor scd, DropTargetProvider dropTargetProvider) {
  this.dropTargetProvider = dropTargetProvider;
  this.scd = scd;

  componentPrototype = null;

  // Initialize palette item UI
  HorizontalPanel panel = new HorizontalPanel();
  panel.setStylePrimaryName("ode-SimplePaletteItem");

  Image image = scd.getImage();
  image.setStylePrimaryName("ode-SimplePaletteItem-icon");
  panel.add(image);
  panel.setCellHorizontalAlignment(image, HorizontalPanel.ALIGN_LEFT);
  panel.setCellWidth(image, "30px");

  Label label = new Label(ComponentsTranslation.getComponentName(scd.getName()));
  label.setHorizontalAlignment(Label.ALIGN_LEFT);
  label.addStyleName("ode-SimplePaletteItem-caption");
  panel.add(label);

  HorizontalPanel optPanel = new HorizontalPanel();

  ComponentHelpWidget helpImage = new ComponentHelpWidget(scd);
  helpImage.addStyleName("ode-SimplePalleteItem-button");
  optPanel.add(helpImage);
  optPanel.setCellHorizontalAlignment(helpImage, HorizontalPanel.ALIGN_LEFT);

  if (scd.getExternal()) {
    ComponentRemoveWidget deleteImage = new ComponentRemoveWidget(scd);
    deleteImage.addStyleName("ode-SimplePalleteItem-button");
    optPanel.add(deleteImage);
    optPanel.setCellHorizontalAlignment(deleteImage, HorizontalPanel.ALIGN_RIGHT);
  }

  panel.add(optPanel);
  panel.setCellHorizontalAlignment(optPanel, HorizontalPanel.ALIGN_RIGHT);

  panel.setWidth("100%");
  add(panel);
  setWidth("100%");

  addHandlers();
}
 
Example 20
Project: optaplanner-wb   File: MultiConstraintBendableMatchRuleModellerWidget.java   Source Code and License Vote up 4 votes
private HorizontalPanel createBendableConstraintMatchRow(final String labelText,
                                                         final int index,
                                                         final List<HelpIcon> hardConstraintMatchHelpIcons,
                                                         final List<ConstraintMatchInputWidget> constraintMatchInputWidgets,
                                                         final AbstractActionBendableConstraintMatch constraintMatch) {
    HorizontalPanel horizontalPanel = new HorizontalPanel();

    HorizontalPanel labelPanel = new HorizontalPanel();
    labelPanel.add(new Label(labelText));
    horizontalPanel.add(labelPanel);

    HorizontalPanel selectPanel = new HorizontalPanel();

    TextBox constraintLevelTextBox = new TextBox();
    constraintLevelTextBox.setEnabled(false);
    constraintLevelTextBox.getElement().getStyle().setWidth(40,
                                                            Style.Unit.PX);
    constraintLevelTextBox.setValue(String.valueOf(index));
    selectPanel.add(constraintLevelTextBox);

    HelpIcon constraintLevelSelectHelpIcon = new HelpIcon();
    hardConstraintMatchHelpIcons.add(constraintLevelSelectHelpIcon);
    constraintLevelSelectHelpIcon.setVisible(false);
    constraintLevelSelectHelpIcon.setHelpContent(translationService.getTranslation(GuidedRuleEditorConstants.RuleModellerActionPlugin_ScoreLevelExceeded));
    constraintLevelSelectHelpIcon.getElement().getStyle().setPaddingLeft(5,
                                                                         Style.Unit.PX);
    selectPanel.add(constraintLevelSelectHelpIcon);

    horizontalPanel.add(selectPanel);

    ConstraintMatchInputWidget constraintMatchInputWidget = new ConstraintMatchInputWidget(constraintMatch);
    constraintMatchInputWidget
            .addConstraintMatchValueChangeHandler(new ConstraintMatchValueChangeHandler(constraintMatch));
    constraintMatchInputWidgets.add(constraintMatchInputWidget);

    horizontalPanel.add(constraintMatchInputWidget);
    horizontalPanel.setCellWidth(labelPanel,
                                 "150px");
    horizontalPanel.setCellWidth(selectPanel,
                                 "70px");

    horizontalPanel.setStyleName(GuidedRuleEditorResources.INSTANCE.css().multiConstraintMatch());
    horizontalPanel.getElement().getStyle().setWidth(100,
                                                     Style.Unit.PCT);

    return horizontalPanel;
}
 
Example 21
Project: onecmdb   File: CIMultiValueWidget.java   Source Code and License Vote up 4 votes
public void addValue(final Widget widget) {
	// need to get the base widget...
	if (widget instanceof IBaseField) {
		final HorizontalPanel hPanel = new HorizontalPanel();
		hPanel.add(((IBaseField)widget).getBaseField());
		
		
		valuePanel.add(hPanel);
		if (mValue.getCtrl().isReadonly()) {
			((IBaseField)widget).getBaseField().setStyleName("multi-value-input-readonly");
		} else {
			Image delete = new Image("images/delete-value.gif");
			delete.setTitle("Remove this value");
			delete.addClickListener(new ClickListener() {

				public void onClick(Widget sender) {
					List values = mValue.getAttributeValues();
					List remainingValues = new ArrayList();
					for (Iterator iter = values.iterator(); iter.hasNext();) {
						AttributeValue aValue = (AttributeValue) iter.next();
						if (widget.equals(aValue.getWidget())) {
							// Remove this, 
							mValue.removeAttributeValue(aValue);
							valuePanel.remove(hPanel);
							break;
						}
					}
				}
				
			});

			hPanel.add(delete);
			hPanel.setCellWidth(((IBaseField)widget).getBaseField(), "100%");
			//((IBaseField)widget).getBaseField().setStyleName("multi-value-input");
			((IBaseField)widget).getBaseField().setStyleName("multi-value-input-inside");
			hPanel.setStyleName("multi-value-input");
		}
		baseFields.add(widget);
		
	}
}
 
Example 22
Project: sc2gears   File: HomePage.java   Source Code and License Vote up 4 votes
@Override
  public void buildGUI() {
add( ClientUtils.createVerticalEmptyWidget( 30 ) );

final HorizontalPanel greetingsPanel = new HorizontalPanel();
add( greetingsPanel );

if ( sharedApiAccountUserInfo == null ) {
	// Greeting
	if ( apiUserInfo.getLastVisit() == null ) {
		greetingsPanel.add( new Label( "Welcome " ) );
		greetingsPanel.add( ClientUtils.createHorizontalEmptyWidget( 5 ) );
		greetingsPanel.add( ClientUtils.styledWidget( new Label( apiUserInfo.getUserName() ), "strong" ) );
		greetingsPanel.add( new Label( "!" ) );
	}
	else {
		greetingsPanel.add( new Label( "Welcome back" ) );
		greetingsPanel.add( ClientUtils.createHorizontalEmptyWidget( 5 ) );
		greetingsPanel.add( ClientUtils.styledWidget( new Label( apiUserInfo.getUserName() ), "strong" ) );
		greetingsPanel.add( new Label( "! Your last visit was at:" ) );
		greetingsPanel.add( ClientUtils.createHorizontalEmptyWidget( 5 ) );
		greetingsPanel.add( ClientUtils.createTimestampWidget( apiUserInfo.getLastVisit() ) );
	}
}
else {
	if ( sharedApiAccountUserInfo.isHasApiAccount() )
		greetingsPanel.add( new Label( "You are now viewing the" ) );
	else
		greetingsPanel.add( new Label( "You do NOT have access to the" ) );
	greetingsPanel.add( ClientUtils.createHorizontalEmptyWidget( 9 ) );
	greetingsPanel.add( ClientUtils.styledWidget( new Label( sharedApiAccountUserInfo.getSharedApiAccount() ), "strong" ) );
	greetingsPanel.add( ClientUtils.createHorizontalEmptyWidget( 9 ) );
	greetingsPanel.add( new Label( "API account!" ) );
}

// Replay parser engine version
if ( apiUserInfo.getRepParserEngineVer() != null ) {
	add( ClientUtils.createVerticalEmptyWidget( 30 ) );
	final HorizontalPanel rowPanel = new HorizontalPanel();
	rowPanel.add( new Label( "Replay parser engine version:" ) );
	rowPanel.add( ClientUtils.createHorizontalEmptyWidget( 5 ) );
	rowPanel.add( ClientUtils.styledWidget( new Label( apiUserInfo.getRepParserEngineVer() ), "strong" ) );
	add( rowPanel );
}

// Parsing service tester page
add( ClientUtils.createVerticalEmptyWidget( 30 ) );
add( new Anchor( "Parsing Service Tester page", "/parsing_service_tester.html", "_blank" ) );

add( ClientUtils.createVerticalEmptyWidget( 70 ) );

// Footer
final HorizontalPanel linksPanel = new HorizontalPanel();
linksPanel.setWidth( "500px" );
DOM.setStyleAttribute( linksPanel.getElement(), "padding", "2px" );
DOM.setStyleAttribute( linksPanel.getElement(), "borderTop", "1px solid #555555" );
linksPanel.addStyleName( "noWrap" );
linksPanel.add( new Anchor( "About the Service", "https://sites.google.com/site/sc2gears/parsing-service", "_blank" ) );
linksPanel.add( ClientUtils.createHorizontalEmptyWidget( 10 ) );
linksPanel.add( new Anchor( "Terms of Service", "https://sites.google.com/site/sc2gears/parsing-service#TOC-Terms-of-Service", "_blank" ) );
linksPanel.add( ClientUtils.createHorizontalEmptyWidget( 10 ) );
linksPanel.add( new Anchor( "Privacy Policy", "https://sites.google.com/site/sc2gears/parsing-service#TOC-Privacy-Policy", "_blank" ) );
linksPanel.add( ClientUtils.createHorizontalEmptyWidget( 15 ) );
final Label lastLabel = new Label( "© András Belicza, 2011-2014, Icons: Fugue" );
DOM.setStyleAttribute( lastLabel.getElement(), "color", "#555555" );
DOM.setStyleAttribute( lastLabel.getElement(), "paddingTop", "3px" );
linksPanel.add( lastLabel );
linksPanel.setCellWidth( lastLabel, "100%" );
linksPanel.setCellHorizontalAlignment( lastLabel, HasHorizontalAlignment.ALIGN_RIGHT );
for ( int i = linksPanel.getWidgetCount() - 1; i >= 0; i-- )
	DOM.setStyleAttribute( linksPanel.getWidget( i ).getElement(), "fontSize", "80%" );
add( linksPanel );
  }