List of usage examples for com.google.gwt.user.client Element addClassName
@Override public boolean addClassName(String className)
From source file:org.opencms.ade.containerpage.client.CmsContainerpageUtil.java
License:Open Source License
/** * Creates a drag container element for group-container elements.<p> * // w ww. jav a 2 s . c o m * @param containerElement the container element data * @param subElements the sub-elements * @param container the drag parent * * @return the draggable element * * @throws Exception if something goes wrong */ public CmsContainerPageElementPanel createGroupcontainerElement(CmsContainerElementData containerElement, List<CmsContainerElementData> subElements, I_CmsDropContainer container) throws Exception { com.google.gwt.user.client.Element element = DOM.createDiv(); element.addClassName(CmsContainerpageUtil.CLASS_GROUP_CONTAINER_ELEMENT_MARKER); boolean hasProps = !containerElement.getSettingConfig().isEmpty(); CmsGroupContainerElementPanel groupContainer = createGroupcontainer(element, container, containerElement.getClientId(), containerElement.getSitePath(), containerElement.getNoEditReason(), hasProps, containerElement.hasViewPermission(), containerElement.isReleasedAndNotExpired()); groupContainer.setContainerId(container.getContainerId()); //adding sub-elements Iterator<CmsContainerElementData> it = subElements.iterator(); while (it.hasNext()) { CmsContainerElementData subElement = it.next(); if (subElement.getContents().containsKey(container.getContainerId())) { CmsContainerPageElementPanel subDragElement = createElement(subElement, groupContainer); groupContainer.add(subDragElement); } } if (subElements.size() == 0) { groupContainer.addStyleName(I_CmsLayoutBundle.INSTANCE.containerpageCss().emptyGroupContainer()); } addOptionBar(groupContainer); return groupContainer; }
From source file:org.opencms.ade.containerpage.client.ui.CmsGroupcontainerEditor.java
License:Open Source License
/** * Creates a place-holder for the group-container.<p> * /*from w w w . j a va 2s. c om*/ * @param element the element * * @return the place-holder widget */ protected Element createPlaceholder(Element element) { Element result = CmsDomUtil.clone(element); result.addClassName(I_CmsLayoutBundle.INSTANCE.containerpageCss().groupcontainerPlaceholder()); result.getStyle().setBackgroundColor("transparent"); return result; }
From source file:org.overlord.sramp.ui.client.local.pages.ontologies.OntologiesTable.java
License:Apache License
/** * Select item.//from w w w . j ava2 s .c om * * @param ontology * the ontology */ public void selectItem(OntologySummaryBean ontology) { Element row = this.getRow(rows.get(ontology)); row.addClassName("active"); //$NON-NLS-1$ this.selectedOntology = ontology; }
From source file:org.pentaho.mantle.client.ui.xul.MantleXul.java
License:Open Source License
public void customizeAdminStyle() { Timer t = new Timer() { public void run() { if (container != null) { cancel();// www . j a va2s .c o m // call this method when Elements are added to DOM GwtTree adminCatTree = (GwtTree) container.getDocumentRoot().getElementById("adminCatTree"); adminCatTree.getTree().removeStyleName("gwt-Tree"); Panel adminContentPanel = (Panel) container.getDocumentRoot() .getElementById("adminContentPanel").getManagedObject(); adminContentPanel.setWidth("100%"); for (int i = 0; i < adminCatTree.getTree().getItemCount(); i++) { TreeItem treeItem = adminCatTree.getTree().getItem(i); Element e = treeItem.getElement(); e.getStyle().clearPadding(); e.addClassName("adminCatTreeItem"); if (i == adminCatTree.getTree().getItemCount() - 1) { e.addClassName("adminCatTreeItemLast"); } } MantleXul.this.selectAdminCatTreeTreeItem( Messages.getString("manageUsersAndRoles").replaceAll("&", "&")); } } }; t.scheduleRepeating(250); }
From source file:org.thechiselgroup.biomixer.client.core.ui.CSS.java
License:Apache License
public static void addClass(String elementID, String cssClass) { Element element = getElementById(elementID); /*//www . jav a2s. c om * workaround for bug where class name is null */ if (element.getClassName() == null) { element.setClassName(""); } element.addClassName(cssClass); }
From source file:org.thechiselgroup.biomixer.client.dnd.resources.DefaultResourceSetAvatarDragController.java
License:Apache License
/** * Creates a shade element that has bounds of drop target element, but an * absolute location, and is positioned behind the drop target. *//*from w w w .j a va 2 s . c o m*/ private Element createShadeElement(Widget dropTarget) { Element shade = DOM.createSpan(); shade.addClassName(CSS_SHADE_CLASS); CSS.setZIndex(shade, CSS_SHADE_Z_INDEX); WindowPanel window = getWindow(dropTarget); CSS.setAbsoluteBounds(shade, dropTarget.getAbsoluteLeft() - window.getAbsoluteLeft(), dropTarget.getAbsoluteTop() - window.getAbsoluteTop(), dropTarget.getOffsetWidth(), dropTarget.getOffsetHeight()); return shade; }