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


Java LIElement类代码示例

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


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

示例1: prepareToAdoptChildren

import com.google.gwt.dom.client.LIElement; //导入依赖的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.LIElement; //导入依赖的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.LIElement; //导入依赖的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: _findItemIn

import com.google.gwt.dom.client.LIElement; //导入依赖的package包/类
private static TreeViewItem _findItemIn(final Collection<TreeViewItem> items,
										final LIElement element) {
	TreeViewItem outItem = null;
	if (items != null && items.size() > 0) {
		for(TreeViewItem item : items) {
			if (outItem != null) break;
			if (item.getElement().cast() == element) {
				outItem = item;
			} else if (item.hasChildren()) {
				outItem = _findItemIn(item.getChildren(),element);  
			}
		}
	}
	return outItem;
}
 
开发者ID:opendata-euskadi,项目名称:r01fb,代码行数:16,代码来源:TreeViewUtils.java

示例5: _createBaseTagElement

import com.google.gwt.dom.client.LIElement; //导入依赖的package包/类
private static LIElement _createBaseTagElement() {
	// 		<ul class='tags'>
	//			<li><span><img />Tag1</span></li>
	//			<li><span><img />Tag1</span></li>
	//			...
	//		</ul>
	LIElement containerLIEl = DOM.createElement("li").cast();
	SpanElement spanEl = DOM.createSpan().cast();
	ImageElement imgEl = DOM.createImg().cast();
	
	// assemble the structure
	spanEl.appendChild(imgEl);
	spanEl.appendChild(Document.get().createTextNode(""));
	containerLIEl.appendChild(spanEl);
	return containerLIEl;
}
 
开发者ID:opendata-euskadi,项目名称:r01fb,代码行数:17,代码来源:TagList.java

示例6: onBrowserEvent

import com.google.gwt.dom.client.LIElement; //导入依赖的package包/类
@Override
	@SuppressWarnings("fallthrough")
	public void onBrowserEvent(final Event event) {
		super.onBrowserEvent(event);
		
		int eventType = DOM.eventGetType(event);
		Element eventTargetEl = DOM.eventGetTarget(event);
		
//		GWT.log("_____" + eventTargetEl.getNodeName() + ": " + event.getType());
		
		switch (eventType) {
		case Event.ONCLICK: {
			if (ImageElement.is(eventTargetEl)) {
				LIElement tagLIElement = _findTagLIElementContaining(eventTargetEl);
				T tag = _tagForElement(tagLIElement);
				this.removeTag(tag);
			}
			break;
		}
		}
	}
 
开发者ID:opendata-euskadi,项目名称:r01fb,代码行数:22,代码来源:TagList.java

示例7: TreeViewItem

import com.google.gwt.dom.client.LIElement; //导入依赖的package包/类
/**
 * Creates an empty tree item.
 */
TreeViewItem(final CanBePaintedAsWidget viewObjectToWidgetTransformer) {		
	// Create the item element structure
	LIElement elem = DOM.clone(BASE_ELEM,		// a simple LI	
							   true)			// deep cloning
					    .cast();
	elem.setAttribute("id",DOM.createUniqueId());		
	this.setElement(elem);
	
	// Set the ViewObject to Widget transformer
	_viewObjectToWidgetTransformer = viewObjectToWidgetTransformer;
	
	// Create the items container delegate
	_childItemsContainerDelegate = new TreeViewIsHierarchicalDelegate<TreeViewItem>(_viewObjectToWidgetTransformer,
																					this);
	// Create other delegates
	_hideDisplayDelegate = new ViewHideDisplayDelegate(this);
	_enableDisableDelegate = new ViewEnableDisableDelegate(this);
	
	// Create the observable delegate
	_observableDelegate = new ObservableTreeViewItemDelegate(this);
}
 
开发者ID:opendata-euskadi,项目名称:r01fb,代码行数:25,代码来源:TreeViewItem.java

示例8: onLazyLoadingSuccessful

import com.google.gwt.dom.client.LIElement; //导入依赖的package包/类
@Override
	public void onLazyLoadingSuccessful(final Collection<ViewObject> children) {
//		GWT.log("====>" + this.getText() + " > " + (children != null ? children.size() : 0) + " child loaded");
		// Remove the loading... label
		LabelElement loadingLabel = _childLoadingSPANElement();
		LIElement parentLI = this.getElement().cast();
		parentLI.removeChild(loadingLabel);
		
		// if the number of children loaded is 0 (there where no child items), hide the expander 
		// otherwise paint the children
		if (CollectionUtils.isNullOrEmpty(children)) {
			_expanderINPUTElement().setDisabled(true);
		} else {
			this.paintChildren(children);
		}
	}
 
开发者ID:opendata-euskadi,项目名称:r01fb,代码行数:17,代码来源:TreeViewItem.java

示例9: addEntry

import com.google.gwt.dom.client.LIElement; //导入依赖的package包/类
private void addEntry(String entry, boolean logout) {
    AnchorElement anchor = Document.get().createAnchorElement();
    anchor.setInnerText(entry);

    Event.sinkEvents(anchor, Event.ONCLICK);
    Event.setEventListener(anchor, event -> {
        if (Event.ONCLICK == event.getTypeInt()) {
            if (!logout) {
                onRoleClicked(entry);
            } else {
                onLogoutClicked();
            }
        }
    });

    LIElement li = Document.get().createLIElement();
    li.getStyle().setCursor(Style.Cursor.POINTER);
    li.appendChild(anchor);
    roleList.appendChild((Node) li);
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:21,代码来源:TopMenuBar.java

示例10: addSourceCodeItem

import com.google.gwt.dom.client.LIElement; //导入依赖的package包/类
@Override
public void addSourceCodeItem(String name) {
    AnchorElement anchor = Document.get().createAnchorElement();
    String displayName = DisplayerHtmlConstants.INSTANCE.getString("displayer_source_code_" + name);
    anchor.setInnerText(displayName);

    LIElement li = Document.get().createLIElement();
    li.getStyle().setCursor(Style.Cursor.POINTER);
    li.appendChild(anchor);
    tabList.appendChild((Node) li);

    Event.sinkEvents(anchor, Event.ONCLICK);
    Event.setEventListener(anchor, event -> {
        if(Event.ONCLICK == event.getTypeInt()) {
            presenter.onSourceCodeItemSelected(name);
            if (selectedItem != null) {
                selectedItem.setClassName("");
                selectedItem.getStyle().setCursor(Style.Cursor.POINTER);
            }
            selectedItem = li;
            selectedItem.setClassName("active");
            selectedItem.getStyle().setCursor(Style.Cursor.DEFAULT);
            previewItem.setClassName("");
        }
    });
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:27,代码来源:DisplayerHtmlEditorView.java

示例11: declareVariable

import com.google.gwt.dom.client.LIElement; //导入依赖的package包/类
@Override
public void declareVariable(String var, String description) {

    SpanElement span = Document.get().createSpanElement();
    span.setInnerText(var);

    AnchorElement anchor = Document.get().createAnchorElement();
    anchor.setTitle(description);
    anchor.appendChild(span);

    LIElement li = Document.get().createLIElement();
    li.getStyle().setCursor(Style.Cursor.POINTER);
    li.appendChild(anchor);

    variablesMenu.appendChild((Node) li);

    Event.sinkEvents(anchor, Event.ONCLICK);
    Event.setEventListener(anchor, event -> {
        if(Event.ONCLICK == event.getTypeInt()) {
            presenter.onVariableSelected(var);
        }
    });
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:24,代码来源:SourceCodeEditorView.java

示例12: addBreadcrumbItem

import com.google.gwt.dom.client.LIElement; //导入依赖的package包/类
@Override
public void addBreadcrumbItem(String navItemName, Command onClicked) {
    LIElement li = Document.get().createLIElement();
    breadcrumb.appendChild((Node) li);

    if (onClicked != null) {
        AnchorElement anchor = Document.get().createAnchorElement();
        anchor.setInnerText(navItemName);
        li.appendChild(anchor);
        li.getStyle().setCursor(Style.Cursor.POINTER);

        Event.sinkEvents(anchor, Event.ONCLICK);
        Event.setEventListener(anchor, event -> {
            if (Event.ONCLICK == event.getTypeInt()) {
                onClicked.execute();
            }
        });
    } else {
        ((Node) li).setTextContent(navItemName);
        li.setClassName("active");
    }
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:23,代码来源:NavTilesWidgetView.java

示例13: addItem

import com.google.gwt.dom.client.LIElement; //导入依赖的package包/类
private void addItem(UnorderedList unorderedList, String name, boolean selected, Command onSelect) {
    AnchorElement anchor = Document.get().createAnchorElement();
    anchor.setInnerText(name);

    LIElement li = Document.get().createLIElement();
    li.getStyle().setCursor(Style.Cursor.POINTER);
    li.appendChild(anchor);
    li.setClassName(selected ? "selected" : "");
    unorderedList.appendChild((Node) li);

    Event.sinkEvents(anchor, Event.ONCLICK);
    Event.setEventListener(anchor, event -> {
        if(Event.ONCLICK == event.getTypeInt()) {
            onSelect.execute();
        }
    });
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:18,代码来源:NavComponentConfigModalView.java

示例14: addCommand

import com.google.gwt.dom.client.LIElement; //导入依赖的package包/类
@Override
public void addCommand(String name, Command command) {
    AnchorElement anchor = Document.get().createAnchorElement();
    anchor.setInnerText(name);

    LIElement li = Document.get().createLIElement();
    li.getStyle().setCursor(Style.Cursor.POINTER);
    li.appendChild(anchor);
    commandMenu.appendChild((Node) li);

    Event.sinkEvents(anchor, Event.ONCLICK);
    Event.setEventListener(anchor, event -> {
        if(Event.ONCLICK == event.getTypeInt()) {
            command.execute();
        }
    });
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:18,代码来源:NavItemDefaultEditorView.java

示例15: addItem

import com.google.gwt.dom.client.LIElement; //导入依赖的package包/类
@Override
public void addItem(String id, String name, String description, Command onItemSelected) {
    AnchorElement anchor = Document.get().createAnchorElement();
    anchor.setInnerText(name);
    if (description != null && !description.equals(name)) {
        anchor.setTitle(description);
    }

    LIElement li = Document.get().createLIElement();
    li.getStyle().setCursor(Style.Cursor.POINTER);
    li.appendChild(anchor);
    navWidget.appendChild((Node) li);
    itemMap.put(id, li);

    Event.sinkEvents(anchor, Event.ONCLICK);
    Event.setEventListener(anchor, event -> {
        if (Event.ONCLICK == event.getTypeInt()) {
            onItemSelected.execute();
        }
    });
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:22,代码来源:BaseNavWidgetView.java


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