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


Java SimplePanel.setStylePrimaryName方法代码示例

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


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

示例1: MockBall

import com.google.gwt.user.client.ui.SimplePanel; //导入方法依赖的package包/类
/**
 * Creates a new MockBall component.
 *
 * @param editor  editor of source file the component belongs to
 */
public MockBall(SimpleEditor editor) {
  super(editor, TYPE, images.ball());

  // Initialize mock ball UI
  ballWidget = new SimplePanel();
  ballWidget.setStylePrimaryName("ode-SimpleMockComponent");

  // Create an appropriately sized ball
  canvas = new GWTCanvas(diameter, diameter);
  canvas.setPixelSize(diameter, diameter);
  canvas.setBackgroundColor(GWTCanvas.TRANSPARENT);
  fillCircle();
  ballWidget.setWidget(canvas);

  initComponent(ballWidget);
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:22,代码来源:MockBall.java

示例2: Thumb

import com.google.gwt.user.client.ui.SimplePanel; //导入方法依赖的package包/类
public Thumb() {
	visibleThumb = new SimplePanel();
	Element visibleElem = visibleThumb.getElement();
	Element touchElem = getElement();
	
	visibleThumb.setStylePrimaryName(THUMB_CLASS_NAME);
	
	BrowserUtils.setStyleAttributeAllBrowsers(visibleElem, "boxSizing", "border-box");
	BrowserUtils.setStyleAttributeAllBrowsers(touchElem, "boxSizing", "border-box");

	this.setWidget(visibleThumb);
	
	if (!isPassive)
	{
		visibleThumb.addStyleName(INTERACTIVE_CLASS_NAME);
	}
}
 
开发者ID:openremote,项目名称:WebConsole,代码行数:18,代码来源:SliderComponent.java

示例3: setNodeWidget

import com.google.gwt.user.client.ui.SimplePanel; //导入方法依赖的package包/类
public void setNodeWidget(Widget nodeWidget) {
    this.nodeWidget = nodeWidget;

    addStyleName(CLASSNAME);

    nodeCaptionDiv = DOM.createDiv();
    nodeCaptionDiv.setPropertyString("className", CLASSNAME + "-caption");

    Element wrapper = DOM.createDiv();
    nodeCaptionSpan = DOM.createSpan();
    DOM.appendChild(getElement(), nodeCaptionDiv);
    DOM.appendChild(nodeCaptionDiv, wrapper);
    DOM.appendChild(wrapper, nodeCaptionSpan);

    if (BrowserInfo.get().isOpera()) {
        /*
         * Focus the caption div of the node to get keyboard navigation
         * to work without scrolling up or down when focusing a node.
         */
        nodeCaptionDiv.setTabIndex(-1);
    }

    FlowPanel nodeContent = new FlowPanel();
    nodeContent.setStylePrimaryName(CLASSNAME + "-content");
    setWidget(nodeContent);

    nodeWidgetRoot = new SimplePanel();
    nodeWidgetRoot.setStylePrimaryName(CLASSNAME + "-widget");
    nodeWidgetRoot.setWidget(nodeWidget);
    nodeContent.add(nodeWidgetRoot);

    childNodeContainer = new FlowPanel();
    childNodeContainer.setStyleName(CLASSNAME + "-children");
    nodeContent.add(childNodeContainer);
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:36,代码来源:CubaWidgetsTreeWidget.java

示例4: MockVideoPlayer

import com.google.gwt.user.client.ui.SimplePanel; //导入方法依赖的package包/类
/**
 * Creates a new MockVideoPlayer component.
 *
 * @param editor  editor of source file the component belongs to
 */
public MockVideoPlayer(SimpleEditor editor) {
  super(editor, TYPE, images.videoplayer());

  // Initialize mock video UI
  videoPlayerWidget = new SimplePanel();
  videoPlayerWidget.setStylePrimaryName("ode-SimpleMockComponent");
  videoPlayerWidget.setWidget(getIconImage());
  initComponent(videoPlayerWidget);
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:15,代码来源:MockVideoPlayer.java

示例5: MockWrapper

import com.google.gwt.user.client.ui.SimplePanel; //导入方法依赖的package包/类
MockWrapper(SimpleEditor editor, String type, ImageResource icon) {
  super(editor, type, icon);

  // Initialize wrapper UI
  wrapper = new SimplePanel();
  wrapper.setStylePrimaryName("ode-SimpleMockComponent");
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:8,代码来源:MockWrapper.java

示例6: createLabelPanel

import com.google.gwt.user.client.ui.SimplePanel; //导入方法依赖的package包/类
private void createLabelPanel() {
  panelForItem =new SimplePanel();
  panelForItem.setStylePrimaryName("listViewItemStyle");
  panelForItem.setSize(ComponentConstants.LISTVIEW_PREFERRED_WIDTH + "px",
      ComponentConstants.LISTVIEW_PREFERRED_HEIGHT + "px");
  panelForItem.add(labelInItem);
  listViewWidget.add(panelForItem);
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:9,代码来源:MockListView.java

示例7: MockSlider

import com.google.gwt.user.client.ui.SimplePanel; //导入方法依赖的package包/类
/**
 * Creates a new MockSlider component.
 *
 * @param editor editor of source file the component belongs to
 */
public MockSlider(SimpleEditor editor) {
  super(editor, TYPE, images.slider());

  // Initialize mock slider UI
  sliderWidget = new SimplePanel();
  sliderWidget.setStylePrimaryName("ode-SimpleMockComponent");

  sliderWidget.setWidget(getIconImage());

  initComponent(sliderWidget);
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:17,代码来源:MockSlider.java

示例8: MockWebViewer

import com.google.gwt.user.client.ui.SimplePanel; //导入方法依赖的package包/类
/**
 * Creates a new MockWebViewer component.
 *
 * @param editor  editor of source file the component belongs to
 */
public MockWebViewer(SimpleEditor editor) {
  super(editor, TYPE, images.webviewer());

  // Initialize mock WebViewer UI
  SimplePanel webViewerWidget = new SimplePanel();
  webViewerWidget.setStylePrimaryName("ode-SimpleMockContainer");
  // TODO(halabelson): Center vertically as well as horizontally
  webViewerWidget.addStyleDependentName("centerContents");
  webViewerWidget.setWidget(largeImage);
  initComponent(webViewerWidget);
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:17,代码来源:MockWebViewer.java

示例9: TabBarItemComponent

import com.google.gwt.user.client.ui.SimplePanel; //导入方法依赖的package包/类
public TabBarItemComponent(TabBarItem item, EnumSystemTabItemType systemTabType) {
	this.item = item;
	this.systemTabType = systemTabType;
	setStylePrimaryName(TAB_ITEM_CLASS_NAME);
	TabImage tabImage = item.getImage();
	setHeight("100%");
	setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
	boolean hasText = false;
	this.addStyleName(INTERACTIVE_CLASS_NAME);
	
	// Check if we have text
	if (item.getName() != null && !item.getName().equals("")) {
		hasText = true;
	}
	
	// Add Image
	if (tabImage != null) {
		boolean isSystemImage = false;
		if (tabImage.getSystemImage() != null && tabImage.getSystemImage()) isSystemImage = true;
		int tabImageSize = hasText ? (TAB_BAR_HEIGHT - IMAGE_PADDING_TOP - TAB_TEXT_HEIGHT) : (TAB_BAR_HEIGHT - IMAGE_PADDING_TOP);
		imageComponent = new SimplePanel();
		imageComponent.setStylePrimaryName(TAB_IMAGE_CLASS_NAME);
		imageComponent.setWidth("100%");
		imageComponent.setHeight(tabImageSize + "px");
		String marginStr = hasText ? IMAGE_PADDING_TOP + "px 0 0 0" : IMAGE_PADDING_TOP + "px 0";
		DOM.setStyleAttribute(imageComponent.getElement(), "margin", marginStr);
		Element elem = imageComponent.getElement();
		
		String imagePath = "";
		if (isSystemImage) {
			imagePath = BrowserUtils.getSystemImageDir() + tabImage.getSrc();
		} else {
			imagePath = WebConsole.getConsoleUnit().getControllerService().getController().getResourcesUrl() + tabImage.getSrc();
		}
		
		DOM.setStyleAttribute(elem, "backgroundImage", "url(" + imagePath + ")");
		DOM.setStyleAttribute(elem, "backgroundRepeat", "no-repeat");
		DOM.setStyleAttribute(elem, "backgroundPosition", "center center");
		DOM.setStyleAttribute(elem, "backgroundColor", "transparent");
		DOM.setStyleAttribute(elem, "backgroundSize", "contain");
		DOM.setStyleAttribute(elem, "border", "none");
		this.add(imageComponent);
		hasImage = true;
	}
	
	// Add Text
	if (item.getName() != null && !item.getName().equals("")) {
		int lineHeight = hasImage ? TAB_TEXT_HEIGHT : TAB_BAR_HEIGHT;

		nameComponent = new Label();
		nameComponent.setText(item.getName());
		nameComponent.setWidth("100%");
		nameComponent.setStylePrimaryName(TAB_TEXT_CLASS_NAME);
		DOM.setStyleAttribute(nameComponent.getElement(), "lineHeight", lineHeight + "px");
		this.add(nameComponent);
		hasText = true;
	}
}
 
开发者ID:openremote,项目名称:WebConsole,代码行数:59,代码来源:TabBarComponent.java


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