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


Java SimplePanel.setStyleName方法代码示例

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


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

示例1: init

import com.google.gwt.user.client.ui.SimplePanel; //导入方法依赖的package包/类
@Override
protected void init(){
	grid = new DescribeGrid(labarr, "data");
	verticalPanel.add(grid);
	grid.addStyleName("bda-descgrid-savedata");
	savebtn.setStyleName("bda-descgrid-savedata-submitbtn");
	SimplePanel simPanel = new SimplePanel();
	simPanel.add( savebtn );
	simPanel.setStyleName("bda-descgrid-savedata-simpanel");
	verticalPanel.add(simPanel);
	savebtn.addClickHandler(new ClickHandler() {
		@Override
		public void onClick(ClickEvent event) {
			dbController.submitSaveDataset2DB(panel,SaveDatasetPanel.this, dataset,grid);
		}
	});
}
 
开发者ID:ICT-BDA,项目名称:EasyML,代码行数:18,代码来源:SaveDatasetPanel.java

示例2: addCategoryToSmileyCategoryPanel

import com.google.gwt.user.client.ui.SimplePanel; //导入方法依赖的package包/类
/**
 * Adds the given smiles category to the tab panel
 * @param smileCategoriesTabPanel the tab panel to add the category to
 * @param categoryInfo the smiley category info
 */
private void addCategoryToSmileyCategoryPanel( final DecoratedTabPanel smileCategoriesTabPanel,
											   final SmileyHandler.SmileyCategoryInfo categoryInfo ) {
	//Initialize the scroll panel
	final SimplePanel scrollPanel = new SimplePanel();
	scrollPanel.setStyleName( CommonResourcesContainer.SMILEY_LIST_SCROLL_PANEL_STYLE );
	
	//Add proper tab header
	if( categoryInfo.minGold > 0 ) {
		final PriceTagWidget minMoneyTitle = new PriceTagWidget( SmileyHandlerUI.getCategoryTitle( categoryInfo.categoryID ),
															     categoryInfo.minGold, true, false );
		smileCategoriesTabPanel.add( scrollPanel, minMoneyTitle );
		final int index = smileCategoriesTabPanel.getWidgetIndex( scrollPanel );
		pricedCategoryTitles.put( index, minMoneyTitle);
	} else {
		smileCategoriesTabPanel.add( scrollPanel, SmileyHandlerUI.getCategoryTitle( categoryInfo.categoryID ) );
	}
	
	//Remember the category
	tabsToCategories.put( smileCategoriesTabPanel.getWidgetIndex( scrollPanel ), categoryInfo );
}
 
开发者ID:ivan-zapreev,项目名称:x-cure-chat,代码行数:26,代码来源:SmileSelectionDialogUI.java

示例3: createIconWidget

import com.google.gwt.user.client.ui.SimplePanel; //导入方法依赖的package包/类
/**
 * Create icon wrapper that contains an icon.
 *
 * @return {@link SimplePanel} as icon wrapper
 */
private SimplePanel createIconWidget() {
  SimplePanel iconWrapper = new SimplePanel();
  iconWrapper.setStyleName(resources.notificationCss().notificationPopupIconWrapper());
  iconWrapper.ensureDebugId(ICON_DBG_ID + notification.getId());
  return iconWrapper;
}
 
开发者ID:eclipse,项目名称:che,代码行数:12,代码来源:NotificationPopup.java

示例4: createCloseWidget

import com.google.gwt.user.client.ui.SimplePanel; //导入方法依赖的package包/类
/**
 * Create close icon widget that contains an close notification icon.
 *
 * @return {@link SimplePanel} as close icon wrapper
 */
private SimplePanel createCloseWidget() {
  SimplePanel closeWrapper = new SimplePanel();
  SVGImage closeImage = new SVGImage(resources.closeIcon());
  closeImage.addClickHandler(
      new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
          delegate.onClose(notification);
        }
      });
  closeWrapper.add(closeImage);
  closeWrapper.setStyleName(resources.notificationCss().notificationPopupCloseButtonWrapper());
  closeWrapper.ensureDebugId(CLOSE_ICON_DBG_ID + notification.getId());
  return closeWrapper;
}
 
开发者ID:eclipse,项目名称:che,代码行数:21,代码来源:NotificationPopup.java

示例5: createCloseWidget

import com.google.gwt.user.client.ui.SimplePanel; //导入方法依赖的package包/类
/**
 * Create close icon widget that contains an close notification icon.
 *
 * @return {@link SimplePanel} as close icon wrapper
 */
private SimplePanel createCloseWidget() {
  SimplePanel closeWrapper = new SimplePanel();
  SVGImage closeImage = new SVGImage(resources.closeIcon());
  closeImage.addClickHandler(
      new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
          delegate.onClose(notification);
        }
      });
  closeWrapper.add(closeImage);
  closeWrapper.setStyleName(resources.notificationCss().notificationCloseButtonWrapper());
  closeImage.ensureDebugId(CLOSE_ICON_DBG_ID + notification.getId());
  return closeWrapper;
}
 
开发者ID:eclipse,项目名称:che,代码行数:21,代码来源:NotificationContainerItem.java

示例6: generateLegend

import com.google.gwt.user.client.ui.SimplePanel; //导入方法依赖的package包/类
protected void generateLegend(int i, String ras) {
	String c = "col" + i;
	HTMLPanel html = new HTMLPanel("<span id='" + c + "'></span>");
	SimplePanel p = new SimplePanel();
	p.setSize("20px", "20px");
	p.getElement().getStyle().setBackgroundColor(colorsArray[i]);
	p.setStyleName("colorBox");
	HorizontalPanel hp = new HorizontalPanel();
	hp.setStyleName("margin-bottom");
	hp.add(p);
	String htmlString = "<b>" + ras + "</b>";
	HTMLPanel htm = new HTMLPanel( htmlString );
	hp.add(htm);
	html.add(hp, c);
	legend.add(html);
}
 
开发者ID:RISCOSS,项目名称:riscoss-corporate,代码行数:17,代码来源:ComparisonPanel.java

示例7: generateIndicatorWidget

import com.google.gwt.user.client.ui.SimplePanel; //导入方法依赖的package包/类
protected Widget generateIndicatorWidget(JSONObject v) {
	VerticalPanel panel = new VerticalPanel();
	GaugeImage img = new GaugeImage();
	img.setEvidence( v.get( "p" ).isString().stringValue(), v.get( "m" ).isString().stringValue() );
	SimplePanel pp = new SimplePanel();
	pp.setWidget(img);
	pp.setStyleName("contentResultsTable");
	panel.add(pp);
	panel.add( new HTML( 
			"Exposure: <font color='red'>" + 
					v.get( "e" ).isObject().get( "e" ).isNumber().doubleValue() +
			"</font>") );
	panel.setStyleName("headerTable");
	panel.setHeight("100%");
	return panel;
}
 
开发者ID:RISCOSS,项目名称:riscoss-corporate,代码行数:17,代码来源:ComparisonPanel.java

示例8: getSizeWidget

import com.google.gwt.user.client.ui.SimplePanel; //导入方法依赖的package包/类
private static Widget getSizeWidget(ChangeInfo c) {
  int largeChangeSize = Gerrit.info().change().largeChange();
  int changedLines = c.insertions() + c.deletions();
  int p = 100;
  if (changedLines < largeChangeSize) {
    p = changedLines * 100 / largeChangeSize;
  }

  int width = Math.max(2, 70 * p / 100);
  int red = p >= 50 ? 255 : (int) Math.round((p) * 5.12);
  int green = p <= 50 ? 255 : (int) Math.round(256 - (p - 50) * 5.12);
  String bg = "#" + toHex(red) + toHex(green) + "00";

  SimplePanel panel = new SimplePanel();
  panel.setStyleName(Gerrit.RESOURCES.css().changeSize());
  panel.setWidth(width + "px");
  panel.getElement().getStyle().setBackgroundColor(bg);
  return panel;
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:20,代码来源:ChangeTable.java

示例9: prepareCanvas

import com.google.gwt.user.client.ui.SimplePanel; //导入方法依赖的package包/类
private Widget prepareCanvas() {
	canvas = Canvas.createIfSupported();
	if (canvas == null) {
		// TODO
		throw new RuntimeException("Canvas not supported!");
	}
	canvas.setTabIndex(0);

	final SimplePanel panel = new SimplePanel(canvas);
	panel.setStyleName("content");

	Window.addResizeHandler(e -> resizeCanvas());
	Scheduler.get().scheduleFinally(() -> resizeCanvas());
	return panel;
}
 
开发者ID:mateusz-matela,项目名称:djvu-html5,代码行数:16,代码来源:Djvu_html5.java

示例10: createTitleWidget

import com.google.gwt.user.client.ui.SimplePanel; //导入方法依赖的package包/类
/**
 * Create title widget that contains notification title.
 *
 * @return {@link SimplePanel} as title wrapper
 */
private SimplePanel createTitleWidget() {
  SimplePanel titleWrapper = new SimplePanel();
  Label titleLabel = new Label();
  titleWrapper.add(titleLabel);
  titleWrapper.setStyleName(resources.notificationCss().notificationPopupTitleWrapper());
  titleWrapper.ensureDebugId(TITLE_DBG_ID + notification.getId());
  return titleWrapper;
}
 
开发者ID:eclipse,项目名称:che,代码行数:14,代码来源:NotificationPopup.java

示例11: createIconWidget

import com.google.gwt.user.client.ui.SimplePanel; //导入方法依赖的package包/类
/**
 * Create icon wrapper that contains an icon.
 *
 * @return {@link SimplePanel} as icon wrapper
 */
private SimplePanel createIconWidget() {
  SimplePanel iconWrapper = new SimplePanel();
  iconWrapper.setStyleName(resources.notificationCss().notificationIconWrapper());
  iconWrapper.ensureDebugId(ICON_DBG_ID + notification.getId());
  return iconWrapper;
}
 
开发者ID:eclipse,项目名称:che,代码行数:12,代码来源:NotificationContainerItem.java

示例12: createContentWidget

import com.google.gwt.user.client.ui.SimplePanel; //导入方法依赖的package包/类
/**
 * Create message widget that contains notification message.
 *
 * @return {@link SimplePanel} as message wrapper
 */
private SimplePanel createContentWidget() {
  SimplePanel messageWrapper = new SimplePanel();
  Label messageLabel = new Label();
  messageWrapper.add(messageLabel);
  messageWrapper.setStyleName(resources.notificationCss().notificationMessageWrapper());
  messageWrapper.ensureDebugId(MESSAGE_WRAPPER_DBG_ID + notification.getId());
  return messageWrapper;
}
 
开发者ID:eclipse,项目名称:che,代码行数:14,代码来源:NotificationContainerItem.java

示例13: getCellTitle

import com.google.gwt.user.client.ui.SimplePanel; //导入方法依赖的package包/类
protected Widget getCellTitle() {
	if (iTitle == null) {
		SimpleForm form = new SimpleForm();
		form.removeStyleName("unitime-NotPrintableBottomLine");
		form.addRow(MESSAGES.propName(), new HTML(iCell.getName("<br>&nbsp;&nbsp;&nbsp;") +
				(iCell.hasProperty(Property.EventType) ? " (" + iCell.getProperty(Property.EventType, "") + ")"
				:iCell.hasProperty(Property.Owner) ? " (" + iCell.getProperty(Property.Owner, "") + ")" : "")
				));
		if (iCell.hasTime())
			form.addRow(MESSAGES.propTimeGridTime(), new HTML((iCell.hasDays() ? iCell.getDays() + " " : "") + iCell.getTime()));
		if (iCell.hasDate())
			form.addRow(MESSAGES.propTimeGridDate(), new HTML(iCell.getDate()));
		if (iCell.getNrRooms() > 0)
			form.addRow(MESSAGES.propTimeGridLocation(), new HTML(iCell.getRoom("<br>")));
		if (iCell.getNrInstructors() > 0)
			form.addRow(MESSAGES.propTimeGridInstructor(), new HTML(iCell.getInstructor("<br>")));
		if (iCell.hasProperty(Property.StudentConflicts))
			form.addRow(MESSAGES.propTimeGridStudentConflicts(), new HTML(
					MESSAGES.formatStudentConflicts(
							iCell.getProperty(Property.StudentConflicts, "0"),
							iCell.getProperty(Property.StudentConflictsCommitted, "0"),
							iCell.getProperty(Property.StudentConflictsDistance, "0"),
							iCell.getProperty(Property.StudentConflictsHard, "0"))));
		if (iCell.hasProperty(Property.TimePreference))
			form.addRow(MESSAGES.propTimeGridTimePreferences(), new HTML(iCell.getProperty(Property.TimePreference, "0")));
		if (iCell.hasProperty(Property.RoomPreference))
			form.addRow(MESSAGES.propTimeGridRoomPreferences(), new HTML(iCell.getProperty(Property.RoomPreference, "0")));
		if (iCell.hasProperty(Property.DistributionPreference))
			form.addRow(MESSAGES.propTimeGridDistributionPreferences(), new HTML(iCell.getProperty(Property.DistributionPreference, "0")));
		if (iCell.hasProperty(Property.InitialAssignment)) {
			String initial = iCell.getProperty(Property.InitialAssignment, "-");
			form.addRow(MESSAGES.propTimeGridInitialAssignment(), new HTML(("-".equals(initial) ? "<i>" + MESSAGES.initialAssignmentCurrent() + "</i>" : initial)));
		}
		if (iCell.hasProperty(Property.PerturbationPenalty))
			form.addRow(MESSAGES.propTimeGridPerturbationPenalty(), new HTML(iCell.getProperty(Property.PerturbationPenalty, "0")));
		if (iCell.hasProperty(Property.DepartmentBalance))
			form.addRow(MESSAGES.propTimeGridDepartmentBalance(), new HTML(iCell.getProperty(Property.DepartmentBalance, "0")));
		if (iCell.hasProperty(Property.NonConflictingPlacements))
			form.addRow(MESSAGES.propTimeGridNonConflictingPlacements(), new HTML(iCell.getProperty(Property.NonConflictingPlacements, "0")));
		SimplePanel panel = new SimplePanel(form);
		panel.setStyleName("unitime-RoomHint");
		iTitle = panel;
	}
	return iTitle;
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:46,代码来源:TimetableGrid.java

示例14: populateTitlePanel

import com.google.gwt.user.client.ui.SimplePanel; //导入方法依赖的package包/类
private void populateTitlePanel() {
	//Add the avatar panel to the message if needed
	final boolean isAvatarPanelNeeded = isAvatarTitlePanelNeeded();
	if( isAvatarPanelNeeded ) {
		//Add the sub-panel with the avatar
		VerticalPanel avatarTitlePanel = new VerticalPanel();
		avatarTitlePanel.setWidth("100%");
		avatarTitlePanel.setHorizontalAlignment( HasHorizontalAlignment.ALIGN_CENTER );
		avatarTitlePanel.setVerticalAlignment( HasVerticalAlignment.ALIGN_BOTTOM );
		avatarTitlePanel.addStyleName( CommonResourcesContainer.MESSAGE_AVATAR_TITLE_PANEL_STYLE );
		
		//Populate the panel, store the link to the avatar, if needed
		userAvatar = populateAvatarTitlePanel( avatarTitlePanel, messageData.senderData );
		
		//Put it into the message
		titlePanelTable.setWidget(0, 0, avatarTitlePanel );
		titlePanelTable.getCellFormatter().addStyleName(0, 0, CommonResourcesContainer.FORUM_MESSAGE_SUBJECT_DELIM_PANEL_STYLE );
	}
	
	//Add the subpanel with the title and other message info
	VerticalPanel titleVertPanel = new VerticalPanel();
	titleVertPanel.setHeight("100%");
	//In case of the avatar panel NOT needed this is the first cell in the row, otherwise it is the second cell
	titlePanelTable.setWidget(0, ( isAvatarPanelNeeded ? 1 : 0 ), titleVertPanel );
	titleVertPanel.setVerticalAlignment( HasVerticalAlignment.ALIGN_TOP );
	titleVertPanel.setHorizontalAlignment( HasHorizontalAlignment.ALIGN_LEFT );
	
	final Label messageSubjectField = new Label( getMessageSubjectFieldName() + ":" );
	messageSubjectField.setWordWrap( false );
	MessageTextToFlowPanel.addContentWidget( messageSubjectContent, messageSubjectField, true );
	final List<Widget> messageWidgets = SmileyHandlerUI.getMessageViewObject( messageData.messageTitle,
																			  ChatMessage.MAX_ONE_WORD_LENGTH, false );
	for( Widget w : messageWidgets ) {
		MessageTextToFlowPanel.addContentWidget( messageSubjectContent, w, true );
	}
	
	//Set the proper styles to the field and value labels
	setMessageSubjectFieldValueStyles( messageSubjectField, messageSubjectContent );
	titleVertPanel.setVerticalAlignment( HasVerticalAlignment.ALIGN_TOP );
	titleVertPanel.setVerticalAlignment( HasVerticalAlignment.ALIGN_MIDDLE );
	//Add message title clicking capability, if needed
	if( isMsgTitleClickable ) {
		//THe clickable version allows to view the forum message replies
		messageSubjectClickPanel = new FocusPanel();
		messageSubjectClickPanel.setTitle( getViewForumMessageRepliesLinkText() );
		messageSubjectClickPanel.addStyleName( CommonResourcesContainer.FORUM_MESSAGE_TITLE_STYLE );
		messageSubjectClickPanel.add( messageSubjectContent );
		titleVertPanel.add( messageSubjectClickPanel );
	} else {
		messageSubjectContent.addStyleName( CommonResourcesContainer.FORUM_MESSAGE_TITLE_STYLE );
		titleVertPanel.add( messageSubjectContent );
	}
	
	lastSenderProfileLink = populateMessageTitleLastReplyInfoPanel( titleInfoLastRepPanel );
	titleVertPanel.add( titleInfoLastRepPanel );
	
	//Add the message title info
	if( SiteManager.isAdministrator() ) {
		//if the user is an administrator, then he is allowed to see the message id of all messages
		addNewFieldValuePair( titleInfoPanel, i18nTitles.forumMessageID(), messageData.messageID + "", true );
	}
	populateMessageTitleInfoPanel( titleInfoPanel );
	titleVertPanel.setVerticalAlignment( HasVerticalAlignment.ALIGN_BOTTOM );
	titleVertPanel.add( titleInfoPanel );
	
	//Complete the title panel
	mainVerticalPanel.add( titlePanelTable );

	//Add the delimiter panel
	SimplePanel delimiterPanel = new SimplePanel();
	delimiterPanel.setStyleName( CommonResourcesContainer.FORUM_MESSAGE_TITLE_DELIMITER_PANEL_STYLE );
	mainVerticalPanel.add( delimiterPanel );
}
 
开发者ID:ivan-zapreev,项目名称:x-cure-chat,代码行数:74,代码来源:ForumMessageWidget.java

示例15: Top10BodyWidget

import com.google.gwt.user.client.ui.SimplePanel; //导入方法依赖的package包/类
/**
 * The basic constructor provided with the site section url prefix
 * @param siteSectionPrefix the history token site section prefix
 */
public Top10BodyWidget(  final String siteSectionPrefix ) {
	super();
	
	//Store the data
	this.siteSectionPrefix = siteSectionPrefix;
	
	//Register as the avatar spoiler change listener 
	UserAvatarImageWidget.addAvatarSpoilerChangeListener( this );
	
	//Initialize the main decorated panel
	decoratedPanel = new DecoratorPanel();
	decoratedPanel.setStyleName( CommonResourcesContainer.GRAY_ROUNDED_CORNER_PANEL_STYLE );
	
	//Initialize the vertical
	widgetPanel = new VerticalPanel();
	widgetPanel.setWidth("100%");
	widgetPanel.setHorizontalAlignment( HasHorizontalAlignment.ALIGN_LEFT );
	widgetPanel.setVerticalAlignment( HasVerticalAlignment.ALIGN_TOP );
	decoratedPanel.add( widgetPanel );
	
	//Initialize the scroll panel
	scrollPanel = new SimplePanel();
	scrollPanel.setStyleName( CommonResourcesContainer.SCROLLABLE_SIMPLE_PANEL );
	widgetPanel.add( scrollPanel );
	
	//Initialize the panel storing the statistics widgets
	statWidgetsPanel = new HorizontalPanel();
	statWidgetsPanel.setHorizontalAlignment( HasHorizontalAlignment.ALIGN_CENTER );
	statWidgetsPanel.setVerticalAlignment( HasVerticalAlignment.ALIGN_TOP );
	statWidgetsPanel.setWidth("100%");
	scrollPanel.add( statWidgetsPanel );
	
	//Add top10 widgets here
	addTop10Widget( new MoneyTop10StatWidget() );
	addTop10Widget( new TimeOnSiteTop10StatWidget() );
	addTop10Widget( new ChatMsgsTop10StatWidget() );
	addTop10Widget( new ForumPostsTop10StatWidget() );
	addTop10Widget( new RegistrationsTop10StatWidget() );
	addTop10Widget( new LastProfileFileTop10StatWidget() );
	addTop10Widget( new VisitsTop10StatWidget() );
	
	//Initialize the composite
	initWidget( decoratedPanel );
}
 
开发者ID:ivan-zapreev,项目名称:x-cure-chat,代码行数:49,代码来源:Top10BodyWidget.java


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