com.google.gwt.user.client.ui.HasAlignment Java Examples

The following examples show how to use com.google.gwt.user.client.ui.HasAlignment. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Status.java    From document-management-system with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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 #2
Source File: Status.java    From document-management-system with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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 #3
Source File: LogScrollTable.java    From document-management-system with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Adds new user name row
 *
 * @param userName The user name value
 */
public void addRow(GWTActivity activity) {
	int rows = dataTable.getRowCount();
	dataTable.insertRow(rows);
	dataTable.setHTML(rows, 0, activity.getAction());
	dataTable.setHTML(rows, 1, activity.getUser());
	DateTimeFormat dtf = DateTimeFormat.getFormat(GeneralComunicator.i18n("general.date.pattern"));
	dataTable.setHTML(rows, 2, dtf.format(activity.getDate()));
	dataTable.setHTML(rows, 3, activity.getParams());
	dataTable.getCellFormatter().setHorizontalAlignment(rows, 1, HasAlignment.ALIGN_CENTER);
	dataTable.getCellFormatter().setHorizontalAlignment(rows, 2, HasAlignment.ALIGN_CENTER);
}
 
Example #4
Source File: WorkflowDetailTable.java    From document-management-system with GNU General Public License v2.0 5 votes vote down vote up
/**
 * addRow
 *
 * @param instanceLogEntry
 */
public void addRow(GWTProcessInstanceLogEntry instanceLogEntry) {
	int rows = dataTable.getRowCount();
	dataTable.insertRow(rows);
	dataTable.setHTML(rows, 0, String.valueOf(instanceLogEntry.getProcessDefinitionId()));
	dataTable.setHTML(rows, 1, instanceLogEntry.getProcessDefinitionName());
	dataTable.setHTML(rows, 2, instanceLogEntry.getToken());
	DateTimeFormat dtf = DateTimeFormat.getFormat(GeneralComunicator.i18n("general.date.pattern"));
	dataTable.setHTML(rows, 3, dtf.format(instanceLogEntry.getDate()));
	dataTable.setHTML(rows, 4, instanceLogEntry.getType());
	dataTable.setHTML(rows, 5, instanceLogEntry.getInfo());
	dataTable.getCellFormatter().setHorizontalAlignment(rows, 0, HasAlignment.ALIGN_CENTER);
	dataTable.getCellFormatter().setHorizontalAlignment(rows, 3, HasAlignment.ALIGN_CENTER);
}
 
Example #5
Source File: ToolBarButton.java    From document-management-system with GNU General Public License v2.0 5 votes vote down vote up
public ToolBarButton(Image image, String title, ClickHandler handler) {
	super();
	this.image = image;
	this.image.setTitle(title);
	addClickHandler(handler); // Adding clickhandler to widget

	add(image);
	setCellHorizontalAlignment(image, HasAlignment.ALIGN_CENTER);
	setCellVerticalAlignment(image, HasAlignment.ALIGN_MIDDLE);
	setSize("24", "24");
	setCellHeight(image, "24");
	setCellWidth(image, "24");

	sinkEvents(Event.ONCLICK | Event.MOUSEEVENTS);
}
 
Example #6
Source File: UserNews.java    From document-management-system with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Adds a new row
 *
 * @param search The search value
 */
public void addRow(GWTQueryParams search) {
	int rows = table.getRowCount();

	data.put(dataIndexValue, search);

	if (!search.isShared()) {
		table.setHTML(rows, 0, " ");
	} else {
		table.setWidget(rows, 0, new Image(OKMBundleResources.INSTANCE.sharedQuery()));
	}

	table.setHTML(rows, 1, search.getQueryName());
	table.setHTML(rows, 2, "" + dataIndexValue++);
	table.setHTML(rows, 3, "");
	table.getFlexCellFormatter().setVisible(rows, 2, false);

	// The hidden column extends table to 100% width
	CellFormatter cellFormatter = table.getCellFormatter();
	cellFormatter.setWidth(rows, 0, "30px");
	cellFormatter.setHeight(rows, 0, "20px");
	cellFormatter.setHorizontalAlignment(rows, 0, HasAlignment.ALIGN_CENTER);
	cellFormatter.setVerticalAlignment(rows, 0, HasAlignment.ALIGN_MIDDLE);
	cellFormatter.setWidth(rows, 3, "100%");

	table.getRowFormatter().setStyleName(rows, "okm-userNews");
	setRowWordWarp(rows, 4, false);
}
 
Example #7
Source File: SearchSaved.java    From document-management-system with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Adds a new row
 *
 * @param search Search parameters to be added.
 */
private void addRow(GWTQueryParams search) {
	int rows = table.getRowCount();

	data.put(new Long(dataIndexValue), search);

	if (!search.isShared()) {
		table.setHTML(rows, 0, " ");
	} else {
		table.setWidget(rows, 0, new Image(OKMBundleResources.INSTANCE.sharedQuery()));
	}

	table.setHTML(rows, 1, search.getQueryName());
	table.setHTML(rows, 2, "" + dataIndexValue++);
	table.setHTML(rows, 3, "");
	table.getCellFormatter().setVisible(rows, 2, false);

	// The hidden column extends table to 100% width
	CellFormatter cellFormatter = table.getCellFormatter();
	cellFormatter.setWidth(rows, 0, "30px");
	cellFormatter.setHeight(rows, 0, "20px");
	cellFormatter.setHorizontalAlignment(rows, 0, HasAlignment.ALIGN_CENTER);
	cellFormatter.setVerticalAlignment(rows, 0, HasAlignment.ALIGN_MIDDLE);
	cellFormatter.setWidth(rows, 3, "100%");

	table.getRowFormatter().setStyleName(rows, "okm-SearchSaved");
	setRowWordWarp(rows, 4, false);
}
 
Example #8
Source File: Guestbook.java    From appengine-gwtguestbook-namespaces-java with Apache License 2.0 5 votes vote down vote up
/**
 * This is the entry point method.
 */
public void onModuleLoad() {
  // Set up guest entries tables, first row for headers.
  guestEntries.setHTML(0, 0, "<b>Guest Name</b>");
  guestEntries.setHTML(0, 1, "<b>Message</b>");

  // Style the entries table.
  guestEntries.addStyleName("gb-GuestEntries");
  guestEntries.getRowFormatter().addStyleName(0, "gb-GuestEntriesHeader");
  guestEntries.getCellFormatter().addStyleName(0, 0, "gb-GuestHeader");
  guestEntries.getCellFormatter().addStyleName(0, 1, "gb-MessageHeader");

  // Attach components together.
  mainPanel.add(errorLabel);
  mainPanel.add(guestSignaturePanel);
  mainPanel.add(guestEntries);

  // Align the signature panel and entries table.
  mainPanel.setWidth("100%");
  mainPanel.setCellHorizontalAlignment(guestSignaturePanel,
      HasAlignment.ALIGN_CENTER);
  mainPanel.setCellHorizontalAlignment(guestEntries,
      HasAlignment.ALIGN_CENTER);
  mainPanel.setCellWidth(guestEntries, "550px");

  // Load and display existing guest entries.
  loadGuestEntries();

  // Attach handlers onto UI components.
  guestSignaturePanel.addEntryUpdateHandler(this);

  // Attach main panel to host HTML page.
  RootPanel.get().add(mainPanel);
}
 
Example #9
Source File: TabWorkspace.java    From document-management-system with GNU General Public License v2.0 4 votes vote down vote up
/**
 * TabWorkspace
 */
public TabWorkspace() {
	vPanel = new VerticalPanel();
	iframe = new Frame("about:blank");

	DOM.setElementProperty(iframe.getElement(), "frameborder", "0");
	DOM.setElementProperty(iframe.getElement(), "marginwidth", "0");
	DOM.setElementProperty(iframe.getElement(), "marginheight", "0");

	// Commented because on IE show clear if allowtransparency=true
	DOM.setElementProperty(iframe.getElement(), "allowtransparency", "false");
	DOM.setElementProperty(iframe.getElement(), "scrolling", "auto");

	iframe.setUrl(Main.CONTEXT + "/extra/index.jsp");
	iframe.setStyleName("okm-Iframe");

	vPanel.add(iframe);
	vPanel.setCellHorizontalAlignment(iframe, HasAlignment.ALIGN_CENTER);

	vPanel.setWidth("100%");
	vPanel.setHeight("100%");

	// User workspace values
	if (GeneralComunicator.getWorkspace() == null) {
		timer = new Timer() {
			@Override
			public void run() {
				if (GeneralComunicator.getWorkspace() == null) {
					firstTimeLoadingWorkspace();
				} else {
					init();
				}
			}
		};

		firstTimeLoadingWorkspace();
	} else {
		init();
	}

	initWidget(vPanel);
}
 
Example #10
Source File: HorizImageListEditorView.java    From dashbuilder with Apache License 2.0 4 votes vote down vote up
@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;
}