本文整理汇总了Java中com.google.gwt.user.client.ui.HasName类的典型用法代码示例。如果您正苦于以下问题:Java HasName类的具体用法?Java HasName怎么用?Java HasName使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
HasName类属于com.google.gwt.user.client.ui包,在下文中一共展示了HasName类的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: addFieldWithLabel
import com.google.gwt.user.client.ui.HasName; //导入依赖的package包/类
public void addFieldWithLabel(Widget w, String id, String label, String... styles)
{
// Prepend form ID for uniqueness
id = formId + "_" + id;
// Create HTML DIV for each field
FlowPanel div = new FlowPanel();
div.getElement().setId("div_" + id);
if (w instanceof HasName)
{
((HasName) w).setName(id);
}
w.getElement().setId(id);
if (label != null)
{
div.add(createLabel(id, label));
}
div.add(w);
for (String styleName : styles)
{
div.addStyleName(styleName);
}
contentPanel.add(div);
}
开发者ID:turbomanage,项目名称:listmaker,代码行数:24,代码来源:FormBuilder.java
示例2: checkName
import com.google.gwt.user.client.ui.HasName; //导入依赖的package包/类
@Override
public <T extends UIObject & HasName> void checkName(T button) {
final String name = "name";
final Element label = button.getElement();
final InputElement input = InputElement.as(label.getFirstChildElement());
button.setName(name);
assertEquals(name, button.getName());
assertEquals(name, input.getName());
}
开发者ID:gwtbootstrap3,项目名称:gwtbootstrap3,代码行数:10,代码来源:InputToggleButtonGwt.java
示例3: onSelection
import com.google.gwt.user.client.ui.HasName; //导入依赖的package包/类
/**
* @see com.google.gwt.event.logical.shared.SelectionHandler#onSelection(com.google.gwt.event.logical.shared.SelectionEvent)
*/
@Override
public void onSelection(SelectionEvent<TreeItem> event) {
if ( (view != null) && (event != null) ) {
Object source = event.getSource();
// Only proceed if the source was from the same panel
if ( (source != null) && (source instanceof HasName) ) {
String sourceName = ((HasName) source).getName();
if ( view.getName().equalsIgnoreCase(sourceName) ) {
TextBox breadcrumbs = view.getBreadcrumbs();
TreeItem selectedItem = event.getSelectedItem();
if ( selectedItem != null ) {
String selectedItemText = selectedItem.getText();
// Only bother to update the bread crumbs if the
// user
// has
// selected an item that has actually loaded
if ( !selectedItemText.equalsIgnoreCase(DatasetWidget.LOADING) ) {
// Update bread crumbs by walking the meta data
// categories GUI tree already in memory
TreeItem parentItem = selectedItem.getParentItem();
if ( parentItem != null ) {
// First clear bread crumbs so events fire
// even
// when there is no change in
// breadcrumbsText
// characters, but set boolean fireEvents to
// false to avoid unnecessary event firing.
breadcrumbs.setValue("", false);
String breadcrumbsText = getBreadcrumbsText(parentItem);
breadcrumbs.setValue(breadcrumbsText, true);
}
}
}
}
}
}
}
开发者ID:NOAA-PMEL,项目名称:LAS,代码行数:41,代码来源:VariableMetadataActivity.java
示例4: onValueChange
import com.google.gwt.user.client.ui.HasName; //导入依赖的package包/类
@Override
public void onValueChange (ValueChangeEvent<String> event) {
String name = null;
if (event.getSource() instanceof HasName) {
name = ((HasName) event.getSource()).getName();
}
if (name != null) {
propertyLookup.get(name).value = event.getValue();
}
}
开发者ID:billy1380,项目名称:blogwt,代码行数:12,代码来源:PropertiesPage.java
示例5: add
import com.google.gwt.user.client.ui.HasName; //导入依赖的package包/类
public void add(HasValue<Boolean> aItem) {
if (!grouped.contains(aItem)) {
if (aItem instanceof HasName) {
((HasName) aItem).setName(groupName);
}
groupedHandlers.put(aItem, aItem.addValueChangeHandler(this));
grouped.add(aItem);
}
}
开发者ID:marat-gainullin,项目名称:platypus-js,代码行数:10,代码来源:RadioGroup.java
示例6: remove
import com.google.gwt.user.client.ui.HasName; //导入依赖的package包/类
public boolean remove(HasValue<Boolean> aItem) {
HandlerRegistration handler = groupedHandlers.get(aItem);
if (handler != null) {
handler.removeHandler();
}
if (aItem instanceof HasName) {
((HasName) aItem).setName("");
}
return grouped.remove(aItem);
}
开发者ID:marat-gainullin,项目名称:platypus-js,代码行数:11,代码来源:RadioGroup.java
示例7: clear
import com.google.gwt.user.client.ui.HasName; //导入依赖的package包/类
public void clear() {
for (HandlerRegistration handler : groupedHandlers.values()) {
if (handler != null) {
handler.removeHandler();
}
}
groupedHandlers.clear();
for (HasValue<Boolean> item : grouped) {
if (item instanceof HasName) {
((HasName) item).setName("");
}
}
grouped.clear();
}
开发者ID:marat-gainullin,项目名称:platypus-js,代码行数:15,代码来源:RadioGroup.java
示例8: setJsName
import com.google.gwt.user.client.ui.HasName; //导入依赖的package包/类
@Override
public void setJsName(String aValue) {
name = aValue;
if(decorated instanceof HasName){
((HasName)decorated).setName(aValue);
}
}
开发者ID:marat-gainullin,项目名称:platypus-js,代码行数:8,代码来源:ModelDecoratorBox.java
示例9: setName
import com.google.gwt.user.client.ui.HasName; //导入依赖的package包/类
/**
* Convenience method that will set the name of all child widgets that can have a name
*
* @param name Name of group
* @see #add(com.google.gwt.user.client.ui.Widget)
*/
@Override
public void setName(final String name) {
this.name = name;
if (name == null) {
return;
}
for (final Widget w : getChildren()) {
if (w instanceof HasName) {
((HasName) w).setName(name);
}
}
}
开发者ID:gwtbootstrap3,项目名称:gwtbootstrap3,代码行数:21,代码来源:AbstractButtonGroup.java
示例10: add
import com.google.gwt.user.client.ui.HasName; //导入依赖的package包/类
@Override
public void add(final Widget w) {
super.add(w);
if (name == null) {
return;
}
// Add group's name to child widgets that can have a name
if (w instanceof HasName) {
((HasName) w).setName(name);
}
}
开发者ID:gwtbootstrap3,项目名称:gwtbootstrap3,代码行数:14,代码来源:AbstractButtonGroup.java
示例11: onSelection
import com.google.gwt.user.client.ui.HasName; //导入依赖的package包/类
@Override
public void onSelection(SelectionEvent<TreeItem> event) {
if ( (view != null) && (event != null) ) {
Object source = event.getSource();
// Only proceed if the source was from the same panel or from
// the comparePanel
if ( (source != null) && (source instanceof HasName) ) {
String sourceName = ((HasName) source).getName();
String viewName = view.getName();
if ( ((viewName != null) && viewName.equalsIgnoreCase(sourceName)) || CONSTANTS.comparePanelName().equalsIgnoreCase(sourceName) ) { //$NON-NLS-1$
// Get variables from the tree
TreeItem selectedItem = event.getSelectedItem();
if ( selectedItem != null ) {
Object userObject = selectedItem.getUserObject();
if ( (userObject != null) && (userObject instanceof VariableSerializable) ) {
VariableSerializable selectedVariable = (VariableSerializable) userObject;
// Find all siblings if any
Vector<VariableSerializable> variables = new Vector<VariableSerializable>();
// Vector<TreeItem> children = new
// Vector<TreeItem>();
int selectedIndex = 0;
TreeItem parent = selectedItem.getParentItem();
if ( parent == null ) {
// There are no reachable siblings without a
// parent, so just use the selectedVariable
// and leave selectedIndex == 0
variables.add(selectedVariable);
// children.add(selectedItem);
} else {
for ( int i = 0; i < parent.getChildCount(); i++ ) {
TreeItem child = parent.getChild(i);
userObject = child.getUserObject();
if ( (userObject != null) && (userObject instanceof VariableSerializable) ) {
variables.add((VariableSerializable) userObject);
// children.add(child);
}
}
selectedIndex = variables.indexOf(selectedVariable);
}
// Add the variables to the view
view.setVariables(variables, selectedIndex);
}
}
}
}
}
}
开发者ID:NOAA-PMEL,项目名称:LAS,代码行数:48,代码来源:MultiVariableSelectorActivity.java
示例12: getName
import com.google.gwt.user.client.ui.HasName; //导入依赖的package包/类
public String getName() {
if (uiObject instanceof HasName){
return ((HasName)uiObject).getName();
}
return null;
}
开发者ID:qafedev,项目名称:qafe-platform,代码行数:7,代码来源:LabeledTextAreaFieldWidget.java
示例13: setName
import com.google.gwt.user.client.ui.HasName; //导入依赖的package包/类
public void setName(String arg0) {
if (uiObject instanceof HasName){
((HasName)uiObject).setName(arg0);
}
}
开发者ID:qafedev,项目名称:qafe-platform,代码行数:6,代码来源:LabeledTextAreaFieldWidget.java
示例14: getName
import com.google.gwt.user.client.ui.HasName; //导入依赖的package包/类
public String getName() {
if (textbox instanceof HasName) {
return ((HasName)textbox).getName();
}
return null;
}
开发者ID:qafedev,项目名称:qafe-platform,代码行数:7,代码来源:LabeledTextFieldWidget.java
示例15: setName
import com.google.gwt.user.client.ui.HasName; //导入依赖的package包/类
public void setName(String arg0) {
if (textbox instanceof HasName) {
((HasName)textbox).setName(arg0);
}
}
开发者ID:qafedev,项目名称:qafe-platform,代码行数:6,代码来源:LabeledTextFieldWidget.java
示例16: checkName
import com.google.gwt.user.client.ui.HasName; //导入依赖的package包/类
public <T extends UIObject & HasName> void checkName(T button) {
final String name = "name";
button.setName(name);
assertEquals(name, button.getName());
}
开发者ID:gwtbootstrap3,项目名称:gwtbootstrap3,代码行数:6,代码来源:BaseGwt.java
注:本文中的com.google.gwt.user.client.ui.HasName类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论