• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java LIElement类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: addItem

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

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

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


示例17: addHitPolicyOption

import com.google.gwt.dom.client.LIElement; //导入依赖的package包/类
@Override
public void addHitPolicyOption( final GuidedDecisionTable52.HitPolicy hitPolicy ) {
    final AnchorElement anchor = Document.get()
            .createAnchorElement();
    anchor.setInnerText( HitPolicyInternationalizer.internationalize( hitPolicy ) );

    Event.sinkEvents( anchor,
                      Event.ONCLICK );
    Event.setEventListener( anchor,
                            event -> {
                                if ( Event.ONCLICK == event.getTypeInt() ) {
                                    presenter.onHitPolicySelected( hitPolicy );
                                }
                            } );

    final LIElement li = Document.get()
            .createLIElement();
    li.appendChild( anchor );
    listOfAvailableHitModes.appendChild( (Node) li );
}
 
开发者ID:kiegroup,项目名称:drools-wb,代码行数:21,代码来源:HitPolicySelectorViewImpl.java


示例18: findTreeViewItemContaining

import com.google.gwt.dom.client.LIElement; //导入依赖的package包/类
/**
 * Finds the TreeView item that contains the provided {@link Element}
 * (this {@link Element} usually is the {@link EventTarget})
 * @param element
 * @param tree
 * @return
 */
public static TreeViewItem findTreeViewItemContaining(final Element element,
													  final TreeView tree) {
	// Find the eventTarget parent LI and the tree view item associated with it
	LIElement liElement = TreeViewUtils.findTreeViewItemLIElement(element);
	TreeViewItem item = _findItemIn(tree.getChildren(),
									liElement);
	return item;
}
 
开发者ID:opendata-euskadi,项目名称:r01fb,代码行数:16,代码来源:TreeViewUtils.java


示例19: insertTagAt

import com.google.gwt.dom.client.LIElement; //导入依赖的package包/类
/**
 * Inserts a tag at a position
 * @param tag
 * @param position
 */
public void insertTagAt(final T tag,final int position) {
	// Check the index 
	if (position < 0 || position > this.getTagCount()) throw new IndexOutOfBoundsException();
	
	// Check the tag existence
	if (_elementForTag(tag) != null) return;	// Tag already exists
	
	// Create the LI element for the tag
	LIElement liElement = DOM.clone(BASE_TAG_ELEM,	// a simple LI	
							   		true)			// deep cloning
							 .cast();
	// Set the span text
	liElement.getChild(0)	// span
					.getChild(1)	// span text	(child(0) is the image)
						.setNodeValue(tag.getCaption());

	// Physical attach.
	if (position == this.getTagCount()) {
		_tagsContainerULElement.appendChild(liElement);
	} else {
		LIElement beforeLIElem = _tagsContainerULElement.getChild(position).cast();
		_tagsContainerULElement.insertBefore(liElement,
								 		   beforeLIElem);
	}
	// Logical attach.
	if (_tags == null) _tags = new LinkedHashMap<T,LIElement>();
	_insertMapEntryAt(_tags,
					  tag,liElement,
					  position);
	
	// Nofify observers
	_observableDelegate.notifyObserversAboutChildAddition(tag);
}
 
开发者ID:opendata-euskadi,项目名称:r01fb,代码行数:39,代码来源:TagList.java


示例20: removeTag

import com.google.gwt.dom.client.LIElement; //导入依赖的package包/类
/**
 * Removes a tag
 * @param tag
 */
public void removeTag(final T tag) {
	LIElement tagLIElem = _elementForTag(tag);
	if (tagLIElem == null) return;

	// Physical detach the li from it's parent ul.
	_tagsContainerULElement.removeChild(tagLIElem);

	// Logical detach.
	_tags.remove(tag);
	
	// Nofify observers
	_observableDelegate.notifyObserversAboutChildRemoval(tag);
}
 
开发者ID:opendata-euskadi,项目名称:r01fb,代码行数:18,代码来源:TagList.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ControlPoint类代码示例发布时间:2022-05-22
下一篇:
Java ReturnNode类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap