當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。