当前位置: 首页>>代码示例>>Java>>正文


Java UIDL.getIntAttribute方法代码示例

本文整理汇总了Java中com.vaadin.client.UIDL.getIntAttribute方法的典型用法代码示例。如果您正苦于以下问题:Java UIDL.getIntAttribute方法的具体用法?Java UIDL.getIntAttribute怎么用?Java UIDL.getIntAttribute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.vaadin.client.UIDL的用法示例。


在下文中一共展示了UIDL.getIntAttribute方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: 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

示例2: 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

示例3: 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

示例4: 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

示例5: createNode

import com.vaadin.client.UIDL; //导入方法依赖的package包/类
@Override
protected VTree.TreeNode createNode(UIDL childUidl) {
    if (childUidl.hasAttribute("widgetIndex")) {
        int widgetIndex = childUidl.getIntAttribute("widgetIndex");
        if (widgetIndex < nodeWidgets.size()) {
            ComponentConnector componentConnector = getChildComponents().get(widgetIndex);

            CubaWidgetsTreeWidget.WidgetTreeNode treeNode = getWidget().new WidgetTreeNode();
            treeNode.setNodeWidget(componentConnector.getWidget());
            return treeNode;
        }
    }
    // all branches should return instance of same TreeNode class
    return getWidget().new WidgetTreeNode();
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:16,代码来源:CubaWidgetsTreeConnector.java

示例6: updateFromUIDL

import com.vaadin.client.UIDL; //导入方法依赖的package包/类
@Override
public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
	getWidget().filterChangeEventMode = uidl
			.getStringAttribute(AsyncFilterComboBoxConstants.ATTR_FILTERCHANGE_EVENTMODE);
	getWidget().filterChangeEventTimeout = uidl
			.getIntAttribute(AsyncFilterComboBoxConstants.ATTR_FILTERCHANGE_TIMEOUT);
	super.updateFromUIDL(uidl, client);
}
 
开发者ID:zero11it,项目名称:vaadin-asyncfiltercombobox,代码行数:9,代码来源:AsyncFilterComboBoxConnector.java

示例7: updateFromUIDL

import com.vaadin.client.UIDL; //导入方法依赖的package包/类
@Override
public void updateFromUIDL(final UIDL uidl, ApplicationConnection client) {
   getWidget().client = client;
   getWidget().id = uidl.getId();

   if (uidl.hasAttribute("fontName")) {
      RichTextArea.FontSize fontSize = null;

      if (uidl.hasAttribute("fontSize")) {
         int fontSizeValue = uidl.getIntAttribute("fontSize");
         for (RichTextArea.FontSize fontSizesConstant : fontSizesConstants) {
            if (fontSizesConstant.getNumber() == fontSizeValue) {
               fontSize = fontSizesConstant;
            }
         }
      }

      getWidget().setFont(uidl.getStringAttribute("fontName"), fontSize);
   }

   if (uidl.hasAttribute("insertHtml")) {
      getWidget().insertHtml(uidl.getStringAttribute("insertHtml"));
   }

   if (uidl.hasVariable("text")) {
      String newValue = uidl.getStringVariable("text");
      if (!SharedUtil.equals(newValue, cachedValue)) {
         getWidget().setValue(newValue);
         cachedValue = newValue;
      }
   }

   if (!isRealUpdate(uidl)) {
      return;
   }

   getWidget().setEnabled(isEnabled());
   getWidget().setReadOnly(isReadOnly());
   getWidget().immediate = getState().immediate;
   int newMaxLength = uidl.hasAttribute("maxLength") ? uidl
           .getIntAttribute("maxLength") : -1;
   if (newMaxLength >= 0) {
      if (getWidget().maxLength == -1) {
         getWidget().keyPressHandler = getWidget().rta
                 .addKeyPressHandler(getWidget());
      }
      getWidget().maxLength = newMaxLength;
   } else if (getWidget().maxLength != -1) {
      getWidget().getElement().setAttribute("maxlength", "");
      getWidget().maxLength = -1;
      getWidget().keyPressHandler.removeHandler();
   }

   if (uidl.hasAttribute("selectAll")) {
      getWidget().selectAll();
   }

}
 
开发者ID:vkazhdan,项目名称:vaadin-crichtextarea,代码行数:59,代码来源:CRichTextAreaConnector.java


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