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

The following are Jave code examples for showing how to use add() 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: sig-seguimiento-vehiculos   File: VehicleDialog.java   Source Code and License Vote up 6 votes
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;
}
 
Example 2
Project: appinventor-extensions   File: GalleryAppBox.java   Source Code and License Vote up 6 votes
/**
 * 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);
}
 
Example 3
Project: LAS   File: AlertButton.java   Source Code and License Vote up 6 votes
/**
 * @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");
}
 
Example 4
Project: document-management-system   File: MailDashboard.java   Source Code and License Vote up 6 votes
/**
 * 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);
}
 
Example 5
Project: document-management-system   File: WorkflowDashboard.java   Source Code and License Vote up 6 votes
/**
 * 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);
}
 
Example 6
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 7
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 8
Project: Wiab.pro   File: DialogBox.java   Source Code and License Vote up 6 votes
/**
 * Creates dialog box.
 *
 * @param popup - UniversalPopup on which the dialog is based
 * @param title - title placed in the title bar
 * @param innerWidget - the inner widget of the dialog
 * @param dialogButtons - buttons
 */
public static void create(UniversalPopup popup, String title, Widget innerWidget,
    DialogButton[] dialogButtons) {
  // Title
  popup.getTitleBar().setTitleText(title);

  VerticalPanel contents = new VerticalPanel();
  popup.add(contents);

  // Message
  contents.add(innerWidget);

  // Buttons
  HorizontalPanel buttonPanel = new HorizontalPanel();
  for (DialogButton dialogButton : dialogButtons) {
    Button button = new Button(dialogButton.getTitle());
    button.setStyleName(Dialog.getCss().dialogButton());
    buttonPanel.add(button);
    dialogButton.link(button);
  }
  contents.add(buttonPanel);
  buttonPanel.setStyleName(Dialog.getCss().dialogButtonPanel());
  contents.setCellHorizontalAlignment(buttonPanel, HasHorizontalAlignment.ALIGN_RIGHT);
}
 
Example 9
Project: sc2gears   File: User.java   Source Code and License Vote up 6 votes
private static DialogBox createWaitingDialog( final String message ) {
	final DialogBox dialogBox = new DialogBox();
	dialogBox.setText( "Info" );
	
	final HorizontalPanel hp = new HorizontalPanel();
	DOM.setStyleAttribute( hp.getElement(), "padding", "20px" );
	hp.setHeight( "20px" );
	hp.add( new Image( "/images/loading.gif" ) );
	hp.add( ClientUtils.createHorizontalEmptyWidget( 5 ) );
	hp.add( new Label( message ) );
	dialogBox.setWidget( hp );
	
	dialogBox.center();
	
	return dialogBox;
}
 
Example 10
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 11
Project: onecmdb   File: ConfirmNewProblemtScreen.java   Source Code and License Vote up 6 votes
public void load(String objectType, Long objectId) {
	setErrorText("");
	setLoadingText("");
	this.objectType = objectType;
	
	vPanel.clear();
	vPanel.add(new HTML("Problem <i>" + objectType + "</i> successfully created."));
	
	HorizontalPanel bPanel = new HorizontalPanel();
	bPanel.add(newProblem);
	bPanel.add(listProblem);
	bPanel.add(editProblem);
	newProblem.addClickListener(this);
	listProblem.addClickListener(this);
	editProblem.addClickListener(this);
	
	vPanel.add(bPanel);
	
}
 
Example 12
Project: gerrit   File: ProjectInfoScreen.java   Source Code and License Vote up 6 votes
private TextBox renderTextBox(LabeledWidgetsGrid g, ConfigParameterInfo param) {
  NpTextBox textBox = param.type().equals("STRING") ? new NpTextBox() : new NpIntTextBox();
  if (param.inheritable()) {
    textBox.setValue(param.configuredValue());
    Label inheritedLabel =
        new Label(AdminMessages.I.pluginProjectInheritedValue(param.inheritedValue()));
    inheritedLabel.setStyleName(Gerrit.RESOURCES.css().pluginProjectConfigInheritedValue());
    HorizontalPanel p = new HorizontalPanel();
    p.add(textBox);
    p.add(inheritedLabel);
    addWidget(g, p, param);
  } else {
    textBox.setValue(param.value());
    addWidget(g, textBox, param);
  }
  saveEnabler.listenTo(textBox);
  return textBox;
}
 
Example 13
Project: ontobrowser   File: EditSynonymPopup.java   Source Code and License Vote up 6 votes
private void addDialogWidgets() {
	VerticalPanel dialogVPanel = new VerticalPanel();
	HorizontalPanel buttonsHPanel = new HorizontalPanel();
	Button cancelButton = new Button("Cancel");
			
	cancelButton.addClickHandler(new ClickHandler() {
		public void onClick(ClickEvent event) {
			typeError.setText(null);
			dialogBox.hide();
		}
	});
	
	buttonsHPanel.add(updateButton);
	buttonsHPanel.add(cancelButton);
	buttonsHPanel.addStyleName("dialog-buttons");	
	
	dialogVPanel.setHorizontalAlignment(VerticalPanel.ALIGN_LEFT);
	dialogVPanel.add(grid);		
	dialogVPanel.add(typeError);
	dialogVPanel.add(buttonsHPanel);
	dialogVPanel.setCellHorizontalAlignment(buttonsHPanel, VerticalPanel.ALIGN_CENTER);
	
			
	dialogBox.setWidget(dialogVPanel);
}
 
Example 14
Project: mvp4g-examples   File: AbstractProductView.java   Source Code and License Vote up 6 votes
public void createView() {
	leftButton = new Button( getLeftButtonName() );
	rightButton = new Button( getRightButtonName() );

	Grid grid = new Grid( 2, 2 );
	grid.setText( 0, 0, "Name :" );
	grid.setWidget( 0, 1, createAndGetNameWidget() );

	HorizontalPanel buttons = new HorizontalPanel();
	buttons.add( leftButton );
	buttons.add( rightButton );

	grid.setWidget( 1, 1, buttons );

	setWidget( grid );
}
 
Example 15
Project: sig-seguimiento-vehiculos   File: MenuPanelWidget.java   Source Code and License Vote up 5 votes
private HorizontalPanel getZoomToolGroup2Tools() {
	HorizontalPanel horizontalGroup = new HorizontalPanel();
	horizontalGroup.getElement().getStyle()
			.setVerticalAlign(VerticalAlign.MIDDLE);
	horizontalGroup.setSpacing(5);

	horizontalGroup.add(zoomIn);
	horizontalGroup.add(zoomOut);
	horizontalGroup.add(zoomToSeletionTool);

	return horizontalGroup;
}
 
Example 16
Project: sig-seguimiento-vehiculos   File: JoinDataDialog.java   Source Code and License Vote up 5 votes
private void createLayerAttributeComboPanel() {
	layerAttributeComboPanel = new HorizontalPanel();
	layerAttributeComboPanel.setWidth("100%");
	layerAttributeComboPanel.addStyleName(ThemeStyles.get().style()
			.borderBottom());
	layerAttributeComboPanel.setSpacing(5);
	layerAttributeComboPanel.setVisible(false);
	layerAttributeComboPanel.add(new Label(UIMessages.INSTANCE
			.layerSchemaToolText()));
	layerAttributeComboPanel.add(layerAttributeCombo);

}
 
Example 17
Project: sig-seguimiento-vehiculos   File: MenuPanelWidget.java   Source Code and License Vote up 5 votes
private HorizontalPanel getSpatialToolGroup1Tools() {
	HorizontalPanel horizontalGroup = new HorizontalPanel();
	horizontalGroup.getElement().getStyle()
			.setVerticalAlign(VerticalAlign.MIDDLE);
	horizontalGroup.setSpacing(5);

	horizontalGroup.add(unionTool);
	horizontalGroup.add(divideTool);
	horizontalGroup.add(geometricValidationTool);

	return horizontalGroup;
}
 
Example 18
Project: sig-seguimiento-vehiculos   File: GeoprocessDialog.java   Source Code and License Vote up 5 votes
private void createComboLayer(final ComboBox<VectorLayerInfo> combo,
		final String numCombo, final TextButton validateButton) {
	clearLayerComboBox(combo);
	combo.setTypeAhead(true);
	combo.setTriggerAction(TriggerAction.ALL);
	combo.setForceSelection(true);
	combo.setEditable(false);
	combo.enableEvents();
	combo.setWidth(WIDTH_COMBO_LAYER);
	combo.setId(numCombo);

	combo.addSelectionHandler(new SelectionHandler<VectorLayerInfo>() {
		@Override
		public void onSelection(SelectionEvent<VectorLayerInfo> event) {
			combo.setValue(event.getSelectedItem(), true);
			List<VectorLayerInfo> updatedLayers = removeLayer(event
					.getSelectedItem());
			if (COMBO1_ID.equals(combo.getId())) {
				updateCombo(LAYER_COMBO_2, LAYER_STORE_2, updatedLayers);
			} else {
				updateCombo(LAYER_COMBO_1, LAYER_STORE_1, updatedLayers);
			}
		}
	});
	
	validateButton.setToolTip(UIMessages.INSTANCE
			.descriptionValidationToolText());

	final HorizontalPanel horizontalGroup = getHorizontalPanel();
	horizontalGroup.add(combo);
	horizontalGroup.add(validateButton);

	panel.add(new Label(UIMessages.INSTANCE.layerLabelText(numCombo)));
	panel.add(horizontalGroup);
}
 
Example 19
Project: sig-seguimiento-vehiculos   File: MenuPanelWidget.java   Source Code and License Vote up 5 votes
private HorizontalPanel getMeasureToolGroupTools() {
	HorizontalPanel horizontalGroup = new HorizontalPanel();
	horizontalGroup.getElement().getStyle()
			.setVerticalAlign(VerticalAlign.MIDDLE);
	horizontalGroup.setSpacing(5);

	horizontalGroup.add(measureAreaTool);
	horizontalGroup.add(measureTool);
	horizontalGroup.add(measureElementTool);

	return horizontalGroup;
}
 
Example 20
Project: unitimes   File: ClassificationsEdit.java   Source Code and License Vote up 5 votes
public MySumCell(List<MyCell> cells) {
	iCells = cells;
	for (MyCell cell: iCells)
		cell.iSums.add(this);
	
	iPanel = new HorizontalPanel();
	
	iTextBox = new HTML("", false);
	iTextBox.setWidth("60px");
	iTextBox.setStyleName("unitime-Label");
	iTextBox.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
	
	iRearLabel = new HTML("", false);
	iRearLabel.setWidth("55px");
	iRearLabel.setStyleName("unitime-Label");
	iRearLabel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
	
	iPanel.add(iTextBox);
	iPanel.setCellVerticalAlignment(iTextBox, HasVerticalAlignment.ALIGN_MIDDLE);
	
	iPanel.add(iRearLabel);
	iPanel.setCellVerticalAlignment(iRearLabel, HasVerticalAlignment.ALIGN_MIDDLE);

	initWidget(iPanel);	
	
	update();
}
 
Example 21
Project: sig-seguimiento-vehiculos   File: MenuPanelWidget.java   Source Code and License Vote up 5 votes
private HorizontalPanel getLayerGroupTools() {
	HorizontalPanel horizontalGroup = new HorizontalPanel();
	horizontalGroup.setSpacing(5);
	horizontalGroup.getElement().getStyle()
			.setVerticalAlign(VerticalAlign.MIDDLE);

	horizontalGroup.add(addLayerTool);
	horizontalGroup.add(layerInfoTool);
	horizontalGroup.add(changeStyleTool);

	return horizontalGroup;
}
 
Example 22
Project: sig-seguimiento-vehiculos   File: GeoprocessDialog.java   Source Code and License Vote up 5 votes
private void createGeoprocessAndDistanceField(final Geoprocesses spatialOperation) {
	spatialOperationComboBox = new GeoprocessComboBox(
			spatialOperation.getAll());
	spatialOperationComboBox.setWidth(WIDTH_SPATIAL_OPERATION_COMBO);
	clearSpatialOperationComboBox();				
	spatialOperationComboBox
			.addSelectionHandler(new SelectionHandler<Geoprocess>() {
				@Override
				public void onSelection(SelectionEvent<Geoprocess> event) {
					spatialOperationComboBox.setValue(
							event.getSelectedItem(), true);

					if (event.getSelectedItem() instanceof BufferGeoprocess) {
						LAYER_COMBO_2.setValue(null);
						LAYER_COMBO_2.setEnabled(false);
						distanceTextField.setText("0");
						distanceTextField.setEnabled(true);
						distanceTextField.setVisible(true);
					} else {							
						LAYER_COMBO_2.setEnabled(true);
						distanceTextField.setText("");
						distanceTextField.setEnabled(false);
						distanceTextField.setVisible(false);
					}
				}
			});

	initDistanceTextField();
	final HorizontalPanel horizontalGroup = getHorizontalPanel();
	horizontalGroup.add(spatialOperationComboBox);
	horizontalGroup.add(distanceTextField);
	panel.add(horizontalGroup);
}
 
Example 23
Project: sig-seguimiento-vehiculos   File: GeoDataImportDialog.java   Source Code and License Vote up 5 votes
private Widget createUrlToShareAnchor() {
	urlPanel = new HorizontalPanel();
	urlPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
	urlPanel.setSpacing(1);
	urlToShareAnchor = new AnchorBuilder().build();
	urlPanel.add(urlToShareAnchor);
	Image img = new Image(ImageProvider.INSTANCE.externalLink16());
	urlPanel.add(img);
	urlPanel.setVisible(false);
	return urlPanel;
}
 
Example 24
Project: sig-seguimiento-vehiculos   File: BasicToolBar.java   Source Code and License Vote up 5 votes
private void initializeToolbar() {
	toolBar = new HorizontalPanel();
	toolBar.setSpacing(3);

	toolBar.add(selectionTool);
	toolBar.add(infoFeatureTool);
	toolBar.add(wmsGetInfoTool);
	toolBar.add(panTool);
	toolBar.add(zoomToFullExtendTool);

	createButtonGroup();
}
 
Example 25
Project: sig-seguimiento-vehiculos   File: MenuPanelWidget.java   Source Code and License Vote up 5 votes
private HorizontalPanel getEditionToolGroup1Tools() {
	HorizontalPanel horizontalGroup = new HorizontalPanel();
	horizontalGroup.getElement().getStyle()
			.setVerticalAlign(VerticalAlign.MIDDLE);
	horizontalGroup.setSpacing(5);

	horizontalGroup.add(reshapeTool);
	horizontalGroup.add(resizeTool);
	horizontalGroup.add(rotateTool);

	return horizontalGroup;
}
 
Example 26
Project: sig-seguimiento-vehiculos   File: ExportDataDialog.java   Source Code and License Vote up 5 votes
private Widget createPanel() {
	String comboWidth = "150px";

	vectorFormatCombo = new VectorFormatComboBox(comboWidth,
			VectorFormat.getSupportedExportVectorFormat());
	vectorFormatCombo.addSelectionHandler(getVectorComboSelectionHandler());
	vectorFormatCombo.setValue(VectorFormat.GEO_JSON_FORMAT);
	epsgCombo = new ProjectionComboBox(comboWidth);
	
	
	downloadFileButton = new TextButton(
			UIMessages.INSTANCE.downloadfileText());
	downloadFileButton.setIcon(ImageProvider.INSTANCE.download32());
	downloadFileButton.setIconAlign(IconAlign.TOP);
	
	gitHubButton = new TextButton(
			"GitHub");
	gitHubButton.setIcon(ImageProvider.INSTANCE.github32());
	gitHubButton.setIconAlign(IconAlign.TOP);

	HorizontalPanel horizontalGroup = new HorizontalPanel();
	horizontalGroup.getElement().getStyle().setBackgroundColor("#E0ECF8");
	horizontalGroup.setSpacing(10);

	VerticalPanel vPanel = new VerticalPanel();
	vPanel.setSpacing(5);
	vPanel.add(vectorFormatCombo);
	vPanel.add(epsgCombo);

	horizontalGroup.add(vPanel);
					
	horizontalGroup.add(downloadFileButton);
	horizontalGroup.add(gitHubButton);
	
	return horizontalGroup;
}
 
Example 27
Project: sig-seguimiento-vehiculos   File: MenuPanelWidget.java   Source Code and License Vote up 5 votes
private HorizontalPanel getSpatialToolGroup2Tools() {
	HorizontalPanel horizontalGroup = new HorizontalPanel();
	horizontalGroup.getElement().getStyle()
			.setVerticalAlign(VerticalAlign.MIDDLE);
	horizontalGroup.setSpacing(5);

	horizontalGroup.add(bufferTool);
	horizontalGroup.add(envelopeTool);
	horizontalGroup.add(centroidTool);

	return horizontalGroup;
}
 
Example 28
Project: appinventor-extensions   File: ReportList.java   Source Code and License Vote up 5 votes
/**
 * Adds the header row to the table.
 *
 */
private void setHeaderRow() {
  table.getRowFormatter().setStyleName(0, "ode-ProjectHeaderRow");

  HorizontalPanel reportHeader = new HorizontalPanel();
  final Label reportHeaderLabel = new Label(MESSAGES.moderationReportTextHeader());
  reportHeaderLabel.addStyleName("ode-ProjectHeaderLabel");
  reportHeader.add(reportHeaderLabel);
  table.setWidget(0, 0, reportHeader);

  HorizontalPanel appHeader = new HorizontalPanel();
  final Label appHeaderLabel = new Label(MESSAGES.moderationAppHeader());
  appHeaderLabel.addStyleName("ode-ProjectHeaderLabel");
  appHeader.add(appHeaderLabel);
  table.setWidget(0, 1, appHeader);

  HorizontalPanel dateCreatedHeader = new HorizontalPanel();
  final Label dateCreatedHeaderLabel = new Label(MESSAGES.moderationReportDateCreatedHeader());
  dateCreatedHeaderLabel.addStyleName("ode-ProjectHeaderLabel");
  dateCreatedHeader.add(dateCreatedHeaderLabel);
  table.setWidget(0, 2, dateCreatedHeader);

  HorizontalPanel appAuthorHeader = new HorizontalPanel();
  final Label appAuthorHeaderLabel = new Label(MESSAGES.moderationAppAuthorHeader());
  appAuthorHeaderLabel.addStyleName("ode-ProjectHeaderLabel");
  appAuthorHeader.add(appAuthorHeaderLabel);
  table.setWidget(0, 3, appAuthorHeader);

  HorizontalPanel reporterHeader = new HorizontalPanel();
  final Label reporterHeaderLabel = new Label(MESSAGES.moderationReporterHeader());
  reporterHeaderLabel.addStyleName("ode-ProjectHeaderLabel");
  reporterHeader.add(reporterHeaderLabel);
  table.setWidget(0, 4, reporterHeader);

}
 
Example 29
Project: sig-seguimiento-vehiculos   File: MenuPanelWidget.java   Source Code and License Vote up 5 votes
private HorizontalPanel getEditionToolGroup2Tools() {
	HorizontalPanel horizontalGroup = new HorizontalPanel();
	horizontalGroup.getElement().getStyle()
			.setVerticalAlign(VerticalAlign.MIDDLE);
	horizontalGroup.setSpacing(5);

	horizontalGroup.add(dragTool);
	horizontalGroup.add(deleteTool);
	horizontalGroup.add(copyElementTool);

	return horizontalGroup;
}
 
Example 30
Project: sig-seguimiento-vehiculos   File: JoinDataDialog.java   Source Code and License Vote up 5 votes
private void getCSVComboPanel() {
	comboPanel = new HorizontalPanel();
	comboPanel.setWidth("100%");
	comboPanel.addStyleName(ThemeStyles.get().style().borderTop());
	comboPanel.setSpacing(5);
	comboPanel.setVisible(false);
	comboPanel.add(new Label(UIMessages.INSTANCE.bindableAttribute()));
	comboPanel.add(csvAttributeCombo);
}
 
Example 31
Project: WebConsole   File: SlidingToolbar.java   Source Code and License Vote up 5 votes
private SlidingToolbar(PanelSizeInfo sizeInfo) {
	HorizontalPanel container = new HorizontalPanel();
	this.initWidget(container);
	setWidth("340px");
	setStylePrimaryName("toolbar");
	setHeight("100%");
	container.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
	DOM.setStyleAttribute(getElement(), "marginLeft", "-320px");
	mainPanel = new VerticalPanel();
	mainPanel.setStylePrimaryName("mainToolbarPanel");
	tab = new Label(">");
	tab.setStylePrimaryName("tabToolbarPanel");
	container.add(mainPanel);
	container.add(tab);
	
	// Configure Main Panel
	mainPanel.setHeight("80%");
	mainPanel.setWidth("320px");
	mainPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
	Element mainElem = mainPanel.getElement();
	DOM.setStyleAttribute(mainElem, "paddingLeft", "70px");
	DOM.setStyleAttribute(mainElem, "paddingTop", "20px");
	DOM.setStyleAttribute(mainElem, "paddingRight", "20px");
	DOM.setStyleAttribute(mainElem, "paddingBottom", "20px");
	
	// Configure Tab
	tab.setWidth("20px");
	tab.setHeight("50px");
	tab.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
	Element tabElem = tab.getElement();
	DOM.setStyleAttribute(tabElem, "lineHeight", "50px");
	
	// Add to Window
	RootPanel.get().add(this, 0, 0);
	
	addAnimation();
	
	createToolbarContent(sizeInfo);
}
 
Example 32
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 33
Project: LAS   File: OperationsMenu.java   Source Code and License Vote up 5 votes
public OperationsMenu() {
	buttonBar = new HorizontalPanel();
	buttonBar.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
       turnOffButtons();
       animationButton.addStyleDependentName("SMALLER");
       animationButton.setTitle("Interactive interface for making a sequence of plots over time.");
       compareButton.addStyleDependentName("SMALLER");
       correlationButton.addStyleDependentName("SMALLER");
       correlationButton.setTitle("Beta interface to make a scatter plot of a property vs. another property.");
       googleEarthButton.addStyleDependentName("SMALLER");
       googleEarthButton.setTitle("View a plot of data draped over the globe using Google Earth.");
       showValuesButton.addStyleDependentName("SMALLER");
       showValuesButton.setTitle("Look at the data values in a new window.");
       exportToDesktopButton.addStyleDependentName("SMALLER");
       exportToDesktopButton.setTitle("Get a few lines of native script for various analysis packages.");
       saveAsButton.addStyleDependentName("SMALLER");
       saveAsButton.ensureDebugId("saveAsButton");
       saveAsButton.setTitle("Save data in various text and binary formats.");
       climateAnalysis.addStyleDependentName("SMALLER");
       climateAnalysis.setTitle("Perform time average spectrum and other advanced analysis.");
       dsgTable.addStyleDependentName("SMALLER");
       dsgTable.setTitle("See a table of current observations by ID.");
       thumbnailTable.addStyleDependentName("SMALLER");
       thumbnailTable.setTitle("See a table of select property-property plots.");
	buttonBar.add(animationButton);
	buttonBar.add(correlationButton);
	buttonBar.add(googleEarthButton);
	buttonBar.add(showValuesButton);
	buttonBar.add(exportToDesktopButton);
	buttonBar.add(saveAsButton);
	buttonBar.add(climateAnalysis);
	buttonBar.add(dsgTable);
	buttonBar.add(thumbnailTable);
	climateAnalysis.setVisible(false);
	dsgTable.setVisible(false);
	thumbnailTable.setVisible(false);
	initWidget(buttonBar);
	buttonBar.setSize("100%", "100%");
}
 
Example 34
Project: LAS   File: MultiVariableSelectorImpl.java   Source Code and License Vote up 5 votes
/**
 * @wbp.parser.constructor
 */
public MultiVariableSelectorImpl(String id) {
    setName(id);
    clientFactory = GWT.create(ClientFactory.class);

    variableSelectors = new HorizontalPanel();

    // HorizontalPanel variable_container = new HorizontalPanel();
    VariableSelectorActivity variableSelectorPresenter = new VariableSelectorActivity(clientFactory, id);
    firstVariableSelector = variableSelectorPresenter.init(id);

    variableSelectors.add(firstVariableSelector);

    initWidget(variableSelectors);
}
 
Example 35
Project: LAS   File: ESGFSearchPanel.java   Source Code and License Vote up 5 votes
@Override
public void onSuccess(String id) {
    
    spin.hide();
    eventBus.fireEvent(new ESGFDatasetAddedEvent());
    for ( int i = 0; i < datasetPanel.getWidgetCount(); i++) {
        HorizontalPanel entry = (HorizontalPanel) datasetPanel.getWidget(i);
        if ( entry.getWidgetCount() == 1 && entry.getElement().getId().equals(id)) {
            String added = "&nbsp;&nbsp(Data set ready.)";
            HTML addedlabel = new HTML(added);
            entry.add(addedlabel);
        }
    }
}
 
Example 36
Project: LAS   File: SettingsWidget.java   Source Code and License Vote up 5 votes
public SettingsWidget(String title, String panelID, String operationID, String optionID) {
	this.operationID = operationID;
	this.optionID = optionID;
	
	closeButton = new PushButton("Close");
	closeButton.addStyleDependentName("SMALLER");
	closeButton.setTitle("Close settings panel for "+panelID);
	closeButton.addClickListener(closeClick);
	buttonBar = new HorizontalPanel();
	buttonBar.add(closeButton);
	
	datasetButton = new DatasetButton();		
	optionsButton = new OptionsButton(optionID, 300);
	datasetButton.setOffset(0);

	operations = new OperationsWidget(title);
	operations.addClickHandler(operationsClickHandler);

	settingsButton = new PushButton (title);
	settingsButton.addStyleDependentName("SMALLER");
	settingsButton.addClickListener(settingsButtonClick);
	settingsPopup = new PopupPanel(false);

	buttonBar.add(datasetButton);
	buttonBar.add(optionsButton);

	settingsLayout = new FlexTable();
	settingsLayout.setWidget(0, 0, buttonBar);
	settingsLayout.setWidget(1, 0, operations);


	settingsPopup.add(settingsLayout);
	settingsButton.setWidth("65px");
	initWidget(settingsButton);	

}
 
Example 37
Project: document-management-system   File: ToolBarBoxExample.java   Source Code and License Vote up 5 votes
/**
 * ToolBarBoxExample
 */
public ToolBarBoxExample() {
	toolBarBoxExtension = new ToolBarBoxExtension(new Image(OKMExtensionBundleExampleResources.INSTANCE.general()),
			"new toolbar") {
		@Override
		public Widget getWidget() {
			return hPanel;
		}
	};

	hPanel = new HorizontalPanel();
	hPanel.add(new HTML("new toolbarbox example"));
}
 
Example 38
Project: document-management-system   File: GeneralDashboard.java   Source Code and License Vote up 5 votes
/**
 * GeneralDashboard
 */
public GeneralDashboard() {
	vPanelLeft = new VerticalPanel();
	vPanelRight = new VerticalPanel();
	hPanel = new HorizontalPanel();

	lastWeekTopDownloadedDocuments = new DashboardWidget("LastWeekTopDownloadedDocuments",
			"dashboard.general.last.week.top.downloaded.documents", "img/icon/actions/download.gif",
			true, "lastWeekTopDownloadedDocuments");
	lastMonthTopDownloadedDocuments = new DashboardWidget("LastMonthTopDownloadedDocuments",
			"dashboard.general.last.month.top.downloaded.documents", "img/icon/actions/download.gif",
			false, "lastMonthTopDownloadedDocuments");
	lastWeekTopModifiedDocuments = new DashboardWidget("LastWeekTopModifiedDocuments",
			"dashboard.general.last.week.top.modified.documents", "img/icon/actions/checkin.gif",
			false, "lastWeekTopModifiedDocuments");
	lastMonthTopModifiedDocuments = new DashboardWidget("LastMonthTopModifiedDocuments",
			"dashboard.general.last.month.top.modified.documents", "img/icon/actions/checkin.gif",
			false, "lastMonthTopModifiedDocuments");
	lastModifiedDocuments = new DashboardWidget("LastModifiedDocuments",
			"dashboard.user.last.modified.documents", "img/icon/actions/checkin.gif",
			true, "lastModifiedDocuments");
	lastUploadedDocuments = new DashboardWidget("LastUploadedDocuments",
			"dashboard.general.last.uploaded.documents", "img/icon/actions/add_document.gif",
			false, "lastUploadedDocuments");

	vPanelLeft.add(lastWeekTopDownloadedDocuments);
	vPanelLeft.add(lastMonthTopDownloadedDocuments);
	vPanelLeft.add(lastWeekTopModifiedDocuments);
	vPanelLeft.add(lastMonthTopModifiedDocuments);
	vPanelLeft.add(lastUploadedDocuments);
	vPanelRight.add(lastModifiedDocuments);

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

	initWidget(hPanel);
}
 
Example 39
Project: document-management-system   File: UserDashboard.java   Source Code and License Vote up 5 votes
/**
 * UserDashboard
 */
public UserDashboard() {
	vPanelLeft = new VerticalPanel();
	vPanelRight = new VerticalPanel();
	hPanel = new HorizontalPanel();

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

	lockedDocuments = new DashboardWidget("UserLockedDocuments", "dashboard.user.locked.documents",
			"img/icon/lock.gif", true, "userLockedDocuments");
	chechoutDocuments = new DashboardWidget("UserCheckedOutDocuments", "dashboard.user.checkout.documents",
			"img/icon/actions/checkout.gif", true, "userCheckedOutDocuments");
	lastModifiedDocuments = new DashboardWidget("UserLastModifiedDocuments",
			"dashboard.user.last.modified.documents", "img/icon/actions/checkin.gif", true,
			"userLastModifiedDocuments");
	lastDownloadedDocuments = new DashboardWidget("UserLastDownloadedDocuments",
			"dashboard.user.last.downloaded.documents", "img/icon/actions/download.gif", false,
			"userLastDownloadedDocuments");
	subscribedDocuments = new DashboardWidget("UserSubscribedDocuments", "dashboard.user.subscribed.documents",
			"img/icon/subscribed.gif", false, "userSubscribedDocuments");
	subscribedFolder = new DashboardWidget("UserSubscribedFolders", "dashboard.user.subscribed.folders",
			"img/icon/subscribed.gif", false, "userSubscribedFolders");
	lastUploadedDocuments = new DashboardWidget("UserLastUploadedDocuments",
			"dashboard.user.last.uploaded.documents", "img/icon/actions/add_document.gif", true,
			"userLastUploadedDocuments");

	vPanelLeft.add(lockedDocuments);
	vPanelLeft.add(chechoutDocuments);
	vPanelLeft.add(lastDownloadedDocuments);
	vPanelRight.add(lastModifiedDocuments);
	vPanelRight.add(lastUploadedDocuments);
	vPanelLeft.add(subscribedDocuments);
	vPanelLeft.add(subscribedFolder);

	initWidget(hPanel);
}
 
Example 40
Project: document-management-system   File: NewsDashboard.java   Source Code and License Vote up 5 votes
/**
 * NewsDashboard
 */
public NewsDashboard() {
	vPanelLeft = new VerticalPanel();
	vPanelRight = new VerticalPanel();
	hPanel = new HorizontalPanel();

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

	initWidget(hPanel);
}
 
Example 41
Project: gwt-cs   File: Picking.java   Source Code and License Vote up 5 votes
@Override
public void buildPanel() {
    viewerPanel = new ViewerPanel();
    showCartographicPositionOnMouseOver();

    _showPosOnMouseOverTBtn = new ToggleButton("Show Cartographic Position on Mouse Over");
    _showPosOnMouseOverTBtn.setValue(true);
    _showPosOnMouseOverTBtn.addValueChangeHandler(new MValueChangeHandler());

    _pickEntityTBtn = new ToggleButton("Pick Entity");
    _pickEntityTBtn.addValueChangeHandler(new MValueChangeHandler());

    _drillDownPickingTBtn = new ToggleButton("Drill-Down Picking");
    _drillDownPickingTBtn.addValueChangeHandler(new MValueChangeHandler());

    _pickPositionTBtn = new ToggleButton("Pick position");
    _pickPositionTBtn.addValueChangeHandler(new MValueChangeHandler());

    HorizontalPanel hPanel = new HorizontalPanel();
    hPanel.add(_showPosOnMouseOverTBtn);
    hPanel.add(_pickEntityTBtn);
    hPanel.add(_drillDownPickingTBtn);
    hPanel.add(_pickPositionTBtn);

    AbsolutePanel aPanel = new AbsolutePanel();
    aPanel.add(viewerPanel);
    aPanel.add(hPanel, 20, 20);

    contentPanel.add(new HTML("<p>Use the mouse to select and manipulate objects in the scene.</p>"));
    contentPanel.add(aPanel);

    initWidget(contentPanel);
}
 
Example 42
Project: x-cure-chat   File: InfoPopupPanel.java   Source Code and License Vote up 5 votes
/**
 * Adds the label and returns the pointer to it
 */
protected Label addLabel(HorizontalPanel horizontalPanel, final String name, final String style){
	Label lab  = new Label( name );
	lab.setWordWrap(false);
	lab.setStyleName( style );
	horizontalPanel.add( lab );
	return lab;
}
 
Example 43
Project: x-cure-chat   File: UserAvatarWidget.java   Source Code and License Vote up 5 votes
/**
 * Allows to display the statistics entry based on the statistical data text and the image
 * @param avatarVerticalPanel the vertical panel to add the statistical widget to
 * @param widget the widget that described the value 
 * @param image_name the name of the image describing the statistics 
 */
private void displayStatisticsElement( final VerticalPanel avatarVerticalPanel,
									   final Widget widget, final String image_name) {
	final HorizontalPanel panel = new HorizontalPanel();
	panel.setVerticalAlignment( HasVerticalAlignment.ALIGN_BOTTOM );
	panel.add( new Image( ServerSideAccessManager.USER_INFO_RELATED_IMAGES_LOCATION +
						  ServerSideAccessManager.SERVER_CONTEXT_DELIMITER + image_name + ".png" ) );
	panel.add( new HTML("&nbsp;") );
	panel.add( widget );
	avatarVerticalPanel.add( panel );
}
 
Example 44
Project: geowe-core   File: MenuPanelWidget.java   Source Code and License Vote up 5 votes
private HorizontalPanel getSpatialToolGroup2Tools() {
	HorizontalPanel horizontalGroup = new HorizontalPanel();
	horizontalGroup.getElement().getStyle()
			.setVerticalAlign(VerticalAlign.MIDDLE);
	horizontalGroup.setSpacing(5);

	horizontalGroup.add(bufferTool);
	horizontalGroup.add(envelopeTool);
	horizontalGroup.add(centroidTool);

	return horizontalGroup;
}
 
Example 45
Project: gerrit   File: ProjectBranchesScreen.java   Source Code and License Vote up 5 votes
private void initPageHeader() {
  parseToken();
  HorizontalPanel hp = new HorizontalPanel();
  hp.setStyleName(Gerrit.RESOURCES.css().projectFilterPanel());
  Label filterLabel = new Label(AdminConstants.I.projectFilter());
  filterLabel.setStyleName(Gerrit.RESOURCES.css().projectFilterLabel());
  hp.add(filterLabel);
  filterTxt = new NpTextBox();
  filterTxt.setValue(match);
  filterTxt.addKeyUpHandler(
      new KeyUpHandler() {
        @Override
        public void onKeyUp(KeyUpEvent event) {
          Query q = new Query(filterTxt.getValue());
          if (match.equals(q.qMatch)) {
            q.start(start);
          } else {
            if (query == null) {
              q.run();
            }
            query = q;
          }
        }
      });
  hp.add(filterTxt);
  add(hp);
}
 
Example 46
Project: firefly   File: ImageSelectDialogTypes.java   Source Code and License Vote up 5 votes
public void addTab(TabPane<Panel> tabs) {
    HorizontalPanel hp = new HorizontalPanel();
    hp.add(_size);
    hp.setSpacing(10);
    tabs.addTab(hp, _prop.getTitle("blank"));
    GwtUtil.setStyle(_size, "paddingLeft", "10px");
}
 
Example 47
Project: gwtlib   File: PagingBar.java   Source Code and License Vote up 5 votes
protected Widget create() {
  HorizontalPanel panel = new HorizontalPanel();
  panel.setSpacing(0);
  panel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
  if(_positionWidget != null) panel.add(_positionWidget);
  if(_loadingWidget != null) panel.add(_loadingWidget);
  if(_browserWidget != null) panel.add(_browserWidget);
  panel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
  if(_gotoWidget != null) panel.add(_gotoWidget);
  if(_pageSizesWidget != null) panel.add(_pageSizesWidget);
  return panel;
}
 
Example 48
Project: geowe-core   File: FeatureInfoToolBar.java   Source Code and License Vote up 5 votes
public void initialize(GridEditing<FeatureAttributeBean> gridEditing,
		ListStore<FeatureAttributeBean> featureAttributes) {
	this.gridEditing = gridEditing;
	this.featureAttributes = featureAttributes;
	setHeaderVisible(false);
	addStyleName(ThemeStyles.get().style().borderBottom());
	HorizontalPanel horizontalGroup = new HorizontalPanel();
	horizontalGroup.setSpacing(5);
	horizontalGroup.add(getEditButton());
	horizontalGroup.add(getClearButton());
	horizontalGroup.add(getWKTButton());
	horizontalGroup.add(getExportCSVButton());
	setWidget(horizontalGroup);
}
 
Example 49
Project: x-cure-chat   File: SiteTitle.java   Source Code and License Vote up 5 votes
public SiteTitle() {
	//Add the widgets to the main panel
	HorizontalPanel titlePanel = new HorizontalPanel();
	titlePanel.setVerticalAlignment( HasVerticalAlignment.ALIGN_MIDDLE );
	titlePanel.setHorizontalAlignment( HasHorizontalAlignment.ALIGN_LEFT );
	titlePanel.add( SiteDynamicDecorations.getBackgroundTimeImage() );
	//titlePanel.add( new HTML("&nbsp;") ); //Add some spacing
	//titlePanel.add( SiteDynamicDecorations.getSiteTitleLabel() );
	
	//Initialize the composite
	initWidget( titlePanel );
}
 
Example 50
Project: geowe-core   File: BasicToolBar.java   Source Code and License Vote up 5 votes
private void initializeToolbar() {
	toolBar = new HorizontalPanel();
	toolBar.setSpacing(3);

	toolBar.add(selectionTool);
	toolBar.add(infoFeatureTool);
	toolBar.add(wmsGetInfoTool);
	toolBar.add(panTool);
	toolBar.add(zoomToFullExtendTool);

	createButtonGroup();
}
 
Example 51
Project: appinventor-extensions   File: ShowBarcodeCommand.java   Source Code and License Vote up 4 votes
BarcodeDialogBox(String projectName, String appInstallUrl) {
      super(false, true);
      setStylePrimaryName("ode-DialogBox");
      setText(MESSAGES.barcodeTitle(projectName));

      ClickHandler buttonHandler = new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
          hide();
        }
      };

      Button cancelButton = new Button(MESSAGES.cancelButton());
      cancelButton.addClickHandler(buttonHandler);
      Button okButton = new Button(MESSAGES.okButton());
      okButton.addClickHandler(buttonHandler);
      HTML barcodeQrcode = new HTML("<center>" + BlocklyPanel.getQRCode(appInstallUrl) + "</center>");
      HorizontalPanel buttonPanel = new HorizontalPanel();
      buttonPanel.setHorizontalAlignment(HorizontalPanel.ALIGN_CENTER);
      HTML warningLabel = new HTML(MESSAGES.barcodeWarning(
          "<a href=\"" + "http://appinventor.mit.edu/explore/ai2/share.html" +
          "\" target=\"_blank\">",
          "</a>"));
      warningLabel.setWordWrap(true);
      warningLabel.setWidth("200px");  // set width to get the text to wrap
      HorizontalPanel warningPanel = new HorizontalPanel();
      warningPanel.setHorizontalAlignment(HorizontalPanel.ALIGN_LEFT);
      warningPanel.add(warningLabel);

      // The cancel button is removed from the panel since it has no meaning in this
      // context.  But the logic is still here in case we want to restore it, and as
      // an example of how to code this stuff in GWT.
      // buttonPanel.add(cancelButton);
      buttonPanel.add(okButton);
      buttonPanel.setSize("100%", "24px");
      VerticalPanel contentPanel = new VerticalPanel();
      contentPanel.add(barcodeQrcode);
      contentPanel.add(buttonPanel);
      contentPanel.add(warningPanel);
//      contentPanel.setSize("320px", "100%");
      add(contentPanel);
    }
 
Example 52
Project: sig-seguimiento-vehiculos   File: ColorStyleTab.java   Source Code and License Vote up 4 votes
@Override
protected void initializePanel() {
	String fieldWidth = "125px";

	fillColor = new TextField();
	fillColor.setWidth(fieldWidth);
	addFocusHandler(fillColor);
	
	fillOpacity = new Slider();
	fillOpacity.setWidth(fieldWidth);
	fillOpacity.setValue(0);
	fillOpacity.setIncrement(1);
	
	lineColor = new TextField();
	lineColor.setWidth(fieldWidth);
	addFocusHandler(lineColor);
	
	lineThick = new Slider();
	lineThick.setWidth(fieldWidth);
	lineThick.setValue(0);
	lineThick.setMaxValue(20);
	lineThick.setIncrement(1);

	colorPicker = new ColorPicker();
	colorPicker.addSelectedColorChangedListener(this);

	HorizontalPanel mainPanel = new HorizontalPanel();
	mainPanel.setSpacing(10);

	VerticalLayoutContainer vlc = new VerticalLayoutContainer();
	vlc.add(new FieldLabel(fillColor, UIMessages.INSTANCE.vlswFillcolor()),
			new VerticalLayoutData(-18, -1));
	vlc.add(new FieldLabel(fillOpacity, UIMessages.INSTANCE
			.vlswFillopacity()), new VerticalLayoutData(-18, -1));
	vlc.add(new FieldLabel(lineColor, UIMessages.INSTANCE.vlswStrokeColor()),
			new VerticalLayoutData(-18, -1));
	vlc.add(new FieldLabel(lineThick, UIMessages.INSTANCE.vlswStrokeWidth()),
			new VerticalLayoutData(-18, -1));

	mainPanel.add(vlc);
	mainPanel.add(colorPicker);
	
	panel.add(mainPanel);
}
 
Example 53
Project: essence   File: AnalyzerAndReportUI.java   Source Code and License Vote up 4 votes
private void setupDetectorPanel(HorizontalPanel detectorPanel, final Label errorLabelActivateDetector, 
			final ListDataProvider<AnalyzerResultDTO> dataProvider) {
		// DoS detector panel
		Label detectorTypeLabel = new Label("Filter Type");

		final ListBox detectorType = new ListBox();
		detectorType.setName("Detector Type");
		detectorType.setTitle("Detector Type Title");
		detectorType.addItem("VALUE_OUT_OF_BOUND", "VALUE_OUT_OF_BOUND");
		detectorType.addItem("MS_EP_CONNECTIVITY", "MS_EP_CONNECTIVITY");
		detectorType.addItem("WRONG_MSG_TO_MS_EP", "WRONG_MSG_TO_MS_EP");
		//detectorType.addItem("ERR_MSG_FROM_MS_EP", "ERR_MSG_FROM_MS_EP");
		//detectorType.addItem("WRONG_MSG_FORMAT", "WRONG_MSG_FORMAT");
		detectorType.addItem("DENIAL_OF_SERVICE", "DENIAL_OF_SERVICE");
		//detectorType.addItem("NW_SEGMENTATION", "NW_SEGMENTATION");
		//detectorType.addItem("NEW_HOST", "NEW_HOST");
		detectorType.setWidth("220");
	    detectorPanel.add(HTMLFormatUtil.getPaddingLabel());
		detectorPanel.add(detectorTypeLabel);
		detectorPanel.add(detectorType);

		// Result display button
	    Button displayDetectorResultButton = new Button("Show Detector Findings");
//	    displayDetectorResultButton.addClickHandler(new ClickHandler() {
//	    	public void onClick(ClickEvent event) {
//	    		greetingService.getAnalyzerResultsByType(
//	    				DetectionRuleTypeDTO.valueOf(detectorType.getValue(detectorType.getSelectedIndex())),
//	    				new AsyncCallbackAdapter<List<AnalyzerResultDTO>>() {
//	    					// Called by onFailure if the session is still valid
//	    					public void doFailureAction() {
//	    						errorLabelActivateDetector.setText(SERVER_ERROR);
//	    					}
//
//	    					public void onSuccess(List<AnalyzerResultDTO> result) {
//	    						dataProvider.setList(result);
//	    					}
//	    				});
//	        }
//	    });
	    detectorPanel.add(HTMLFormatUtil.getPaddingLabel());
	    detectorPanel.add(displayDetectorResultButton);

		// Result display button
	    Button displayAllResultButton = new Button("Show All Findings");
//	    displayAllResultButton.addClickHandler(new ClickHandler() {
//	    	public void onClick(ClickEvent event) {
//	    		greetingService.getAnalyzerResults(new AsyncCallbackAdapter<List<AnalyzerResultDTO>>() {
//					// Called by onFailure if the session is still valid
//					public void doFailureAction() {
//						errorLabelActivateDetector.setText(SERVER_ERROR);
//					}
//
//	    			public void onSuccess(List<AnalyzerResultDTO> result) {
//	    				dataProvider.setList(result);
//	    			}
//	    		});
//	        }
//	    });
	    detectorPanel.add(HTMLFormatUtil.getPaddingLabel());
	    detectorPanel.add(displayAllResultButton);
	}
 
Example 54
Project: LAS   File: OutputControlPanelImpl.java   Source Code and License Vote up 4 votes
/**
 * @wbp.parser.constructor
 */
public OutputControlPanelImpl(String outputPanelID) {
    ClientFactory clientFactory = GWT.create(ClientFactory.class);

    setName(outputPanelID);

    FlowPanel mainPanel = new FlowPanel();

    HorizontalPanel horizontalPanel_0 = new HorizontalPanel();
    horizontalPanel_0.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    horizontalPanel_0.setVerticalAlignment(HasVerticalAlignment.ALIGN_TOP);
    horizontalPanel_0.setSpacing(5);
    mainPanel.add(horizontalPanel_0);

    datasetButton = new DatasetButton();
    datasetButton.setName(outputPanelID);
    horizontalPanel_0.add(datasetButton);

    displayButton = new PushButton("Enlarge Image");
    displayButton.setTitle("Show the plot's image at full size in a new window.");
    displayButton.addStyleDependentName("SMALLER");
    displayButton.addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            listener.onDisplayButtonClick(getImageURL());
        }
    });
    displayButton.setEnabled(false);
    horizontalPanel_0.add(displayButton);

    flexTable = new FlexTable();
    VariableControlsActivity variableControlsPresenter = new VariableControlsActivity(clientFactory, outputPanelID);
    variableControls = variableControlsPresenter.init(outputPanelID);
    // horizontalPanel_0.add(variableControls);
    flexTable.setWidget(0, 0, variableControls);

    mainPanel.add(flexTable);

    mainPanel.setVisible(true);
    // mainPanel.setOpen(true);

    initWidget(mainPanel);
    // initWidget(binder.createAndBindUi(this));
}
 
Example 55
Project: gerrit   File: ProjectListScreen.java   Source Code and License Vote up 4 votes
@Override
protected void onInitUI() {
  super.onInitUI();
  setPageTitle(AdminConstants.I.projectListTitle());
  initPageHeader();

  prev = PagingHyperlink.createPrev();
  prev.setVisible(false);

  next = PagingHyperlink.createNext();
  next.setVisible(false);

  projects =
      new ProjectsTable() {
        @Override
        protected void initColumnHeaders() {
          super.initColumnHeaders();
          table.setText(0, ProjectsTable.C_REPO_BROWSER, AdminConstants.I.projectRepoBrowser());
          table
              .getFlexCellFormatter()
              .addStyleName(0, ProjectsTable.C_REPO_BROWSER, Gerrit.RESOURCES.css().dataHeader());
        }

        @Override
        protected void onOpenRow(int row) {
          History.newItem(link(getRowItem(row)));
        }

        private String link(ProjectInfo item) {
          return Dispatcher.toProject(item.name_key());
        }

        @Override
        protected void insert(int row, ProjectInfo k) {
          super.insert(row, k);
          table
              .getFlexCellFormatter()
              .addStyleName(row, ProjectsTable.C_REPO_BROWSER, Gerrit.RESOURCES.css().dataCell());
        }

        @Override
        protected void populate(int row, ProjectInfo k) {
          populateState(row, k);
          FlowPanel fp = new FlowPanel();
          fp.add(new ProjectSearchLink(k.name_key()));
          fp.add(new HighlightingInlineHyperlink(k.name(), link(k), match));
          table.setWidget(row, ProjectsTable.C_NAME, fp);
          table.setText(row, ProjectsTable.C_DESCRIPTION, k.description());
          addWebLinks(row, k);

          setRowItem(row, k);
        }

        private void addWebLinks(int row, ProjectInfo k) {
          List<WebLinkInfo> webLinks = Natives.asList(k.webLinks());
          if (webLinks != null && !webLinks.isEmpty()) {
            FlowPanel p = new FlowPanel();
            table.setWidget(row, ProjectsTable.C_REPO_BROWSER, p);
            for (WebLinkInfo weblink : webLinks) {
              p.add(weblink.toAnchor());
            }
          }
        }
      };
  projects.setSavePointerId(PageLinks.ADMIN_PROJECTS);

  add(projects);
  final HorizontalPanel buttons = new HorizontalPanel();
  buttons.setStyleName(Gerrit.RESOURCES.css().changeTablePrevNextLinks());
  buttons.add(prev);
  buttons.add(next);
  add(buttons);
}
 
Example 56
Project: ontobrowser   File: AddRelationshipPopup.java   Source Code and License Vote up 4 votes
private void addDialogWidgets() {
	VerticalPanel vertPanel = new VerticalPanel();
	Grid grid = new Grid(4,2);
	HorizontalPanel buttonsHPanel = new HorizontalPanel();
	DisclosurePanel recentlyViewedPanel = new DisclosurePanel("Recently Viewed Terms");
	DisclosurePanel recentlyCreatedPanel = new DisclosurePanel("Recently Created Terms");
	Button cancelButton = new Button("Cancel");
	
	recentlyViewedPanel.getHeader().addStyleName("dialog-label");
	recentlyViewedPanel.add(recentlyViewTable);
	
	recentlyCreatedPanel.getHeader().addStyleName("dialog-label");
	recentlyCreatedPanel.add(recentlyCreatedTable);
			
	cancelButton.addClickHandler(new ClickHandler() {
		public void onClick(ClickEvent event) {
			dialogBox.hide();
			if(currentTerm != null) {
				eventBus.fireEvent(new ViewTermEvent(currentTerm));
			}
		}
	});
	
	grid.addStyleName("gwt-Grid");
	errorLabel.addStyleName("dialog-error");
	buttonsHPanel.addStyleName("dialog-buttons");
	buttonsHPanel.addStyleName("centered-hortz");
	vertPanel.addStyleName("dialog-vpanel");		
	//vertPanel.setHorizontalAlignment(VerticalPanel.ALIGN_CENTER);
			
	int row = 0, col = 0;
	grid.setWidget(row, col, new Label("Ontology:"));
	grid.setWidget(++row, col, new Label("Term:"));
	grid.setWidget(++row, col, new Label("Relationship:"));
	grid.setWidget(++row, col, new Label("Related Term:"));
	row = 0;
	col = 1;
	grid.setWidget(row, col, ontologyLabel);
	grid.setWidget(++row, col, termLabel);
	grid.setWidget(++row, col, typeDropBox);
	grid.setWidget(++row, col, relatedTermLabel);
	
	for(row = col = 0; row < grid.getRowCount(); row++) {
		Label label = (Label)grid.getWidget(row, col);
		label.addStyleName("dialog-label");
	}
			
	buttonsHPanel.add(addButton);
	buttonsHPanel.add(cancelButton);
	
	vertPanel.add(grid);
	vertPanel.add(recentlyViewedPanel);
	vertPanel.add(recentlyCreatedPanel);
	vertPanel.add(errorLabel);
	vertPanel.add(buttonsHPanel);
	dialogBox.setWidget(vertPanel);
}
 
Example 57
Project: gerrit   File: MyWatchedProjectsScreen.java   Source Code and License Vote up 4 votes
@Override
protected void onInitUI() {
  super.onInitUI();
  createWidgets();

  /* top table */
  grid = new Grid(2, 2);
  grid.setStyleName(Gerrit.RESOURCES.css().infoBlock());
  grid.setText(0, 0, Util.C.watchedProjectName());
  final HorizontalPanel hp = new HorizontalPanel();
  hp.add(nameBox);
  hp.add(browse);
  grid.setWidget(0, 1, hp);

  grid.setText(1, 0, Util.C.watchedProjectFilter());
  grid.setWidget(1, 1, filterTxt);

  final CellFormatter fmt = grid.getCellFormatter();
  fmt.addStyleName(0, 0, Gerrit.RESOURCES.css().topmost());
  fmt.addStyleName(0, 1, Gerrit.RESOURCES.css().topmost());
  fmt.addStyleName(0, 0, Gerrit.RESOURCES.css().header());
  fmt.addStyleName(1, 0, Gerrit.RESOURCES.css().header());
  fmt.addStyleName(1, 0, Gerrit.RESOURCES.css().bottomheader());

  final FlowPanel fp = new FlowPanel();
  fp.setStyleName(Gerrit.RESOURCES.css().addWatchPanel());
  fp.add(grid);
  fp.add(addNew);
  add(fp);

  /* bottom table */
  add(watchesTab);
  add(delSel);

  /* popup */
  projectsPopup =
      new ProjectListPopup() {
        @Override
        protected void onMovePointerTo(String projectName) {
          // prevent user input from being overwritten by simply poping up
          if (!projectsPopup.isPoppingUp() || "".equals(nameBox.getText())) {
            nameBox.setText(projectName);
          }
        }

        @Override
        protected void openRow(String projectName) {
          nameBox.setText(projectName);
          doAddNew();
        }
      };
  projectsPopup.initPopup(Util.C.projects(), PageLinks.SETTINGS_PROJECTS);
}
 
Example 58
Project: appformer   File: HorizImageListEditorView.java   Source Code and License Vote up 4 votes
@Override
public ImageListEditorView<T> add(final SafeUri uri, final String width, final String height,
                                   final SafeHtml heading, final SafeHtml text, 
                                   final boolean selected, final Command clickCommand) {
    final VerticalPanel panel = new VerticalPanel();
    panel.setVerticalAlignment(HasAlignment.ALIGN_MIDDLE);
    panel.setHeight("100%");

    final Image image = new Image(uri);
    image.setWidth(width);
    image.setHeight(height);
    image.addStyleName(style.image());
    final double alpha = selected ? 1 : 0.2;
    image.getElement().setAttribute("style", "filter: alpha(opacity=5);opacity: " + alpha);

    final Tooltip tooltip = new Tooltip();
    tooltip.setTitle( text.asString() );
    tooltip.setWidget(image);
    tooltip.setContainer("body");
    tooltip.setPlacement(Placement.BOTTOM);
    tooltip.setIsAnimated(false);
    tooltip.setShowDelayMs(100);

    final HTML label = new HTML(heading.asString());
    final HorizontalPanel labelPanel = new HorizontalPanel();
    labelPanel.setWidth("100%");
    labelPanel.setHorizontalAlignment(HasAlignment.ALIGN_CENTER);
    labelPanel.add(label);

    panel.add(tooltip);
    panel.add(labelPanel);        
    mainPanel.add(panel);

    image.addClickHandler(e -> {
        tooltip.hide();
        tooltip.destroy();
        clickCommand.execute();
    });

    return this;
}
 
Example 59
Project: ontobrowser   File: EditTermPopup.java   Source Code and License Vote up 4 votes
private void addDialogWidgets() {
	VerticalPanel dialogVPanel = new VerticalPanel();
	HorizontalPanel buttonsHPanel = new HorizontalPanel();
	Button cancelButton = new Button("Cancel");
	
	cancelButton.addClickHandler(new ClickHandler() {
		public void onClick(ClickEvent event) {
			dialogBox.hide();
		}
	});
							
	buttonsHPanel.add(updateButton);
	buttonsHPanel.add(cancelButton);
	buttonsHPanel.addStyleName("dialog-buttons");	
			
	dialogVPanel.setHorizontalAlignment(VerticalPanel.ALIGN_LEFT);
	dialogVPanel.add(new Label("Definition:"));
	dialogVPanel.add(definitionField);
	dialogVPanel.add(definitionError);
	dialogVPanel.add(new Label("URL:"));
	dialogVPanel.add(urlField);
	dialogVPanel.add(urlError);
	dialogVPanel.add(new Label("Comments:"));
	dialogVPanel.add(commentsField);
	dialogVPanel.add(commentsError);
	
	dialogVPanel.add(buttonsHPanel);
	dialogVPanel.setCellHorizontalAlignment(buttonsHPanel, VerticalPanel.ALIGN_CENTER);
	
	for(Widget widget : dialogVPanel) {
		if(widget instanceof Label) {
			Label label = (Label)widget;
			if(label.getText().length() != 0) {
				label.addStyleName("dialog-label");
			} else {
				label.addStyleName("dialog-error");
			}
		}
	}
	
	dialogBox.setWidget(dialogVPanel);
}