当前位置: 首页>>代码示例>>Java>>正文


Java UListElement类代码示例

本文整理汇总了Java中com.google.gwt.dom.client.UListElement的典型用法代码示例。如果您正苦于以下问题:Java UListElement类的具体用法?Java UListElement怎么用?Java UListElement使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


UListElement类属于com.google.gwt.dom.client包,在下文中一共展示了UListElement类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: prepareToAdoptChildren

import com.google.gwt.dom.client.UListElement; //导入依赖的package包/类
@Override
public void prepareToAdoptChildren() {
	if (!this.hasChildren()) {	
		// BEFORE the item is prepared to adopt children, it's just like:
		//		<li>
		//			<input type="checkbox" class="expander" disabled>	<!-- input.expander DISABLED = no child -->
        //        	<span class="expander"></span>
        //        	<input type="checkbox" class="selection">
        //        	<!-- the widget --> <!-- if it's a text item: <label>Child Node 1</label> -->
		//			<!-- there's NO child items container -->
        //		</li>
		//
		// AFTER the item is prepared to adopt children, it's: 
		//		<li>
		//			<input type="checkbox" class="expander">			<!-- input.expander ENABLED = has child -->
        //        	<span class="expander"></span>
        //        	<input type="checkbox" class="selection">
        //        	<!-- the widget --> <!-- if it's a text item: <label>Child Node 1</label> -->
		//			<ul class='childContainer'>						 	<!-- child items container is present -->
		//				... here will come the child items 
		//			</ul>
        //		</li>
		// 
		// [1] - Create a child items container UL by cloning the BASE_INTERNAL_ELEM
		UListElement childContainerULElem = DOM.clone(BASE_CHILD_CONTAINER_ELEM,// an UL
										  			  true)						// deep cloning
										  	   .cast();
		// [2] - set the new UL as a child of the item (the LI)
		LIElement parentLI = this.getElement().cast();
		parentLI.appendChild(childContainerULElem);
		// [3] - Change the <input type="checkbox" class="expander"> status from DISABLED to ENABLED
		InputElement expanderINPUT = parentLI.getFirstChild().cast();	// from Node to Element
		expanderINPUT.setDisabled(false);
	} else {
		throw new IllegalStateException();
	}
}
 
开发者ID:opendata-euskadi,项目名称:r01fb,代码行数:38,代码来源:TreeViewItem.java

示例2: appendList

import com.google.gwt.dom.client.UListElement; //导入依赖的package包/类
public final void appendList(ArrayList<String> choices, boolean ordered, String additionalStyle) {
   if (choices == null || choices.size() == 0) {
      return;
   }
   
   FlowPanel htmlList = new FlowPanel(ordered? OListElement.TAG : UListElement.TAG);
   
   if (additionalStyle != null && additionalStyle.length() > 0) {
      _promptChar.getElement().setAttribute("style", additionalStyle);
   }
   
   for (String choice : choices) {
      FlowPanel item = new FlowPanel(LIElement.TAG);
      item.getElement().setInnerText(choice);
      htmlList.add(item);
   }
   
   appendAndScrollOrFocusAsAppropriate(htmlList);
}
 
开发者ID:ainslec,项目名称:gwt-promptly,代码行数:20,代码来源:PromptlyPanel.java

示例3: findTreeViewItemLIElement

import com.google.gwt.dom.client.UListElement; //导入依赖的package包/类
public static LIElement findTreeViewItemLIElement(final Element element) {
	LIElement outLIElement = null;
	
	Element currElement = element;
	while (currElement != null) {
		if (LIElement.is(currElement)) {
			Element parentElement = currElement.getParentElement();
			if (UListElement.is(parentElement) && CONTAINER_UL_CSS_CLASS_NAME.equals(parentElement.getClassName())) {
				outLIElement = currElement.cast();
			} else {
				currElement = parentElement.getParentElement();
			}
		} else {
			currElement = currElement.getParentElement();
		}
		if (outLIElement != null) break;
	}
	return outLIElement;
}
 
开发者ID:opendata-euskadi,项目名称:r01fb,代码行数:20,代码来源:TreeViewUtils.java

示例4: setActive

import com.google.gwt.dom.client.UListElement; //导入依赖的package包/类
private void setActive(final AnchorElement element, final UListElement active, final List<UListElement> allElements) {
  $(element).click(new Function() {
    @Override
    public boolean f(Event e) {
      $("a.inline").removeClass("selected");
      $(element).addClass("selected");
      for (UListElement otherElement : allElements) {
        if (otherElement != active) {
          $(otherElement).hide();
        }
      }
      $(active).show();
      return false;
    }
  });
}
 
开发者ID:JetBrains,项目名称:mapper,代码行数:17,代码来源:TodoListMapper.java

示例5: createDomImpl

import com.google.gwt.dom.client.UListElement; //导入依赖的package包/类
@Override
public Element createDomImpl(Renderable element) {
  UListElement e = Document.get().createULElement();

  // Be careful if you want to move these into CSS - they might affect rendering
  // of email notifications in gmail. Find a nicer way to deal with this.
  e.getStyle().setPadding(0, Unit.PX);
  e.getStyle().setMargin(0, Unit.PX);
  e.getStyle().setProperty(LIST_STYLE_POSITION, POSITION_INSIDE);
  return element.setAutoAppendContainer(e);
}
 
开发者ID:jorkey,项目名称:Wiab.pro,代码行数:12,代码来源:LineRendering.java

示例6: allChildrenGone

import com.google.gwt.dom.client.UListElement; //导入依赖的package包/类
@Override
public void allChildrenGone() {
	UListElement childContainerULElement = _childrenContainerULElement();
	assert(childContainerULElement != null && childContainerULElement.getChildCount() == 0);
	LIElement containerLI = this.getElement().cast();
	containerLI.removeChild(childContainerULElement);
}
 
开发者ID:opendata-euskadi,项目名称:r01fb,代码行数:8,代码来源:TreeViewItem.java

示例7: _initDOM

import com.google.gwt.dom.client.UListElement; //导入依赖的package包/类
/**
 * Builds the element structure:
 * <pre class='brush:html'>
 * 		<ul class='treeview'>
 *			<li>
 *				<input type="checkbox" class="expander" disabled>	<!-- input.expander DISABLED = no child -->
    *        		<span class="expander"></span>
    *        		
    *        		<!-- The root node widget -->	<!-- usually is a the tree caption -->
    *        
    *        		<ul class='childContainer'>..</ul>		<!-- the child items container -->
    *			</li>
    *		</ul>
 * </pre>
 */
private void _initDOM() {
	// [1] - Create a main UL
	UListElement mainULEl = DOM.createElement("ul").cast();
	mainULEl.addClassName(TreeViewUtils.TREEVIEW_CSS_CLASS_NAME);
	
	// [2] - Create a single LI for the tree label and append it to the UL
	LIElement mainLIEl = DOM.createElement("li").cast();
	mainULEl.appendChild(mainLIEl);

	// [3] - Create an UL to contain the root nodes and append it to the title's LI
	_rootNodesContainerElement = DOM.createElement("ul").cast();
	_rootNodesContainerElement.addClassName(TreeViewUtils.CONTAINER_UL_CSS_CLASS_NAME);
	mainLIEl.appendChild(_rootNodesContainerElement);
	
	// [4] - set the widget DOM element
	this.setElement(mainULEl);		
	
	// Capture events
	this.sinkEvents(Event.ONMOUSEDOWN | Event.ONCLICK | Event.KEYEVENTS);	// = DOM.sinkEvents(this.getElement(),Event.ONMOUSEDOWN | Event.ONCLICK | Event.KEYEVENTS)
	DOM.sinkEvents(this.getElement(),	// main UL
				   Event.FOCUSEVENTS);

	// Add area role "tree"
	Roles.getTreeRole()
		 .set(this.getElement());
}
 
开发者ID:opendata-euskadi,项目名称:r01fb,代码行数:42,代码来源:TreeView.java

示例8: createDomImpl

import com.google.gwt.dom.client.UListElement; //导入依赖的package包/类
@Override
public Element createDomImpl(Renderable element) {
  UListElement e = Document.get().createULElement();

  // Be careful if you want to move these into CSS - they might affect rendering
  // of email notifications in gmail. Find a nicer way to deal with this.
  e.getStyle().setPadding(0, Unit.PX);
  e.getStyle().setMargin(0, Unit.PX);
  return element.setAutoAppendContainer(e);
}
 
开发者ID:apache,项目名称:incubator-wave,代码行数:11,代码来源:LineRendering.java

示例9: loadApp

import com.google.gwt.dom.client.UListElement; //导入依赖的package包/类
private void loadApp() {
    // Show login links
    Element userLinks = Document.get().getElementById(AppStyles.ID_USER_LINKS);
    UListElement ul = Document.get().createULElement();
    LIElement liSignedIn = Document.get().createLIElement();
    LIElement liSignOut = Document.get().createLIElement();
    User me = App.getAppModel().getMe();
    String firstName = me.firstName;
    String lastName = me.lastName;
    liSignedIn.setInnerHTML("Signed in as <span class=\"nameText\">" + firstName + " " + lastName + "</span>");
    liSignOut.setInnerHTML("<span class=\"listmaker-userEmail\">" + me.emailAddress + "</span>");
    liSignOut.setInnerHTML("<a href=\"" + LOGOUT_URL + "\">Sign out</a>");
    ul.appendChild(liSignedIn);
    ul.appendChild(liSignOut);
    userLinks.appendChild(ul);

    //gwt-activities-and-places
    ActivityMapper userActivityMapper = new UserActivityMapper();
    ActivityManager userActivityManager = new ActivityManager(userActivityMapper, App.getEventBus());
    userActivityManager.setDisplay(userDisplay);

    ActivityMapper addNoteActivityMapper = new AddNoteActivityMapper();
    ActivityManager addNoteActivityManager = new ActivityManager(addNoteActivityMapper, App.getEventBus());
    addNoteActivityManager.setDisplay(addNote);

    ActivityMapper navActivityMapper = new NavActivityMapper();
    ActivityManager navActivityManager = new ActivityManager(navActivityMapper, App.getEventBus());
    navActivityManager.setDisplay(nav);

    ActivityMapper mainActivityMapper = new AppActivityMapper();
    ActivityManager noteDisplayActivityManager = new ActivityManager(mainActivityMapper, App.getEventBus());
    noteDisplayActivityManager.setDisplay(mainDisplay);

    PlaceHistoryHandler historyHandler = new PlaceHistoryHandler(App.getPlaceHistoryMapper());
    historyHandler.register(App.getClientFactory().getPlaceController(), App.getEventBus(), defaultPlace);
    DOM.removeChild(RootPanel.getBodyElement(), DOM.getElementById(AppStyles.ID_SPLASH));

    RootPanel.get(AppStyles.BODY_PANEL_USER_ID).add(userDisplay);
    RootPanel.get(AppStyles.BODY_PANEL_TOP_ID).add(addNote);
    RootPanel.get(AppStyles.BODY_PANEL_CONTENT_ID).add(mainDisplay);
    RootPanel.get(AppStyles.BODY_PANEL_NAV_ID).add(nav);

    historyHandler.handleCurrentHistory();

}
 
开发者ID:turbomanage,项目名称:listmaker,代码行数:46,代码来源:ListmakerMvp.java

示例10: setDir

import com.google.gwt.dom.client.UListElement; //导入依赖的package包/类
public void setDir(String dir)
{
	// Set an attribute specific to this tag
	((UListElement) getElement().cast()).setDir(dir);
}
 
开发者ID:turbomanage,项目名称:listmaker,代码行数:6,代码来源:UnorderedListWidget.java

示例11: _createBaseChildContainerElement

import com.google.gwt.dom.client.UListElement; //导入依赖的package包/类
private static UListElement _createBaseChildContainerElement() {
	UListElement ulElem = DOM.createElement("ul").cast();
	ulElem.addClassName(TreeViewUtils.CONTAINER_UL_CSS_CLASS_NAME);
	return ulElem;
}
 
开发者ID:opendata-euskadi,项目名称:r01fb,代码行数:6,代码来源:TreeViewItem.java

示例12: _childrenContainerULElement

import com.google.gwt.dom.client.UListElement; //导入依赖的package包/类
UListElement _childrenContainerULElement() {
	UListElement containerLI = this.getElement().cast();
	if (containerLI.getChildCount() < 4) return null;
	UListElement childContainerULElem = containerLI.getChild(4).cast();
	return childContainerULElem;
}
 
开发者ID:opendata-euskadi,项目名称:r01fb,代码行数:7,代码来源:TreeViewItem.java

示例13: createTreeNode

import com.google.gwt.dom.client.UListElement; //导入依赖的package包/类
/**
 * Creates a single tree node from the given trace node.
 * @param node
 */
protected LIElement createTreeNode(TraceNodeBean node) {
    String nodeId = String.valueOf(nodeIdCounter++);
    nodeMap.put(nodeId, node);

    boolean isCall = "Call".equals(node.getType()); //$NON-NLS-1$
    boolean hasChildren = !node.getTasks().isEmpty();
    LIElement li = Document.get().createLIElement();
    li.setClassName(hasChildren ? "parent_li" : "leaf_li"); //$NON-NLS-1$ //$NON-NLS-2$
    if (hasChildren)
        li.setAttribute("role", "treeitem"); //$NON-NLS-1$ //$NON-NLS-2$
    SpanElement span = Document.get().createSpanElement();
    span.setAttribute("data-nodeid", nodeId); //$NON-NLS-1$
    Element icon = Document.get().createElement("i"); //$NON-NLS-1$
    span.appendChild(icon);
    span.appendChild(Document.get().createTextNode(" ")); //$NON-NLS-1$
    if (isCall) {
        span.setClassName(node.getStatus());
        icon.setClassName("icon-minus-sign"); //$NON-NLS-1$
        span.appendChild(Document.get().createTextNode(node.getOperation()));
        span.appendChild(Document.get().createTextNode(":")); //$NON-NLS-1$
        span.appendChild(Document.get().createTextNode(node.getComponent()));
    } else {
        span.appendChild(Document.get().createTextNode(node.getDescription()));
        span.setClassName("Info"); //$NON-NLS-1$
        icon.setClassName("icon-info-sign"); //$NON-NLS-1$
    }
    li.appendChild(span);
    if (node.getDuration() != -1) {
        li.appendChild(Document.get().createTextNode(" [")); //$NON-NLS-1$
        li.appendChild(Document.get().createTextNode(String.valueOf(node.getDuration())));
        li.appendChild(Document.get().createTextNode("ms]")); //$NON-NLS-1$
    }
    if (node.getPercentage() != -1) {
        li.appendChild(Document.get().createTextNode(" (")); //$NON-NLS-1$
        li.appendChild(Document.get().createTextNode(String.valueOf(node.getPercentage())));
        li.appendChild(Document.get().createTextNode("%)")); //$NON-NLS-1$
    }

    if (hasChildren) {
        UListElement ul = Document.get().createULElement();
        ul.setAttribute("role", "group"); //$NON-NLS-1$ //$NON-NLS-2$
        li.appendChild(ul);

        List<TraceNodeBean> tasks = node.getTasks();
        for (TraceNodeBean task : tasks) {
            LIElement tn = createTreeNode(task);
            ul.appendChild(tn);
        }
    }
    return li;
}
 
开发者ID:Governance,项目名称:rtgov-ui,代码行数:56,代码来源:CallTraceWidget.java

示例14: Nav

import com.google.gwt.dom.client.UListElement; //导入依赖的package包/类
public Nav() {
	super(UListElement.TAG);
	StyleUtils.addStyle(this, Nav.STYLE_NAV);
}
 
开发者ID:Putnami,项目名称:putnami-web-toolkit,代码行数:5,代码来源:Nav.java

示例15: List

import com.google.gwt.dom.client.UListElement; //导入依赖的package包/类
public List() {
	this(UListElement.TAG);
}
 
开发者ID:Putnami,项目名称:putnami-web-toolkit,代码行数:4,代码来源:List.java


注:本文中的com.google.gwt.dom.client.UListElement类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。