当前位置: 首页>>代码示例>>Java>>正文


Java HorizontalPanel.setCellWidth方法代码示例

本文整理汇总了Java中com.google.gwt.user.client.ui.HorizontalPanel.setCellWidth方法的典型用法代码示例。如果您正苦于以下问题:Java HorizontalPanel.setCellWidth方法的具体用法?Java HorizontalPanel.setCellWidth怎么用?Java HorizontalPanel.setCellWidth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.gwt.user.client.ui.HorizontalPanel的用法示例。


在下文中一共展示了HorizontalPanel.setCellWidth方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: LabeledTextBox

import com.google.gwt.user.client.ui.HorizontalPanel; //导入方法依赖的package包/类
/**
 * 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%");
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:32,代码来源:LabeledTextBox.java

示例2: addLogo

import com.google.gwt.user.client.ui.HorizontalPanel; //导入方法依赖的package包/类
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);
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:24,代码来源:TopPanel.java

示例3: Status

import com.google.gwt.user.client.ui.HorizontalPanel; //导入方法依赖的package包/类
/**
 * 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);
}
 
开发者ID:openkm,项目名称:document-management-system,代码行数:28,代码来源:Status.java

示例4: Status

import com.google.gwt.user.client.ui.HorizontalPanel; //导入方法依赖的package包/类
/**
 * 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);
}
 
开发者ID:openkm,项目名称:document-management-system,代码行数:28,代码来源:Status.java

示例5: getItemPanel

import com.google.gwt.user.client.ui.HorizontalPanel; //导入方法依赖的package包/类
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;
}
 
开发者ID:kiegroup,项目名称:optaplanner-wb,代码行数:18,代码来源:MultiConstraintHardSoftMatchRuleModellerWidget.java

示例6: ConstraintMatchRuleModellerWidget

import com.google.gwt.user.client.ui.HorizontalPanel; //导入方法依赖的package包/类
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);
}
 
开发者ID:kiegroup,项目名称:optaplanner-wb,代码行数:24,代码来源:ConstraintMatchRuleModellerWidget.java

示例7: getItemPanel

import com.google.gwt.user.client.ui.HorizontalPanel; //导入方法依赖的package包/类
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;
}
 
开发者ID:kiegroup,项目名称:optaplanner-wb,代码行数:18,代码来源:MultiConstraintHardMediumSoftMatchRuleModellerWidget.java

示例8: ButtonBar

import com.google.gwt.user.client.ui.HorizontalPanel; //导入方法依赖的package包/类
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);
}
 
开发者ID:lsst,项目名称:firefly,代码行数:27,代码来源:Form.java

示例9: setRestWidget

import com.google.gwt.user.client.ui.HorizontalPanel; //导入方法依赖的package包/类
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");
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:10,代码来源:AriaTabBar.java

示例10: DesignToolbar

import com.google.gwt.user.client.ui.HorizontalPanel; //导入方法依赖的package包/类
/**
 * 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);
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:40,代码来源:DesignToolbar.java

示例11: ScreenIndicator

import com.google.gwt.user.client.ui.HorizontalPanel; //导入方法依赖的package包/类
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");
			}
		}
	}
}
 
开发者ID:openremote,项目名称:WebConsole,代码行数:40,代码来源:ScreenIndicator.java

示例12: layoutViews

import com.google.gwt.user.client.ui.HorizontalPanel; //导入方法依赖的package包/类
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);
}
 
开发者ID:Novartis,项目名称:ontobrowser,代码行数:34,代码来源:OntoBrowser.java

示例13: BendableConstraintMatchRuleModellerWidget

import com.google.gwt.user.client.ui.HorizontalPanel; //导入方法依赖的package包/类
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);
}
 
开发者ID:kiegroup,项目名称:optaplanner-wb,代码行数:34,代码来源:BendableConstraintMatchRuleModellerWidget.java

示例14: load

import com.google.gwt.user.client.ui.HorizontalPanel; //导入方法依赖的package包/类
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);
}
 
开发者ID:luox12,项目名称:onecmdb,代码行数:11,代码来源:CIIconDisplayNameWidget.java

示例15: TitlePanel

import com.google.gwt.user.client.ui.HorizontalPanel; //导入方法依赖的package包/类
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");
        }
    }
 
开发者ID:lsst,项目名称:firefly,代码行数:32,代码来源:TitlePanel.java


注:本文中的com.google.gwt.user.client.ui.HorizontalPanel.setCellWidth方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。