Java Code Examples for com.google.gwt.user.client.DOM#setElementProperty()

The following examples show how to use com.google.gwt.user.client.DOM#setElementProperty() . 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: Administration.java    From document-management-system with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Administration
 */
public Administration() {
	iframe = new Frame("about:blank");

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

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

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

	initWidget(iframe);
}
 
Example 2
Source File: HTMLPreview.java    From document-management-system with GNU General Public License v2.0 6 votes vote down vote up
/**
 * HTMLPreview
 */
public HTMLPreview() {
	iframe = new Frame("about:blank");

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

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

	iframe.setStyleName("okm-Iframe");
	iframe.addStyleName("okm-EnableSelect");

	initWidget(iframe);
}
 
Example 3
Source File: MailPreview.java    From document-management-system with GNU General Public License v2.0 6 votes vote down vote up
/**
 * MailPreview
 */
public MailPreview() {
	iframe = new Frame("about:blank");

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

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

	iframe.setStyleName("okm-Iframe");
	iframe.addStyleName("okm-EnableSelect");

	initWidget(iframe);
}
 
Example 4
Source File: SyntaxHighlighterPreview.java    From document-management-system with GNU General Public License v2.0 6 votes vote down vote up
/**
 * HTMLPreview
 */
public SyntaxHighlighterPreview() {
	iframe = new Frame("about:blank");

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

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

	iframe.setStyleName("okm-Iframe");
	iframe.addStyleName("okm-EnableSelect");

	initWidget(iframe);
}
 
Example 5
Source File: MiniProgressBar.java    From appinventor-extensions with Apache License 2.0 5 votes vote down vote up
/**
 * Set the current progress.
 *
 * @param curProgress the current progress
 */
public void setProgress(double curProgress) {
  this.curProgress = Math.max(minProgress, Math.min(maxProgress, curProgress));

  // Calculate percent complete
  int percent = (int) (100 * getPercent());
  DOM.setStyleAttribute(barElement, "width", percent + "%");
  DOM.setElementProperty(textElement, "innerHTML", generateText(curProgress));
  updateTextStyle(percent);

  // Realign the text
  redraw();
}
 
Example 6
Source File: MiniProgressBar.java    From appinventor-extensions with Apache License 2.0 5 votes vote down vote up
private void updateTextStyle(int percent) {
  // Set the style depending on the size of the bar
  if (percent < 50) {
    DOM.setElementProperty(textElement, "className",
        textClassName + " " + textFirstHalfClassName);
  } else {
    DOM.setElementProperty(textElement, "className",
        textClassName + " " + textSecondHalfClassName);
  }
}
 
Example 7
Source File: HTMLEditorPopup.java    From document-management-system with GNU General Public License v2.0 5 votes vote down vote up
/**
 * rebuildFormEditor
 */
private TextArea rebuildFormEditor() {
	htmlEditor = new TextArea(); // textarea must be recreated each time
	htmlEditor.setName("elm1");
	htmlEditor.setStyleName("tinymce");
	DOM.setElementProperty(htmlEditor.getElement(), "id", "elm1");

	return htmlEditor;
}
 
Example 8
Source File: ExternalURLPopup.java    From document-management-system with GNU General Public License v2.0 5 votes vote down vote up
/**
 * ExternalURLPopup
 */
public ExternalURLPopup() {

	// Establishes auto-close when click outside
	super(false, true);

	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");
	//DOM.setElementProperty(iframe.getElement(), "z-index", "10000");
	iframe.setStyleName("okm-Popup-text");

	button = new Button(Main.i18n("button.close"), new ClickHandler() {
		@Override
		public void onClick(ClickEvent event) {
			Log.debug("onClick(" + event + ")");
			hide();

			Log.debug("onClick: void");
		}
	});

	vPanel.add(new HTML("<br>"));
	vPanel.add(iframe);
	vPanel.add(new HTML("<br>"));
	vPanel.add(button);
	vPanel.add(new HTML("<br>"));

	vPanel.setCellHorizontalAlignment(iframe, HorizontalPanel.ALIGN_CENTER);
	vPanel.setCellHorizontalAlignment(button, HorizontalPanel.ALIGN_CENTER);

	button.setStyleName("okm-YesButton");

	setWidget(vPanel);
}
 
Example 9
Source File: MiniProgressBar.java    From appinventor-extensions with Apache License 2.0 4 votes vote down vote up
public void setBarStyleName(String barClassName) {
  DOM.setElementProperty(barElement, "className", barClassName);
}
 
Example 10
Source File: ZohoPopup.java    From document-management-system with GNU General Public License v2.0 4 votes vote down vote up
/**
 * ZohoWriterPopup
 */
public ZohoPopup(String title, String url, final String id) {
	super(false, true);

	int width = DEFAULT_WIDTH;
	int height = DEFAULT_HEIGHT;

	// Calculate size
	if (Main.get().mainPanel.getOffsetHeight() < height + UIDialogConstants.MARGIN) {
		height = Main.get().mainPanel.getOffsetHeight() - UIDialogConstants.MARGIN;
	}

	if (Main.get().mainPanel.getOffsetWidth() < width + UIDialogConstants.MARGIN) {
		width = Main.get().mainPanel.getOffsetWidth() - UIDialogConstants.MARGIN;
	}

	setText(title);
	vPanel = new VerticalPanel();

	frame = new Frame(url);
	DOM.setElementProperty(frame.getElement(), "frameborder", "0");
	DOM.setElementProperty(frame.getElement(), "marginwidth", "0");
	DOM.setElementProperty(frame.getElement(), "marginheight", "0");
	frame.setWidth(String.valueOf(width) + "px");
	frame.setHeight(String.valueOf(height - UIDialogConstants.FRAME_OFFSET - UIDialogConstants.DIALOG_TOP) + "px");
	frame.setStyleName("okm-Popup-text");

	close = new Button(GeneralComunicator.i18n("button.close"));
	close.addClickHandler(new ClickHandler() {

		@Override
		public void onClick(ClickEvent event) {
			close.setEnabled(false);
			zohoService.closeZohoWriter(id, new AsyncCallback<Object>() {
				@Override
				public void onSuccess(Object result) {
					hide();
				}

				@Override
				public void onFailure(Throwable caught) {
					GeneralComunicator.showError("closeZohoWriter", caught);
				}
			});
		}
	});

	close.addStyleName("okm-Input");

	vPanel.setWidth(String.valueOf(width) + "px");
	vPanel.setHeight(String.valueOf(height - UIDialogConstants.DIALOG_TOP) + "px");

	vPanel.add(frame);
	HorizontalPanel hPanel = new HorizontalPanel();
	hPanel.add(close);
	vPanel.add(hPanel);

	vPanel.setCellHeight(frame, String.valueOf(height - UIDialogConstants.FRAME_OFFSET - UIDialogConstants.DIALOG_TOP) + "px");
	vPanel.setCellHeight(hPanel, String.valueOf(UIDialogConstants.BUTTONS_HEIGHT) + "px");
	vPanel.setCellHorizontalAlignment(hPanel, HasAlignment.ALIGN_CENTER);
	vPanel.setCellVerticalAlignment(hPanel, HasAlignment.ALIGN_MIDDLE);

	setWidget(vPanel);
}
 
Example 11
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);
}