當前位置: 首頁>>代碼示例>>Java>>正文


Java UIObject類代碼示例

本文整理匯總了Java中com.google.gwt.user.client.ui.UIObject的典型用法代碼示例。如果您正苦於以下問題:Java UIObject類的具體用法?Java UIObject怎麽用?Java UIObject使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


UIObject類屬於com.google.gwt.user.client.ui包,在下文中一共展示了UIObject類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: position

import com.google.gwt.user.client.ui.UIObject; //導入依賴的package包/類
private void position(final UIObject relativeObject, int offsetWidth, int offsetHeight) {
    int textBoxOffsetWidth = relativeObject.getOffsetWidth();
    int offsetWidthDiff = offsetWidth - textBoxOffsetWidth;
    int left = relativeObject.getAbsoluteLeft();
    if (offsetWidthDiff > 0) {
        int windowRight = Window.getClientWidth() + Window.getScrollLeft();
        int windowLeft = Window.getScrollLeft();
        int distanceToWindowRight = windowRight - left;
        int distanceFromWindowLeft = left - windowLeft;
        if (distanceToWindowRight < offsetWidth && distanceFromWindowLeft >= offsetWidthDiff) {
            left -= offsetWidthDiff;
        }
    }
    int top = relativeObject.getAbsoluteTop();
    int windowTop = Window.getScrollTop();
    int windowBottom = Window.getScrollTop() + Window.getClientHeight();
    int distanceFromWindowTop = top - windowTop;
    int distanceToWindowBottom = windowBottom - (top + relativeObject.getOffsetHeight());
    if (distanceToWindowBottom < offsetHeight && distanceFromWindowTop >= offsetHeight) {
        top -= offsetHeight;
    } else {
        top += relativeObject.getOffsetHeight();
    }
    setPopupPosition(left, top);
}
 
開發者ID:Jenner4S,項目名稱:unitimes,代碼行數:26,代碼來源:FilterBox.java

示例2: UploadFormPopup

import com.google.gwt.user.client.ui.UIObject; //導入依賴的package包/類
/**
 * Creates an upload popup.
 */
public UploadFormPopup() {
  form = BINDER.createAndBindUi(this);

  PopupChrome chrome = PopupChromeFactory.createPopupChrome();
  chrome.enableTitleBar();
  popup = PopupFactory.createPopup(null, new CenterPopupPositioner(), chrome, false);
  popup.getTitleBar().setTitleText("Upload attachment");
  popup.add(form);

  iframe = Document.get().createIFrameElement();
  iframe.setName("_uploadform" + iframeId++);
  // HACK(danilatos): Prevent browser from caching due to whatever reason
  iframe.setSrc("/uploadform?nocache=" + Duration.currentTimeMillis());
  form.getElement().setAttribute("target", iframe.getName());

  onloadRegistration =
      DomHelper.registerEventHandler(iframe, "load", new JavaScriptEventListener() {
        @Override
        public void onJavaScriptEvent(String name, Event event) {
          onIframeLoad();
        }
      });
  UIObject.setVisible(iframe, false);
}
 
開發者ID:ArloJamesBarnes,項目名稱:walkaround,代碼行數:28,代碼來源:UploadFormPopup.java

示例3: setupWavePanel

import com.google.gwt.user.client.ui.UIObject; //導入依賴的package包/類
private void setupWavePanel() {
  // Hide the frame until waves start getting opened
  UIObject.setVisible(waveFrame.getElement(), false);

  Document.get().getElementById(SIGNOUT_ELEMENT_ID).setInnerText(messages.signout());

  // Handles opening waves.
  ClientEvents.get().addWaveSelectionEventHandler(new WaveSelectionEventHandler() {

    @Override
    public void onSelection(WaveRef waveRef, boolean ctrlDown, boolean altDown) {
      // Ctrl or Alt isn't pressed => open wave with diffs
      closeAndOpenWave(new OpenWaveData(waveRef, false, null, !ctrlDown && !altDown));
    }
  });

  waveFrame.getElement().setId(WAVE_ELEMENT_ID);
}
 
開發者ID:jorkey,項目名稱:Wiab.pro,代碼行數:19,代碼來源:WebClient.java

示例4: checkEnabled

import com.google.gwt.user.client.ui.UIObject; //導入依賴的package包/類
protected <H extends UIObject & HasEnabled> void checkEnabled(HasEnabled widget, H target, boolean checkElement) {
    final Element element = target.getElement();
    if(checkElement) {
        assertFalse(element.hasClassName(CssName.DISABLED));
        assertFalse(element.hasAttribute(CssName.DISABLED));
    }
    widget.setEnabled(true);
    if(checkElement) {
        assertFalse(element.hasClassName(CssName.DISABLED));
        assertFalse(element.hasAttribute(CssName.DISABLED));
    }
    assertEquals(widget.isEnabled(), true);
    widget.setEnabled(false);
    if(checkElement) {
        assertTrue(element.hasClassName(CssName.DISABLED));
        assertTrue(element.hasAttribute(CssName.DISABLED));
    }
    assertEquals(target.isEnabled(), false);
}
 
開發者ID:GwtMaterialDesign,項目名稱:gwt-material,代碼行數:20,代碼來源:MaterialWidgetTestCase.java

示例5: renderChildren

import com.google.gwt.user.client.ui.UIObject; //導入依賴的package包/類
@SuppressWarnings("unchecked")
private void renderChildren() {
  elementsMap = new HashMap<>();
  CategoryRenderer categoryRenderer = category.getRenderer();
  for (Object o : category.getData()) {
    ListItem<?> element =
        ListItem.create(categoryRenderer, resources.defaultCategoriesListCss(), o);
    categoryRenderer.renderElement(element, o);
    elementsMap.put(o, element);
    if (element.getId().isEmpty()) {
      UIObject.ensureDebugId(element, "projectWizard-" + element.getInnerText());
    }
    container.getElement().appendChild(element);
  }
  if (elementsMap.isEmpty()) {
    expandControl.getStyle().setVisibility(Style.Visibility.HIDDEN);
  } else {
    expandControl.getStyle().setVisibility(Style.Visibility.VISIBLE);
  }
}
 
開發者ID:eclipse,項目名稱:che,代碼行數:21,代碼來源:CategoryNodeElement.java

示例6: BreakpointConfigurationViewImpl

import com.google.gwt.user.client.ui.UIObject; //導入依賴的package包/類
@Inject
public BreakpointConfigurationViewImpl(DebuggerLocalizationConstant locale) {
  Widget widget = uiBinder.createAndBindUi(this);

  this.setWidget(widget);
  this.setTitle(locale.breakpointConfigurationTitle());
  ensureDebugId("breakpoint-configuration-window");

  Button closeButton =
      createButton(
          locale.evaluateExpressionViewCloseButtonTitle(),
          UIObject.DEBUG_ID_PREFIX + "close-btn",
          clickEvent -> delegate.onCloseClicked());
  addButtonToFooter(closeButton);

  Button applyButton =
      createButton(
          locale.viewBreakpointConfigurationApplyButton(),
          UIObject.DEBUG_ID_PREFIX + "apply-btn",
          clickEvent -> delegate.onApplyClicked());
  addButtonToFooter(applyButton);
}
 
開發者ID:eclipse,項目名稱:che,代碼行數:23,代碼來源:BreakpointConfigurationViewImpl.java

示例7: setOpen

import com.google.gwt.user.client.ui.UIObject; //導入依賴的package包/類
void setOpen(boolean open) {
  if (open && info._revisionNumber() > 0 && !commentList.isEmpty()) {
    renderComments(commentList);
    commentList = Collections.emptyList();
  }
  setName(open);

  UIObject.setVisible(summary, !open);
  UIObject.setVisible(message, open);
  comments.setVisible(open && comments.getWidgetCount() > 0);
  if (open) {
    removeStyleName(style.closed());
  } else {
    addStyleName(style.closed());
  }
}
 
開發者ID:gerrit-review,項目名稱:gerrit,代碼行數:17,代碼來源:Message.java

示例8: addHashtag

import com.google.gwt.user.client.ui.UIObject; //導入依賴的package包/類
private void addHashtag(String hashtags) {
  ChangeApi.hashtags(project.get(), changeId.get())
      .post(
          PostInput.create(hashtags, null),
          new GerritCallback<JsArrayString>() {
            @Override
            public void onSuccess(JsArrayString result) {
              Gerrit.display(
                  PageLinks.toChange(project, psId.getParentKey(), String.valueOf(psId.get())));
            }

            @Override
            public void onFailure(Throwable err) {
              UIObject.setVisible(error, true);
              error.setInnerText(
                  err instanceof StatusCodeException
                      ? ((StatusCodeException) err).getEncodedResponse()
                      : err.getMessage());
              hashtagTextBox.setEnabled(true);
            }
          });
}
 
開發者ID:gerrit-review,項目名稱:gerrit,代碼行數:23,代碼來源:Hashtags.java

示例9: refresh

import com.google.gwt.user.client.ui.UIObject; //導入依賴的package包/類
public void refresh() {
    UIObject.setVisible(panel.contentNode, getState().isOpen());
    updateStyleName(panel);

    if (getState().isToggleIconEnabled()) {
        updateToggleIcon(getState().isOpen());
    }

    if (getState().isToggleEnabled()) {
        if (clickHandlerRegistration != null) {
            clickHandlerRegistration.removeHandler();
        }
        clickHandlerRegistration = panel.addDomHandler(toggleClickHandler, ClickEvent.getType());
    } else {
        if (clickHandlerRegistration != null) {
            clickHandlerRegistration.removeHandler();
        }
        clickHandlerRegistration = panel.addDomHandler(toggleDisabledClickHandler, ClickEvent.getType());
    }
}
 
開發者ID:mouellet,項目名稱:vaadin-stackpanel,代碼行數:21,代碼來源:StackPanelConnector.java

示例10: complete

import com.google.gwt.user.client.ui.UIObject; //導入依賴的package包/類
/**
 * Complete the partially filled history item with the response data.
 *
 * @param response Response data.
 * @param timeMillis Time that execution took in milliseconds.
 * @param linkFactory Link factory that is used to generate hyperlink and menu links in the
 *        response view.
 */
public void complete(ApiResponse response, long timeMillis, PrettifierLinkFactory linkFactory) {
  executing.setVisible(false);
  wireContent.addStyleName(style.fadeIn());
  time.setInnerText("time to execute: " + timeMillis + " ms");
  statusDiv.setInnerText(response.getStatus() + " " + response.getStatusText());

  // Headers are hidden by default.
  UIObject.setVisible(responseHeadersDiv, false);
  responseHeadersDiv.setInnerText(getResponseHeadersString(response));
  try {
    JsonPrettifier.prettify(
        request.getService(), requestBodyDiv, request.getRequestBody(), linkFactory);
  } catch (JsonFormatException e) {
    // We should only be generating valid requests
    requestBodyDiv.add(new InlineLabel(request.getRequestBody()));
  }

  setResponseContent(request, response, realPathFragment, linkFactory);
}
 
開發者ID:showlowtech,項目名稱:google-apis-explorer,代碼行數:28,代碼來源:EmbeddedHistoryItemView.java

示例11: initSize

import com.google.gwt.user.client.ui.UIObject; //導入依賴的package包/類
protected void initSize(UIObject widget, String width, String height, String uuid, String parent, String context) {
    if (widget == null) {
        return;
    }
    if (!QAMLUtil.isEmpty(width)) {
        if (!width.startsWith("-")) {
            // Width is not negative
            if (QAMLUtil.isNumber(width)) {
                width = width + QAMLConstants.UNIT;
            }
            widget.setWidth(width);
        }
    }
    if (!QAMLUtil.isEmpty(height)) {
        if (!height.startsWith("-")) {
            // Height is not negative
            if (QAMLUtil.isNumber(height)) {
                height = height + QAMLConstants.UNIT;
            }
            widget.setHeight(height);
        }
    }
    if ("0".equals(width) && "0".equals(height)) {
        widget.setVisible(false);
    }
}
 
開發者ID:qafedev,項目名稱:qafe-platform,代碼行數:27,代碼來源:AbstractComponentRenderer.java

示例12: toggle

import com.google.gwt.user.client.ui.UIObject; //導入依賴的package包/類
private void toggle(ToggleGVO toggleGVO, WindowActivity activity) {
    List<BuiltInComponentGVO> builtInComponents = toggleGVO.getComponents();
    if (builtInComponents == null) {
        return;
    }
    for (BuiltInComponentGVO builtInComponentGVO : builtInComponents) {
        List<UIObject> widgets = getWidgets(builtInComponentGVO, activity);			
        if (QAMLUtil.isEmpty(widgets)) {
            continue;
        }
        for (UIObject widget : widgets) {
            if (widget instanceof HasVisibility) {
                HasVisibility hasVisibility = (HasVisibility)widget;
                boolean visible = hasVisibility.isVisible();
                hasVisibility.setVisible(!visible);
            }
        }
    }
}
 
開發者ID:qafedev,項目名稱:qafe-platform,代碼行數:20,代碼來源:ToggleExecute.java

示例13: onDetach

import com.google.gwt.user.client.ui.UIObject; //導入依賴的package包/類
@Override
public void onDetach(){		
    if(resizeRegistration != null) {
        resizeRegistration.removeHandler();
    }
    
    // This is to clear all existing components from repository. showPanel.hide() will implicitly call this method.
    List<UIObject> uiObjects = ComponentRepository.getInstance().getComponent(this.getId());
    if(uiObjects != null){
        UIObject uiObject = uiObjects.iterator().next();
        if (uiObject instanceof ShowPanelComponent) {
            ShowPanelComponent showPanel = (ShowPanelComponent)uiObject;				
            Widget innerComponent = showPanel.getWidget();
            if (innerComponent != null) {
                ComponentRepository.getInstance().clearContainerComponent(innerComponent);
            }				
        }
    }
    
    ComponentRepository.getInstance().remove(this.getId());
    
    removeMaskForActivePanel();
    super.onDetach();
}
 
開發者ID:qafedev,項目名稱:qafe-platform,代碼行數:25,代碼來源:ShowPanelComponent.java

示例14: processChildren

import com.google.gwt.user.client.ui.UIObject; //導入依賴的package包/類
void processChildren(TreeItem rootItem, TreeItemGVO[] children, String uuid, String parent, String context) {
        if (children != null) {
            for (int i = 0; i < children.length; i++) {
                TreeItemGVO componentGVO = children[i];
                UIObject uiObject = renderChildComponent(componentGVO, null, uuid, parent, context, null);
//				if (uiObject instanceof QTreeItem) {
//					QTreeItem treeItem = (QTreeItem) uiObject;
//					treeItem.setState(componentGVO.getExpand().booleanValue());
//					rootItem.addItem(treeItem);
//					// TODO set Tree
//					RendererHelper.fillIn(componentGVO, treeItem.getLabel(), uuid, parent, context);
//					processChildren(treeItem, componentGVO.getChildren(), uuid, parent, context);
//				}
                RendererHelper.fillIn(componentGVO, uiObject, uuid, parent, context);
            }
        }
    }
 
開發者ID:qafedev,項目名稱:qafe-platform,代碼行數:18,代碼來源:TreeRenderer.java

示例15: setPanel

import com.google.gwt.user.client.ui.UIObject; //導入依賴的package包/類
private void setPanel(SetPanelGVO setPanelGVO, String appId, String windowId, String eventSessionId) {
    String panelRefId = setPanelGVO.getTarget();
       String key = RendererHelper.generateId(panelRefId, windowId, appId);
       List<UIObject> uiObjects = ComponentRepository.getInstance().getComponent(key);
       if ((uiObjects != null) && (uiObjects.size() > 0)) {
       	UIObject uiObject = uiObjects.get(0);
       	if (uiObject instanceof SimplePanel) {
            SimplePanel simplePanel = (SimplePanel) uiObject;
            Widget innerComponent = simplePanel.getWidget();
            if (innerComponent != null) {
                ComponentRepository.getInstance().clearContainerComponent(innerComponent);
            }
            ComponentGVO panelDefinitionGVO = setPanelGVO.getSrc();
            UIObject panelDefinition = AnyComponentRenderer.getInstance().render(panelDefinitionGVO, eventSessionId, windowId, appId);
            if (panelDefinition instanceof Widget) {
                simplePanel.setWidget((Widget)panelDefinition);
            }
        }
       }
}
 
開發者ID:qafedev,項目名稱:qafe-platform,代碼行數:21,代碼來源:SetPanelHandler.java


注:本文中的com.google.gwt.user.client.ui.UIObject類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。