本文整理汇总了Java中com.vaadin.client.UIDL类的典型用法代码示例。如果您正苦于以下问题:Java UIDL类的具体用法?Java UIDL怎么用?Java UIDL使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UIDL类属于com.vaadin.client包,在下文中一共展示了UIDL类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: updateFromUIDL
import com.vaadin.client.UIDL; //导入依赖的package包/类
@Override
public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
super.updateFromUIDL(uidl, client);
getWidget().updateTextState();
// We may have actions attached to this text field
if (uidl.getChildCount() > 0) {
final int cnt = uidl.getChildCount();
for (int i = 0; i < cnt; i++) {
UIDL childUidl = uidl.getChildUIDL(i);
if (childUidl.getTag().equals("actions")) {
if (getWidget().getShortcutActionHandler() == null) {
getWidget().setShortcutActionHandler(new ShortcutActionHandler(uidl.getId(), client));
}
getWidget().getShortcutActionHandler().updateActionMap(childUidl);
}
}
}
}
开发者ID:cuba-platform,项目名称:cuba,代码行数:21,代码来源:CubaDateFieldConnector.java
示例2: updateFromUIDL
import com.vaadin.client.UIDL; //导入依赖的package包/类
public void updateFromUIDL(UIDL uidl) {
if (getElement().hasChildNodes()) {
getElement().removeAllChildren();
}
aligns = tableWidget.getHead().getColumnAlignments();
if (uidl.getChildCount() > 0) {
final Element table = DOM.createTable();
table.setAttribute("cellpadding", "0");
table.setAttribute("cellspacing", "0");
final Element tBody = DOM.createTBody();
tr = DOM.createTR();
tr.setClassName(tableWidget.getStylePrimaryName() + "-arow-row");
addCellsFromUIDL(uidl);
tBody.appendChild(tr);
table.appendChild(tBody);
getElement().appendChild(table);
}
initialized = getElement().hasChildNodes();
}
开发者ID:cuba-platform,项目名称:cuba,代码行数:27,代码来源:TableAggregationRow.java
示例3: updateFromUIDL
import com.vaadin.client.UIDL; //导入依赖的package包/类
@Override
public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
if (uidl.hasVariable("groupColumns")) {
getWidget().updateGroupColumns(uidl.getStringArrayVariableAsSet("groupColumns"));
} else {
getWidget().updateGroupColumns(null);
}
VScrollTable.VScrollTableBody.VScrollTableRow row = getWidget().focusedRow;
super.updateFromUIDL(uidl, client);
if (row instanceof CubaGroupTableWidget.CubaGroupTableBody.CubaGroupTableGroupRow) {
getWidget().setRowFocus(
getWidget().getRenderedGroupRowByKey(
((CubaGroupTableWidget.CubaGroupTableBody.CubaGroupTableGroupRow) row).getGroupKey()
)
);
}
}
开发者ID:cuba-platform,项目名称:cuba,代码行数:21,代码来源:CubaGroupTableConnector.java
示例4: updateFromUIDL
import com.vaadin.client.UIDL; //导入依赖的package包/类
@Override
public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
super.updateFromUIDL(uidl, client);
// We may have actions attached to this text field
if (uidl.getChildCount() > 0) {
final int cnt = uidl.getChildCount();
for (int i = 0; i < cnt; i++) {
UIDL childUidl = uidl.getChildUIDL(i);
if (childUidl.getTag().equals("actions")) {
if (getWidget().getShortcutActionHandler() == null) {
getWidget().setShortcutActionHandler(new ShortcutActionHandler(uidl.getId(), client));
}
getWidget().getShortcutActionHandler().updateActionMap(childUidl);
}
}
}
}
开发者ID:cuba-platform,项目名称:cuba,代码行数:19,代码来源:CubaTextFieldConnector.java
示例5: accept
import com.vaadin.client.UIDL; //导入依赖的package包/类
@Override
// Exception squid:S1166 - Hide origin exception
// Exception squid:S2221 - This code is trans-coded to JavaScript, hence
// Exception semantics changes
@SuppressWarnings({ "squid:S1166", "squid:S2221" })
protected boolean accept(VDragEvent drag, UIDL configuration) {
try {
String component = drag.getTransferable().getDragSource().getWidget().getElement().getId();
int c = configuration.getIntAttribute(COMPONENT_COUNT);
String mode = configuration.getStringAttribute(MODE);
for (int dragSourceIndex = 0; dragSourceIndex < c; dragSourceIndex++) {
String requiredPid = configuration.getStringAttribute(COMPONENT + dragSourceIndex);
if ((STRICT_MODE.equals(mode) && component.equals(requiredPid))
|| (PREFIX_MODE.equals(mode) && component.startsWith(requiredPid))) {
return true;
}
}
} catch (Exception e) {
// log and continue
LOGGER.log(Level.SEVERE, "Error verifying drop target: " + e.getLocalizedMessage());
}
return false;
}
开发者ID:eclipse,项目名称:hawkbit,代码行数:26,代码来源:ItemIdClientCriterion.java
示例6: hideDropTargetHints
import com.vaadin.client.UIDL; //导入依赖的package包/类
/**
* Hides the highlighted drop target hints.
*
* @param configuration
* for the accept criterion to retrieve the drop target hints.
*/
// Exception squid:S1166 - Hide origin exception
// Exception squid:S2221 - This code is trans-coded to JavaScript, hence
// Exception semantics changes
@SuppressWarnings({ "squid:S1166", "squid:S2221" })
void hideDropTargetHints(UIDL configuration) {
int totalDropTargetHintsCount = configuration.getIntAttribute(DROP_AREA_CONFIG_COUNT);
for (int dropAreaIndex = 0; dropAreaIndex < totalDropTargetHintsCount; dropAreaIndex++) {
try {
String dropArea = configuration.getStringAttribute(DROP_AREA_CONFIG + dropAreaIndex);
Element hideHintFor = Document.get().getElementById(dropArea);
if (hideHintFor != null) {
hideHintFor.removeClassName(ViewComponentClientCriterion.HINT_AREA_STYLE);
}
} catch (Exception e) {
// log and continue
LOGGER.log(Level.SEVERE, "Error highlighting valid drop targets: " + e.getLocalizedMessage());
}
}
}
开发者ID:eclipse,项目名称:hawkbit,代码行数:26,代码来源:ViewClientCriterion.java
示例7: isValidDragSource
import com.vaadin.client.UIDL; //导入依赖的package包/类
/**
* Checks if this accept criterion is responsible for the current drag
* source. Therefore the current drag source id has to start with the drag
* source id-prefix configured for the criterion.
*
* @param drag
* the current drag event holding the context.
* @param configuration
* for the accept criterion to retrieve the configured drag
* source id-prefix.
* @return <code>true</code> if the criterion is responsible for the current
* drag source, otherwise <code>false</code>.
*/
// Exception squid:S1166 - Hide origin exception
// Exception squid:S2221 - This code is trans-coded to JavaScript, hence
// Exception semantics changes
@SuppressWarnings({ "squid:S1166", "squid:S2221" })
boolean isValidDragSource(final VDragEvent drag, final UIDL configuration) {
try {
final String dragSource = drag.getTransferable().getDragSource().getWidget().getElement().getId();
final String dragSourcePrefix = configuration.getStringAttribute(DRAG_SOURCE);
if (dragSource.startsWith(dragSourcePrefix)) {
return true;
}
} catch (final Exception e) {
// log and continue
LOGGER.log(Level.SEVERE, "Error verifying drag source: " + e.getLocalizedMessage());
}
return false;
}
开发者ID:eclipse,项目名称:hawkbit,代码行数:32,代码来源:ViewComponentClientCriterion.java
示例8: showDropTargetHints
import com.vaadin.client.UIDL; //导入依赖的package包/类
/**
* Highlights the valid drop targets configured for the criterion.
*
* @param configuration
* for the accept criterion to retrieve the configured drop hint
* areas.
*/
// Exception squid:S1166 - Hide origin exception
// Exception squid:S2221 - This code is trans-coded to JavaScript, hence
// Exception semantics changes
// Exception squid:S2629 - not supported by GWT
@SuppressWarnings({ "squid:S1166", "squid:S2221", "squid:S2629" })
void showDropTargetHints(final UIDL configuration) {
final int dropAreaCount = configuration.getIntAttribute(DROP_AREA_COUNT);
for (int dropAreaIndex = 0; dropAreaIndex < dropAreaCount; dropAreaIndex++) {
try {
final String dropArea = configuration.getStringAttribute(DROP_AREA + dropAreaIndex);
LOGGER.log(Level.FINE, "Hint Area: " + dropArea);
final Element showHintFor = Document.get().getElementById(dropArea);
if (showHintFor != null) {
showHintFor.addClassName(HINT_AREA_STYLE);
}
} catch (final Exception e) {
// log and continue
LOGGER.log(Level.SEVERE, "Error highlighting drop targets: " + e.getLocalizedMessage());
}
}
}
开发者ID:eclipse,项目名称:hawkbit,代码行数:31,代码来源:ViewComponentClientCriterion.java
示例9: isValidDropTarget
import com.vaadin.client.UIDL; //导入依赖的package包/类
/**
* Checks if the current drop location is a valid drop target for the
* criterion. Therefore the current drop location id has to start with one
* of the drop target id-prefixes configured for the criterion.
*
* @param configuration
* for the accept criterion to retrieve the configured drop
* target id-prefixes.
* @return <code>true</code> if the current drop location is a valid drop
* target for the criterion, otherwise <code>false</code>.
*/
// Exception squid:S1166 - Hide origin exception
// Exception squid:S2221 - This code is trans-coded to JavaScript, hence
// Exception semantics changes
// Exception squid:S2629 - not supported by GWT
@SuppressWarnings({ "squid:S1166", "squid:S2221", "squid:S2629" })
boolean isValidDropTarget(final UIDL configuration) {
try {
final String dropTarget = VDragAndDropManager.get().getCurrentDropHandler().getConnector().getWidget()
.getElement().getId();
final int dropTargetCount = configuration.getIntAttribute(DROP_TARGET_COUNT);
for (int dropTargetIndex = 0; dropTargetIndex < dropTargetCount; dropTargetIndex++) {
final String dropTargetPrefix = configuration.getStringAttribute(DROP_TARGET + dropTargetIndex);
LOGGER.log(Level.FINE, "Drop Target: " + dropTargetPrefix);
if (dropTarget.startsWith(dropTargetPrefix)) {
return true;
}
}
} catch (final Exception e) {
// log and continue
LOGGER.log(Level.SEVERE, "Error verifying drop target: " + e.getLocalizedMessage());
}
return false;
}
开发者ID:eclipse,项目名称:hawkbit,代码行数:35,代码来源:ViewComponentClientCriterion.java
示例10: exceptionWhenProcessingDropTargetHintsDataStructure
import com.vaadin.client.UIDL; //导入依赖的package包/类
@Test
@Description("Exception occures when processing serialized data structure for preparing the drop targets to show.")
public void exceptionWhenProcessingDropTargetHintsDataStructure() {
final ViewComponentClientCriterion cut = new ViewComponentClientCriterion();
// prepare configuration:
final Document document = Document.get();
final UIDL uidl = GWT.create(UIDL.class);
when(uidl.getIntAttribute("cda")).thenReturn(2);
when(uidl.getStringAttribute("da0")).thenReturn("no-problem");
when(uidl.getStringAttribute("da1")).thenReturn("problem-bear");
doThrow(new RuntimeException()).when(uidl).getStringAttribute("da1");
// act
try {
cut.showDropTargetHints(uidl);
} catch (final RuntimeException re) {
fail("Exception is not re-thrown in order to continue with the loop");
}
// assure that no-problem was invoked anyway
verify(document).getElementById("no-problem");
// cross-check that problem-bear was never invoked
verify(document, Mockito.times(0)).getElementById("problem-bear");
}
开发者ID:eclipse,项目名称:hawkbit,代码行数:27,代码来源:ViewComponentClientCriterionTest.java
示例11: checkDragSourceWithValidId
import com.vaadin.client.UIDL; //导入依赖的package包/类
@Test
@Description("Verifies that drag source is valid for the configured prefix")
public void checkDragSourceWithValidId() {
final ViewComponentClientCriterion cut = new ViewComponentClientCriterion();
// prepare drag-event:
final String prefix = "this";
final String id = "thisId";
final VDragEvent dragEvent = CriterionTestHelper.createMockedVDragEvent(id);
// prepare configuration:
final UIDL uidl = GWT.create(UIDL.class);
when(uidl.getStringAttribute("ds")).thenReturn(prefix);
// act
final boolean result = cut.isValidDragSource(dragEvent, uidl);
// assure that drag source is valid: [thisId startsWith this]
assertThat(result).as("Expected: [" + id + " startsWith " + prefix + "].").isTrue();
}
开发者ID:eclipse,项目名称:hawkbit,代码行数:21,代码来源:ViewComponentClientCriterionTest.java
示例12: checkDragSourceWithInvalidId
import com.vaadin.client.UIDL; //导入依赖的package包/类
@Test
@Description("Verifies that drag source is not valid for the configured prefix")
public void checkDragSourceWithInvalidId() {
final ViewComponentClientCriterion cut = new ViewComponentClientCriterion();
// prepare drag-event:
final String prefix = "this";
final String id = "notThis";
final VDragEvent dragEvent = CriterionTestHelper.createMockedVDragEvent(id);
// prepare configuration:
final UIDL uidl = GWT.create(UIDL.class);
when(uidl.getStringAttribute("ds")).thenReturn(prefix);
// act
final boolean result = cut.isValidDragSource(dragEvent, uidl);
// assure that drag source is valid: [thisId !startsWith this]
assertThat(result).as("Expected: [" + id + " !startsWith " + prefix + "].").isFalse();
}
开发者ID:eclipse,项目名称:hawkbit,代码行数:21,代码来源:ViewComponentClientCriterionTest.java
示例13: exceptionWhenCheckingDragSource
import com.vaadin.client.UIDL; //导入依赖的package包/类
@Test
@Description("An exception occures while the drag source is validated against the configured prefix")
public void exceptionWhenCheckingDragSource() {
final ViewComponentClientCriterion cut = new ViewComponentClientCriterion();
// prepare drag-event:
final String prefix = "this";
final String id = "notThis";
final VDragEvent dragEvent = CriterionTestHelper.createMockedVDragEvent(id);
doThrow(new RuntimeException()).when(dragEvent).getTransferable();
// prepare configuration:
final UIDL uidl = GWT.create(UIDL.class);
when(uidl.getStringAttribute("ds")).thenReturn(prefix);
// act
Boolean result = null;
try {
result = cut.isValidDragSource(dragEvent, uidl);
} catch (final Exception ex) {
fail("Exception is not re-thrown");
}
// assure that in case of exception the drag source is declared invalid
assertThat(result).as("Expected: Invalid drag if exception occures.").isFalse();
}
开发者ID:eclipse,项目名称:hawkbit,代码行数:28,代码来源:ViewComponentClientCriterionTest.java
示例14: successfulCheckValidDropTarget
import com.vaadin.client.UIDL; //导入依赖的package包/类
@Test
@Description("Successfully checks if the current drop location is in the list of valid drop targets")
public void successfulCheckValidDropTarget() {
final ViewComponentClientCriterion cut = new ViewComponentClientCriterion();
// prepare drag and drop manager:
final String dtargetid = "dropTarget1Id";
final VDropHandler dropHandler = CriterionTestHelper.createMockedVDropHandler(dtargetid);
when(VDragAndDropManager.get().getCurrentDropHandler()).thenReturn(dropHandler);
// prepare configuration:
final UIDL uidl = createUidlWithThreeDropTargets();
// act
final boolean result = cut.isValidDropTarget(uidl);
// assure drop target is valid: [dropTarget1Id startsWith dropTarget1]
assertThat(result).as("Expected: [" + dtargetid + " startsWith dropTarget1].").isTrue();
}
开发者ID:eclipse,项目名称:hawkbit,代码行数:20,代码来源:ViewComponentClientCriterionTest.java
示例15: failedCheckValidDropTarget
import com.vaadin.client.UIDL; //导入依赖的package包/类
@Test
@Description("Failed check if the current drop location is in the list of valid drop targets")
public void failedCheckValidDropTarget() {
final ViewComponentClientCriterion cut = new ViewComponentClientCriterion();
// prepare drag and drop manager:
final String dtargetid = "no-hit";
final VDropHandler dropHandler = CriterionTestHelper.createMockedVDropHandler(dtargetid);
when(VDragAndDropManager.get().getCurrentDropHandler()).thenReturn(dropHandler);
// prepare configuration:
final UIDL uidl = createUidlWithThreeDropTargets();
// act
final boolean result = cut.isValidDropTarget(uidl);
// assure "no-hit" does not match [dropTarget0,dropTarget1,dropTarget2]
assertThat(result).as("Expected: [" + dtargetid + " does not match one of the list entries].").isFalse();
}
开发者ID:eclipse,项目名称:hawkbit,代码行数:20,代码来源:ViewComponentClientCriterionTest.java
示例16: exceptionWhenCheckingValidDropTarget
import com.vaadin.client.UIDL; //导入依赖的package包/类
@Test
@Description("An exception occures while the current drop location is validated against the list of valid drop target prefixes")
public void exceptionWhenCheckingValidDropTarget() {
final ViewComponentClientCriterion cut = new ViewComponentClientCriterion();
// prepare drag and drop manager:
final String dtargetid = "no-hit";
final VDropHandler dropHandler = CriterionTestHelper.createMockedVDropHandler(dtargetid);
when(VDragAndDropManager.get().getCurrentDropHandler()).thenReturn(dropHandler);
doThrow(new RuntimeException()).when(dropHandler).getConnector();
// prepare configuration:
final UIDL uidl = createUidlWithThreeDropTargets();
// act
Boolean result = null;
try {
result = cut.isValidDropTarget(uidl);
} catch (final Exception ex) {
fail("Exception is not re-thrown");
}
// assure that in case of exception the drop target is declared invalid
assertThat(result).as("Expected: Invalid drop if exception occures.").isFalse();
}
开发者ID:eclipse,项目名称:hawkbit,代码行数:26,代码来源:ViewComponentClientCriterionTest.java
示例17: id
import com.vaadin.client.UIDL; //导入依赖的package包/类
@Test
@Description("Verifies that drag source is not valid for the configured id (strict mode)")
public void noMatchInStrictMode() {
final ItemIdClientCriterion cut = new ItemIdClientCriterion();
// prepare drag-event:
final String testId = "thisId";
final VDragEvent dragEvent = CriterionTestHelper.createMockedVDragEvent(testId);
// prepare configuration:
final UIDL uidl = GWT.create(UIDL.class);
final String configuredId = "component0";
final String id = "this";
when(uidl.getStringAttribute(configuredId)).thenReturn(id);
final String configuredMode = "m";
final String strictMode = "s";
when(uidl.getStringAttribute(configuredMode)).thenReturn(strictMode);
final String count = "c";
when(uidl.getIntAttribute(count)).thenReturn(1);
// act
final boolean result = cut.accept(dragEvent, uidl);
// verify that in strict mode: [thisId !equals this]
assertThat(result).as("Expected: [" + id + " !equals " + testId + "].").isFalse();
}
开发者ID:eclipse,项目名称:hawkbit,代码行数:27,代码来源:ItemIdClientCriterionTest.java
示例18: updateFromUIDL
import com.vaadin.client.UIDL; //导入依赖的package包/类
@Override
public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
super.updateFromUIDL(uidl, client);
// replace VPanel class names
Tools.replaceClassNames(getWidget().captionNode, VPanel.CLASSNAME, CubaTokenListLabelWidget.CLASSNAME);
Tools.replaceClassNames(getWidget().contentNode, VPanel.CLASSNAME, CubaTokenListLabelWidget.CLASSNAME);
Tools.replaceClassNames(getWidget().bottomDecoration, VPanel.CLASSNAME, CubaTokenListLabelWidget.CLASSNAME);
Tools.replaceClassNames(getWidget().getElement(), VPanel.CLASSNAME, CubaTokenListLabelWidget.CLASSNAME);
}
开发者ID:cuba-platform,项目名称:cuba,代码行数:11,代码来源:CubaTokenListLabelConnector.java
示例19: addCellsFromUIDL
import com.vaadin.client.UIDL; //导入依赖的package包/类
protected void addCellsFromUIDL(UIDL uidl) {
int colIndex = 0;
final Iterator cells = uidl.getChildIterator();
while (cells.hasNext() && colIndex < tableWidget.getVisibleColOrder().length) {
String columnId = tableWidget.getVisibleColOrder()[colIndex];
if (addSpecificCell(columnId, colIndex)) {
colIndex++;
continue;
}
final Object cell = cells.next();
String style = "";
if (uidl.hasAttribute("style-" + columnId)) {
style = uidl.getStringAttribute("style-" + columnId);
}
boolean sorted = tableWidget.getHead().getHeaderCell(colIndex).isSorted();
if (cell instanceof String) {
addCell((String) cell, aligns[colIndex], style, sorted);
}
final String colKey = tableWidget.getColKeyByIndex(colIndex);
int colWidth;
if ((colWidth = tableWidget.getColWidth(colKey)) > -1) {
tableWidget.setColWidth(colIndex, colWidth, false);
}
colIndex++;
}
}
开发者ID:cuba-platform,项目名称:cuba,代码行数:34,代码来源:TableAggregationRow.java
示例20: getItemId
import com.vaadin.client.UIDL; //导入依赖的package包/类
@Override
protected String getItemId(UIDL uidl) {
if (uidl.hasAttribute("tid")) {
return uidl.getStringAttribute("tid");
}
return null;
}
开发者ID:cuba-platform,项目名称:cuba,代码行数:9,代码来源:CubaMenuBarConnector.java
注:本文中的com.vaadin.client.UIDL类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论