本文整理汇总了Java中com.google.gwt.user.client.ui.HasText.setText方法的典型用法代码示例。如果您正苦于以下问题:Java HasText.setText方法的具体用法?Java HasText.setText怎么用?Java HasText.setText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.user.client.ui.HasText
的用法示例。
在下文中一共展示了HasText.setText方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateChecksum
import com.google.gwt.user.client.ui.HasText; //导入方法依赖的package包/类
private void updateChecksum(UIObject uiObject, DataMap dataMap) {
UIObject component = getComponentByName(uiObject, DataContainerGVO.QAFE_CHECKSUM);
if (component != null) {
int checksum = 0;
for (Map.Entry<String, DataContainerGVO> field : dataMap.entrySet()) {
if (!isMetaData(field.getKey())) {
Object value = field.getValue().createType();
checksum += QAMLUtil.calculateChecksum(field.getKey(), value);
}
}
if (component instanceof HasText) {
HasText hasText = (HasText)component;
hasText.setText(String.valueOf(checksum));
}
}
}
示例2: validate
import com.google.gwt.user.client.ui.HasText; //导入方法依赖的package包/类
public static boolean validate(String url, HasText errorWidget) {
if(url != null && url.trim().length() > 0) {
try {
UrlParser.parse(url.trim());
return true;
} catch(Exception e) {
if(errorWidget != null) {
errorWidget.setText(e.getMessage());
}
}
}
return false;
}
示例3: handleValueAttribute
import com.google.gwt.user.client.ui.HasText; //导入方法依赖的package包/类
private void handleValueAttribute(TextFieldGVO gvo, UIObject uiObject) {
String value = gvo.getValue();
if ((value != null) && (value.length() > 0)) {
if (uiObject instanceof HasData) {
HasData hasData = (HasData)uiObject;
hasData.setData(value, SetValueGVO.ACTION_ADD, null);
} else if (uiObject instanceof HasText) {
HasText hasText = (HasText)uiObject;
String oldValue = hasText.getText();
hasText.setText(value);
doDataChange(gvo, uiObject, oldValue, hasText.getText());
}
}
}
示例4: handleDisplayName
import com.google.gwt.user.client.ui.HasText; //导入方法依赖的package包/类
private void handleDisplayName(UIObject uiObject, BuiltInComponentGVO builtInComponentGVO,
String value) {
if (uiObject instanceof HasDataGridMethods) {
HasDataGridMethods hasDataGridMethods = (HasDataGridMethods)uiObject;
String uuid = builtInComponentGVO.getComponentIdUUID();
if (uuid != null) {
boolean containsColumn = uuid.contains(".");
if (containsColumn) {
String columnId = uuid.replaceFirst(".+\\.", "").replaceFirst("\\|.+", "");
hasDataGridMethods.setColumnLabel(columnId, value);
}
}
} else if (uiObject instanceof PushButton) {
((PushButton)uiObject).getUpFace().setText(value);
((PushButton)uiObject).getDownFace().setText(value);
} else if (uiObject instanceof HasText) {
HasText t = (HasText)uiObject;
t.setText(value);
} else if (uiObject instanceof VerticalPanel) {
VerticalPanel vp = (VerticalPanel)uiObject;
Widget tabPanelWidget = vp.getParent().getParent().getParent();
if (tabPanelWidget instanceof TabPanel) {
TabPanel tp = (TabPanel)tabPanelWidget;
TabBar tb = tp.getTabBar();
int tabCount =tp.getWidgetCount();
for (int i=0;i < tabCount;i++){
Widget w = tp.getWidget(i);
if (w == vp){
tb.setTabText(i, value);
}
}
}
} else if (uiObject instanceof QWindowPanel) {
QWindowPanel p = (QWindowPanel) uiObject;
p.setCaption(value);
}
}
示例5: copy
import com.google.gwt.user.client.ui.HasText; //导入方法依赖的package包/类
private void copy(CopyGVO copyGVO, UIObject sender, String appId, String windowId, String eventSessionId) {
String toKey = generateId(copyGVO.getTo(), windowId, appId, eventSessionId);
String fromKey = generateId(copyGVO.getFrom(), windowId, appId, eventSessionId);
List<UIObject> uiObjectsFrom = getUIObjects(fromKey);
if (uiObjectsFrom == null) {
return;
}
List<UIObject> uiObjectsTo = getUIObjects(toKey);
if (uiObjectsTo == null) {
return;
}
if (uiObjectsTo.size()==uiObjectsFrom.size()){
for (int i=0;i<uiObjectsTo.size();i++){
UIObject uiObjectFrom = uiObjectsFrom.get(i);
UIObject uiObjectTo = uiObjectsTo.get(i);
if (uiObjectFrom instanceof HasText) {
HasText hasTextFrom = (HasText) uiObjectFrom;
String fromValue = hasTextFrom.getText();
if (uiObjectTo instanceof HasText) {
HasText hasTextTo = (HasText) uiObjectTo;
hasTextTo.setText(fromValue);
}
}
}
}
}
示例6: execute
import com.google.gwt.user.client.ui.HasText; //导入方法依赖的package包/类
public void execute(BuiltInFunctionGVO builtInFunction) {
if (builtInFunction instanceof CopyGVO) {
CopyGVO copy = (CopyGVO) builtInFunction;
List<UIObject> uiObjectsFrom = null;
if (copy.getFromGVO().getComponentIdUUID() != null) {
uiObjectsFrom = RendererHelper.getComponent(copy.getFromGVO().getComponentIdUUID());
} else {
uiObjectsFrom = RendererHelper.getNamedComponent(copy.getFromGVO().getComponentName());
}
List<UIObject> uiObjectsTo = null;
if (copy.getToGVO().getComponentIdUUID() != null) {
uiObjectsTo = RendererHelper.getComponent(copy.getToGVO().getComponentIdUUID());
} else {
uiObjectsTo = RendererHelper.getNamedComponent(copy.getToGVO().getComponentName());
}
if (uiObjectsTo != null && uiObjectsFrom != null) {
if (uiObjectsTo.size()==uiObjectsFrom.size()){
for (int i=0;i<uiObjectsTo.size();i++){
UIObject uiObjectFrom = uiObjectsFrom.get(i);
UIObject uiObjectTo = uiObjectsTo.get(i);
if (uiObjectFrom instanceof HasText) {
HasText hasTextFrom = (HasText) uiObjectFrom;
String fromValue = hasTextFrom.getText();
if (uiObjectTo instanceof HasText) {
HasText hasTextTo = (HasText) uiObjectTo;
hasTextTo.setText(fromValue);
}
}
}
}
}
}
FunctionsExecutor.setProcessedBuiltIn(true);
}