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


Java HorizontalPanel类代码示例

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


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

示例1: IconCell

import com.google.gwt.user.client.ui.HorizontalPanel; //导入依赖的package包/类
public IconCell(ImageResource resource, final String title, String text) {
	super(null);
	iIcon = new Image(resource);
	iIcon.setTitle(title);
	iIcon.setAltText(title);
	if (text != null && !text.isEmpty()) {
		iLabel = new HTML(text, false);
		iPanel = new HorizontalPanel();
		iPanel.setStyleName("icon");
		iPanel.add(iIcon);
		iPanel.add(iLabel);
		iIcon.getElement().getStyle().setPaddingRight(3, Unit.PX);
		iPanel.setCellVerticalAlignment(iIcon, HasVerticalAlignment.ALIGN_MIDDLE);
	}
	iIcon.addClickHandler(new ClickHandler() {
		@Override
		public void onClick(ClickEvent event) {
			event.stopPropagation();
			UniTimeConfirmationDialog.info(title);
		}
	});
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:23,代码来源:WebTable.java

示例2: initializew3wPanel

import com.google.gwt.user.client.ui.HorizontalPanel; //导入依赖的package包/类
private void initializew3wPanel() {
	w3wPanel = new HorizontalPanel();
	w3wPanel.setSpacing(5);
	w3wPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
	StyleInjector.inject(".w3wPanel { " + "background: #E0ECF8;"
			+ "border-radius: 5px 10px;" + "opacity: 0.8}");
	w3wPanel.setStyleName("w3wPanel");
	w3wPanel.setWidth("415px");

	wordsLabel = new Label();
	w3wAnchor = new AnchorBuilder().setHref("https://what3words.com/")
			.setText(UIMessages.INSTANCE.what3Words())
			.setTitle("https://what3words.com/").build();
	w3wAnchor.getElement().getStyle().setColor("#FF0000");
	w3wAnchor.setVisible(false);
	w3wPanel.add(w3wAnchor);
	w3wPanel.add(wordsLabel);
}
 
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:19,代码来源:BasicToolBar.java

示例3: createSeparatorPanel

import com.google.gwt.user.client.ui.HorizontalPanel; //导入依赖的package包/类
private void createSeparatorPanel() {
	separatorPanel = new HorizontalPanel();
	separatorPanel.setSpacing(1);
	separatorPanel.setWidth("100%");
	separatorPanel.addStyleName(ThemeStyles.get().style().borderTop());
	separatorPanel.addStyleName(ThemeStyles.get().style().borderBottom());
	separatorPanel
			.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
	separatorPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
	separatorPanel.add(new Label(UIMessages.INSTANCE
			.separator(DEFAULT_CSV_SEPARATOR)));
	separatorTextField = new TextField();
	separatorTextField.setText(DEFAULT_CSV_SEPARATOR);
	separatorTextField.setWidth(30);

	separatorPanel.add(separatorTextField);
}
 
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:18,代码来源:JoinDataDialog.java

示例4: ActionBar

import com.google.gwt.user.client.ui.HorizontalPanel; //导入依赖的package包/类
public ActionBar() {
	super();
	setWidth(300);
	setHeaderVisible(false);
	addStyleName(ThemeStyles.get().style().borderBottom());
	setPosition(0, 0);
	getElement().getStyle().setPosition(Position.ABSOLUTE);
	HorizontalPanel horizontalGroup = new HorizontalPanel();
	horizontalGroup.add(getMenuButton());
	horizontalGroup.add(new SeparatorToolItem());
	Image image = new Image(ImageProvider.INSTANCE.menulogoGeowe());
	horizontalGroup.add(image);
	horizontalGroup.add(new SeparatorToolItem());
	horizontalGroup.add(new SeparatorToolItem());						
	horizontalGroup.add(getGeocodingButton());
	setWidget(horizontalGroup);		
}
 
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:18,代码来源:ActionBar.java

示例5: createGridPanel

import com.google.gwt.user.client.ui.HorizontalPanel; //导入依赖的package包/类
private HorizontalPanel createGridPanel() {
	HorizontalPanel hPanel = new HorizontalPanel();
	hPanel.setSize("510px", "320px");
	
	vehicleStore = new ListStore<VehicleJSO>(vehicleProps.key());
	vehiculeGrid = createGrid(vehicleStore, vehicleProps);
	
	vehiculeGrid.getSelectionModel().addSelectionChangedHandler(
			new SelectionChangedHandler<VehicleJSO>() {
				@Override
				public void onSelectionChanged(
						SelectionChangedEvent<VehicleJSO> event) {
					List<VehicleJSO> selected = event.getSelection();						
					vehicleToolBar.setVehicles(selected);						
				}
			});

	VerticalLayoutContainer gridContainer = new VerticalLayoutContainer();
	gridContainer.setWidth(500);
	gridContainer.setHeight(320);
	gridContainer.add(vehiculeGrid, new VerticalLayoutData(1, 1));				
	hPanel.add(gridContainer);
	hPanel.add(vehicleToolBar);
	return hPanel;
}
 
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:26,代码来源:VehicleDialog.java

示例6: 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

示例7: Toolbar

import com.google.gwt.user.client.ui.HorizontalPanel; //导入依赖的package包/类
/**
 * Initializes and assembles all commands into buttons in the toolbar.
 */
public Toolbar() {
  buttonMap = new HashMap<String, TextButton>();
  dropDownButtonMap = new HashMap<String, DropDownButton>();

  leftButtons = new HorizontalPanel();
  leftButtons.setSpacing(4);

  rightButtons = new HorizontalPanel();
  rightButtons.setSpacing(4);
  rightButtons.setHorizontalAlignment(HorizontalPanel.ALIGN_RIGHT);

  HorizontalPanel toolbar = new HorizontalPanel();
  toolbar.add(leftButtons);  // this nesting keeps buttons left aligned
  toolbar.add(rightButtons);
  toolbar.setCellHorizontalAlignment(rightButtons, HorizontalPanel.ALIGN_RIGHT);
  toolbar.setWidth("100%");
  toolbar.setStylePrimaryName("ya-Toolbar");

  initWidget(toolbar);
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:24,代码来源:Toolbar.java

示例8: 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

示例9: GalleryAppBox

import com.google.gwt.user.client.ui.HorizontalPanel; //导入依赖的package包/类
/**
 * Creates new Gallery app box.
 */
private GalleryAppBox() {
  gContainer = new FlowPanel();
  final HorizontalPanel container = new HorizontalPanel();
  container.setWidth("100%");
  container.setSpacing(0);
  container.setHorizontalAlignment(HorizontalPanel.ALIGN_CENTER);
  HorizontalPanel panel = new HorizontalPanel();
  Image image = new Image();
  image.setResource(Ode.getImageBundle().waitingIcon());
  panel.add(image);
  Label label = new Label();
  label.setText(Ode.getMessages().defaultRpcMessage());
  panel.add(label);
  gContainer.add(panel);
  this.add(gContainer);
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:20,代码来源:GalleryAppBox.java

示例10: StatusPanel

import com.google.gwt.user.client.ui.HorizontalPanel; //导入依赖的package包/类
/**
   * Initializes and assembles all UI elements shown in the status panel.
   */
  public StatusPanel() {
    HorizontalPanel hpanel = new HorizontalPanel();
    hpanel.setWidth("100%");
    hpanel.setHorizontalAlignment(HorizontalPanel.ALIGN_CENTER);
    String tosUrl = Ode.getInstance().getSystemConfig().getTosUrl();
    if (!Strings.isNullOrEmpty(tosUrl)) {
      String appInventorFooter =
          "<a href=\"" + tosUrl + "\" target=\"_blank\">" + MESSAGES.privacyTermsLink() + "</a>";
      hpanel.add(new HTML(appInventorFooter));
    }

    // This shows the git version and the date of the build
//    String version = GitBuildId.getVersion();
//    String date = GitBuildId.getDate();
//    if (version != null && date != null) {
//      Label buildId = new Label(MESSAGES.gitBuildId(date, version));
//      hpanel.add(buildId);
//      hpanel.setCellHorizontalAlignment(buildId, HorizontalPanel.ALIGN_RIGHT);
//    }

    initWidget(hpanel);
    setStyleName("ode-StatusPanel");
  }
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:27,代码来源:StatusPanel.java

示例11: loadPage

import com.google.gwt.user.client.ui.HorizontalPanel; //导入依赖的package包/类
private void loadPage(int pageNo) {
	int displayWidth = WebConsole.getConsoleUnit().getConsoleDisplay().getWidth();
	
	pageNo = pageNo > pageCount ? pageCount : pageNo;
	currentPage = pageNo;
	
	// Remove existing items
	hideCurrentItems();
	
	// Draw the corresponding set of items
	int startIndex = ((pageNo-1) * maxItemsPerPage);
	
	// Determine width per item and add handlers
	int itemsOnPage = (items.size() - startIndex) > maxItemsPerPage ? maxItemsPerPage : (items.size() - startIndex);
	widthPerItem = (int)Math.floor((double)displayWidth / itemsOnPage);

	for (int i=startIndex; i<(startIndex+(maxItemsPerPage)); i++) {
		if (i >= items.size()) {
			break;
		}
		TabBarItemComponent item = items.get(i);
		item.setWidth(widthPerItem);
		((HorizontalPanel)getWidget()).add(item);
	}
}
 
开发者ID:openremote,项目名称:WebConsole,代码行数:26,代码来源:TabBarComponent.java

示例12: AlertButton

import com.google.gwt.user.client.ui.HorizontalPanel; //导入依赖的package包/类
/**
 * @param title The text that will appear on the button face.
 * @param alertStyle the dependent style suffix that will be appended to the default GWT style when the user is to be alerted.
 */
public AlertButton(String title, String alertStyle) {
    button = new PushButton(title);
    button.addStyleDependentName("SMALLER");
    panel = new HorizontalPanel();
    panel.setBorderWidth(1);
    checkBox = new CheckBox();
    panel.add(button);
    button.setSize("66", "21");
    panel.add(checkBox);
    checkBox.setSize("20", "20");
    ClientFactory cf = GWT.create(ClientFactory.class);
    eventBus = cf.getEventBus();
    this.alertStyle = alertStyle;
    eventBus.addHandler(WidgetSelectionChangeEvent.TYPE, updateNeededEventHandler);
    eventBus.addHandler(VariableSelectionChangeEvent.TYPE, variableChangedEventHandler);
    eventBus.addHandler(UpdateFinishedEvent.TYPE, updateFinishedHandler);
    eventBus.addHandler(MapChangeEvent.TYPE, mapChangeHandler);
    initWidget(panel);
    panel.setSize("90", "23");
    this.ensureDebugId("AlertButton");
}
 
开发者ID:NOAA-PMEL,项目名称:LAS,代码行数:26,代码来源:AlertButton.java

示例13: MailDashboard

import com.google.gwt.user.client.ui.HorizontalPanel; //导入依赖的package包/类
/**
 * GeneralDashboard
 */
public MailDashboard() {
	vPanelLeft = new VerticalPanel();
	vPanelRight = new VerticalPanel();
	hPanel = new HorizontalPanel();

	userLastImportedMails = new DashboardWidget("UserLastImportedMails",
			"dashboard.mail.last.imported.mails", "img/email.gif", true, "userLastImportedMails");
	userLastImportedAttachments = new DashboardWidget("UserLastImportedMailAttachments",
			"dashboard.mail.last.imported.attached.documents", "img/email_attach.gif", true,
			"userLastImportedMailAttachments");

	vPanelLeft.add(userLastImportedMails);
	vPanelRight.add(userLastImportedAttachments);

	hPanel.add(vPanelLeft);
	hPanel.add(vPanelRight);

	initWidget(hPanel);
}
 
开发者ID:openkm,项目名称:document-management-system,代码行数:23,代码来源:MailDashboard.java

示例14: WorkflowDashboard

import com.google.gwt.user.client.ui.HorizontalPanel; //导入依赖的package包/类
/**
 * UserDashboard
 */
public WorkflowDashboard() {
	vPanelLeft = new VerticalPanel();
	vPanelRight = new VerticalPanel();
	hPanel = new HorizontalPanel();

	hPanel.add(vPanelLeft);
	hPanel.add(vPanelRight);

	pendingTasks = new WorkflowWidget("dashboard.workflow.pending.tasks", "img/icon/workflow.gif", true);
	pendingPooledTasks = new WorkflowWidget("dashboard.workflow.pending.tasks.unassigned", "img/icon/workflow.gif", true);
	pendingTasks.setIsWidgetPendingTask();
	pendingPooledTasks.setIsWidgetPooledTask();
	workflowFormPanel = new WorkflowFormPanel();

	vPanelLeft.add(pendingTasks);
	vPanelLeft.add(pendingPooledTasks);
	vPanelRight.add(workflowFormPanel);

	hPanel.setHeight("100%");
	vPanelRight.setHeight("100%");

	initWidget(hPanel);
}
 
开发者ID:openkm,项目名称:document-management-system,代码行数:27,代码来源:WorkflowDashboard.java

示例15: WorkflowWidget

import com.google.gwt.user.client.ui.HorizontalPanel; //导入依赖的package包/类
/**
 * WorkflowWidget
 */
public WorkflowWidget(String name, String uuid, WorkflowWidgetToFire workflowWidgetToFire, Map<String, Object> workflowVariables) {
	this.name = name;
	this.uuid = uuid;
	this.workflowWidgetToFire = workflowWidgetToFire;
	this.workflowVariables = workflowVariables;
	drawed = false;

	vPanel = new VerticalPanel();
	hPanel = new HorizontalPanel();
	manager = new FormManager();

	vPanel.setWidth("300px");
	vPanel.setHeight("50px");

	vPanel.add(new HTML("<br>"));
	vPanel.add(manager.getTable());
	vPanel.add(new HTML("<br>"));

	vPanel.setCellHorizontalAlignment(hPanel, VerticalPanel.ALIGN_CENTER);

	initWidget(vPanel);
}
 
开发者ID:openkm,项目名称:document-management-system,代码行数:26,代码来源:WorkflowWidget.java


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