本文整理了Java中com.google.gwt.user.client.Element.getPropertyObject()
方法的一些代码示例,展示了Element.getPropertyObject()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Element.getPropertyObject()
方法的具体详情如下:
包路径:com.google.gwt.user.client.Element
类名称:Element
方法名:getPropertyObject
暂无
代码示例来源:origin: errai/errai
@SuppressWarnings("unchecked")
@Override
public T getValue() {
final String inputType = getElement().getPropertyString("type");
final Class<?> valueType = getValueClassForInputType(inputType);
if (Boolean.class.equals(valueType)) {
return (T) (Boolean) getElement().getPropertyBoolean("checked");
}
else if (String.class.equals(valueType)) {
final Object rawValue = getElement().getPropertyObject("value");
return (T) (rawValue != null ? rawValue : "");
}
else {
throw new RuntimeException("Unrecognized input element type [" + inputType + "]");
}
}
代码示例来源:origin: org.jboss.errai/errai-common
@SuppressWarnings("unchecked")
@Override
public T getValue() {
final String inputType = getElement().getPropertyString("type");
final Class<?> valueType = getValueClassForInputType(inputType);
if (Boolean.class.equals(valueType)) {
return (T) (Boolean) getElement().getPropertyBoolean("checked");
}
else if (String.class.equals(valueType)) {
final Object rawValue = getElement().getPropertyObject("value");
return (T) (rawValue != null ? rawValue : "");
}
else {
throw new RuntimeException("Unrecognized input element type [" + inputType + "]");
}
}
代码示例来源:origin: sk.seges.acris/acris-binding
private static Object getSelectedItem(ListBox list) {
assert list != null;
int index = list.getSelectedIndex();
Object model = list.getElement().getPropertyObject("model");
if (model instanceof ListBindingManager) {
ListBindingManager lbm = (ListBindingManager) model;
if (index != -1) {
return lbm.getElement(index);
} else {
return null;
}
} else {
return index;
}
}
代码示例来源:origin: fr.lteconsulting/hexa.core
public String getButtonText( Object obj )
{
for( int i = 0; i < panel.getWidgetCount(); i++ )
{
Button b = (Button) panel.getWidget( i );
if( b.getElement().getPropertyObject( "object" ) == obj )
return b.getText();
}
return null;
}
}
代码示例来源:origin: ltearno/hexa.tools
public void setButtonText( Object obj, String text )
{
for( int i = 0; i < panel.getWidgetCount(); i++ )
{
Button b = (Button) panel.getWidget( i );
if( b.getElement().getPropertyObject( "object" ) == obj )
b.setText( text );
}
}
代码示例来源:origin: fr.lteconsulting/hexa.core
public void setEnabled( Object obj, boolean fEnabled )
{
for( int i = 0; i < panel.getWidgetCount(); i++ )
{
Button b = (Button) panel.getWidget( i );
if( b.getElement().getPropertyObject( "object" ) == obj )
b.setEnabled( fEnabled );
}
}
代码示例来源:origin: fr.lteconsulting/hexa.core
public void setButtonText( Object obj, String text )
{
for( int i = 0; i < panel.getWidgetCount(); i++ )
{
Button b = (Button) panel.getWidget( i );
if( b.getElement().getPropertyObject( "object" ) == obj )
b.setText( text );
}
}
代码示例来源:origin: ltearno/hexa.tools
public String getButtonText( Object obj )
{
for( int i = 0; i < panel.getWidgetCount(); i++ )
{
Button b = (Button) panel.getWidget( i );
if( b.getElement().getPropertyObject( "object" ) == obj )
return b.getText();
}
return null;
}
}
代码示例来源:origin: ltearno/hexa.tools
public void setEnabled( Object obj, boolean fEnabled )
{
for( int i = 0; i < panel.getWidgetCount(); i++ )
{
Button b = (Button) panel.getWidget( i );
if( b.getElement().getPropertyObject( "object" ) == obj )
b.setEnabled( fEnabled );
}
}
代码示例来源:origin: sk.seges.acris/acris-binding
private static void setSelectedItem(ListBox list, Object item) {
assert list != null;
Object model = list.getElement().getPropertyObject("model");
if (model instanceof ListBindingManager) {
ListBindingManager lbm = (ListBindingManager) model;
list.setSelectedIndex(getEqualItemIndex(lbm.getElements(), item));
} else {
list.setSelectedIndex((Integer) item);
}
}
代码示例来源:origin: fr.lteconsulting/hexa.core
public void selectButton( Object obj )
{
for( int i = 0; i < panel.getWidgetCount(); i++ )
{
Button b = (Button) panel.getWidget( i );
if( b.getElement().getPropertyObject( "object" ) == obj )
b.addStyleName( "Ribbon-selected" );
else
b.removeStyleName( "Ribbon-selected" );
}
}
代码示例来源:origin: sk.seges.acris/acris-binding
private static List<Object> getSelectedItems(ListBox list) {
assert list != null;
List<Object> elements = new ArrayList<Object>();
if (list.getSelectedIndex() == -1) {
return elements;
}
Object model = list.getElement().getPropertyObject("model");
if (model instanceof ListBindingManager) {
ListBindingManager lbm = (ListBindingManager) model;
for (int i = 0, n = list.getItemCount(); i < n; ++i) {
if (list.isItemSelected(i)) {
elements.add(lbm.getElement(i));
}
}
} else {
for (int i = 0, n = list.getItemCount(); i < n; ++i) {
if (list.isItemSelected(i)) {
elements.add(i);
}
}
}
return elements;
}
代码示例来源:origin: ltearno/hexa.tools
public void selectButton( Object obj )
{
for( int i = 0; i < panel.getWidgetCount(); i++ )
{
Button b = (Button) panel.getWidget( i );
if( b.getElement().getPropertyObject( "object" ) == obj )
b.addStyleName( "Ribbon-selected" );
else
b.removeStyleName( "Ribbon-selected" );
}
}
代码示例来源:origin: sk.seges.acris/acris-binding
private static void setSelectedItems(ListBox list, List<Object> indexes) {
assert list != null;
Object model = list.getElement().getPropertyObject("model");
if (model instanceof ListBindingManager) {
ListBindingManager lbm = (ListBindingManager) model;
for (Object index : indexes) {
list.setSelectedIndex(getEqualItemIndex(lbm.getElements(), index));
}
} else {
for (Object index : indexes) {
list.setItemSelected((Integer) index, true);
}
}
}
内容来源于网络,如有侵权,请联系作者删除!