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


Java SimplePanel.addStyleName方法代碼示例

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


在下文中一共展示了SimplePanel.addStyleName方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

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

示例2: addContentWidgetWebKit

import com.google.gwt.user.client.ui.SimplePanel; //導入方法依賴的package包/類
protected void addContentWidgetWebKit( final FlowPanel content, final Widget wid ) {
	Widget widToAdd = wid;
	//Somehow Chrome and Safari do not understand inline in this context, so we use float left
	if( BrowserDetect.getBrowserDetect().isSafari() || BrowserDetect.getBrowserDetect().isChrome() ) {
		SimplePanel panelWrap = new SimplePanel();
		panelWrap.add( wid );
		panelWrap.addStyleName( CommonResourcesContainer.FLOAT_LEFT_INSTEAD_OF_INLINE_STYLE );
		widToAdd = panelWrap;
	}
	MessageTextToFlowPanel.addContentWidget( content, widToAdd, false );
}
 
開發者ID:ivan-zapreev,項目名稱:x-cure-chat,代碼行數:12,代碼來源:ForumMessageWidget.java

示例3: makeSideHeader

import com.google.gwt.user.client.ui.SimplePanel; //導入方法依賴的package包/類
protected Widget makeSideHeader() {

        Widget close = makeCloseButton(false);

        SimplePanel panel= new SimplePanel();
        panel.addStyleName(_ffCss.titleBgColor());
        panel.addStyleName(_ffCss.titleColor());
        panel.setHeight("100%");


        VerticalPanel header = new VerticalPanel();
        titleLabel.addStyleName("title-label");
        titleLabel.setHeight("100%");
        DOM.setStyleAttribute(titleLabel.getElement(), "cursor", "default");

        GwtUtil.setStyle(header, "paddingTop", "3px");

        titleLabel.setHTML(" ");

        header.addStyleName(_ffCss.popupTitleVerticalBackground());
        header.addStyleName(_ffCss.titleBgColor());
        header.addStyleName(_ffCss.titleColor());
//        header.addStyleName(_ffCss.popupBackground());

        header.add(close);
        header.add(titleLabel);
        header.setCellHeight(titleLabel, "100%");
        header.setWidth("15px");
        header.setHeight("100%");

        panel.setWidget(header);
        return panel;
    }
 
開發者ID:lsst,項目名稱:firefly,代碼行數:34,代碼來源:PopupPane.java

示例4: wrap

import com.google.gwt.user.client.ui.SimplePanel; //導入方法依賴的package包/類
public static Widget wrap(Widget w, int top, int right, int bottom, int left, boolean fullSize) {
    SimplePanel wrapper = new SimplePanelWithLayout(w);
    wrapper.addStyleName("wrapper-for-layout");
    GwtUtil.setStyle(wrapper, "position", "relative");
    GwtUtil.setStyles(w, "position", "absolute",
                      "left", left + "px",
                      "right", right + "px",
                      "top", top + "px",
                      "bottom", bottom + "px",
                      "width",  "auto",
                      "height",  "auto");
    if (fullSize) GwtUtil.setStyles(wrapper, "width", "100%",  "height", "100%");
    return wrapper;
}
 
開發者ID:lsst,項目名稱:firefly,代碼行數:15,代碼來源:GwtUtil.java

示例5: TablePanel

import com.google.gwt.user.client.ui.SimplePanel; //導入方法依賴的package包/類
public TablePanel(String name, Loader<TableDataView> loader) {
    setInit(false);
    this.name = name;
    dataModel = new DataSetTableModel(loader);
    dataModel.addHandler(modelEventHandler);

    mainWrapper = new SimplePanel();
    mainWrapper.addStyleName("mainWrapper");
    mainWrapper.setSize("100%", "100%");
    mainPanel.setSize("100%", "100%");
    mainPanel.addStyleName("mainPanel");
    DOM.setStyleAttribute(mainPanel.getElement(), "borderSpacing", "0px");
    toolbarWrapper = new HorizontalPanel();
    toolbarWrapper.setStyleName("firefly-toolbar");
    stateId = name;
    mainWrapper.add(mainPanel);
    initWidget(mainWrapper);
    sinkEvents(Event.ONMOUSEOVER);

    WebEventManager.getAppEvManager().addListener(Name.DOWNLOAD_REQUEST_READY, new WebEventListener() {
        public void eventNotify(WebEvent ev) {
            if (ev.getName().equals(Name.DOWNLOAD_REQUEST_READY)) {
                if (ev.getSource() instanceof DownloadRequest) {
                    downloadRequest = (DownloadRequest) ev.getSource();
                }
            }
        }
    });
    helpButton.setVisible(false);
}
 
開發者ID:lsst,項目名稱:firefly,代碼行數:31,代碼來源:TablePanel.java

示例6: createInDiv

import com.google.gwt.user.client.ui.SimplePanel; //導入方法依賴的package包/類
private static MiniPlotWidget createInDiv(SimplePanel panel,
                                          String target,
                                          String groupName,
                                          boolean enableCatalogs) {
    MiniPlotWidget mpw= makeMPW(groupName);
    mpw.addStyleName("standard-border");
    mpw.setCatalogButtonEnable(enableCatalogs);
    panel.setWidget(mpw);
    panel.addStyleName("fits-input-cmd-main-widget");
    mpwMap.put(target, mpw);
    return mpw;
}
 
開發者ID:lsst,項目名稱:firefly,代碼行數:13,代碼來源:FitsViewerJSInterface.java

示例7: addDialogWidgets

import com.google.gwt.user.client.ui.SimplePanel; //導入方法依賴的package包/類
private void addDialogWidgets() {
	VerticalPanel vertPanel = new VerticalPanel();
	SimplePanel decPanel = new SimplePanel();
	Grid grid = new Grid(4,2);
	HorizontalPanel buttonsHPanel = new HorizontalPanel();
	
	Label commentsLabel = new Label("Comments:");
	Button cancelButton = new Button("Cancel");
	
	decPanel.addStyleName("decorator-panel");
	replacementLabel.addStyleName("dialog-label");
	commentsLabel.addStyleName("dialog-label");
	
	cancelButton.addClickHandler(new ClickHandler() {
		public void onClick(ClickEvent event) {
			dialogBox.hide();
			relationship = null;
			commentsField.setValue(null);
			errorLabel.setVisible(false);
		}
	});
	
	grid.addStyleName("gwt-Grid");
	buttonsHPanel.addStyleName("dialog-buttons");
	buttonsHPanel.addStyleName("centered-hortz");
	vertPanel.addStyleName("dialog-vpanel");		
	//vertPanel.setHorizontalAlignment(VerticalPanel.ALIGN_CENTER);
			
	int row = 0, col = 0;
	grid.setWidget(row, col, new Label("Ontology:"));
	grid.setWidget(++row, col, new Label("Term:"));
	grid.setWidget(++row, col, new Label("Relationship:"));
	grid.setWidget(++row, col, new Label("Related Term:"));
	row = 0;
	col = 1;
	grid.setWidget(row, col, ontologyLabel);
	grid.setWidget(++row, col, termLabel);
	grid.setWidget(++row, col, typeLabel);
	grid.setWidget(++row, col, relatedTermLabel);
	
	for(row = col = 0; row < grid.getRowCount(); row++) {
		Label label = (Label)grid.getWidget(row, col);
		label.addStyleName("dialog-label");
	}			
							
	buttonsHPanel.add(obsoleteButton);
	buttonsHPanel.add(cancelButton);
	
	decPanel.setWidget(grid);
	//vertPanel.add(grid);
	vertPanel.add(decPanel);
	vertPanel.add(replacementLabel);
	vertPanel.add(table);
	vertPanel.add(commentsLabel);
	vertPanel.add(commentsField);
	vertPanel.add(errorLabel);
	vertPanel.add(buttonsHPanel);
	
	dialogBox.setWidget(vertPanel);
}
 
開發者ID:Novartis,項目名稱:ontobrowser,代碼行數:61,代碼來源:ReplaceRelationshipPopup.java

示例8: addDialogWidgets

import com.google.gwt.user.client.ui.SimplePanel; //導入方法依賴的package包/類
private void addDialogWidgets() {
	VerticalPanel vertPanel = new VerticalPanel();
	SimplePanel decPanel = new SimplePanel();
   	Grid grid = new Grid(5,2);
	HorizontalPanel buttonsHPanel = new HorizontalPanel();
	
	Label comments = new Label("Comments:");
	Button cancelButton = new Button("Cancel");
	
	decPanel.addStyleName("decorator-panel");		
	comments.addStyleName("dialog-label");
							
	cancelButton.addClickHandler(new ClickHandler() {
		public void onClick(ClickEvent event) {
			dialogBox.hide();
			synonym = null;
			commentsField.setValue(null);
			errorLabel.setVisible(false);
		}
	});
	
	grid.addStyleName("gwt-Grid");
	errorLabel.addStyleName("dialog-error");
	buttonsHPanel.addStyleName("dialog-buttons");
	buttonsHPanel.addStyleName("centered-hortz");
	vertPanel.addStyleName("dialog-vpanel");		
	//vertPanel.setHorizontalAlignment(VerticalPanel.ALIGN_CENTER);
			
	int row = 0, col = 0;
	grid.setWidget(row, col, ontologyHeadingLabel);
	grid.setWidget(++row, col, new Label("Term:"));
	grid.setWidget(++row, col, new Label("Synonym:"));
	grid.setWidget(++row, col, new Label("Source:"));
	grid.setWidget(++row, col, new Label("Reference Id:"));
	row = 0;
	col = 1;
	grid.setWidget(row, col, ontologyLabel);
	grid.setWidget(++row, col, termLabel);
	grid.setWidget(++row, col, synonymLabel);
	grid.setWidget(++row, col, sourceLabel);
	grid.setWidget(++row, col, referenceIdLabel);
	
	for(row = col = 0; row < grid.getRowCount(); row++) {
		Label label = (Label)grid.getWidget(row, col);
		label.addStyleName("dialog-label");
	}			
							
	buttonsHPanel.add(obsoleteButton);
	buttonsHPanel.add(cancelButton);
	
	decPanel.setWidget(grid);
	//vertPanel.add(grid);
	vertPanel.add(decPanel);
	vertPanel.add(comments);
	vertPanel.add(commentsField);
	vertPanel.add(errorLabel);
	vertPanel.add(buttonsHPanel);
	
	dialogBox.setWidget(vertPanel);
}
 
開發者ID:Novartis,項目名稱:ontobrowser,代碼行數:61,代碼來源:ReplaceSynonymPopup.java

示例9: AlertWidget

import com.google.gwt.user.client.ui.SimplePanel; //導入方法依賴的package包/類
public AlertWidget(AlertBean alert) {
	VerticalPanel rootPanel = new VerticalPanel();

	FocusPanel headerPanel = new FocusPanel();
	rootPanel.add(headerPanel);
	headerPanel.addStyleName("alert-header");
	HorizontalPanel titleAndButtonPanel = new HorizontalPanel();
	headerPanel.add(titleAndButtonPanel);
	Label icon = new Label("");
	icon.addStyleName(alert.getLevel() == AlertBean.LEVEL_INFO ? "info-icon"
			: "warn-icon");
	titleAndButtonPanel.add(icon);
	Label alertTitle = new Label(alert.getTitle());
	alertTitle.addStyleName("alert-title");
	titleAndButtonPanel.add(alertTitle);

	final SimplePanel collapsibleOuterPanel = new SimplePanel();
	rootPanel.add(collapsibleOuterPanel);
	collapsibleOuterPanel.addStyleName("alert-details-outer");
	VerticalPanel collapsibleInnerPanel = new VerticalPanel();
	collapsibleOuterPanel.add(collapsibleInnerPanel);
	collapsibleInnerPanel.addStyleName("alert-details-inner");
	if (DISPLAY_ALERT_DATE && alert.isPublishActiveRange()
			&& (alert.getFrom() != null || alert.getTo() != null)) {
		Label dateRangeLabel = new Label(
				formatDateRange(alert.getFrom(), alert.getTo()));
		collapsibleInnerPanel.add(dateRangeLabel);
		dateRangeLabel.addStyleName("alert-datetime");
	}
	Label descriptionLabel = new Label(alert.getDescription());
	collapsibleInnerPanel.add(descriptionLabel);
	descriptionLabel.addStyleName("alert-description");
	if (alert.getUrl() != null && alert.getUrl().length() > 0) {
		final String url = alert.getUrl();
		Anchor moreInfoAnchor = new Anchor(I18nUtils.tr("more.info.alert"));
		moreInfoAnchor.addClickHandler(new ClickHandler() {
			@Override
			public void onClick(ClickEvent event) {
				Window.open(url, "_blank", "");
			}
		});
		moreInfoAnchor.addStyleName("alert-url");
		collapsibleInnerPanel.add(moreInfoAnchor);
	}
	initWidget(rootPanel);
}
 
開發者ID:mecatran,項目名稱:OpenTripPlanner-client-gwt,代碼行數:47,代碼來源:AlertWidget.java


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